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

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

public static class TopicProxy.Policy
extends java.lang.Object

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


Constructor Summary
TopicProxy.Policy(java.lang.String principalName, java.lang.String principalType, java.lang.String publish, java.lang.String subscribe, java.lang.String persistent)
          Creates a new Policy object.
 
Method Summary
 java.lang.String getPersistence()
          Returns the persistence value associated with this principal.
static TopicProxy.Policy getPolicyFromString(java.lang.String stringEncoded)
          Returns a policy object from a String representation
static TopicProxy.Policy getPolicyFromString(java.lang.String stringEncoded, boolean principalNameIsEncoded)
          Returns a policy object from a String representation
 java.lang.String getPrincipalName()
          Returns the user or group name associated with this principal
 java.lang.String getPrincipalType()
          Returns the type of the name associated with this principal.
 java.lang.String getPublish()
          Returns the publish value associated with this policy.
 java.lang.String getSubscribe()
          Returns the subscribe value associated with this principal.
 void setPersistence(java.lang.String persistent)
          Sets whether persistence is enabled.
 void setPrincipalName(java.lang.String principalName)
          Sets the user or group name of the principal.
 void setPrincipalType(java.lang.String principalType)
          Sets the type of the principal.
 void setPublish(java.lang.String publish)
          Sets whether publish is allowed by the policy.
 void setSubscribe(java.lang.String subscribe)
          Sets whether subscribe is allowed by the policy.
 java.lang.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(java.lang.String principalName,
                         java.lang.String principalType,
                         java.lang.String publish,
                         java.lang.String subscribe,
                         java.lang.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:
  • 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.
publish - Denotes whether the principal 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.
subscribe - Denotes whether the policy 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.
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.
Throws:
ConfigManagerProxyLoggedException - if any of the values supplied to this constructor were invalid.
Method Detail

setPrincipalName

public void setPrincipalName(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.String getPrincipalName()
Returns the user or group name associated with this principal

Returns:
String the name of the principal

getPrincipalType

public java.lang.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 java.lang.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 java.lang.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 java.lang.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(java.lang.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(java.lang.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 java.lang.String toString()
Returns a String representation of the policy. Use getPolicyFromString() to convert this String representation back to a policy.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the policy.