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); }
/** * Creates a TransportConfiguration providing the class name of the {@link org.hornetq.spi.core.remoting.ConnectorFactory} * * @param className The class name of the ConnectorFactory */ public TransportConfiguration(final String className) { this(className, new HashMap<String, Object>(), UUIDGenerator.getInstance().generateStringUUID()); }
/** * 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()); }
/** * Creates a TransportConfiguration providing the class name of the {@link org.hornetq.spi.core.remoting.ConnectorFactory} * * @param className The class name of the ConnectorFactory */ public TransportConfiguration(final String className) { this(className, new HashMap<String, Object>(), UUIDGenerator.getInstance().generateStringUUID()); }
public DiscoveryGroupConfiguration(final long refreshTimeout, final long discoveryInitialWaitTimeout, BroadcastEndpointFactoryConfiguration endpointFactoryConfiguration) { this(UUIDGenerator.getInstance().generateStringUUID(), refreshTimeout, discoveryInitialWaitTimeout, endpointFactoryConfiguration); }
/** * 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 DivertConfiguration(final String name, final String routingName, final String address, final String forwardingAddress, final boolean exclusive, final String filterString, final String transformerClassName) { this.name = name; if (routingName == null) { this.routingName = UUIDGenerator.getInstance().generateStringUUID(); } else { this.routingName = routingName; } this.address = address; this.forwardingAddress = forwardingAddress; this.exclusive = exclusive; this.filterString = filterString; this.transformerClassName = transformerClassName; }
/** * Broadcast group is bound locally to the wildcard address */ public BroadcastGroupImpl(final String nodeID, final String name, final InetAddress localAddress, final int localPort, final InetAddress groupAddress, final int groupPort, final ScheduledExecutorService scheduledExecutor, final long broadcastPeriod) throws Exception { this.nodeID = nodeID; this.name = name; this.localAddress = localAddress; this.localPort = localPort; this.groupAddress = groupAddress; this.groupPort = groupPort; this.scheduledExecutor = scheduledExecutor; this.broadCastPeriod = broadcastPeriod; uniqueID = UUIDGenerator.getInstance().generateStringUUID(); }
public synchronized SequentialFileFactory newFileFactory(final SimpleString address) throws Exception { String guid = UUIDGenerator.getInstance().generateStringUUID(); SequentialFileFactory factory = newFileFactory(guid); factory.createDirs(); File fileWithID = new File(directory + File.separatorChar + guid + File.separatorChar + PagingStoreFactoryNIO.ADDRESS_FILE); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileWithID))); try { writer.write(address.toString()); writer.newLine(); } finally { writer.close(); } return factory; }
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); }
public InVMConnection(final int serverID, final String id, final BufferHandler handler, final ConnectionLifeCycleListener listener, final Executor executor) { this(serverID, id, handler, listener, executor, null); }
public BroadcastGroupImpl(final NodeManager nodeManager, final String name, final long broadCastPeriod, final ScheduledExecutorService scheduledExecutor, final BroadcastEndpointFactory endpointFactory) throws Exception { this.nodeManager = nodeManager; this.name = name; this.scheduledExecutor = scheduledExecutor; this.broadCastPeriod = broadCastPeriod; this.endpoint = endpointFactory.createBroadcastEndpoint(); uniqueID = UUIDGenerator.getInstance().generateStringUUID(); }
public synchronized SequentialFileFactory newFileFactory(final SimpleString address) throws Exception { String guid = UUIDGenerator.getInstance().generateStringUUID(); SequentialFileFactory factory = newFileFactory(guid); factory.createDirs(); File fileWithID = new File(directory + File.separatorChar + guid + File.separatorChar + PagingStoreFactoryNIO.ADDRESS_FILE); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileWithID))); try { writer.write(address.toString()); writer.newLine(); } finally { writer.close(); } return factory; }
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(); }
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()); } }
private ServerMessage createQueueInfoMessage(final NotificationType type, final SimpleString queueName) { ServerMessage message = new ServerMessageImpl(storageManager.generateUniqueID(), 50); message.setAddress(queueName); String uid = UUIDGenerator.getInstance().generateStringUUID(); message.putStringProperty(ManagementHelper.HDR_NOTIFICATION_TYPE, new SimpleString(type.toString())); message.putLongProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP, System.currentTimeMillis()); message.putStringProperty(new SimpleString("foobar"), new SimpleString(uid)); return message; }
private ServerMessage createQueueInfoMessage(final NotificationType type, final SimpleString queueName) { ServerMessage message = new ServerMessageImpl(storageManager.generateUniqueID(), 50); message.setAddress(queueName); String uid = UUIDGenerator.getInstance().generateStringUUID(); message.putStringProperty(ManagementHelper.HDR_NOTIFICATION_TYPE, new SimpleString(type.toString())); message.putLongProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP, System.currentTimeMillis()); message.putStringProperty(new SimpleString("foobar"), new SimpleString(uid)); return message; }
private StompSession getTransactedSession(StompConnection connection, String txID) throws Exception { StompSession stompSession = transactedSessions.get(txID); if (stompSession == null) { stompSession = new StompSession(connection, this, server.getStorageManager().newContext(executor)); String name = UUIDGenerator.getInstance().generateStringUUID(); ServerSession session = server.createSession(name, connection.getLogin(), connection.getPasscode(), HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, connection, false, false, false, false, null, stompSession); stompSession.setServerSession(session); transactedSessions.put(txID, stompSession); } server.getStorageManager().setContext(stompSession.getContext()); return stompSession; }
public synchronized void addBinding(final Binding binding) throws Exception { addressManager.addBinding(binding); TypedProperties props = new TypedProperties(); props.putIntProperty(ManagementHelper.HDR_BINDING_TYPE, binding.getType().toInt()); props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, binding.getAddress()); props.putSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME, binding.getClusterName()); props.putSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME, binding.getRoutingName()); props.putLongProperty(ManagementHelper.HDR_BINDING_ID, binding.getID()); props.putIntProperty(ManagementHelper.HDR_DISTANCE, binding.getDistance()); Filter filter = binding.getFilter(); if (filter != null) { props.putSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING, filter.getFilterString()); } String uid = UUIDGenerator.getInstance().generateStringUUID(); if (log.isDebugEnabled()) { log.debug("ClusterCommunication::Sending notification for addBinding " + binding + " from server " + server); } managementService.sendNotification(new Notification(uid, NotificationType.BINDING_ADDED, props)); }
public synchronized void addBinding(final Binding binding) throws Exception { addressManager.addBinding(binding); TypedProperties props = new TypedProperties(); props.putIntProperty(ManagementHelper.HDR_BINDING_TYPE, binding.getType().toInt()); props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, binding.getAddress()); props.putSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME, binding.getClusterName()); props.putSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME, binding.getRoutingName()); props.putLongProperty(ManagementHelper.HDR_BINDING_ID, binding.getID()); props.putIntProperty(ManagementHelper.HDR_DISTANCE, binding.getDistance()); Filter filter = binding.getFilter(); if (filter != null) { props.putSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING, filter.getFilterString()); } String uid = UUIDGenerator.getInstance().generateStringUUID(); if (HornetQServerLogger.LOGGER.isDebugEnabled()) { HornetQServerLogger.LOGGER.debug("ClusterCommunication::Sending notification for addBinding " + binding + " from server " + server); } managementService.sendNotification(new Notification(uid, CoreNotificationType.BINDING_ADDED, props)); }