java.lang.Object com.ibm.broker.config.proxy.TopicProxy.Policy
public static class TopicProxy.Policy
extends Object
A small class that represents a policy for a given topic.
Constructor | Description |
---|---|
TopicProxy.Policy(String, String, String, String, String) | Creates a new Policy object. |
Method | Description |
---|---|
String getPersistence() | Returns the persistence value associated with this principal. |
TopicProxy.Policy getPolicyFromString(String) | Returns a policy object from a String representation |
TopicProxy.Policy getPolicyFromString(String, boolean) | 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) | Sets whether persistence is enabled. |
void setPrincipalName(String) | Sets the user or group name of the principal. |
void setPrincipalType(String) | Sets the type of the principal. |
void setPublish(String) | Sets whether publish is allowed by the policy. |
void setSubscribe(String) | Sets whether subscribe is allowed by the policy. |
String toString() | Returns a String representation of the policy. |
public TopicProxy.Policy(String principalName, String principalType, String publish, String subscribe, String persistent) throws ConfigManagerProxyLoggedExceptionCreates 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.
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.
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.
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.
public String getPrincipalName()Returns the user or group name associated with this principal
- Returns
- String the name of the principal
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.
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.
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.
public void setPersistence(String persistent) throws ConfigManagerProxyLoggedExceptionSets 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.
public void setPrincipalName(String principalName) throws ConfigManagerProxyLoggedExceptionSets 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.
public void setPrincipalType(String principalType) throws ConfigManagerProxyLoggedExceptionSets 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.
public void setPublish(String publish) throws ConfigManagerProxyLoggedExceptionSets 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.
public void setSubscribe(String subscribe) throws ConfigManagerProxyLoggedExceptionSets 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.
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.
- Overrides
- toString in class Object