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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
convertRealmDnToRealmPath(String realmDn)
Returns realm name in "/" separated format for the provided realm/organization name in DN format.String
convertRealmPathToRealmDn(String realmPath)
Returns realm name in DN format for the provided realm/organization name in "/" separated format.String
convertRealmPathToRoutingPath(String realmPath)
Return the routing path for a given realm path.Set<String>
getRealmNames()
Retrieve the set of configured realms.boolean
isActive(Realm realm)
Determines if the provided realm is active or inactive.Realm
lookup(String realm)
Looks up the provided realm, in either its path or DN format.Optional<Realm>
lookupAsOptional(String realm)
Looks up the provided realm, in either its path or DN format.void
onRealmCreation(Consumer<Realm> action)
Add a listener for realm creation events.void
onRealmDeletion(Consumer<Realm> action)
Add a listener for realm deletion events.
-
-
-
Method Detail
-
lookup
Realm lookup(String realm) throws RealmLookupException
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-
null
Realm
instance that matches the realm. - Throws:
RealmLookupException
- If the provided realm cannot be found.
-
lookupAsOptional
Optional<Realm> lookupAsOptional(String realm) throws RealmLookupException
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
Realm
instance that matches the realm ornull
if the provided realm cannot be found. - Throws:
RealmLookupException
- If the provided realm is not valid.
-
isActive
boolean isActive(Realm realm) throws RealmLookupException
Determines if the provided realm is active or inactive.- Parameters:
realm
- The realm to determine if is active or inactive.- Returns:
true
if the realm is active,false
otherwise.- Throws:
RealmLookupException
- If the provided realm cannot be found.
-
convertRealmDnToRealmPath
String convertRealmDnToRealmPath(String realmDn)
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
String convertRealmPathToRealmDn(String realmPath)
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
String convertRealmPathToRoutingPath(String realmPath)
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
void onRealmCreation(Consumer<Realm> action)
Add a listener for realm creation events.- Parameters:
action
- The action to invoke when a realm is created.
-
onRealmDeletion
void onRealmDeletion(Consumer<Realm> action)
Add a listener for realm deletion events.- Parameters:
action
- The action to invoke when a realm is deleted.
-
-