|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.root.RootObject
com.neeve.sma.SmaObject
com.neeve.sma.MessageBusDescriptor
public final class MessageBusDescriptor
A message bus descriptor.
This class contains information used to describe a message bus. It is intended for use by a user when establishing bus bindings. It also contains methods to persist and load descriptors to/from X Platform configuration repositories.
Field Summary | |
---|---|
static short |
CATCH_ALL_CHANNEL_ID
The channel id that is used to for a binding's single catch all channel. |
static String |
CATCH_ALL_CHANNEL_NAME_DEFAULT
The default name of the catch all channel to use when "auto_add_catchall_channel=true"
is set to true on the binding. |
static String |
PROPNAME_ADDRESS
Name of property used to specify the bus's address. |
static String |
PROPNAME_AUTO_ADD_CATCHALL_CHANNEL
Name of the bus descriptor property controlling whether a 'catchall' channel should be auto created If this property is specified in the message bus descriptor, then a catchall channel with name 32767 and id 32767 will automatically be added to the bus descriptor when the binding is created provided another catchall channel is not already present in the bus descriptor. |
static boolean |
PROPNAME_AUTO_ADD_CATCHALL_CHANNEL_DEFAULT
Default value for PROPNAME_AUTO_ADD_CATCHALL_CHANNEL . |
static String |
PROPNAME_PROVIDER_NAME
Name of property used to specify provider name. |
static String |
PROPNAME_SET_BUS_AND_CHANNEL_ON_RECEIPT
Name of the bus descriptor property controlling whether the bus and channel name are set on received messages. |
static String |
PROPNAME_SET_FLOW_ON_RECEIPT
Name of the bus descriptor property controlling whether the flow is set on received messages. |
static String |
PROPNAME_SET_KEY_ON_RECEIPT
Name of the bus descriptor property controlling whether the message key is set on received messages. |
static String |
PROPNAME_SET_SNO_ON_RECEIPT
Name of the bus descriptor property controlling whether the sequence number is set on received messages. |
static String |
PROPNAME_TOPIC_STARTS_WITH_CHANNEL_PROPNAME
Name of the bus descriptor property controlling whether topic names start with the channel name for the bus. |
static boolean |
PROPNAME_TOPIC_STARTS_WITH_CHANNEL_PROPNAME_DEFAULT
Default value for PROPNAME_TOPIC_STARTS_WITH_CHANNEL_PROPNAME . |
Method Summary | |
---|---|
MessageBusDescriptor |
addChannel(MessageChannelDescriptor channelDescriptor)
Add a channel descriptor. |
static MessageBusDescriptor |
create(String name)
Create a default message bus descriptor. |
void |
delete()
Delete a message bus descriptor from the default configuration repository. |
void |
delete(IConfigRepository repo)
Delete a bus descriptor from the configuration repository. |
static boolean |
exists(IConfigRepository repo,
String busName)
Checks if a message bus is configured in a configuration repository. |
static boolean |
exists(String busName)
Checks if a message bus is configured in the default configuration repository. |
MessageChannelDescriptor |
getChannel(String channelName)
Get a channel descriptor. |
int |
getChannelCount()
Get the number of channels in the bus. |
Set<MessageChannelDescriptor> |
getChannels()
Get the set of channel descriptors. |
String |
getName()
Get the name of the bus that this descriptor describes |
Properties |
getProviderConfig()
Get the provider configuration configuration. |
UtlAddressDescriptor |
getProviderConfigAsAddressDescriptor()
Get the provider configuration as an address descriptor string |
static MessageBusDescriptor |
load(IConfigRepository repo,
String name,
String userName)
Create a message bus descriptor from a configuration respository. |
static MessageBusDescriptor |
load(String name)
Create a bus descriptor from the default configuration respository. |
static MessageBusDescriptor |
load(String name,
String userName)
Create a bus descriptor from the default configuration respository. |
static Set<MessageBusDescriptor> |
loadAll()
Create bus descriptors for all buses configured in the default configuration repository. |
static Set<MessageBusDescriptor> |
loadAll(IConfigRepository repo,
String userName)
Create bus descriptors for all buses in a configuration repository. |
static Set<MessageBusDescriptor> |
loadAll(String userName)
Create bus descriptors for all buses configured in the default configuration repository. |
void |
removeChannel(String channelName)
Remove a channel descriptor. |
void |
save()
Save a message bus descriptor to the default configuration repository. |
void |
save(IConfigRepository repo,
String userName)
Save a bus descriptor to a configuration repository. |
Properties |
save(Properties props)
Save a bus descriptor to a property table. |
void |
save(String userName)
Save a message bus descriptor to the default configuration repository. |
MessageBusDescriptor |
setProviderConfig(Properties props)
Set the configuration for the provider specific portion of the bus binding that this descriptor describes. |
MessageBusDescriptor |
setProviderConfig(String descriptorStr)
Set a provider configuration from a descriptor string |
MessageBusDescriptor |
setProviderConfigProperty(String propName,
String propVal)
Add a property to the provider configuration |
String |
toString()
Returns a string representation of this object |
Methods inherited from class com.neeve.root.RootObject |
---|
getChecked, getThreaded, getTracer, setChecked, setTracer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROPNAME_PROVIDER_NAME
public static final String PROPNAME_ADDRESS
public static final String PROPNAME_SET_FLOW_ON_RECEIPT
Setting the flow on inbound messages incurs performance overhead. Ultra low latency applications should avoid enabling this property.
When not specified, defaults to the global value set via MessageBusBinding.PROP_SET_FLOW_ON_RECEIPT
.
Parameter Name: "set_flow_on_receipt"
public static final String PROPNAME_SET_SNO_ON_RECEIPT
Setting the sequence number on inbound messages incurs performance overhead. Ultra low latency applications should avoid enabling this property.
When not specified, defaults to the global value set via MessageBusBinding.PROP_SET_SNO_ON_RECEIPT
.
Parameter Name: "set_sno_on_receipt"
public static final String PROPNAME_SET_BUS_AND_CHANNEL_ON_RECEIPT
Setting the channel and bus name on inbound messages incurs performance overhead. Performance sensitive applications should avoid enabling this property.
When not specified, defaults to the global value set via MessageBusBinding.PROP_SET_BUS_AND_CHANNEL_ON_RECEIPT
.
Parameter Name: "set_bus_and_channel_on_receipt"
public static final String PROPNAME_SET_KEY_ON_RECEIPT
Not all binding implementations transport the key on the wire, this property has no effect for binding that don't transport the key.
Setting the key on inbound message incurs a performance overhead. Performance sensitive applications should avoid enabling this property.
When not specified, defaults to the global value set via MessageBusBinding.PROP_SET_KEY_ON_RECEIPT
.
Parameter Name: "set_key_on_receipt"
public static final String PROPNAME_TOPIC_STARTS_WITH_CHANNEL_PROPNAME
For bus bindings that support topic routing this property controls whether or not the resolved key is prefixed with the channel name.
Parameter Name: "topic_starts_with_channel"
Default Value: true
public static final boolean PROPNAME_TOPIC_STARTS_WITH_CHANNEL_PROPNAME_DEFAULT
PROPNAME_TOPIC_STARTS_WITH_CHANNEL_PROPNAME
.
public static final String PROPNAME_AUTO_ADD_CATCHALL_CHANNEL
If this property is specified in the message bus descriptor, then a catchall channel with name 32767 and id 32767 will automatically be added to the bus descriptor when the binding is created provided another catchall channel is not already present in the bus descriptor.
Parameter Name: "auto_add_catchall_channel"
Default Value: false
public static final boolean PROPNAME_AUTO_ADD_CATCHALL_CHANNEL_DEFAULT
PROPNAME_AUTO_ADD_CATCHALL_CHANNEL
.
public static final String CATCH_ALL_CHANNEL_NAME_DEFAULT
"auto_add_catchall_channel=true"
is set to true on the binding.
channel with an id of 32767
public static final short CATCH_ALL_CHANNEL_ID
When a MessageBusBinding
is configured with a catch all channel,
messages received without a channel or on an unknown or unjoined channel
are dispatched on this channel.
A binding can be configured with the property "auto_add_catchall_channel=true"
automatically add a catch all channel named "_CATCHALL_".
Method Detail |
---|
public final String getName()
public final MessageBusDescriptor setProviderConfig(Properties props)
props
- The properties table that describes the provider configuration.
This parameter cannot be null.
This method sets the configuration for the provider specific portion of a bus binding using a property table.
public final MessageBusDescriptor setProviderConfigProperty(String propName, String propVal) throws SmaException
propName
- The name of the propertypropVal
- The value of the property
SmaException
public final MessageBusDescriptor setProviderConfig(String descriptorStr) throws SmaException
descriptorStr
- The provider configuration specified as an address
descriptor string.
SmaException
public final UtlAddressDescriptor getProviderConfigAsAddressDescriptor() throws SmaException
SmaException
- Thrown in case the PROPNAME_PROVIDER_NAME
and/or the PROPNAME_ADDRESS
properties are missing from the
provider config.public final Properties getProviderConfig()
public final MessageBusDescriptor addChannel(MessageChannelDescriptor channelDescriptor)
channelDescriptor
- The channel descriptor to add.
This method added a channel descriptor to the set of channel descriptors maintained by the bus descriptor. The added descriptor will replace a descriptor of the same channel name if present.
public final MessageChannelDescriptor getChannel(String channelName)
channelName
- The name of the channel whose descriptor to get.
public final Set<MessageChannelDescriptor> getChannels()
public final int getChannelCount()
public final void removeChannel(String channelName)
channelName
- The name of the channel whose descriptor to remove.public final Properties save(Properties props)
props
- The property table.public final void save(IConfigRepository repo, String userName) throws SmaException
repo
- The root directory of the configuration respository.userName
- The name of the user on whose behalf this descriptor
should be saved. This can be null in case no user specific information
is to be written
SmaException
- Thrown in case an error in encountered during
the saving of the descriptor.This method saves a bus descriptor to a configuration repository. The descriptor is saved in a format suitable for loading subsequently using any of the load methods offered by this class.
public final void save(String userName) throws SmaException
userName
- The name of the user on whose behalf this descriptor
should be saved. This can be null in case no user specific information
is to be written
SmaException
This method saves a message bus descriptor to the default configuration respository. The descriptor is saved in a format suitable for loading subsequently using any of the load methods offered in this class.
public final void save() throws SmaException
SmaException
This method invokes save((String)null)
public final void delete(IConfigRepository repo) throws SmaException
repo
- The configuration respository to delete the descriptor from.
SmaException
- Thrown in case an error in encountered during the
deletion of the descriptor.This method deletes a bus descriptor from a configuration repository.
public final void delete() throws SmaException
SmaException
- Thrown in case an error in encountered during the
deletion of the descriptor.This method permanently deletes a message bus descriptor from the default configuration repository.
public final String toString()
toString
in class Object
public static boolean exists(IConfigRepository repo, String busName)
repo
- The configuration respository to check in.busName
- The name of the bus in which to check for.public static boolean exists(String busName)
busName
- The name of the bus in which to check for.public static MessageBusDescriptor create(String name)
name
- The name of the bus whose descriptor is to be prepared.public static MessageBusDescriptor load(IConfigRepository repo, String name, String userName) throws SmaException
repo
- The configuration repository from where to load the descriptor.name
- The name of the bus whose descriptor is to be prepared.userName
- The user for whom to create the descriptor. This can
be null in case user specific information is not to be loaded.
SmaException
public static MessageBusDescriptor load(String name, String userName) throws SmaException
name
- The name of the bus whose descriptor is to be prepared.userName
- The user for whom to create the descriptor. A null
value will result in no user specific information is to be loaded.
SmaException
public static MessageBusDescriptor load(String name) throws SmaException
name
- The name of the bus whose descriptor is to be prepared.
SmaException
This method invokes load(name, null)
public static Set<MessageBusDescriptor> loadAll(IConfigRepository repo, String userName) throws SmaException
repo
- The configuration respository from where to create the buses.userName
- The user for whom to create the descriptors. This can
be null in case no user specific information is to be loaded.
This method creates and initializes bus descriptors for each of the buses configured in a configuration repository.
SmaException
public static Set<MessageBusDescriptor> loadAll(String userName) throws SmaException
userName
- The user for whom to return the descriptors. This can be
null in case no user specific information is to be loaded.
This method creates and initializes buses descriptors for all the buses configured in the default configuration repository.
SmaException
public static Set<MessageBusDescriptor> loadAll() throws SmaException
This method invokes loadAll(null)
SmaException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |