Class Realm

  • Direct Known Subclasses:
    MemoryRealm

    public abstract class Realm
    extends java.lang.Object
    Security realm capable of providing an enroler and a verifier.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Enroler enroler
      The enroler that can add the user roles based on user principals.
      private java.lang.String name
      The name.
      private Series<Parameter> parameters
      The modifiable series of parameters.
      private boolean started
      Indicates if the realm was started.
      private Verifier verifier
      The verifier that can check the validity of the user credentials associated to a request.
    • Constructor Summary

      Constructors 
      Constructor Description
      Realm()
      Constructor.
      Realm​(Verifier verifier, Enroler enroler)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Enroler getEnroler()
      Returns an enroler that can add the user roles based on user principals.
      java.lang.String getName()
      Returns the name.
      Series<Parameter> getParameters()
      Returns the modifiable series of parameters.
      Verifier getVerifier()
      Returns a verifier that can check the validity of the credentials associated to a request.
      boolean isStarted()
      Indicates if the realm is started.
      boolean isStopped()
      Indicates if the realm is stopped.
      void setEnroler​(Enroler enroler)
      Sets an enroler that can add the user roles based on user principals.
      void setName​(java.lang.String name)
      Sets the name.
      void setParameters​(Series<Parameter> parameters)
      Sets the modifiable series of parameters.
      void setVerifier​(Verifier verifier)
      Sets a verifier that can check the validity of the credentials associated to a request.
      void start()
      Starts the realm.
      void stop()
      Stops the realm.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        private volatile java.lang.String name
        The name.
      • parameters

        private final Series<Parameter> parameters
        The modifiable series of parameters.
      • enroler

        private volatile Enroler enroler
        The enroler that can add the user roles based on user principals.
      • verifier

        private volatile Verifier verifier
        The verifier that can check the validity of the user credentials associated to a request.
      • started

        private volatile boolean started
        Indicates if the realm was started.
    • Constructor Detail

      • Realm

        public Realm()
        Constructor.
      • Realm

        public Realm​(Verifier verifier,
                     Enroler enroler)
        Constructor.
        Parameters:
        verifier - The verifier that can check the validity of the credentials associated to a request.
        enroler - The enroler that can add the user roles based on user principals.
    • Method Detail

      • getEnroler

        public Enroler getEnroler()
        Returns an enroler that can add the user roles based on user principals.
        Returns:
        An enroler.
      • getName

        public java.lang.String getName()
        Returns the name.
        Returns:
        The name.
      • getParameters

        public Series<Parameter> getParameters()
        Returns the modifiable series of parameters. A parameter is a pair composed of a name and a value and is typically used for configuration purpose, like Java properties. Note that multiple parameters with the same name can be declared and accessed.
        Returns:
        The modifiable series of parameters.
      • getVerifier

        public Verifier getVerifier()
        Returns a verifier that can check the validity of the credentials associated to a request.
        Returns:
        A verifier.
      • isStarted

        public boolean isStarted()
        Indicates if the realm is started.
        Returns:
        True if the realm is started.
      • isStopped

        public boolean isStopped()
        Indicates if the realm is stopped.
        Returns:
        True if the realm is stopped.
      • setEnroler

        public void setEnroler​(Enroler enroler)
        Sets an enroler that can add the user roles based on user principals.
        Parameters:
        enroler - An enroler.
      • setName

        public void setName​(java.lang.String name)
        Sets the name.
        Parameters:
        name - The name.
      • setParameters

        public void setParameters​(Series<Parameter> parameters)
        Sets the modifiable series of parameters. This method clears the current series and adds all entries in the parameter series.
        Parameters:
        parameters - A series of parameters.
      • setVerifier

        public void setVerifier​(Verifier verifier)
        Sets a verifier that can check the validity of the credentials associated to a request.
        Parameters:
        verifier - A local verifier.
      • start

        public void start()
                   throws java.lang.Exception
        Starts the realm.
        Throws:
        java.lang.Exception
      • stop

        public void stop()
                  throws java.lang.Exception
        Stops the realm.
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object