WBI BrokersTM
Config Manager Proxy API

com.ibm.broker.config.proxy
Class TopicProxy.Policy

java.lang.Object
  extended bycom.ibm.broker.config.proxy.TopicProxy.Policy
Enclosing class:
TopicProxy

public static class TopicProxy.Policy
extends Object

A small class that represents a policy for a given topic.


Constructor Summary
TopicProxy.Policy(String principalName, String principalType, String publish, String subscribe, String persistent)
          Creates a new Policy object.
 
Method Summary
 String getPersistence()
          Returns the persistence value associated with this principal.
static TopicProxy.Policy getPolicyFromString(String stringEncoded)
          Returns a policy object from a String representation
static TopicProxy.Policy getPolicyFromString(String stringEncoded, boolean principalNameIsEncoded)
          Returns a policy object from a String representation
 String getPrincipalName()
          Returns the user or group name associated with this principal
 String getPrincipalType()
          Returns the type of the name associated with this principal.
 String getPublish()
          Returns the publish value associated with this policy.
 String getSubscribe()
          Returns the subscribe value associated with this principal.
 void setPersistence(String persistent)
          Sets whether persistence is enabled.
 void setPrincipalName(String principalName)
          Sets the user or group name of the principal.
 void setPrincipalType(String principalType)
          Sets the type of the principal.
 void setPublish(String publish)
          Sets whether publish is allowed by the policy.
 void setSubscribe(String subscribe)
          Sets whether subscribe is allowed by the policy.
 String toString()
          Returns a String representation of the policy.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TopicProxy.Policy

public TopicProxy.Policy(String principalName,
                         String principalType,
                         String publish,
                         String subscribe,
                         String persistent)
                  throws ConfigManagerProxyLoggedException
Creates a new Policy object.

Parameters:
principalName - Name of the user or group to which this policy refers (e.g. "fred")
principalType - Denotes the type of the policy. Valid values:
publish - Denotes whether the principal allows publish requests. Valid values:
subscribe - Denotes whether the policy allows subscribe requests. Valid values:
persistent - Denotes whether persistence is enabled.
Throws:
ConfigManagerProxyLoggedException - if any of the values supplied to this constructor were invalid.
Method Detail

setPrincipalName

public void setPrincipalName(String principalName)
                      throws ConfigManagerProxyLoggedException
Sets the user or group name of the principal.

Parameters:
principalName - Name of the user or group to which this principal refers (e.g. "fred")
Throws:
ConfigManagerProxyLoggedException - if the value supplied was invalid.

setPrincipalType

public void setPrincipalType(String principalType)
                      throws ConfigManagerProxyLoggedException
Sets the type of the principal.

Parameters:
principalType - Denotes the type of the principal. Valid values:
  • AttributeConstants.TOPIC_PRINCIPAL_GROUP - denotes that the principal name refers to a group of users.
  • AttributeConstants.TOPIC_PRINCIPAL_USER - denotes that the principal name refers to a single user.
  • AttributeConstants.TOPIC_PRINCIPAL_PUBLICGROUP - denotes that the principal name refers to a public group.
Throws:
ConfigManagerProxyLoggedException - if the value supplied was invalid.

setPublish

public void setPublish(String publish)
                throws ConfigManagerProxyLoggedException
Sets whether publish is allowed by the policy.

Parameters:
publish - Denotes whether the policy allows publish requests. Valid values:
  • AttributeConstants.TOPIC_PRINCIPAL_ALLOW - states that the policy will allow publish requests.
  • AttributeConstants.TOPIC_PRINCIPAL_DENY - states that the policy will deny publish requests.
  • AttributeConstants.TOPIC_PRINCIPAL_INHERIT - states that the policy will inherit publish behavior from the topic's parent.
Throws:
ConfigManagerProxyLoggedException - if the value supplied was invalid.

setSubscribe

public void setSubscribe(String subscribe)
                  throws ConfigManagerProxyLoggedException
Sets whether subscribe is allowed by the policy.

