|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.broker.config.proxy.AdministeredObject
com.ibm.broker.config.proxy.ConfigManagerProxy
public class ConfigManagerProxy
This class allows applications to connect to and manipulate Configuration Managers. All domain objects are accessible through this one.
In order to use ConfigManagerProxy objects, applications must first obtain handles to them. Here is an example of how to do this:
ConfigManagerConnectionParameters cmcp = new MQConfigManagerConnectionParameters("localhost", 1414, "QMGR"); ConfigManagerProxy cmp = ConfigManagerProxy.getInstance(cmcp);
com.ibm.broker.config.proxy.ConfigManagerProxy extends
com.ibm.broker.config.proxy.AdministeredObject
|
|
Responsibilities |
|
Internal Collaborators |
com.ibm.broker.config.proxy.TopologyProxy
com.ibm.broker.config.proxy.LogProxy com.ibm.broker.config.proxy.TopicRootProxy com.ibm.broker.config.proxy.ConfigManagerConnectionParameters com.ibm.broker.config.proxy.SubscriptionsProxy |
Change Activity: -------- ----------- ------------- ------------------------------------ Reason: Date: Originator: Comments: -------- ----------- ------------- ------------------------------------ f19590.1 2004-03-19 HDMPL v6 Release f44739.7 2007-07-30 HDMPL v6.1 release: Methods now return genericized types where relevant Added setAutoDiscoveryIntervalMins(int) Added getAutoDiscoveryIntervalMins()
Field Summary | |
---|---|
static long |
MAX_WAIT_TIME
The maximum amount of time the Configuration Manager Proxy can be told to wait for Configuration Manager messages until a ConfigManagerProxyPropertyNotInitialisedException is thrown. |
Method Summary | |
---|---|
void |
addAccessControlEntries(AccessControlEntry[] accessControlList)
Adds this list to the list of access control entries that applies to this object. |
void |
beginUpdates()
Tells the ConfigManagerProxy to hold back from sending any subsequent state-changing requests to the Configuration Manager, so multiple requests can be later sent off in a single message (or "batch"). |
void |
cancelDeployment()
Tells the Configuration Manager to remove all of the deployment locks that are currently in place. |
DeployResult |
cancelDeployment(long timeToWaitMs)
Tells the Configuration Manager to remove all of the deployment locks that are currently in place. |
void |
clearUpdates()
Tells the ConfigManagerProxy to discard any state-changing requests received since the last call to beginUpdates(). |
void |
deregisterListeners()
Deregisters ALL external listeners associated with the current ConfigManagerProxy connection. |
static void |
disableConfigManagerProxyTracing()
Stops Configuration Manager Proxy service tracing. |
void |
disconnect()
Deregisters all listeners registered to this ConfigManagerProxy instance and closes the link to the Config Manager. |
static void |
enableConfigManagerProxyTracing(java.lang.String filename)
Enables Configuration Manager Proxy service tracing, sending output to the file with the supplied name. |
AccessControlEntry[] |
getAccessControlEntries()
Creates and returns a set of AccessControlEntry objects that describes the set of (principal,permission) tuples that have been applied specifically to this object. |
int |
getAutoDiscoveryIntervalMins()
Returns the period of time (in minutes) between automatic discoveries of broker information from the Configuration Manager. |
java.lang.String |
getConfigManagerFullVersion()
Returns the full version string of the Configuration Manager to which this Configuration Manager Proxy instance is connected. |
java.lang.String |
getConfigManagerOSArch()
Returns a string describing the architecture of the Configuration Manager machine to which this Configuration Manager Proxy is connected. |
java.lang.String |
getConfigManagerOSName()
Returns a string describing the name of the operating system running on the Configuration Manager machine to which this Configuration Manager Proxy is connected. |
java.lang.String |
getConfigManagerOSVersion()
Returns a string describing the version of the operation system on the Configuration Manager machine to which this Configuration Manager Proxy is connected. |
static int |
getConfigManagerProxyVersion()
Returns the major version string for the Configuration Manager Proxy (the constant AttributeConstants.VERSION_6_1). |
int |
getConfigManagerVersion()
Returns the major version identifier of the Configuration Manager to which the Configuration Manager Proxy is connected. |
ConfigurationObjectType |
getConfigurationObjectType()
Returns the ConfigurationObjectType associated with this AdministeredObject type. |
ConfigurationObjectType |
getConfigurationObjectTypeOfParent()
Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type. |
static ConfigManagerProxy |
getInstance(ConfigManagerConnectionParameters cmcp)
Asks the Configuration Manager Proxy to connect to a Configuration Manager with the supplied parameters. |
LogProxy |
getLog()
Asks the Configuration Manager to register for all log records associated with the current user, through a LogProxy instance. |
SubscriptionsProxy |
getSubscriptions(java.lang.String topic,
java.lang.String brokers,
java.lang.String users,
java.lang.String subscriptionsPoints,
java.util.GregorianCalendar startDate,
java.util.GregorianCalendar endDate)
Generates a SubscriptionsProxy that represents those subscriptions fulfilling the supplied criteria. |
TopicRootProxy |
getTopicRoot()
Returns the RootTopicProxy object associated with this Configuration Manager. |
TopologyProxy |
getTopology()
Returns the TopologyProxy object associated with this Configuration Manager. |
boolean |
isBatching()
Returns true if and only if the creation of a batch is currently in progress. |
boolean |
isIncompatible()
Returns true if and only if the Configuration Manager Proxy has received a message from the Configuration Manager which indicates that the Configuration Manager is unable to process requests from this Configuration Manager Proxy because the versions are not compatible. |
boolean |
isIncompatible(boolean waitIfNotUpdated)
Returns true if and only if the Configuration Manager Proxy has received a message from the Configuration Manager which indicates that the Configuration Manager is unable to process requests from this Configuration Manager Proxy because the versions are not compatible. |
void |
removeAccessControlEntries(AccessControlEntry[] accessControlList)
Deletes this list from the list of access control entries that applies to this object. |
void |
sendUpdates()
Tells the ConfigManagerProxy to send to the Configuration Manager all requests received since the beginUpdates() call. |
void |
sendUpdates(int correlationID)
Tells the ConfigManagerProxy to send to the Configuration Manager all requests received since the beginUpdates() call. |
void |
setAccessControlEntries(AccessControlEntry[] accessControlList)
Sets the complete list of access control entries that apply to this object. |
void |
setAutoDiscoveryIntervalMins(int newIntervalMins)
Sets the period of time between attempts by the Configuration Manager to automatically discover broker information. |
static void |
setLogger(java.lang.String className)
If directed to gather Configuration Manager Proxy trace for IBM service, do not use this method - use enableTracing(String) and disableTracing() instead. |
static void |
setLogger(java.lang.String className,
java.lang.String params)
Initializes a Configuration Manager Proxy logger. |
static void |
setRetryCharacteristics(int maxRetries,
int baseRetryWaitTime,
int retryWaitTimeIncrement)
Sets the retry characteristics for the Configuration Manager Proxy. |
static void |
setRetryCharacteristics(long maxWaitTimeMs)
Sets the retry characteristics for the Configuration Manager Proxy. |
void |
startDebugSystemTrace()
Asks the Configuration Manager to start debug system trace. |
void |
startSystemTrace()
Asks the Configuration Manager to start system trace. |
void |
stopSystemTrace()
Asks the Configuration Manager to stop system trace. |
static java.util.Properties |
withUUID(java.lang.String uuid)
Returns a new Properties object that has the UUID attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long MAX_WAIT_TIME
Method Detail |
---|
public static ConfigManagerProxy getInstance(ConfigManagerConnectionParameters cmcp) throws ConfigManagerProxyLoggedException
cmcp
- An object describing the connection parameters to the Configuration Manager.
Cannot be null.
ConfigManagerProxyLoggedException
- if a connection could not
be established for whatever reason.public void disconnect()
public void cancelDeployment() throws ConfigManagerProxyLoggedException
Only use this method if multiple brokers are not responding and you are sure that the outstanding deployment messages will never be processed by the brokers to which they are addressed.
If a single broker is not responding and the Configuration Manager Proxy is connected to a Configuration Manager of at least version 6, consider BrokerProxy.cancelDeployment() instead.
ConfigManagerProxyLoggedException
- if the request
could not be sent to the Configuration Manager.public DeployResult cancelDeployment(long timeToWaitMs) throws ConfigManagerProxyLoggedException
Only use this method if multiple brokers are not responding and you are sure that the outstanding deployment messages will never be processed by the brokers to which they are addressed.
If a single broker is not responding and the Configuration Manager Proxy is connected to a Configuration Manager of at least version 6, consider BrokerProxy.cancelDeployment() instead.
timeToWaitMs
- A positive value describes the
maximum length of time to wait for a response from
the Configuration Manager (in milliseconds) before returning
the DeployResult. Alternatively:
ConfigManagerProxyLoggedException
- if the request
could not be sent to the Configuration Manager.public void deregisterListeners()
Note: The same effect can be achieved by using ConfigManagerProxy.disconnect(). The difference is that this call doesn't close the link to the Configuration Manager- it is possible to use call this method and still make use of the APIs and the listener registration mechanism.
public TopologyProxy getTopology() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the
Topology subcomponent could not be loaded because the Config
Manager has not yet supplied the required information.public static int getConfigManagerProxyVersion()
public TopicRootProxy getTopicRoot() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the
Topology subcomponent could not be loaded because the Config
Manager has not yet supplied the required information.public SubscriptionsProxy getSubscriptions(java.lang.String topic, java.lang.String brokers, java.lang.String users, java.lang.String subscriptionsPoints, java.util.GregorianCalendar startDate, java.util.GregorianCalendar endDate) throws ConfigManagerProxyLoggedException
topic
- Name of the topic to search, or null to
search all topic names. '%' can be used within the
string to denote a wildcard.brokers
- Which brokers to search, or null to
search all brokers. '%' can be used within the
string to denote a wildcard.users
- Which users to search, or null to
search all users. '%' can be used within the
string to denote a wildcard.subscriptionsPoints
- Which subscriptions points
to search, or null to search all subscriptions points.
'%' can be used within the string to denote a wildcard.startDate
- The earliest date to search, or null
to not specify a start date.endDate
- The latest date to search, or null
to not specify an end date.
ConfigManagerProxyLoggedException
- if the request could not
be sent to the Configuration Manager.public LogProxy getLog() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the
Topology subcomponent could not be loaded because the Config
Manager has not yet supplied the required information.public ConfigurationObjectType getConfigurationObjectTypeOfParent()
getConfigurationObjectTypeOfParent
in class AdministeredObject
public static void setRetryCharacteristics(int maxRetries, int baseRetryWaitTime, int retryWaitTimeIncrement)
The Configuration Manager Proxy may not always have been supplied a required piece of information that is needed to perform an operation (e.g. it can't return a broker's execution group list if that broker's information has not been supplied to it by the Configuration Manager). This can happen if the proxy has a slow link to the Configuration Manager, or if the Configuration Manager is heavily burdened or just not running.
Collectively, the parameters supplied to this method represent the maximum amount of time to wait for the required information to arrive before the exception is thrown. Specifically, three parameters are required which describe how many times the Configuration Manager Proxy should poll incoming messages from the Configuration Manager to see if the required information has arrived. The three parameters are: the number of times to retry, the initial amount of time to wait between failure (in milliseconds) and the amount of time to increase the wait time by on successive failure (again in milliseconds).
So supplying (10,1000,1000) to this method (which happens to be the default) means that retries will occur one, two, four, seven, eleven seconds after the first failure (and so on). If the required information still cannot be found after the number of maxRetries is exhausted, a ConfigManagerProxyPropertyNotInitializedException will be thrown to the calling application.
maxRetries
- the maximum number of consecutive
failures before an exception is thrown to the calling
application.baseRetryWaitTime
- The initial time to wait
between retries (in milliseconds)retryWaitTimeIncrement
- How much to increase
the retry wait time by after each consecutive failure.public static void setRetryCharacteristics(long maxWaitTimeMs)
The Configuration Manager Proxy may not always have been supplied a required piece of information that is needed to perform an operation (e.g. it can't return a broker's execution group list if that broker's information has not been supplied to it by the Configuration Manager). This can happen if the proxy has a slow link to the Configuration Manager, or if the Configuration Manager is heavily burdened or just not running.
maxWaitTimeMs
- the maximum length of time the
Configuration Manager Proxy can wait for a response from the
Configuration Manager before a
ConfigManagerProxyPropertyNotInitalizedException is thrown.
The maximum value allowed value is ConfigManagerProxy.MAX_WAIT_TIME
If the supplied value is greater than this,
ConfigManagerProxy.MAX_WAIT_TIME will be used instead.public static void enableConfigManagerProxyTracing(java.lang.String filename) throws ConfigManagerProxyLoggedException
Not to be confused with startSystemTrace() and startDebugSystemTrace(), which enables tracing of the Configuration Manager.
filename
- File spec of the output file, which cannot be null.
ConfigManagerProxyLoggedException
- if the logger could not
be instantiated.public static void disableConfigManagerProxyTracing()
Not to be confused with stopSystemTrace(), which enables tracing of the Configuration Manager.
public static void setLogger(java.lang.String className, java.lang.String params) throws ConfigManagerProxyLoggedException
className
- Fully qualified name of the logger class
(must extend com.ibm.broker.config.proxy.Logger)
A null or blank value here will disable logging.params
- any parameters required by the logger
ConfigManagerProxyLoggedException
- if the logger could
not be instantiated.public static void setLogger(java.lang.String className) throws ConfigManagerProxyLoggedException
This method sets up an logger that does not require parameters.
className
- Fully qualified name of the
logger class (must extend com.ibm.broker.config.proxy.Logger).
A null or blank value here will disable logging.
ConfigManagerProxyLoggedException
- if the logger could
not be instantiated.public void beginUpdates() throws ConfigManagerProxyLoggedException
ConfigManagerProxyLoggedException
- - if a batch is already
in progress.sendUpdates()
,
clearUpdates()
,
isBatching()
public void sendUpdates() throws ConfigManagerProxyLoggedException
ConfigManagerProxyLoggedException
- If a batch was not
in progress, if the batch contained no requests, or if
the request could not be sent to the Configuration Manager.beginUpdates()
,
clearUpdates()
,
isBatching()
public void sendUpdates(int correlationID) throws ConfigManagerProxyLoggedException
correlationID
- Identifier that will accompany any actionresponse
messages sent back to the caller through the AdministeredObjectListener
interface.
ConfigManagerProxyLoggedException
- if a batch was not
in progress, if the batch contained no requests or if the request could not
be sent to the Configuration Manager.beginUpdates()
,
sendUpdates()
,
clearUpdates()
,
isBatching()
public void clearUpdates()
beginUpdates()
,
sendUpdates()
,
isBatching()
public boolean isBatching()
beginUpdates()
,
sendUpdates()
,
clearUpdates()
public boolean isIncompatible()
Note that the timeout condition will result in the response of false being returned, correctly indicating that no 'object-restricted' response has been received. Callers wishing to programmatically detect the timeout condition should use hasBeenUpdatedByConfigManager(true).
public boolean isIncompatible(boolean waitIfNotUpdated)
waitIfNotUpdated
- If this is set to true and
the administered object has not yet received an
update from the Configuration Manager, the call will block
until the first response (e.g. the 'Proxy is
incompatible' message) is received (or the timeout configured
in ConfigManagerProxy.setRetryCharacteristics() occurs).
This parameter allows the caller to ensure correctness
of the returned value (if the value of the incompatible
flag is sought before the first response from the Config
Manager has necessarily been returned, the method may
confusingly return 'false' even though the Config
Manager is not compatible).
public void startSystemTrace() throws ConfigManagerProxyLoggedException
ConfigManagerProxyLoggedException
- if the request
to start system trace could not be sent to the
Configuration Manager.public void stopSystemTrace() throws ConfigManagerProxyLoggedException
ConfigManagerProxyLoggedException
- if the request
to stop system trace could not be sent to the
Configuration Manager.public void startDebugSystemTrace() throws ConfigManagerProxyLoggedException
ConfigManagerProxyLoggedException
- if the request
to start system trace could not be sent to the
Configuration Manager.public int getConfigManagerVersion() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if information on the Configuration Manager's version
was not supplied before a timeout occurred.public int getAutoDiscoveryIntervalMins() throws ConfigManagerProxyPropertyNotInitializedException
Note: AdministeredObjectListeners of the ConfigManagerProxy object will not be notified if this setting is changed. Use the refresh() method (or reconnect to the Configuration Manager), followed by getAutoDiscoveryIntervalMins() to determine the active value for this property.
If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6.1 level, this method returns -1. Use ConfigManagerProxy.getConfigManagerVersion() to return the version of the connected Configuration Manager.
ConfigManagerProxyNotInitializedException
- if the information was not supplied by the Configuration Manager
before a timeout occurred.
ConfigManagerProxyPropertyNotInitializedException
public void setAutoDiscoveryIntervalMins(int newIntervalMins) throws ConfigManagerProxyLoggedException
Note: AdministeredObjectListeners of the ConfigManagerProxy object will not be notified if this setting is changed. Use the refresh() method (or reconnect to the Configuration Manager), followed by getAutoDiscoveryIntervalMins() to determine the active value for this property.
If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6.1 level, this method does nothing.
newIntervalMins
- The new interval (up to a maximum of 10080) or -1.
ConfigManagerProxyLoggedException
- if the request could not be
sent to the Configuration Manager.public java.lang.String getConfigManagerFullVersion() throws ConfigManagerProxyPropertyNotInitializedException
If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6 level, this method returns null.
ConfigManagerProxyNotInitializedException
- if the version information was not supplied by the
Configuration Manager before a timeout occurred.
ConfigManagerProxyPropertyNotInitializedException
public java.lang.String getConfigManagerOSName() throws ConfigManagerProxyPropertyNotInitializedException
If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6 level, this method returns null.
ConfigManagerProxyNotInitializedException
- if the required information was not supplied by the
Configuration Manager before a timeout occurred.
ConfigManagerProxyPropertyNotInitializedException
public java.lang.String getConfigManagerOSArch() throws ConfigManagerProxyPropertyNotInitializedException
If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6 level, this method returns null.
ConfigManagerProxyNotInitializedException
- if the required information was not supplied by the
Configuration Manager before a timeout occurred.
ConfigManagerProxyPropertyNotInitializedException
public java.lang.String getConfigManagerOSVersion() throws ConfigManagerProxyPropertyNotInitializedException
If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6 level, this method returns null.
ConfigManagerProxyNotInitializedException
- if the required information was not supplied by the
Configuration Manager before a timeout occurred.
ConfigManagerProxyPropertyNotInitializedException
public static java.util.Properties withUUID(java.lang.String uuid)
uuid
- property to set
public ConfigurationObjectType getConfigurationObjectType()
getConfigurationObjectType
in class AdministeredObject
public AccessControlEntry[] getAccessControlEntries()
This method does not return details of permissions that have been implicitly granted by inherited access control entries.
ConfigManagerProxyPropertyNotInitializedException
- if this objects list of Access Control Entries was not supplied by the
Configuration Manager before a timeout occurred.public void setAccessControlEntries(AccessControlEntry[] accessControlList) throws ConfigManagerProxyLoggedException
This method submits only changed access control entries to the Configuration Manager. It converts the supplied array into a set of access control entries to add and a set of access control entries to remove, based on the information currently supplied from the Configuration Manager. The add and remove operations are processed separately by the Configuration Manager as two atomic, transactional requests.
If the Configuration Manager to which the Configuration Manager Proxy is connected is of a version less than v6, this method will have no effect.
accessControlList
- Array of access control entries which are to apply to this
object.
ConfigManagerProxyLoggedException
- if the request to update the object could
not be sent to the Configuration Manager.
ConfigManagerProxyPropertyNotInitializedException
- if this objects current list of Access Control Entries was not supplied by the
Configuration Manager before a timeout occurred.public void addAccessControlEntries(AccessControlEntry[] accessControlList) throws ConfigManagerProxyLoggedException
This operation is completely transactional. If the Configuration Manager successfully processes this request, all access control entries from the supplied array will be associated with this administered object. If not, the access control list for this object will have not been modified.
If the Configuration Manager to which the Configuration Manager Proxy is connected is of a version less than v6, this method will have no effect.
accessControlList
- Array of access control entries which are to be added to this
object.
ConfigManagerProxyLoggedException
ConfigManagerProxyLoggedException
- if the request to update the object could
not be sent to the Configuration Manager.public void removeAccessControlEntries(AccessControlEntry[] accessControlList) throws ConfigManagerProxyLoggedException
This operation is completely transactional. If the Configuration Manager successfully processes this request, no access control entries from the supplied array will be associated with this administered object. If not, the access control list for this object will have not been modified.
If the Configuration Manager to which the Configuration Manager Proxy is connected is of a version less than v6, this method will have no effect.
accessControlList
- Array of access control entries which are to be removed from this
object.
ConfigManagerProxyLoggedException
- if the request to update the object could
not be sent to the Configuration Manager.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |