java.lang.Object com.ibm.broker.config.proxy.AdministeredObject
public abstract class AdministeredObject
extends Object
This is the abstract superclass from which all Proxy-type objects inherit. The class provides a set of methods common to all these types, such as the setting and getting of common attributes and the ability to traverse and manipulate the object hierarchy.
com.ibm.broker.config.proxy.AdministeredObject
|
|
Responsibilities |
Provides a means of manipulating arbitrary managed objects
within the Configuration Manager domain. This includes object
creation, object deletion, object modification, and listener
registration/deregistration.
Instances are responsible for maintaining information about the objects they represent locally. AdministeredObjects have a collection of String based properties that describe the object's attributes, such as their name, and also any managed subcomponents of the AdministeredObject- for example, Execution Groups within a Broker. AdministeredObjects may have listeners registered against them, which are informed of any changes to the AdministeredObject's state. |
Internal Collaborators | com.ibm.broker.config.proxy.AdministeredObjectListener |
Method | Description |
---|---|
void deregisterListener(AdministeredObjectListener) | Asks the Configuration Manager Proxy to unsubscribe a previously registered AdministeredObjectListener, given the listener instance that was supplied during registration. |
void deregisterListener(AdvancedAdministeredObjectListener) | Asks the Configuration Manager Proxy to unsubscribe a previously registered AdvancedAdministeredObjectListener, given the listener instance that was supplied during registration. |
int elements(String) | For groups of attributes (such as subcomponents) this method returns the largest number for which an attribute exists in the current object. |
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. |
ConfigurationObjectType getConfigurationObjectType() | Returns the ConfigurationObjectType associated with this AdministeredObject type. |
ConfigurationObjectType getConfigurationObjectTypeOfParent() | Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type. |
Vector getLastBIPMessages() | Returns the last vector of BIP messages that are associated with this object. |
CompletionCodeType getLastCompletionCode() | Returns the completion code of the last operation that was performed by this connection to the Configuration Manager on the object that this AdministeredObject represents. |
String getLastUpdateUser() | Returns the userid of the person who caused the last modification message to be sent for this object. |
String getLongDescription() | Helper method to return the long description field for the current Administered Object. |
AdministeredObject getManagedSubcomponent(Properties) | Returns the first object that has the requested properties. |
AdministeredObject getManagedSubcomponentFromStringRepresentation(String) | Returns the object which has the current object as a parent that has the supplied string representation. |
Enumeration getManagedSubcomponents(Properties) | Asks the Configuration Manager to return an enumeration of all the existing objects that logically belong directly within the current administered object (for example, the execution groups within a broker). |
Enumeration getManagedSubcomponents(Properties, boolean) | Asks the Configuration Manager to return an enumeration of all the existing objects that logically belong directly within the current administered object (for example, the execution groups within a broker). |
Enumeration getManagedSubcomponents(Properties, boolean, Properties) | Asks the Configuration Manager to return an enumeration of all the existing objects that logically belong directly within the current administered object (for example, the execution groups within a broker). |
String getName() | Returns the name of the object |
int getNumberOfSubcomponents() | Returns the number of subcomponents that are directly owned by this object. |
AdministeredObject getParent() | Returns the AdministeredObject that logically owns this object. |
Vector getPredictedNewSubcomponents() | Returns a clone of the predictedNewSubcomponents vector. |
Properties getProperties() | Returns a clone of the complete local attribute list for the current object, based on information supplied solely from the Config Manager. |
String getProperty(String) | Returns the local value of the supplied attribute. |
String getProperty(String, boolean) | Returns the local value of the supplied attribute. |
String getProperty(String, int) | For properties that end in a number (for example, subcomponent properties) this method returns the value of the property that ends in the supplied number, waiting if the information is not available. |
String getProperty(String, int, boolean) | For properties that end in a number (for example, subcomponent properties) this method returns the value of the property that ends in the supplied number, optionally waiting if the information is not available. |
Date getRepositoryTimestamp() | Returns the most recent repository timestamp associated with this object. |
String getShortDescription() | Helper method to return the short description field for the Administered Object. |
GregorianCalendar getTimeOfLastCompletionCode() | Returns the time that the completion code field was last updated, as a result of a request that was sent out by this connection to the Configuration Manager. |
GregorianCalendar getTimeOfLastUpdate() | Returns the time that the object was last updated by a Configuration Manager publication. |
String getType() | Convenience method to return the type of this administered object. |
String getUUID() | Convenience method to return the unique identifier of this administered object. |
boolean hasBeenRestrictedByConfigManager() | Returns true if and only if the proxy has been told by the Configuration Manager that the object is not available for use by the current user. |
boolean hasBeenRestrictedByConfigManager(boolean) | Returns true if and only if the proxy has been told by the Configuration Manager that the object is not available for use by the current user. |
boolean hasBeenUpdatedByConfigManager() | Returns true if and only if this object handle has received at least one update publication from the Configuration Manager. |
boolean hasBeenUpdatedByConfigManager(boolean) | Returns true if and only if this object handle has received at least one update publication from the Configuration Manager. |
boolean isAwaitingSubmissionForCreation() | Returns true if and only if the current object has been created as part of the current batch, but the batch has not yet been sent to the Configuration Manager. |
boolean isDeployed() | Returns true if and only if the object that this AdministeredObject represents exists in the deployed section of the Configuration Manager database. |
boolean isShared() | Returns true if and only if the object that this AdministeredObject represents exists in the shared section of the Configuration Manager database. |
void refresh() | Forces this AdministeredObject to reregister itself with the Configuration Manager and to re-receive the object's complete set of attributes. |
void registerListener(AdministeredObjectListener) | Asks the Configuration Manager to keep the caller informed of any changes to the current AdministeredObject. |
void registerListener(AdvancedAdministeredObjectListener) | Asks the Configuration Manager to keep the caller informed of any changes to the current AdministeredObject. |
void registerListener(AdvancedAdministeredObjectListener, boolean, Object) | Asks the Configuration Manager to keep the caller informed of any changes to the current AdministeredObject, and ask to be provided with advanced notifications. |
void setAccessControlEntries(AccessControlEntry[]) | Sets the complete list of access control entries that applies to this object. |
void setLongDescription(String) | Helper method to set the long description field of the current Administered Object. |
void setName(String) | Helper method to set the name of the Administered Object. |
void setProperties(Properties) | Asks the Configuration Manager to update a set of attributes for the current object. |
void setShortDescription(String) | Helper method to set the short description field of the Administered Object. |
String toString() | Displays the type and UUID of the current object (or the name if it is available). |
String toVerboseString() | Displays the list of all properties currently associated with this administered object. |
void unsubscribeFromConfigurationManagerUpdates() | Asks the Proxy to explicitly unsubscribe the current AdministeredObject from receiving future Configuration Manager updates. |
Properties withName(String) | Returns a new Properties object that has the name attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used. |
Properties withUUID(String) | Returns a new Properties object that has the UUID attribute set to the supplied String, and (for subclass implementations) the type attribute to be the name of the subclass of AdministeredObject being used. |
public void deregisterListener(AdministeredObjectListener listener)Asks the Configuration Manager Proxy to unsubscribe a previously registered AdministeredObjectListener, given the listener instance that was supplied during registration.
If the supplied listener was registered with this AdministeredObject more than once, all registrations will be removed.
If the supplied listener has not been registered with this administered object then this method does nothing.
- Parameters
- listener - the object that will no longer be notified of any events
public void deregisterListener(AdvancedAdministeredObjectListener listener)Asks the Configuration Manager Proxy to unsubscribe a previously registered AdvancedAdministeredObjectListener, given the listener instance that was supplied during registration.
If the supplied listener was registered with this AdministeredObject more than once, all registrations will be removed.
If the supplied listener has not been registered with this administered object then this method does nothing.
- Parameters
- listener - the object that will no longer be notified of any events
public int elements(String key) throws ConfigManagerProxyPropertyNotInitializedExceptionFor groups of attributes (such as subcomponents) this method returns the largest number for which an attribute exists in the current object. For instance, if the attributes "subcomponent.1" and "subcomponent.2" exist in the current object but "subcomponent.3" does not, elements("subcomponent.") will return 2.
- Parameters
- key - The name of the property to find. Use the AttributeConstants.*_PROPERTY constants here.
- Returns
- The number of the last available property or zero if there are no elements available for the supplied property.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the requested property is not yet known.
public 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.
This method does not return details of permissions that have been implicitly granted by inherited access control entries.
- Returns
- AccessControlEntry[] array of AccessControlEntry objects that apply to this object.
public abstract ConfigurationObjectType getConfigurationObjectType()Returns the ConfigurationObjectType associated with this AdministeredObject type. For example, for ExecutionGroupProxy, ConfigurationObjectType.executiongroup is returned.
- Returns
- ConfigurationObjectType associated with this class.
public abstract ConfigurationObjectType getConfigurationObjectTypeOfParent()Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type. For example, for ExecutionGroupProxy, ConfigurationObjectType.broker is returned.
- Returns
- ConfigurationObjectType associated with this class.
public Vector getLastBIPMessages()Returns the last vector of BIP messages that are associated with this object. These are set when a previously submitted action completes and the response is received by the Configuration Manager Proxy.
- Returns
- Vector of com.ibm.broker.config.proxy.LogEntry objects. The vector may be empty or null.
public CompletionCodeType getLastCompletionCode()Returns the completion code of the last operation that was performed by this connection to the Configuration Manager on the object that this AdministeredObject represents. As requests are processed asynchronously, this method should be used in conjunction with getTimeOfLastCompletionCode() to ensure that the completion code refers to the correct operation. For example:
GregorianCalendar oldCCTime = topology.getTimeOfLastCompletionCode(); BrokerProxy b = topology.createBroker("fred"); GregorianCalendar newCCTime = oldCCTime; while (oldCCTime.equals(newCCTime)) { newCCTime = topology.getTimeOfLastCompletionCode(); } CompletionCodeType ccType = topology.getLastCompletionCode(); // ccType refers to the results of the broker createNote, this is not very efficient code because it hangs the caller's thread and does not check for timeouts. The preferred way of getting back results of operations is to use the listener mechanism. See registerListener() for more information.
- Returns
- CompletionCodeType of the last operation performed to this AdministeredObject by this connection.
public String getLastUpdateUser()Returns the userid of the person who caused the last modification message to be sent for this object. The field is only set after at least one modification has been received in the lifetime of this connection. If this value is null, the object has never had an update.
Note that there are circumstances in which the user that caused the last update will be unknown; for example, if the runstate of an object happens to change.
- Returns
- String a userid
public String getLongDescription() throws ConfigManagerProxyPropertyNotInitializedExceptionHelper method to return the long description field for the current Administered Object.
- Returns
- String description string.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the requested property is not yet known.
public AdministeredObject getManagedSubcomponent(Properties props) throws ConfigManagerProxyPropertyNotInitializedExceptionReturns the first object that has the requested properties. If the search yields multiple matches an arbitrary match is returned, although an object that is "awaiting submission for creation" will be returned in preference to one that is not.
- Parameters
- props - the filter which will be used to identify the required objects.
- Returns
- AdministeredObject the first object that matched the filtered criteria. Returns null if no element was found.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the list of available subcomponents could not be determined because the Config Manager has not yet supplied them.
public AdministeredObject getManagedSubcomponentFromStringRepresentation(String representation) throws ConfigManagerProxyPropertyNotInitializedExceptionReturns the object which has the current object as a parent that has the supplied string representation. The String must be in the form "ObjectType+UUID", for example: ExecutionGroup+34d49ca0-fb00-0000-0080-f4ea5a35573b This is a convenience method to get objects from processModify() notifications, which uses this format to notify AdministeredObjectListeners of new objects.
Note that the delimiter ('+') is specified in AttributeConstants.UUID_DELIMITER.
- Parameters
- representation - String of the form "ObjectType+UUID".
- Returns
- AdministeredObject subcomponent of the current object that has the supplied representation. The return value will be null if the supplied string was null, invalid or if the object could not be found.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if this object's subcomponent information had not been supplied by the Configuration Manager before a timeout occurred.
public Enumeration getManagedSubcomponents(Properties filter) throws ConfigManagerProxyPropertyNotInitializedExceptionAsks the Configuration Manager to return an enumeration of all the existing objects that logically belong directly within the current administered object (for example, the execution groups within a broker). This method takes a Properties object which will be used to filter the results, to allow commands of the form "give me all the Execution Groups with the following property". The enumeration will only contain those objects that are accessible to the current user.
For example:
Properties p = new Properties(); p.setProperty(AttributeConstants.OBJECT_RUNSTATE_PROPERTY, AttributeConstants.OBJECT_RUNSTATE_RUNNING); Enumeration e = eg.getManagedSubcomponents(p);will return an Enumeration of AdministeredObjects for which the runstate property is true (i.e. if applied to a MessageFlowProxy, the enumeration will contain all MessageFlowProxys that are running).Note: If a batch of requests is being formed, the search is broadened to include all objects being created by the batch. This is so that new objects can be manipulated before they actually exist within the object hierarchy.
- Parameters
- filter - the filter which will be used to identify the required objects. Each key is an attribute name of the required object and each value is the required value of the attribute.
- Returns
- Enumeration AdministeredObjects that satisfied the filter criteria.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the list of available subcomponents could not be determined because the Config Manager has not yet supplied them.
public Enumeration getManagedSubcomponents(Properties filter, boolean returnContainsStrings) throws ConfigManagerProxyPropertyNotInitializedExceptionAsks the Configuration Manager to return an enumeration of all the existing objects that logically belong directly within the current administered object (for example, the execution groups within a broker). This method takes a Properties object which will be used to filter the results, to allow commands of the form "give me all the Execution Groups with the following property". The enumeration will only contain those objects that are accessible to the current user.
For example:
Properties p = new Properties(); p.setProperty(AttributeConstants.OBJECT_RUNSTATE_PROPERTY, AttributeConstants.OBJECT_RUNSTATE_RUNNING); Enumeration e = eg.getManagedSubcomponents(p, false);will return an Enumeration of AdministeredObjects for which the runstate property is true (i.e. if applied to a MessageFlowProxy, the enumeration will contain all MessageFlowProxys that are running).The type of object inside the returned enumeration is determined by the value of the boolean returnContainsStrings parameter. The benefit of a true value here is that it avoids needlessly instantiating AdministeredObject types that may not actually be required.
Note: If a batch of requests is being formed, the search is broadened to include all objects being created by the batch. This is so that new objects can be manipulated before they actually exist within the object hierarchy.
- Parameters
- filter - The filter which will be used to identify the required objects.
- returnContainsStrings - Describes the format of the returned enumeration (see below).
- Returns
- Enumeration If returnContainsStrings is true, the enumeration contains Strings in the format described by AdministeredObject.getTypeAndUUIDString() that satisfied the filter criteria. If returnContainsStrings is false, the enumeration contains AdministeredObjects that satisfied the filter criteria.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the list of available subcomponents could not be determined because the Config Manager has not yet supplied them.
public Enumeration getManagedSubcomponents(Properties filter, boolean returnContainsStrings, Properties initialPropertiesOfNewObject) throws ConfigManagerProxyPropertyNotInitializedExceptionAsks the Configuration Manager to return an enumeration of all the existing objects that logically belong directly within the current administered object (for example, the execution groups within a broker). This method takes a Properties object which will be used to filter the results, to allow commands of the form "give me all the Execution Groups with the following property". The enumeration will only contain those objects that are accessible to the current user.
For example:
Properties p = new Properties(); p.setProperty(AttributeConstants.OBJECT_RUNSTATE_PROPERTY, AttributeConstants.OBJECT_RUNSTATE_RUNNING); Enumeration e = eg.getManagedSubcomponents(p, false, null);will return an Enumeration of AdministeredObjects for which the runstate property is true (i.e. if applied to a MessageFlowProxy, the enumeration will contain all MessageFlowProxys that are running).The type of object inside the returned enumeration is determined by the value of the boolean returnContainsStrings parameter. The benefit of a true value here is that it avoids needlessly instantiating AdministeredObject types that may not actually be required.
Note: If a batch of requests is being formed, the search is broadened to include all objects being created by the batch. This is so that new objects can be manipulated before they actually exist within the object hierarchy.
- Parameters
- filter - The filter which will be used to identify the required objects.
- returnContainsStrings - Describes the format of the returned enumeration (see below).
- initialPropertiesOfNewObject - If new AdministeredObjects have to be created, this parameter can be used to describe any default attributes of the new objects. May be null if no default attributes are required (but consider using another variant of getManagedSubcomponents() instead).
- Returns
- Enumeration If returnContainsStrings is true, the enumeration contains Strings in the format described by AdministeredObject.getTypeAndUUIDString() that satisfied the filter criteria. If returnContainsStrings is false, the enumeration contains AdministeredObjects that satisfied the filter criteria.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the list of available subcomponents could not be determined because the Config Manager has not yet supplied them.
public String getName() throws ConfigManagerProxyPropertyNotInitializedExceptionReturns the name of the object
- Returns
- String name of the current object.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the property could not be determined because the Config Manager has not yet supplied the relevant information.
public int getNumberOfSubcomponents() throws ConfigManagerProxyPropertyNotInitializedExceptionReturns the number of subcomponents that are directly owned by this object.
- Returns
- int a number greater than or equal to 0.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the required information had not been supplied by the Configuration Manager by the time a timeout occurred.
public AdministeredObject getParent() throws ConfigManagerProxyLoggedExceptionReturns the AdministeredObject that logically owns this object. If invoked on the root of the object hierarchy, this method returns null.
- Returns
- AdministeredObject parent of the current object
- Throws
ConfigManagerProxyLoggedException
if the parent object is not immediately available and has to be requested from the Configuration Manager, but the request could not be sent to the Configuration Manager.
public Vector getPredictedNewSubcomponents()Returns a clone of the predictedNewSubcomponents vector. This vector contains handles to all Administered Object subcomponents of the current object that are yet to be submitted for creation in the current batch.
- Returns
- Vector Containing zero or more AdministeredObjects
public Properties getProperties()Returns a clone of the complete local attribute list for the current object, based on information supplied solely from the Config Manager. Modifying any properties in the returned object will not modify the object itself, unless it is subsequently supplied to the setProperties() method.
- Returns
- Properties where each key contains a String based attribute name for the current object and each value contains the attribute's value.
public String getProperty(String key) throws ConfigManagerProxyPropertyNotInitializedExceptionReturns the local value of the supplied attribute. The information returned will be incorrect if the Configuration Manager has recently modified the required property and the Configuration Manager Proxy has not yet received notification of the change.
- Parameters
- key - The name of the property to find. Use the AttributeConstants.*_PROPERTY constants here.
- Returns
- String the local copy of the required property, or null if the property could not be found.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the value of the property is unknown because the information has not yet been supplied by the Configuration Manager. If this is the case, this method will issue retries in accordance with the retry characteristics set by the ConfigManagerProxy.setRetryCharacteristics() method. Only after these retries have been exhausted will the ConfigManagerProxyPropertyNotInitializedException be thrown.
public String getProperty(String key, boolean waitIfNotAvailable) throws ConfigManagerProxyPropertyNotInitializedExceptionReturns the local value of the supplied attribute. The information returned will be incorrect if the Configuration Manager has recently modified the required property and the Configuration Manager Proxy has not yet received notification of the change.
- Parameters
- key - The name of the property to find. Use the AttributeConstants.*_PROPERTY constants here.
- waitIfNotAvailable - if set to true, if the object has not yet been updated by the Configuration Manager the method will wait for the length of time described by ConfigManagerProxy.setRetryCharacteristics() for the information to become available. If set to false, the method will return immediately if the information is available, or throw a ConfigManagerProxyPropertyNotInitializedException if the information is not available.
- Returns
- String the local copy of the required property, or null if the property could not be found.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the value of the property is unknown because the information has not yet been supplied by the Configuration Manager. If this is the case, AND the value of waitIfNotAvailable is true, this method will issue retries in accordance with the retry characteristics set by the ConfigManagerProxy.setRetryCharacteristics() method. Only after these retries have been exhausted will the ConfigManagerProxyPropertyNotInitializedException be thrown. If the information has not yet been supplied by the Configuration Manager and the value of waitIfNotAvailable is false, this method will throw a ConfigManagerProxyPropertyNotInitializedException immediately.
public String getProperty(String key, int element) throws ConfigManagerProxyPropertyNotInitializedExceptionFor properties that end in a number (for example, subcomponent properties) this method returns the value of the property that ends in the supplied number, waiting if the information is not available.
- Parameters
- key - The name of the property to find. Use the AttributeConstants.*_PROPERTY constants here.
- element - The number of the property to find and return.
- Returns
- String The value of the requested property, or null if the property could not be found.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the requested property is not yet known.
- See Also
public String getProperty(String key, int element, boolean waitIfNotAvailable) throws ConfigManagerProxyPropertyNotInitializedExceptionFor properties that end in a number (for example, subcomponent properties) this method returns the value of the property that ends in the supplied number, optionally waiting if the information is not available.
- Parameters
- key - The name of the property to find. Use the AttributeConstants.*_PROPERTY constants here.
- element - The number of the property to find and return
- waitIfNotAvailable - if set to true, if the object has not yet been updated by the Configuration Manager the method will wait for the length of time described by ConfigManagerProxy.setRetryCharacteristics() for the information to become available. If set to false, the method will return immediately.
- Returns
- String The value of the requested property, or null if the property could not be found.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the requested property is not yet known.
- See Also
public Date getRepositoryTimestamp() throws ConfigManagerProxyPropertyNotInitializedExceptionReturns the most recent repository timestamp associated with this object. The timestamp is updated whenever the record associated with the object is updated inside the Configuration Manager's internal repository.
- Returns
- Date the time of the last modification, or null if the information is not available.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if a timestamp might exist, but the object's information has not yet been supplied by the Configuration Manager.
public String getShortDescription() throws ConfigManagerProxyPropertyNotInitializedExceptionHelper method to return the short description field for the Administered Object.
- Returns
- String description string.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the requested property is not yet known.
public GregorianCalendar getTimeOfLastCompletionCode()Returns the time that the completion code field was last updated, as a result of a request that was sent out by this connection to the Configuration Manager. If this field is null, this object has never received such a completion code.
- Returns
- GregorianCalendar of the time the object's completion code field was last updated.
- See Also
public GregorianCalendar getTimeOfLastUpdate()Returns the time that the object was last updated by a Configuration Manager publication. The request that caused the successful update did not necessarily originate from this JVM. If this value is null, the object has never had an update.
- Returns
- GregorianCalendar of the time the object was last updated. The value will be null if the object has never received an update.
public String getType()Convenience method to return the type of this administered object. Where possible, use getConfigurationObjectType() instead, as it returns the type in a form that is more easily parseable.
- Returns
- String The name of this AdministeredObject type.
public String getUUID()Convenience method to return the unique identifier of this administered object.
- Returns
- String The UUID of this AdministeredObject
public boolean hasBeenRestrictedByConfigManager()Returns true if and only if the proxy has been told by the Configuration Manager that the object is not available for use by the current user. If the object has not yet received any update from the Configuration Manager, the call will block until the first update or 'object has been restricted' message is received (or the timeout configured in ConfigManagerProxy.setRetryCharacteristics() occurs).
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).
- Returns
- boolean true if and only if the object is NOT available
public boolean hasBeenRestrictedByConfigManager(boolean waitIfNotUpdated)Returns true if and only if the proxy has been told by the Configuration Manager that the object is not available for use by the current user.
- Parameters
- 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 an update 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 restriction flag is sought before the 'this object has been restricted' response from the Configuration Manager has necessarily been returned, that this method may return 'false' even though the object is not accessible to the user. This is because it is the receipt of a negative response from the Configuration Manager that triggers the flag to be set.). If the parameter is set to false, or the object has already received at least one message from the Configuration Manager, the call will return immediately.
- Returns
- boolean true if and only if the object is NOT available
public boolean hasBeenUpdatedByConfigManager()Returns true if and only if this object handle has received at least one update publication from the Configuration Manager. This call returns immediately. If this method returns false, it means that requests for attributes of this AdministeredObject are likely to cause a pause while the information is discovered.
- Returns
- boolean true if the object has had at least one update by the Configuration Manager, false otherwise.
public boolean hasBeenUpdatedByConfigManager(boolean waitIfNotUpdated)Returns true if and only if this object handle has received at least one update publication from the Configuration Manager. If no updates have been received, this method optionally waits for the first update to arrive.
- Parameters
- waitIfNotUpdated - If set to true, this method will retry for the currently configured timeout period if the object has not been updated. If the object has not been updated after the timeout period has expired, false will be returned.
- Returns
- boolean true if the object has had at least one update by the Configuration Manager, false otherwise.
- See Also
public boolean isAwaitingSubmissionForCreation()Returns true if and only if the current object has been created as part of the current batch, but the batch has not yet been sent to the Configuration Manager.
- Returns
- true if the object is awaiting submission for creation.
- See Also
public boolean isDeployed() throws ConfigManagerProxyPropertyNotInitializedExceptionReturns true if and only if the object that this AdministeredObject represents exists in the deployed section of the Configuration Manager database. Deployed objects have been the subject of a deployment action at least once- that is, have been deployed to brokers.
- Returns
- boolean true if the object is deployed.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the required information has not been supplied by the Configuration Manager.
public boolean isShared() throws ConfigManagerProxyPropertyNotInitializedExceptionReturns true if and only if the object that this AdministeredObject represents exists in the shared section of the Configuration Manager database. Shared objects can be viewed or modified by the user of any Configuration Manager Proxy application that has the relevant authority.
- Returns
- boolean true if the object is shared.
- Throws
ConfigManagerProxyPropertyNotInitializedException
if the required information has not been supplied by the Configuration Manager.
public void refresh() throws ConfigManagerProxyLoggedExceptionForces this AdministeredObject to reregister itself with the Configuration Manager and to re-receive the object's complete set of attributes. This call is not generally necessary, as the Configuration Manager will keep the object's subscription active indefinitely and keep the Proxy up to date with its latest information anyway.
This method must not be called on Administered Objects that do not yet exist on the Configuration Manager (ie. objects initialized during a batch of creation requests).
- Throws
ConfigManagerProxyLoggedException
if the request to refresh the object could not be sent to the Configuration Manager.
public void registerListener(AdministeredObjectListener listener)Asks the Configuration Manager to keep the caller informed of any changes to the current AdministeredObject.
The listener will only be invoked after a message from the Configuration Manager is received by the Configuration Manager Proxy that states the current object has been modified or deleted, or if a previous action involving this object and originated by this Configuration Manager Proxy has been completed.
In order to register listeners against multiple AdministeredObjects, user applications must call registerListener() for each object for which it wishes to receive notifications.
- Parameters
- listener - the object that will be notified of any events on the current AdministeredObject.
public void registerListener(AdvancedAdministeredObjectListener listener)Asks the Configuration Manager to keep the caller informed of any changes to the current AdministeredObject.
The listener will only be invoked after a message from the Configuration Manager is received by the Configuration Manager Proxy that states the current object has been modified or deleted, or if a previous action involving this object and originated by this Configuration Manager Proxy has been completed.
In order to register listeners against multiple AdministeredObjects, user applications must call registerListener() for each object for which it wishes to receive notifications.
After a successful completion of this call, no "object modified" notification will be sent to the listener until the next time a modification happens to occur on the object. Listeners that wish to receive an immediate notification (e.g. to provide a baseline for any future deltas) must call registerListener(listener, true, *) instead.
- Parameters
- listener - the object that will be notified of any events on the current AdministeredObject.
public void registerListener(AdvancedAdministeredObjectListener listener, boolean sendNotificationImmediately, Object nextNotificationCorrelationID)Asks the Configuration Manager to keep the caller informed of any changes to the current AdministeredObject, and ask to be provided with advanced notifications.
Most applications will not need to use the information provided by the AdvancedAdministeredObjectListener and should therefore not call this method to register their listeners. Use registerListener(AdministeredObjectListener) if possible.
The listener will only be invoked after a message from the Configuration Manager is received by the Configuration Manager Proxy that states the current object has been modified or deleted, or if a previous action involving this object and originated by this Configuration Manager Proxy has been completed.
In order to register listeners against multiple AdministeredObjects, user applications must call registerListener() for each object for which it wishes to receive notifications.
Each AdvancedAdministeredObjectListener instance can have at most one correlationID for each AdministeredObject for which it is registered.
Note: If the caller sets sendNotificationImmediately to false AND the object has not yet received its complete set of attributes from the Configuration Manager, this method will pause until the complete attribute list has been provided; this is done in order to establish a viable baseline from which 'changed attributes' list can be calculated. In this case, if the complete attribute list is not provided by the time the configured timeout occurs, the first processModify() message for this object may include the complete set of attributes for the AdministeredObject when the attribute list finally does arrive.
- Parameters
- listener - the object that will be notified of any events
- sendNotificationImmediately - If false, processModify() will only ever be called upon receipt of a modification message from the Configuration Manager. If true, the method will additionally be called as soon as the listener is registered. This special notification will contain information on all of the object's attributes.
- nextNotificationCorrelationID - This is used to group together listeners that share notification information. Specifically, when a 'modify' or 'delete' notification occurs, advanced listeners are told an approximate time till the next notification to a listener with the same correlation identifier is expected. Specify null here to not use a correlation identifier for this listener.
public void setAccessControlEntries(AccessControlEntry[] accessControlList) throws ConfigManagerProxyLoggedExceptionSets the complete list of access control entries that applies to this object. Null elements in the array are ignored. If the array itself is null or empty, all access control entries for this object are removed.
- Parameters
- accessControlList - Array of access control entries which are to apply to this object.
- Throws
ConfigManagerProxyLoggedException
if the request to update the object could not be sent to the Configuration Manager.
public void setLongDescription(String desc) throws ConfigManagerProxyLoggedExceptionHelper method to set the long description field of the current Administered Object. If this method returns successfully the request will have been sent to the Configuration Manager (or batched for sending if a batch is in progress) but not necessarily processed by the Configuration Manager. Use an AdministeredObjectListener to discover the outcome of this request.
- Parameters
- desc - New description string.
- Throws
ConfigManagerProxyLoggedException
if the request could not be sent to the Configuration Manager.
public void setName(String name) throws ConfigManagerProxyLoggedExceptionHelper method to set the name of the Administered Object. If this method returns successfully the request will have been sent to the Configuration Manager (or batched for sending if a batch is in progress) but not necessarily processed by the Configuration Manager. Use an AdministeredObjectListener to discover the outcome of this request.
- Parameters
- name - New name.
- Throws
ConfigManagerProxyLoggedException
if the request could not be sent to the Configuration Manager.
public void setProperties(Properties suppliedProps) throws ConfigManagerProxyLoggedExceptionAsks the Configuration Manager to update a set of attributes for the current object. The Configuration Manager will be asked to set all attributes for which a key exists in the supplied Properties object, to the values associated with each key.
For example:
Properties p = new Properties(); p.setProperty(AttributeConstants.NAME_PROPERTY, "B1"); p.setProperty(AttributeConstants.LONG_DESCRIPTION_PROPERTY, "hello"); broker1.setProperties(p);will attempt to set the name and the long description of the administered object described by broker1.Upon returning from this method, the request will have been sent to the Configuration Manager (or added to a batch if batch mode is enabled) but it will not have been necessarily serviced by the Configuration Manager. Callers should use AdministeredObjectListener instances to discover the results of this request.
- Parameters
- suppliedProps - the attributes that the caller wishes to set
- Throws
ConfigManagerProxyLoggedException
if the request could not be sent to the Configuration Manager.
public void setShortDescription(String desc) throws ConfigManagerProxyLoggedExceptionHelper method to set the short description field of the Administered Object. If this method returns successfully the request will have been sent to the Configuration Manager (or batched for sending if a batch is in progress) but not necessarily processed by the Configuration Manager. Use an AdministeredObjectListener to discover the outcome of this request.
- Parameters
- desc - New description string.
- Throws
ConfigManagerProxyLoggedException
if the request could not be sent to the Configuration Manager.
public String toString()Displays the type and UUID of the current object (or the name if it is available). The format is not guaranteed, and therefore should not be parsed programatically.
- Returns
- String Representation of the current object
- Overrides
- toString in class Object
public String toVerboseString()Displays the list of all properties currently associated with this administered object.
- Returns
- String Representation of the current object
public void unsubscribeFromConfigurationManagerUpdates()Asks the Proxy to explicitly unsubscribe the current AdministeredObject from receiving future Configuration Manager updates. When this method completes, ALL AdministeredObjectListeners for this object will stop receiving messages regarding this object, and so this method should only be called if updates to the object are definitely NOT required by all callers using this ConfigManagerProxy connection.
After calling this method this AdministeredObject instance can no longer be used. If the logical parent of this object (e.g. the TopologyProxy if this object is a BrokerProxy) subsequently tries to retrieve the object to which this AdministeredObject refers, a new instance of the object will be returned which will be subscribed to updates from the Configuration Manager.
Using this method is not necessary for most applications, as objects are automatically unsubscribed when they go out of scope and are tidied by the JVM.
public static Properties withName(String name)Returns a new Properties object that has the name attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used. This provides an easy way of supplying filters to the get*() calls. For example, broker1.getExecutionGroup(ExecutionGroup.withName("eg1")); will return the Execution Group with Name "eg1" that exists in broker1.
- Parameters
- name -
- Returns
- Properties a new Properties object with the relevant key/value pairs set.
public static Properties withUUID(String uuid)Returns a new Properties object that has the UUID attribute set to the supplied String, and (for subclass implementations) the type attribute to be the name of the subclass of AdministeredObject being used. This provides an easy way of supplying filters to the get*() calls. For example, broker1.getExecutionGroup(ExecutionGroup.withUUID("1234")); will return the Execution Group with UUID "1234" that exists in broker1.
- Parameters
- uuid -
- Returns
- Properties a new Properties object with the UUID property set. to the supplied value.