|
|||||||||
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.MessageChannelDescriptor
public final class MessageChannelDescriptor
A message channel descriptor.
This class contains information used to describe a message channel. It is used by a bus descriptor to describe channels configured for the bus. It also offers methods to persist and load descriptors to/from X Platform configuration repositories.
Method Summary | |
---|---|
static MessageChannelDescriptor |
create(String name,
MessageBusDescriptor parent)
Create a default message channel descriptor. |
void |
delete(IConfigRepository repo)
Delete a channel descriptor from the configuration repository. |
static boolean |
exists(IConfigRepository repo,
String busName,
String channelName)
Checks if a channel is configured in a configuration repository |
static boolean |
exists(String busName,
String channelName)
Checks if a channel descriptor is present in the default configuration repository |
String |
getChannelFilter()
Get the filter for the channel that this descriptor describes. |
short |
getChannelId()
Get a channel's id. |
String |
getChannelKey()
Get the key for the channel that this descriptor describes. |
MessageChannel.Qos |
getChannelQos()
Get the QOS for the channel that this descriptor describes. |
String |
getName()
Get the name of the channel that this descriptor describes |
MessageBusDescriptor |
getParent()
Get the parent (container) bus descriptor |
Properties |
getProviderConfig()
Get the configuration for the provider specific portion of the channel that this descriptor describes. |
static MessageChannelDescriptor |
load(IConfigRepository repo,
MessageBusDescriptor busDescriptor,
String channelName,
String userName)
Create a channel descriptor from a configuration respository. |
static Set<MessageChannelDescriptor> |
loadAll(IConfigRepository repo,
MessageBusDescriptor busDescriptor,
String userName)
Create channel descriptors for all channels for a bus in a configuration repository. |
void |
save(IConfigRepository repo,
String userName)
Save a channel descriptor to a configuration repository. |
MessageChannelDescriptor |
setChannelFilter(String filter)
Set the filter for the channel that this descriptor describes. |
void |
setChannelId(short id)
Set a channel's id. |
MessageChannelDescriptor |
setChannelKey(String key)
Set the key for the channel that this descriptor describes. |
MessageChannelDescriptor |
setChannelQos(MessageChannel.Qos qos)
Set the QOS for the channel that this descriptor describes. |
MessageChannelDescriptor |
setProviderConfig(Properties props)
Set the configuration for the provider specific portion of the channel that this descriptor describes. |
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 |
Method Detail |
---|
public final String getName()
public final MessageBusDescriptor getParent()
public final MessageChannelDescriptor setProviderConfig(Properties props)
props
- The properties table that describes the provider configuration.
This parameter can be null in which case default values will be used for
the properties.
This method sets the configuration for the provider specific portion of a bus channel using a property table. Other property names are provider defined.
public final Properties getProviderConfig()
public final void setChannelId(short id)
id
- The channel id.
The channel id is a numerical identifier of a channel uniquely identifying the channel in its bus.
public final short getChannelId()
public final MessageChannelDescriptor setChannelKey(String key)
key
- The channel key to set. This parameter value can be null
in which case the channel will not be associated with any key.
public final String getChannelKey()
public final MessageChannelDescriptor setChannelFilter(String filter)
A channel filter filters variable parts of a channel key to filter what is received over the channel.
Unless otherwise specified by a particular channel implementation, a channel filter
takes the following form:
var1=val1[|val2][;var2=val3]
For example: given a channel key of "ORDERS/${Region}/{Department}"
,
one can specify a channel filter of "Region=NA|EMEA;Department=Clothing"
.
This would join the channel on:
If a variable portion of the channel key is omitted in a filter, it will result
in the subscription being joined in a wildcard fashion (assuming the underlying
bus implementation supports wildcards). So given a channel key of
"ORDERS/${Region}/${Department}"
and a channel filter of
"Region=NA|EMEA"
, it would result in the following
subscriptions being issued during join:
Finally, if the channel filter is set to null for the channel key in the example above, then the resulting subscription would be:
filter
- The channel filter to set. This parameter value can be null
in which case the channel will not be associated with any filter.
public final String getChannelFilter()
setChannelFilter(String)
public final MessageChannelDescriptor setChannelQos(MessageChannel.Qos qos)
qos
- The channel QOS to set.
public final MessageChannel.Qos getChannelQos()
public final void save(IConfigRepository repo, String userName) throws SmaException
repo
- The configuration respository to save the descriptor to.userName
- The name of the user on whose behalf this descriptor
should be saved.
SmaException
- Thrown in case an error in encountered during
the saving of the descriptor.This method saves a channel descriptor to the configuration repository.
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 channel descriptor from a configuration repository.
public final String toString()
toString
in class Object
public static boolean exists(IConfigRepository repo, String busName, String channelName)
repo
- The configuration respository to check in.busName
- The name of the bus in which to check for channel existence.channelName
- The name of the channel to check for.public static boolean exists(String busName, String channelName)
busName
- The name of the bus in which to check for channel existence.channelName
- The name of the channel to check for.public static MessageChannelDescriptor create(String name, MessageBusDescriptor parent)
name
- The name of the channel whose descriptor is to be prepared.parent
- The descriptor of the bus to which this descriptor's channel belongspublic static MessageChannelDescriptor load(IConfigRepository repo, MessageBusDescriptor busDescriptor, String channelName, String userName) throws SmaException
repo
- The configuration respository to create the channel from.busDescriptor
- The parent bus descriptor preparing this descriptor.channelName
- The name of the channel whose descriptor is to be prepared.userName
- The user for whom the descriptor is being prepared.
SmaException
- Thrown in case an error occurs during the preparation
of the descriptor.public static Set<MessageChannelDescriptor> loadAll(IConfigRepository repo, MessageBusDescriptor busDescriptor, String userName) throws SmaException
repo
- The configuration respository from where to create the buses.busDescriptor
- The parent bus descriptor preparing this descriptor.userName
- The user for whom the descriptor is being prepared.
This method creates and initializes channel descriptors for each of the channels configured for a bus in a configuration repository.
SmaException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |