Package org.forgerock.openig.tools.am
Class Realm
java.lang.Object
org.forgerock.openig.tools.am.Realm
This class defines a Realm as it is used in OpenAM.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the fully qualified realm's name: '/finances/employees' The returned name always starts with /, and never ends with /.Returns the unmodifiable list of the segments composing the realm.static Realm
parseRealm
(String name) Creates a new Realm by parsing the given name.
-
Field Details
-
ROOT_REALM
The root realm, known as "/".
-
-
Method Details
-
parseRealm
Creates a new Realm by parsing the given name. Parsing rules:- input can optionally starts with /
- root realm name (/ or root) is optional
- / and whitespaces are considered as sub-realm separators
- realms and empty elements are ignored (easier if you start from an OpenAM URL endpoint)
Example: root or / or /root finances finances/employees finances employees /finances/employees/europe /finances employees/europe /root/finances/employees/europe ////realms/finances/realms/employees
- Parameters:
name
- The name of the realm to parse. It could be "finances" or "consumers/europe/france" for example. If name is null or empty then the ROOT_REALM will be returned.- Returns:
- The new Realm created from the string.
-
getName
Returns the fully qualified realm's name: '/finances/employees' The returned name always starts with /, and never ends with /.- Returns:
- The fully qualified realm's name.
-
getSegments
Returns the unmodifiable list of the segments composing the realm. For example: '/finances/employees' will return a list containing 'finances' and 'employees'. The 'root' realm name is always omitted.- Returns:
- The unmodifiable list of the segments composing the realm.
-