Class SimpleHandler

  • All Implemented Interfaces:
    Principal, CallbackHandler

    public class SimpleHandler
    extends Base
    implements CallbackHandler, Principal
    The SimpleHandler class is a CallbackHandler implementation based on a specified user name and password.
    Since:
    Coherence 2.5
    Author:
    gg 2004.08.03
    • Constructor Detail

      • SimpleHandler

        public SimpleHandler​(String sName,
                             char[] acPassword)
        Construct a SimpleHandler.
        Parameters:
        sName - the user name
        acPassword - the password
      • SimpleHandler

        public SimpleHandler​(String sName,
                             String sPassword,
                             boolean fDispose)
        Construct a SimpleHandler.
        Parameters:
        sName - the user name
        sPassword - the password
        fDispose - true if the password should be disposed as soon as the PasswordCallback has been served
      • SimpleHandler

        public SimpleHandler​(String sName,
                             char[] acPassword,
                             boolean fDispose)
        Construct a SimpleHandler.
        Parameters:
        sName - the user name
        acPassword - the password
        fDispose - true if the password should be disposed as soon as the PasswordCallback has been served
    • Method Detail

      • handle

        public void handle​(Callback[] aCallback)
                    throws UnsupportedCallbackException
        Invoke an array of Callbacks. This implementation processes only the NameCallback and PasswordCallback types. It completely ignores the TextOutputCallback and ConfirmationCallback and throws the UnsupportedCallbackException for any other type.
        Specified by:
        handle in interface CallbackHandler
        Parameters:
        aCallback - an array of Callback objects which contains the information requested by an underlying security service to be retrieved or displayed.
        Throws:
        UnsupportedCallbackException - if the implementation of this method does not support one or more of the Callbacks specified in the callbacks parameter.
      • equals

        public boolean equals​(Object o)
        Compare this principal to the specified object. Returns true if the object passed in matches the principal represented by the implementation of this interface.
        Specified by:
        equals in interface Principal
        Overrides:
        equals in class Object
        Parameters:
        o - principal to compare with
        Returns:
        true if the principal passed in is the same as that encapsulated by this principal; false otherwise
      • toString

        public String toString()
        Return a string representation of this principal.
        Specified by:
        toString in interface Principal
        Overrides:
        toString in class Object
        Returns:
        a string representation of this principal
      • hashCode

        public int hashCode()
        Return a hashcode for this principal.
        Specified by:
        hashCode in interface Principal
        Overrides:
        hashCode in class Object
        Returns:
        a hashcode for this principal
      • getName

        public String getName()
        Return the name of this principal.
        Specified by:
        getName in interface Principal
        Returns:
        the name of this principal