public class PolicyProxy extends AdministeredObject
Each PolicyProxy instance represents a policy and all the data defined by that policy.
A Policy is used to control the processing and behaviour of a message flow. To cause it to effect a message flow it must be attach to the flow. WorkloadManagement policies are attached to flows by setting the WLMPolicy property on the flow.
In order to use PolicyProxy objects, applications must first obtain handles to them. Here is an example of how to do this:
BrokerProxy b = BrokerProxy.getInstance( new IntegrationNodeConnectionParameters("localhost", 4414)); PolicyManagerProxy p = b.getPolicyManager(policyType); PolicyProxy policy = p.getPolicy("mypolicy");
Change Activity: -------- ----------- ------------- ------------------------------------ Reason: Date: Originator: Comments: -------- ----------- ------------- ------------------------------------Version %Z% %I% %W% %E% %U% [%H% %T%]
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
name_content |
static java.lang.String |
name_name |
static java.lang.String |
name_type |
static java.lang.String |
name_uri |
Constructor and Description |
---|
PolicyProxy(java.lang.String type,
java.lang.String name)
Constructs a new policy object based on the parameters provided.
|
Modifier and Type | Method and Description |
---|---|
void |
deregisterListener(AdministeredObjectListener listener)
Asks the IBM Integration API (CMP) to unsubscribe a
previously registered AdministeredObjectListener, given the
listener instance that was supplied during registration.
|
void |
deregisterListener(AdvancedAdministeredObjectListener listener)
Asks the IBM Integration API (CMP) to unsubscribe a
previously registered AdvancedAdministeredObjectListener,
given the listener instance that was supplied during
registration.
|
ConfigurationObjectType |
getConfigurationObjectType()
Returns the ConfigurationObjectType associated
with this AdministeredObject type.
|
ConfigurationObjectType |
getConfigurationObjectTypeOfParent()
Returns the ConfigurationObjectType associated
with the logical parent of this AdministeredObject type.
|
java.lang.String |
getPolicyContent()
Get the content of the policy.
|
java.lang.String |
getPolicyName()
Get the name of the policy.
|
java.lang.String |
getPolicyType()
Get the type of the policy.
|
java.lang.String |
getPolicyUri()
Get the uri of the policy in the registry.
|
java.lang.String |
getProperty(java.lang.String key)
Returns the local value of the supplied attribute.
|
java.lang.String |
getType()
Convenience method to return the type of this administered object.
|
void |
refresh()
Forces this AdministeredObject to reregister
itself with the broker and to re-receive
the object's complete set of attributes.
|
void |
registerListener(AdministeredObjectListener listener)
Asks the broker to keep the caller informed of any changes to the
current AdministeredObject.
|
void |
registerListener(AdvancedAdministeredObjectListener listener)
Asks the broker to keep the caller informed of any changes to the
current AdministeredObject.
|
void |
registerListener(AdvancedAdministeredObjectListener listener,
boolean sendNotificationImmediately,
java.lang.Object nextNotificationCorrelationID)
Asks the broker to keep the caller informed of any changes to the
current AdministeredObject, and ask to be provided with advanced
notifications.
|
void |
setLongDescription(java.lang.String desc)
This method overrides the base class
implementation, so that an exception is thrown if this method
is invoked against this class.
|
void |
setName(java.lang.String name)
This method overrides the base class
implementation, so that an exception is thrown if this method
is invoked against an existing PolicyProxy.
|
void |
setPolicyContent(java.lang.String policyContent)
Set the policy content
|
void |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue) |
void |
setShortDescription(java.lang.String desc)
This method overrides the base class
implementation, so that an exception is thrown if this method
is invoked against this class.
|
elements, equals, getAdvancedProperties, getBasicProperties, getLastBIPMessages, getLastCompletionCode, getLastUpdateUser, getLongDescription, getManagedSubcomponent, getManagedSubcomponentFromStringRepresentation, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponentsAsStrings, getManagedSubcomponentsAsStrings, getName, getNumberOfSubcomponents, getParent, getProperties, getProperty, getProperty, getProperty, getRepositoryTimestamp, getShortDescription, getTimeOfLastCompletionCode, getTimeOfLastUpdate, getUUID, hasBeenPopulatedByBroker, hasBeenPopulatedByBroker, hasBeenRestrictedByBroker, hasBeenRestrictedByBroker, hasBeenRestrictedByConfigManager, hasBeenRestrictedByConfigManager, hasBeenUpdatedByConfigManager, hasBeenUpdatedByConfigManager, isAwaitingSubmissionForCreation, isAwaitingSubmissionForDeletion, isDeployed, isShared, setProperties, toString, toVerboseString, unsubscribeFromConfigurationManagerUpdates, withName, withUUID
public static final java.lang.String name_name
public static final java.lang.String name_type
public static final java.lang.String name_uri
public static final java.lang.String name_content
public PolicyProxy(java.lang.String type, java.lang.String name)
public ConfigurationObjectType getConfigurationObjectType()
AdministeredObject
getConfigurationObjectType
in class AdministeredObject
public ConfigurationObjectType getConfigurationObjectTypeOfParent()
AdministeredObject
getConfigurationObjectTypeOfParent
in class AdministeredObject
public java.lang.String getPolicyName() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the value of the parameter could not be determined because
the information was not supplied from the broker before a
timeout occurred.public java.lang.String getPolicyType() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the value of the parameter could not be determined because
the information was not supplied from the broker before a
timeout occurred.public java.lang.String getPolicyUri() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the value of the parameter could not be determined because
the information was not supplied from the broker before a
timeout occurred.public java.lang.String getPolicyContent() throws ConfigManagerProxyPropertyNotInitializedException
ConfigManagerProxyPropertyNotInitializedException
- if the value of the parameter could not be determined because
the information was not supplied from the broker before a
timeout occurred.public void setPolicyContent(java.lang.String policyContent)
policyContent
- value to set the policy content to. It must be a valid policy xml document.public void setProperty(java.lang.String propertyName, java.lang.String propertyValue) throws ConfigManagerProxyLoggedException
public java.lang.String getProperty(java.lang.String key) throws ConfigManagerProxyPropertyNotInitializedException
AdministeredObject
getProperty
in class AdministeredObject
key
- The name of the property to find.
Use the AttributeConstants.*_PROPERTY constants here.ConfigManagerProxyPropertyNotInitializedException
- if the value of the property is unknown because
the information has not yet been supplied by the
broker. If this is the case, this method will
issue retries in accordance with the retry characteristics set
by the BrokerProxy.setRetryCharacteristics()
method. Only after these retries have been exhausted
will the ConfigManagerProxyPropertyNotInitializedException
be thrown.public void registerListener(AdministeredObjectListener listener)
The listener will only be invoked after a message from the broker is received by the IBM Integration API (CMP) that states the current object has been modified or deleted, or if a previous action involving this object and originated by this application 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.
registerListener
in class AdministeredObject
listener
- the object that will be notified of any events
on the current AdministeredObject.public void registerListener(AdvancedAdministeredObjectListener listener, boolean sendNotificationImmediately, java.lang.Object nextNotificationCorrelationID)
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 broker is received by the IBM Integration API (CMP) that states the current object has been modified or deleted, or if a previous action involving this object and originated by this application 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 broker, 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.
registerListener
in class AdministeredObject
listener
- the object that will be notified of any eventssendNotificationImmediately
- If false, processModify()
will only ever be called upon receipt of a modification message from the
broker. 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 registerListener(AdvancedAdministeredObjectListener listener)
The listener will only be invoked after a message from the broker is received by the IBM Integration API (CMP) that states the current object has been modified or deleted, or if a previous action involving this object and originated by this application 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.
registerListener
in class AdministeredObject
listener
- the object that will be notified of any events
on the current AdministeredObject.public void deregisterListener(AdministeredObjectListener listener)
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.
deregisterListener
in class AdministeredObject
listener
- the object that will no longer be notified of any eventspublic void deregisterListener(AdvancedAdministeredObjectListener listener)
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.
deregisterListener
in class AdministeredObject
listener
- the object that will no longer be notified of any eventspublic java.lang.String getType()
getType
in class AdministeredObject
public void setShortDescription(java.lang.String desc) throws ConfigManagerProxyLoggedException
setShortDescription
in class AdministeredObject
desc
- (this is ignored)ConfigManagerProxyLoggedException
- to indicate this
method should not be called.public void setLongDescription(java.lang.String desc) throws ConfigManagerProxyLoggedException
setLongDescription
in class AdministeredObject
desc
- (this is ignored)ConfigManagerProxyLoggedException
- to indicate this
method should not be called.public void setName(java.lang.String name) throws ConfigManagerProxyLoggedException
setName
in class AdministeredObject
name
- (this is ignored)ConfigManagerProxyLoggedException
- to indicate this
method should not be called.public void refresh() throws ConfigManagerProxyLoggedException
This method must not be called on AdministeredObject instances that do not yet exist on the broker (ie. objects initialized during a batch of creation requests).
refresh
in class AdministeredObject
ConfigManagerProxyLoggedException
- if the request
to refresh the object could not be sent to the
broker.