public interface SasManagementMBean
The SasManagementMBean
provides access to the SAS server configuration.
A SasManagementMBean
instance always manages the SAS server configuration for the currently active namespace for the client connection.
It is not necessary to get a different MBean for different namespaces.
Modifier and Type | Field and Description |
---|---|
static String |
MBEAN_NAME
The name of this MBean, equal to the string "SAS".
|
static String |
OBJECT_NAME
The JMX Object Name of this MBean.
|
Modifier and Type | Method and Description |
---|---|
void |
addServer(String server)
Add a server to the set of configured SAS servers.
|
boolean |
getAppendNodeID()
Determine if the cluster node ID should be appended to the system name.
|
String |
getBundlePrefixMapping(String name)
Get a bundle prefix mapping.
|
int |
getQueueSize()
Get the SAS facility queue size.
|
String |
getResourceIdentifier()
Get the SAS resource identifier associated with events sent to SAS.
|
String |
getServer()
Deprecated.
Use
getServers() instead.
Warning: will be removed. |
String[] |
getServers()
Get the list of configured SAS servers.
|
String |
getSystemName()
Get the current system name sent to SAS on connection.
|
boolean |
isTracingEnabled()
Determine if the SAS facility is current configured to send trace messages to SAS.
|
TabularData |
listBundlePrefixMappings()
Get all bundle prefix mappings.
|
void |
removeBundlePrefixMapping(String name)
Remove a bundle prefix mapping.
|
boolean |
removeServer(String server)
Remove a server from the set of configured SAS servers.
|
String[] |
reportUnmappedBundles()
Get the set of all unmapped bundles.
|
void |
setAppendNodeID(boolean appendNodeID)
Set cluster node ID append behaviour.
|
void |
setBundlePrefixMapping(String name,
String prefix)
Add or update a bundle prefix mapping.
|
void |
setQueueSize(int queueSize)
Set the SAS facility queue size.
|
void |
setResourceIdentifier(String resourceIdentifier)
Set the resource identifier of the SAS resource bundle to associate with events sent to the SAS server.
|
void |
setServer(String server)
Deprecated.
Use
addServer(String) and removeServer(String) or setServers(String[]) instead.
Warning: will be removed |
void |
setServers(String[] servers)
Set the SAS servers the SAS facility should send trace messages to.
|
void |
setSystemName(String systemName)
Set the system name to use when connecting to SAS.
|
void |
setTracingEnabled(boolean sasTracingEnabled,
boolean force)
Enable or disable SAS tracing.
|
static final String MBEAN_NAME
The name of this MBean, equal to the string "SAS".
static final String OBJECT_NAME
The JMX Object Name of this MBean.
boolean isTracingEnabled() throws ConfigurationException
Determine if the SAS facility is current configured to send trace messages to SAS.
true
if SAS tracing is enabled, false
otherwise.ConfigurationException
- if the SAS configuration could not be read.void setTracingEnabled(boolean sasTracingEnabled, boolean force) throws IllegalStateException, ConfigurationException
Enable or disable SAS tracing. When tracing is enabled, the SAS facility sends trace messages to SAS.
Normally the SAS tracing configuration cannot be changed from enabled to disabled while the SLEE state
for the current namespace is not STOPPED
on any active cluster node.
If the force
argument to this method is true
, the check for current SLEE state is bypassed and the configuration is changed regardless.
sasTracingEnabled
- boolean flag indicating whether or not the SAS facility will send trace messages to the configured server.force
- boolean flag indicating whether or not the current SLEE state should be ignored while making the configuration change.IllegalStateException
- if SAS tracing is currently enabled, sasTracingEnabled
and force
were both false
, and the SLEE was not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.int getQueueSize() throws ConfigurationException
Get the SAS facility queue size.
ConfigurationException
- if an error occurred reading the SAS configuration.void setQueueSize(int queueSize) throws IllegalStateException, ConfigurationException
Set the SAS facility queue size.
The queue size can only be modified if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
queueSize
- the new queue size.IllegalStateException
- if the specified queue size is different to that already configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.String getSystemName() throws ConfigurationException
Get the current system name sent to SAS on connection.
ConfigurationException
- if an error occurred reading the SAS configuration.void setSystemName(String systemName) throws NullPointerException, IllegalArgumentException, IllegalStateException, ConfigurationException
Set the system name to use when connecting to SAS.
The system name can only be modified if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
systemName
- the system name.NullPointerException
- if systemName
is null
.IllegalArgumentException
- if systemName
is zero-length.IllegalStateException
- if the specified system name is different to that already configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.boolean getAppendNodeID() throws ConfigurationException
Determine if the cluster node ID should be appended to the system name.
true
if the node ID should be appended to the system name, false
if not.ConfigurationException
- if an error occurred reading the SAS configuration.void setAppendNodeID(boolean appendNodeID) throws IllegalStateException, ConfigurationException
Set cluster node ID append behaviour.
In order to provide SAS with a unique system name for each Rhino cluster node, the node ID of each node can be appended to the system name send to SAS.
The append behaviour can only be modified if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
appendNodeID
- true
if the node ID should be appended to system name, false
otherwise.IllegalStateException
- if the specified append behaviour is different than that already configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.void addServer(String server) throws NullPointerException, IllegalArgumentException, IllegalStateException, ConfigurationException
Add a server to the set of configured SAS servers.
Servers may be specified either by host name or IP address.
A port may optionally be specified using the format host:port
.
New servers can only be added if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
server
- host name or IP address of the server to add.NullPointerException
- if server
is null
.IllegalArgumentException
- if server
is zero-length.IllegalStateException
- if the specified server is not currently configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.boolean removeServer(String server) throws IllegalStateException, ConfigurationException
Remove a server from the set of configured SAS servers. This must exactly match the server entry, including port if any.
Existing servers can only be removed if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
server
- host name or IP address of the server to remove.IllegalStateException
- if the specified server is currently configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.@Deprecated String getServer() throws ConfigurationException
getServers()
instead.
Warning: will be removed.Get the host name/IP address of the configured SAS server.
ConfigurationException
- if an error occurred reading the SAS configuration.@Deprecated void setServer(String server) throws IllegalStateException, ConfigurationException
addServer(String)
and removeServer(String)
or setServers(String[])
instead.
Warning: will be removedSet the host name/IP address of the SAS server the SAS facility should send trace messages to
The server can only be changed if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
server
- the host name or IP address of the SAS server.ConfigurationException
- if an error occurred updating the SAS configuration.IllegalStateException
- if the specified server is not currently configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.void setServers(String[] servers) throws ConfigurationException
Set the SAS servers the SAS facility should send trace messages to.
Servers may be specified either by host name or IP address.
A port may optionally be specified using the format host:port
.
The server list can only be changed if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
servers
- the host names or IP addresses of the SAS servers.IllegalStateException
- if the specified server list is different to that currently configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.String[] getServers() throws ConfigurationException
Get the list of configured SAS servers.
ConfigurationException
- if an error occurred reading the SAS configuration.String getResourceIdentifier() throws ConfigurationException
Get the SAS resource identifier associated with events sent to SAS.
ConfigurationException
- if an error occurred reading the SAS configuration.void setResourceIdentifier(String resourceIdentifier) throws IllegalStateException, ConfigurationException
Set the resource identifier of the SAS resource bundle to associate with events sent to the SAS server.
The resource identifier can only be changed if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
resourceIdentifier
- the resource identifier to associate with the SAS connection, eg. com.metaswitch.volte-tas
IllegalStateException
- if the specified resource identifier is different to that currently configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.void setBundlePrefixMapping(String name, String prefix) throws NullPointerException, IllegalArgumentException, MappingAlreadyExistsException, ConfigurationException
Add or update a bundle prefix mapping.
Prefix is a number in the range 0x0001 to 0xFFFF.
name
- the bundle name.prefix
- the bundle prefix mapping.NullPointerException
- if either argument is null
.IllegalArgumentException
- if either argument is zero-length.MappingAlreadyExistsException
- if the specified prefix has already been associated with the target name.ConfigurationException
- if an error occurred updating the SAS configuration.String getBundlePrefixMapping(String name) throws ConfigurationException
Get a bundle prefix mapping.
name
- the bundle name.NullPointerException
- if name
is null
.IllegalArgumentException
- if name
is zero-length.ConfigurationException
- if an error occurred reading the SAS configuration.TabularData listBundlePrefixMappings() throws ConfigurationException
Get all bundle prefix mappings.
The returned TabularData contains a CompositeData row for each mapping. The CompositeData contains two columns:
a java.lang.String column "name"
a java.lang.String column "prefix"
ConfigurationException
- if an error occurred reading the SAS configuration.void removeBundlePrefixMapping(String name) throws ConfigurationException, IllegalArgumentException
Remove a bundle prefix mapping.
Existing bundle prefix mappings can only be removed if SAS tracing is currently disabled or the SLEE state
for the current namespace is STOPPED
on all active cluster nodes.
name
- the bundle name.NullPointerException
- if name
is null
.IllegalArgumentException
- if name
is zero-length, or a bundle mapping for the specified name does not exist.IllegalStateException
- if a bundle prefix mapping with the specified name is currently configured, SAS tracing is currently enabled, and the SLEE is not stopped on one or more active cluster nodes.ConfigurationException
- if an error occurred updating the SAS configuration.String[] reportUnmappedBundles() throws ConfigurationException
Get the set of all unmapped bundles.
ConfigurationException
- if an error occurred reading the SAS configuration.