Package org.forgerock.openam.core.realms
Class Realms
java.lang.Object
org.forgerock.openam.core.realms.Realms
A class to statically obtain
Realm instances.-
Method Summary
Modifier and TypeMethodDescriptiongetAsOptional(String realm) Uses the realmStringto lookup the Realm.static RealmUses the realmStringto lookup the Realm.static RealmUses the realm as the parent realm and the subRealm as sub-realm to lookup the Realm.static voidonRealmCreation(Consumer<Realm> action) Add a listener for realm creation events.static voidonRealmDeletion(Consumer<Realm> action) Add a listener for realm deletion events.static Realmroot()Gets the root realm.
-
Method Details
-
root
Gets the root realm.- Returns:
- The root realm.
-
of
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.
-
getAsOptional
Uses the realmStringto lookup the Realm.- Parameters:
realm- The realm to lookup, in either path or DN format.- Returns:
- A
Realminstance of the realm ornullif realm is not valid. - Throws:
RealmLookupException- If the provided realm failed to be resolved.
-
of
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/
-
onRealmCreation
Add a listener for realm creation events.- Parameters:
action- The action to invoke when a realm is created.
-
onRealmDeletion
Add a listener for realm deletion events.- Parameters:
action- The action to invoke when a realm is deleted.
-