org.jivesoftware.smack.packet
Class PrivacyItem.PrivacyRule

java.lang.Object
  extended by org.jivesoftware.smack.packet.PrivacyItem.PrivacyRule
Enclosing class:
PrivacyItem

public static class PrivacyItem.PrivacyRule
extends java.lang.Object

Privacy Rule represents the kind of action to apply. It holds the kind of communication ([jid|group|subscription]) it will allow or block and identifier to apply the action.


Field Summary
static java.lang.String SUBSCRIPTION_BOTH
          If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", "from", or "none"
static java.lang.String SUBSCRIPTION_FROM
           
static java.lang.String SUBSCRIPTION_NONE
           
static java.lang.String SUBSCRIPTION_TO
           
 
Constructor Summary
PrivacyItem.PrivacyRule()
           
 
Method Summary
 PrivacyItem.Type getType()
          Returns the type hold the kind of communication it will allow or block.
 java.lang.String getValue()
          Returns the element identifier to apply the action.
 boolean isSuscription()
          Returns if the receiver represents a subscription rule.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBSCRIPTION_BOTH

public static final java.lang.String SUBSCRIPTION_BOTH
If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", "from", or "none"

See Also:
Constant Field Values

SUBSCRIPTION_TO

public static final java.lang.String SUBSCRIPTION_TO
See Also:
Constant Field Values

SUBSCRIPTION_FROM

public static final java.lang.String SUBSCRIPTION_FROM
See Also:
Constant Field Values

SUBSCRIPTION_NONE

public static final java.lang.String SUBSCRIPTION_NONE
See Also:
Constant Field Values
Constructor Detail

PrivacyItem.PrivacyRule

public PrivacyItem.PrivacyRule()
Method Detail

getType

public PrivacyItem.Type getType()
Returns the type hold the kind of communication it will allow or block. It MUST be filled with one of these values: jid, group or subscription.

Returns:
the type of communication it represent.

getValue

public java.lang.String getValue()
Returns the element identifier to apply the action. If the type is "jid", then the 'value' attribute MUST contain a valid Jabber ID. If the type is "group", then the 'value' attribute SHOULD contain the name of a group in the user's roster. If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", "from", or "none".

Returns:
the identifier to apply the action.

isSuscription

public boolean isSuscription()
Returns if the receiver represents a subscription rule.

Returns:
if the receiver represents a subscription rule.