Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.apache.cloudstack.framework.transport;

import java.util.Random;
import java.security.SecureRandom;

public class TransportAddress {
public final static String LOCAL_SERVICE_NODE = "";
Expand All @@ -29,6 +29,7 @@ public class TransportAddress {
private int _connectionId = LOCAL_SERVICE_CONNECTION;
private String _endpointId;
private int _magic;
private final SecureRandom randomGenerator=new SecureRandom();

public TransportAddress(String nodeId, int connectionId, String endpointId) {
assert (nodeId != null);
Expand All @@ -39,7 +40,7 @@ public TransportAddress(String nodeId, int connectionId, String endpointId) {
_nodeId = nodeId;
_connectionId = connectionId;
_endpointId = endpointId;
_magic = new Random().nextInt();
_magic = randomGenerator.nextInt();
}

public TransportAddress(String nodeId, int connectionId, String endpointId, int magic) {
Expand Down