FileDocCategorySizeDatePackage
EisBackendPrincipal.javaAPI DocGlassfish v2 API4965Fri May 04 22:34:24 BST 2007com.sun.enterprise.connectors.authentication

EisBackendPrincipal

public class EisBackendPrincipal extends Object implements Serializable
This a javabean class thatabstracts the backend principal. The backend principal consist of the userName and password which is used for authenticating/getting connection from the backend.
author
Srikanth P

Fields Summary
private String
userName
private String
password
Constructors Summary
public EisBackendPrincipal()
Default constructor


    
public EisBackendPrincipal(String userName, String password)
Constructor

param
userName UserName
param
password Password
credential
Credential

        this.userName = userName;
        this.password = password;
    
Methods Summary
public booleanequals(java.lang.Object backendPrincipal)
Overloaded method from "Object" class Checks the equality.

param
backendPrincipal Backend principal against which equality has to be tested.
return
true if they are equal false if hey are not equal.


        if(backendPrincipal == null || 
                 !(backendPrincipal instanceof EisBackendPrincipal)) {
            return false;
        }
        EisBackendPrincipal eisBackendPrincipal = 
                           (EisBackendPrincipal)backendPrincipal;
        
        if(isEqual(eisBackendPrincipal.userName,this.userName) &&
                isEqual(eisBackendPrincipal.password,this.password)) {
            return true;
        } else {
            return false;

        }
    
public java.lang.StringgetPassword()
Getter method for Password property

return
Password

        return password;
    
public java.lang.StringgetUserName()
Getter method for UserName property

return
UserName

        return userName;
    
public inthashCode()
Overloaded method from "Object" class Generates the hashcode

return
a hash code value for this object

        int result = 67;
        if(userName != null)
            result = 67 * result + userName.hashCode();
        if(password != null)
            result = 67*result + password.hashCode();
        return result;
    
private booleanisEqual(java.lang.String in, java.lang.String out)
Checks whether two strings are equal including the null string cases.

        if(in == null && out == null) {
            return true;
        }
        if(in == null || out == null) {
            return false;
        }
        return (out.equals(in));
    
public voidsetPassword(java.lang.String password)
Setter method for password property

param
password Password

        this.password = password;
    
public voidsetUserName(java.lang.String userName)
Setter method for UserName property

param
userName UserName

        this.userName = userName;