BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

weblogic.security.acl
Class DefaultUserInfoImpl

java.lang.Object
  |
  +--weblogic.security.acl.DefaultUserInfoImpl
Direct Known Subclasses:
SSLUserInfo, T3User

public class DefaultUserInfoImpl
extends java.lang.Object
implements UserInfo, java.io.Externalizable, WLSerializable

DefaultUserInfoImpl is the default implementation of the UserInfo interface. UserInfo objects are created by a RealmProxy and passed to the T3Client constructor. The WebLogic Server uses a UserInfo object to allow the corresponding realm to retrieve the corresponding user and checks it against the provided information.

DefaultUserInfoImpl accepts as credentials password strings and/or a single X509 certificate or a chain of them. If the explicitly provided username is null, the user's name is extracted from the certificate.

If you inherit from this class, be sure to implement the hashCode and equals methods correctly.

Author:
Copyright (c) 1997-1998 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1999 by BEA WebXpress. All Rights Reserved.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Field Summary
protected  java.util.Vector certificates
           
protected  java.lang.String id
           
protected  java.lang.String password
           
protected  java.lang.String realmName
           
 
Constructor Summary
DefaultUserInfoImpl()
          Constructs a DefaultUserInfoImpl.
DefaultUserInfoImpl(java.lang.String name, java.lang.Object credential)
          Create a user using the default realm.
DefaultUserInfoImpl(java.lang.String name, java.lang.Object credential, java.lang.String realmName)
           
 
Method Summary
protected  byte[] crypt(byte[] bytes)
           
 boolean equals(java.lang.Object obj)
           
 boolean equalsInAllButName(DefaultUserInfoImpl that)
          Ensure that the non-name components of a UserInfo object match those of another.
 java.util.Vector getCertificates()
          Deprecated. this method is not secure, and must not be trusted
 java.lang.String getName()
          Gets the name associated with a DefaultUserInfo.
 java.lang.String getPassword()
           
 java.lang.String getRealmName()
          Gets the name of the realm associated with a DefaultUserInfo.
 boolean hasCertificates()
           
 int hashCode()
           
 boolean hasPassword()
           
protected  void read(java.io.DataInput is)
           
 void readExternal(java.io.ObjectInput is)
          Reads a DefaultUserInfoImpl object from the specified object input stream.
 void readObject(WLObjectInput dis)
          Reads a DefaultUserInfoImpl object from the specified WebLogic object input stream.
protected  void setCredential(java.lang.Object c)
           
 java.lang.String toString()
           
protected  void write(java.io.DataOutput os)
           
 void writeExternal(java.io.ObjectOutput os)
          Writes a DefaultUserInfoImpl object to the specified object output stream.
 void writeObject(WLObjectOutput dos)
          Writes a DefaultUserInfoImpl object to the specified WebLogic object output stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

realmName

protected java.lang.String realmName

id

protected java.lang.String id

password

protected java.lang.String password

certificates

protected java.util.Vector certificates
Constructor Detail

DefaultUserInfoImpl

public DefaultUserInfoImpl()
Constructs a DefaultUserInfoImpl. For serialization only.

DefaultUserInfoImpl

public DefaultUserInfoImpl(java.lang.String name,
                           java.lang.Object credential)
Create a user using the default realm.

DefaultUserInfoImpl

public DefaultUserInfoImpl(java.lang.String name,
                           java.lang.Object credential,
                           java.lang.String realmName)
Method Detail

getRealmName

public java.lang.String getRealmName()
Gets the name of the realm associated with a DefaultUserInfo.
Specified by:
getRealmName in interface UserInfo

Returns:
Name of realm as a string

getName

public java.lang.String getName()
Gets the name associated with a DefaultUserInfo.
Specified by:
getName in interface UserInfo

Returns:
Name of this user

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getCertificates

public java.util.Vector getCertificates()
Deprecated. this method is not secure, and must not be trusted


hasCertificates

public boolean hasCertificates()


setCredential

protected void setCredential(java.lang.Object c)


hasPassword

public boolean hasPassword()


getPassword

public java.lang.String getPassword()


crypt

protected byte[] crypt(byte[] bytes)


write

protected void write(java.io.DataOutput os)
              throws java.io.IOException


read

protected void read(java.io.DataInput is)
             throws java.io.IOException,
                    java.lang.ClassNotFoundException


writeObject

public void writeObject(WLObjectOutput dos)
                 throws java.io.IOException
Writes a DefaultUserInfoImpl object to the specified WebLogic object output stream.
Specified by:
writeObject in interface WLSerializable

Parameters:
dos - WLObjectOutput stream
Throws:
java.io.IOException - if there is an I/O error

readObject

public void readObject(WLObjectInput dis)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
Reads a DefaultUserInfoImpl object from the specified WebLogic object input stream.
Specified by:
readObject in interface WLSerializable

Parameters:
dis - WLObjectInput stream
Throws:
java.io.IOException - if there is an I/O error
java.lang.ClassNotFoundException - if the DefaultUserInfo cannot be found or read

writeExternal

public void writeExternal(java.io.ObjectOutput os)
                   throws java.io.IOException
Writes a DefaultUserInfoImpl object to the specified object output stream.
Specified by:
writeExternal in interface java.io.Externalizable

Parameters:
os - ObjectOutput stream
Throws:
java.io.IOException - if there is an I/O error

readExternal

public void readExternal(java.io.ObjectInput is)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads a DefaultUserInfoImpl object from the specified object input stream.
Specified by:
readExternal in interface java.io.Externalizable

Parameters:
is - ObjectInput stream
Throws:
java.io.IOException - if there is an I/O error
java.lang.ClassNotFoundException - if the DefaultUserImpl cannot be found or read

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

equalsInAllButName

public boolean equalsInAllButName(DefaultUserInfoImpl that)
Ensure that the non-name components of a UserInfo object match those of another.


Documentation is available at
http://www.weblogic.com/docs51