Package org.forgerock.openam.core.realms
Class Realm
- java.lang.Object
-
- org.forgerock.openam.core.realms.Realm
-
public class Realm extends Object
Models a valid realm within OpenAM.On creation of a
Realminstance the realmStringwill 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringasDN()Returns the realm in DN format. e.g.StringasPath()Returns the realm in path format. e.g.booleanequals(Object o)inthashCode()static Realmof(String realm)Uses the realmStringto lookup the Realm.static Realmof(Realm realm, String subRealm)Uses the realm as the parent realm and the subRealm as sub-realm to lookup the Realm.static Realmroot()Gets the root realm.StringtoString()
-
-
-
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 realmStringto lookup the Realm.- Parameters:
realm- The realm to lookup, in either path or DN format.- Returns:
- A
Realminstance 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
Realminstance 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.
-
-