properties.putNullValue(key); properties.putBooleanProperty(key, (Boolean)value); properties.putByteProperty(key, (Byte)value); properties.putShortProperty(key, (Short)value); properties.putIntProperty(key, (Integer)value); properties.putLongProperty(key, (Long)value); properties.putFloatProperty(key, (Float)value); properties.putDoubleProperty(key, (Double)value); properties.putSimpleStringProperty(key, new SimpleString((String)value)); properties.putSimpleStringProperty(key, (SimpleString)value);
private Notification createProposalNotification(SimpleString groupId, SimpleString clusterName) { TypedProperties props = new TypedProperties(); props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID, groupId); props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_VALUE, clusterName); props.putIntProperty(ManagementHelper.HDR_BINDING_TYPE, BindingType.LOCAL_QUEUE_INDEX); props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, address); props.putIntProperty(ManagementHelper.HDR_DISTANCE, 0); return new Notification(null, CoreNotificationType.PROPOSAL, props); }
public boolean containsProperty(final SimpleString key) { return properties.containsProperty(key); }
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 stop() { if (!started) { return; } if (future != null) { future.cancel(false); } socket.close(); started = false; if (notificationService != null) { TypedProperties props = new TypedProperties(); props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name)); Notification notification = new Notification(nodeID, NotificationType.BROADCAST_GROUP_STOPPED, props); try { notificationService.sendNotification(notification); } catch (Exception e) { BroadcastGroupImpl.log.warn("unable to send notification when broadcast group is stopped", e); } } }
if (!props.containsProperty(ManagementHelper.HDR_BINDING_TYPE)) Integer bindingType = props.getIntProperty(ManagementHelper.HDR_BINDING_TYPE); SimpleString routingName = props.getSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME); SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME); SimpleString address = props.getSimpleStringProperty(ManagementHelper.HDR_ADDRESS); if (!props.containsProperty(ManagementHelper.HDR_BINDING_ID)) long id = props.getLongProperty(ManagementHelper.HDR_BINDING_ID); SimpleString filterString = props.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING); if (!props.containsProperty(ManagementHelper.HDR_DISTANCE)) int distance = props.getIntProperty(ManagementHelper.HDR_DISTANCE); if (!props.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME); if (!props.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME); SimpleString filterString = props.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING);
public Map<String, Object> toMap() { Map<String, Object> map = new HashMap<String, Object>(); map.put("messageID", messageID); if (userID != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", address.toString()); map.put("type", type); map.put("durable", durable); map.put("expiration", expiration); map.put("timestamp", timestamp); map.put("priority", priority); for (SimpleString propName : properties.getPropertyNames()) { map.put(propName.toString(), properties.getProperty(propName)); } return map; }
public SimpleString getSimpleStringProperty(final SimpleString key) throws PropertyConversionException { return properties.getSimpleStringProperty(key); }
public void putLongProperty(final SimpleString key, final long value) { properties.putLongProperty(key, value); bufferValid = false; }
public void putStringProperty(final SimpleString key, final SimpleString value) { properties.putSimpleStringProperty(key, value); bufferValid = false; }
public void putIntProperty(final SimpleString key, final int value) { properties.putIntProperty(key, value); bufferValid = false; }
public Integer getIntProperty(final SimpleString key) throws PropertyConversionException { return properties.getIntProperty(key); }
public Long getLongProperty(final SimpleString key) throws HornetQPropertyConversionException { return properties.getLongProperty(key); }
public Object getObjectProperty(final SimpleString key) { return properties.getProperty(key); }
protected MessageImpl() { properties = new TypedProperties(); }
public Set<SimpleString> getPropertyNames() { return properties.getPropertyNames(); }
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)); }
public synchronized void start() throws Exception { if (started) { return; } endpoint.openClient(); started = true; thread = new Thread(new DiscoveryRunnable(), "hornetq-discovery-group-thread-" + name); thread.setDaemon(true); thread.start(); if (notificationService != null) { TypedProperties props = new TypedProperties(); props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name)); Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props); notificationService.sendNotification(notification); } }
if (!props.containsProperty(ManagementHelper.HDR_BINDING_TYPE)) Integer bindingType = props.getIntProperty(ManagementHelper.HDR_BINDING_TYPE); SimpleString routingName = props.getSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME); SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME); SimpleString address = props.getSimpleStringProperty(ManagementHelper.HDR_ADDRESS); if (!props.containsProperty(ManagementHelper.HDR_BINDING_ID)) long id = props.getLongProperty(ManagementHelper.HDR_BINDING_ID); SimpleString filterString = props.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING); if (!props.containsProperty(ManagementHelper.HDR_DISTANCE)) int distance = props.getIntProperty(ManagementHelper.HDR_DISTANCE); if (!props.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME); if (!props.containsProperty(ManagementHelper.HDR_CLUSTER_NAME)) SimpleString clusterName = props.getSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME); SimpleString filterString = props.getSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING);
public Map<String, Object> toMap() { Map<String, Object> map = new HashMap<String, Object>(); map.put("messageID", messageID); if (userID != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", address.toString()); map.put("type", type); map.put("durable", durable); map.put("expiration", expiration); map.put("timestamp", timestamp); map.put("priority", priority); for (SimpleString propName : properties.getPropertyNames()) { map.put(propName.toString(), properties.getProperty(propName)); } return map; }