Class Realm

java.lang.Object
org.forgerock.openig.tools.am.Realm

public final class Realm extends Object
This class defines a Realm as it is used in OpenAM.
  • Field Details

    • ROOT_REALM

      public static final Realm ROOT_REALM
      The root realm, known as "/".
  • Method Details

    • parseRealm

      public static Realm parseRealm(String name)
      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

      public 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

      public List<String> 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.