Package rocks.xmpp.im.roster.model
Interface SubscriptionState
-
- All Known Subinterfaces:
RosterItem
- All Known Implementing Classes:
Contact,DefinedState
public interface SubscriptionStateRepresents a presence subscription state.There are four primary subscription states (these states are described from the perspective of the user, not the contact):
- None: The user does not have a subscription to the contact's presence, and the contact does not have a subscription to the user's presence.
- To: The user has a subscription to the contact's presence, but the contact does not have a subscription to the user's presence.
- From: The contact has a subscription to the user's presence, but the user does not have a subscription to the contact's presence.
- Both: Both the user and the contact have subscriptions to each other's presence (i.e., the union of 'from' and 'to').
The foregoing states are supplemented by various sub-states related to pending inbound and outbound subscriptions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSubscriptionState.Subscription
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static booleanequals(SubscriptionState state1, SubscriptionState state2)Compares two subscription states.SubscriptionState.SubscriptiongetSubscription()Gets the primary subscription state.booleanisPendingIn()If the presence subscription is pending in from a user's perspective.booleanisPendingOut()If the presence subscription is pending out from a user's perspective.
-
-
-
Method Detail
-
equals
static boolean equals(SubscriptionState state1, SubscriptionState state2)
Compares two subscription states.- Parameters:
state1- The first state.state2- The second state.- Returns:
- True, if both subscription states are equal.
-
getSubscription
SubscriptionState.Subscription getSubscription()
Gets the primary subscription state. It may be one ofSubscriptionState.Subscription.NONE,SubscriptionState.Subscription.TO,SubscriptionState.Subscription.FROMorSubscriptionState.Subscription.BOTH.- Returns:
- The primary subscription state.
-
isPendingOut
boolean isPendingOut()
If the presence subscription is pending out from a user's perspective. The user has sent contact a subscription request but contact has not replied yet.- Returns:
- If the state is pending out.
-
isPendingIn
boolean isPendingIn()
If the presence subscription is pending in from a user's perspective. The contact has sent user a subscription request but user has not replied yet.- Returns:
- If the state is pending in.
-
-