Skip navigation links

Oracle® Coherence Java API Reference
v3.5.1

E15583-01


com.tangosol.net.security
Class SimpleHandler

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.security.SimpleHandler

All Implemented Interfaces:
java.security.Principal, javax.security.auth.callback.CallbackHandler

public class SimpleHandler
extends Base
implements javax.security.auth.callback.CallbackHandler, java.security.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 Summary
SimpleHandler(java.lang.String sName, char[] acPassword)
          Construct a SimpleHandler.
SimpleHandler(java.lang.String sName, char[] acPassword, boolean fDispose)
          Construct a SimpleHandler.

 

Method Summary
 boolean equals(java.lang.Object o)
          Compare this principal to the specified object.
 java.lang.String getName()
          Return the name of this principal.
 void handle(javax.security.auth.callback.Callback[] aCallback)
          Invoke an array of Callbacks.
 int hashCode()
          Return a hashcode for this principal.
 java.lang.String toString()
          Return a string representation of this principal.

 

Constructor Detail

SimpleHandler

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

SimpleHandler

public SimpleHandler(java.lang.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(javax.security.auth.callback.Callback[] aCallback)
            throws javax.security.auth.callback.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 javax.security.auth.callback.CallbackHandler
Parameters:
aCallback - an array of Callback objects which contains the information requested by an underlying security service to be retrieved or displayed.
Throws:
javax.security.auth.callback.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(java.lang.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 java.security.Principal
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 java.lang.String toString()
Return a string representation of this principal.
Specified by:
toString in interface java.security.Principal
Returns:
a string representation of this principal

hashCode

public int hashCode()
Return a hashcode for this principal.
Specified by:
hashCode in interface java.security.Principal
Returns:
a hashcode for this principal

getName

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

Skip navigation links

Oracle® Coherence Java API Reference
v3.5.1

E15583-01


Copyright © 2000, 2009, Oracle. All rights reserved.