public DiscoveryGroupConfiguration(final String groupAddress, final int groupPort) { this(UUIDGenerator.getInstance().generateStringUUID(), null, groupAddress, groupPort, HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT, HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT); }
public InVMConnection(final int serverID, final String id, final BufferHandler handler, final ConnectionLifeCycleListener listener, final Executor executor) { this(serverID, id, handler, listener, executor, null); }
private byte[] getAddressBytes() { if (address == null) { address = UUIDGenerator.getHardwareAddress(); if (address == null) { address = generateDummyAddress(); } } return address; }
public final UUID generateUUID() { byte[] address = getAddressBytes(); UUID uid = generateTimeBasedUUID(address); return uid; }
private void createNodeId() throws Exception { ByteBuffer id = ByteBuffer.allocateDirect(16); int read = channel.read(id, 3); if (read != 16) { uuid = UUIDGenerator.getInstance().generateUUID(); nodeID = new SimpleString(uuid.toString()); id.put(uuid.asBytes(), 0, 16); id.position(0); channel.write(id, 3); channel.force(true); } else { byte[] bytes = new byte[16]; id.position(0); id.get(bytes); uuid = new UUID(UUID.TYPE_TIME_BASED, bytes); nodeID = new SimpleString(uuid.toString()); } }
List<NetworkInterface> ifaces = getAllNetworkInterfaces(); byte[] address = findFirstMatchingHardwareAddress(ifaces, getHardwareAddressMethod, isUpMethod, if (UUIDGenerator.log.isDebugEnabled()) UUIDGenerator.log.debug("using hardware address " + UUIDGenerator.asString(address));
public SimpleString generateSimpleStringUUID() { return new SimpleString(generateStringUUID()); }
public final byte[] generateDummyAddress() { Random rnd = getRandomNumberGenerator(); byte[] dummy = new byte[6]; rnd.nextBytes(dummy); /* Need to set the broadcast bit to indicate it's not a real * address. */ dummy[0] |= (byte)0x01; if (UUIDGenerator.log.isDebugEnabled()) { UUIDGenerator.log.debug("using dummy address " + UUIDGenerator.asString(dummy)); } return dummy; }
setUUID(UUIDGenerator.getInstance().generateUUID()); id.put(getUUID().asBytes(), 0, 16); id.position(0);
List<NetworkInterface> ifaces = getAllNetworkInterfaces(); byte[] address = findFirstMatchingHardwareAddress(ifaces, getHardwareAddressMethod, isUpMethod, HornetQUtilLogger.LOGGER.debug("using hardware address " + UUIDGenerator.asString(address));
public UUID generateUUID() { byte[] address = getAddressBytes(); UUID uid = generateTimeBasedUUID(address); return uid; }
public final SimpleString generateSimpleStringUUID() { return new SimpleString(generateStringUUID()); }
public byte[] generateDummyAddress() { Random rnd = getRandomNumberGenerator(); byte[] dummy = new byte[6]; rnd.nextBytes(dummy); /* Need to set the broadcast bit to indicate it's not a real * address. */ dummy[0] |= (byte) 0x01; if (HornetQUtilLogger.LOGGER.isDebugEnabled()) { HornetQUtilLogger.LOGGER.debug("using dummy address " + UUIDGenerator.asString(dummy)); } return dummy; }
/** * Creates a TransportConfiguration providing the class name of the {@link org.hornetq.spi.core.remoting.ConnectorFactory} * and any parameters needed. * * @param className The class name of the ConnectorFactory * @param params The parameters needed by the ConnectorFactory */ public TransportConfiguration(final String className, final Map<String, Object> params) { this(className, params, UUIDGenerator.getInstance().generateStringUUID()); }
public InVMConnection(final Acceptor acceptor, final int serverID, final String id, final BufferHandler handler, final ConnectionLifeCycleListener listener, final Executor executor) { this(acceptor, serverID, id, handler, listener, executor, null); }
userId = org.hornetq.utils.UUIDGenerator.getInstance().generateUUID();
public String generateStringUUID() { byte[] address = getAddressBytes(); if (address == null) { return java.util.UUID.randomUUID().toString(); } else { return generateTimeBasedUUID(address).toString(); } }
private final byte[] getAddressBytes() { if (address == null) { // calling UUIDGenerator.getHardwareAddress() is a // time-expensive operation, let make sure it is called // only once synchronized (this) { if (address == null) { address = UUIDGenerator.getHardwareAddress(); if (address == null) { address = generateDummyAddress(); } } } } return address; }
/** * Creates a TransportConfiguration providing the class name of the {@link org.hornetq.spi.core.remoting.ConnectorFactory} * and any parameters needed. * * @param className The class name of the ConnectorFactory * @param params The parameters needed by the ConnectorFactory */ public TransportConfiguration(final String className, final Map<String, Object> params) { this(className, params, UUIDGenerator.getInstance().generateStringUUID()); }
public HornetQConnection(final String username, final String password, final int connectionType, final String clientID, final int dupsOKBatchSize, final int transactionBatchSize, final ClientSessionFactory sessionFactory) { this.username = username; this.password = password; this.connectionType = connectionType; this.clientID = clientID; this.sessionFactory = sessionFactory; uid = UUIDGenerator.getInstance().generateSimpleStringUUID(); thisVersion = VersionLoader.getVersion(); this.dupsOKBatchSize = dupsOKBatchSize; this.transactionBatchSize = transactionBatchSize; creationStack = new Exception(); }