Package org.forgerock.openam.core.realms
Interface RealmLookup
public interface RealmLookup
API for looking up realms and determining if they are active or not.
Example usage:
Realms realms = ...;
Realm realm = realms.lookup("/realm/A");
boolean active = realms.isActive(realm);
- Since:
- 14.0.0
-
Method Summary
Modifier and TypeMethodDescriptionconvertRealmDnToRealmPath(String realmDn) Returns realm name in "/" separated format for the provided realm/organization name in DN format.convertRealmPathToRealmDn(String realmPath) Returns realm name in DN format for the provided realm/organization name in "/" separated format.convertRealmPathToRoutingPath(String realmPath) Return the routing path for a given realm path.Retrieve the set of configured realms.booleanDetermines if the provided realm is active or inactive.Looks up the provided realm, in either its path or DN format.lookupAsOptional(String realm) Looks up the provided realm, in either its path or DN format.voidonRealmCreation(Consumer<Realm> action) Add a listener for realm creation events.voidonRealmDeletion(Consumer<Realm> action) Add a listener for realm deletion events.
-
Method Details
-
lookup
Looks up the provided realm, in either its path or DN format.- Parameters:
realm- The realm to lookup, in either path or DN format.- Returns:
- A non-
nullRealminstance that matches the realm. - Throws:
RealmLookupException- If the provided realm cannot be found.
-
lookupAsOptional
Looks up the provided realm, in either its path or DN format.- Parameters:
realm- The realm to lookup, in either path or DN format.- Returns:
- A
Realminstance that matches the realm ornullif the provided realm cannot be found. - Throws:
RealmLookupException- If the provided realm is not valid.
-
isActive
Determines if the provided realm is active or inactive.- Parameters:
realm- The realm to determine if is active or inactive.- Returns:
trueif the realm is active,falseotherwise.- Throws:
RealmLookupException- If the provided realm cannot be found.
-
convertRealmDnToRealmPath
Returns realm name in "/" separated format for the provided realm/organization name in DN format.- Parameters:
realmDn- Name of organization.- Returns:
- DN format "/" separated realm name of organization name.
-
convertRealmPathToRealmDn
Returns realm name in DN format for the provided realm/organization name in "/" separated format.- Parameters:
realmPath- DN format "/" separated realm name of organization name.- Returns:
- The realm in DN format.
-
convertRealmPathToRoutingPath
Return the routing path for a given realm path. For example, "/realms/root/realms/myrealm" would be returned for "/myrealm".- Parameters:
realmPath- The realm path.- Returns:
- The routing path.
-
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.
-
getRealmNames
Retrieve the set of configured realms.- Returns:
- Set of strings of full path names for realms.
-