Package org.forgerock.openam.core.realms
Class Realms
- java.lang.Object
-
- org.forgerock.openam.core.realms.Realms
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Realm
of(String realm)
Uses the realmString
to lookup the Realm.static Realm
of(Realm realm, String subRealm)
Uses the realm as the parent realm and the subRealm as sub-realm to lookup the Realm.static void
onRealmCreation(Consumer<Realm> action)
Add a listener for realm creation events.static void
onRealmDeletion(Consumer<Realm> action)
Add a listener for realm deletion events.static Realm
root()
Gets the root realm.
-
-
-
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 realmString
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/
-
onRealmCreation
public static void onRealmCreation(Consumer<Realm> action)
Add a listener for realm creation events.- Parameters:
action
- The action to invoke when a realm is created.
-
-