Enum DefinedState

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOTH
      User and contact are subscribed to each other (two-way); this is reflected in the user's roster by subscription='both'.
      FROM
      Contact is subscribed to user (one-way); this is reflected in the user's roster by subscription='from'.
      FROM_PENDING_OUT
      Contact is subscribed to user, and user has sent contact a subscription request but contact has not replied yet; this is reflected in the user's roster by subscription='from' and ask='subscribe'.
      NONE
      Contact and user are not subscribed to each other, and neither has requested a subscription from the other; this is reflected in the user's roster by subscription='none'.
      NONE_PENDING_IN
      Contact and user are not subscribed to each other, and contact has sent user a subscription request but user has not replied yet.
      NONE_PENDING_OUT
      Contact and user are not subscribed to each other, and user has sent contact a subscription request but contact has not replied yet; this is reflected in the user's roster by subscription='none' and ask='subscribe'.
      NONE_PENDING_OUT_IN
      Contact and user are not subscribed to each other, contact has sent user a subscription request but user has not replied yet, and user has sent contact a subscription request but contact has not replied yet; this is reflected in the user's roster by subscription='none' and ask='subscribe'.
      TO
      User is subscribed to contact (one-way); this is reflected in the user's roster by subscription='to'.
      TO_PENDING_IN
      User is subscribed to contact, and contact has sent user a subscription request but user has not replied yet; this is reflected in the user's roster by subscription='to'.
    • Enum Constant Detail

      • NONE

        public static final DefinedState NONE
        Contact and user are not subscribed to each other, and neither has requested a subscription from the other; this is reflected in the user's roster by subscription='none'.
      • NONE_PENDING_OUT

        public static final DefinedState NONE_PENDING_OUT
        Contact and user are not subscribed to each other, and user has sent contact a subscription request but contact has not replied yet; this is reflected in the user's roster by subscription='none' and ask='subscribe'.
      • NONE_PENDING_IN

        public static final DefinedState NONE_PENDING_IN
        Contact and user are not subscribed to each other, and contact has sent user a subscription request but user has not replied yet. This state might or might not be reflected in the user's roster, as follows: if the user has created a roster item for the contact then the server MUST maintain that roster item and also note the existence of the inbound presence subscription request, whereas if the user has not created a roster item for the contact then the user's server MUST note the existence of the inbound presence subscription request but MUST NOT create a roster item for the contact (instead, the server MUST wait until the user has approved the subscription request before adding the contact to the user's roster).
      • NONE_PENDING_OUT_IN

        public static final DefinedState NONE_PENDING_OUT_IN
        Contact and user are not subscribed to each other, contact has sent user a subscription request but user has not replied yet, and user has sent contact a subscription request but contact has not replied yet; this is reflected in the user's roster by subscription='none' and ask='subscribe'.
      • TO

        public static final DefinedState TO
        User is subscribed to contact (one-way); this is reflected in the user's roster by subscription='to'.
      • TO_PENDING_IN

        public static final DefinedState TO_PENDING_IN
        User is subscribed to contact, and contact has sent user a subscription request but user has not replied yet; this is reflected in the user's roster by subscription='to'.
      • FROM

        public static final DefinedState FROM
        Contact is subscribed to user (one-way); this is reflected in the user's roster by subscription='from'.
      • FROM_PENDING_OUT

        public static final DefinedState FROM_PENDING_OUT
        Contact is subscribed to user, and user has sent contact a subscription request but contact has not replied yet; this is reflected in the user's roster by subscription='from' and ask='subscribe'.
      • BOTH

        public static final DefinedState BOTH
        User and contact are subscribed to each other (two-way); this is reflected in the user's roster by subscription='both'.
    • Method Detail

      • values

        public static DefinedState[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DefinedState c : DefinedState.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DefinedState valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • valueOf

        public static DefinedState valueOf​(SubscriptionState subscriptionState)
        Returns a defined subscription state from an existing subscription state, e.g. a RosterItem.
        Parameters:
        subscriptionState - The existing subscription state.
        Returns:
        The defined subscription state. Never null.
      • isPendingOut

        public final boolean isPendingOut()
        Description copied from interface: SubscriptionState
        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.
        Specified by:
        isPendingOut in interface SubscriptionState
        Returns:
        If the state is pending out.
      • isPendingIn

        public final boolean isPendingIn()
        Description copied from interface: SubscriptionState
        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.
        Specified by:
        isPendingIn in interface SubscriptionState
        Returns:
        If the state is pending in.