Class Realm


  • public class Realm
    extends Object
    Models a valid realm within OpenAM.

    On creation of a Realm instance the realm String will be validated and used to look up the realm.

    Note: Realms are case-insensitive and therefore are compared ignoring case.

    Since:
    14.0.0
    • Method Detail

      • root

        public static Realm root()
        Gets the root realm.
        Returns:
        The root realm.
      • of

        public static Realm of​(String realm)
                        throws RealmLookupException
        Uses the realm String to lookup the Realm.
        Parameters:
        realm - The realm to lookup, in either path or DN format.
        Returns:
        A Realm instance of the realm.
        Throws:
        RealmLookupException - If the provided realm is not valid or failed to be resolved.
      • of

        public static Realm of​(Realm realm,
                               String subRealm)
                        throws RealmLookupException
        Uses the realm as the parent realm and the subRealm as sub-realm to lookup the Realm.
        Parameters:
        realm - The parent realm.
        subRealm - The sub-realm.
        Returns:
        A Realm instance of the concatenation of realm and subRealm.
        Throws:
        RealmLookupException - If the provided realm and subRealm do not constitute a valid realm or failed to be resolved/
      • asPath

        public String asPath()
        Returns the realm in path format. e.g. '/realmA/realmB'.
        Returns:
        The realm path.
      • asDN

        public String asDN()
        Returns the realm in DN format. e.g. 'o=realmA,o=realmB,ou=services,dc=example,dc=com'.
        Returns:
        The realm DN.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object