Parameters:
subscribe - Denotes whether the principal allows subscribe requests. Valid values:
  • AttributeConstants.TOPIC_PRINCIPAL_ALLOW - states that the policy will allow subscribe requests.
  • AttributeConstants.TOPIC_PRINCIPAL_DENY - states that the policy will deny subscribe requests.
  • AttributeConstants.TOPIC_PRINCIPAL_INHERIT - states that the policy will inherit subscribe behavior from the topic's parent.
Throws:
ConfigManagerProxyLoggedException - if the value supplied was invalid.

setPersistence

public void setPersistence(String persistent)
                    throws ConfigManagerProxyLoggedException
Sets whether persistence is enabled.

Parameters:
persistent - Denotes whether persistence is enabled.
  • AttributeConstants.TOPIC_PRINCIPAL_PERSISTENT - states that persistence will be enabled.
  • AttributeConstants.TOPIC_PRINCIPAL_NOTPERSISTENT - states that persistence will be disabled.
  • AttributeConstants.TOPIC_PRINCIPAL_INHERIT - states that the policy will inherit persistence behavior from the topic's parent.
Throws:
ConfigManagerProxyLoggedException - if the value supplied was invalid.

getPrincipalName

public String getPrincipalName()
Returns the user or group name associated with this principal

Returns:
String the name of the principal

getPrincipalType

public String getPrincipalType()
Returns the type of the name associated with this principal.

Returns:
String the type of the principal Valid values:
  • AttributeConstants.TOPIC_PRINCIPAL_GROUP - denotes that the principal name refers to a group of users.
  • AttributeConstants.TOPIC_PRINCIPAL_USER - denotes that the principal name refers to a single user.
  • AttributeConstants.TOPIC_PRINCIPAL_PUBLICGROUP - denotes that the principal name refers to a public group.

getPublish

public String getPublish()
Returns the publish value associated with this policy.

Returns:
String the publish value of the policy. Valid values:
  • AttributeConstants.TOPIC_PRINCIPAL_ALLOW - states that the policy will allow publish requests.
  • AttributeConstants.TOPIC_PRINCIPAL_DENY - states that the policy will deny publish requests.
  • AttributeConstants.TOPIC_PRINCIPAL_INHERIT - states that the policy will inherit publish behavior from the topic's parent.

getSubscribe

public String getSubscribe()
Returns the subscribe value associated with this principal.

Returns:
String the subscribe value of the principal. Valid values:
  • AttributeConstants.TOPIC_PRINCIPAL_ALLOW - states that the policy will allow subscribe requests.
  • AttributeConstants.TOPIC_PRINCIPAL_DENY - states that the policy will deny subscribe requests.
  • AttributeConstants.TOPIC_PRINCIPAL_INHERIT - states that the policy will inherit subscribe behavior from the topic's parent.

getPersistence

public String getPersistence()
Returns the persistence value associated with this principal.

Returns:
String the persistence value of the policy. Valid values:
  • AttributeConstants.TOPIC_PRINCIPAL_PERSISTENT - states that persistence is enabled.
  • AttributeConstants.TOPIC_PRINCIPAL_NOTPERSISTENT - states that persistence is disabled.
  • AttributeConstants.TOPIC_PRINCIPAL_INHERIT - states that the policy will inherit subscribe behavior from the topic's parent.

getPolicyFromString

public static TopicProxy.Policy getPolicyFromString(String stringEncoded)
Returns a policy object from a String representation

Parameters:
stringEncoded - String representation of the Principal, (as returned by Policy.toString()). The name of the principal will be URI encoded.
Returns:
Principal from the String, or null if the String did not refer to a valid encoding.

getPolicyFromString

public static TopicProxy.Policy getPolicyFromString(String stringEncoded,
                                                    boolean principalNameIsEncoded)
Returns a policy object from a String representation

Parameters:
stringEncoded - String representation of the Principal, (as returned by Policy.toString()).
principalNameIsEncoded - True if and only if the name of the principal is known to be URI-encoded.
Returns:
Principal from the String, or null if the String did not refer to a valid encoding.

toString

public String toString()
Returns a String representation of the policy. Use getPolicyFromString() to convert this String representation back to a policy.

Returns:
String representation of the policy.

WBI BrokersTM
Config Manager Proxy API