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 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.
      • 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.
      • getRealmNames

        Set<String> getRealmNames()
        Retrieve the set of configured realms.
        Returns:
        Set of strings of full path names for realms.