Class Identity
- java.lang.Object
-
- org.objectweb.joram.shared.security.Identity
-
- All Implemented Interfaces:
Streamable,Externalizable,Serializable
- Direct Known Subclasses:
JonasIdentity,SimpleIdentity
public abstract class Identity extends Object implements Externalizable, Streamable
Abstract class needed to describe all identities.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleanDEBUGprotected static Loggerloggerprivate static StringSEPARATE_CHARseparate identity class name and root name.private static longserialVersionUIDDefine serialVersionUID for interoperability.
-
Constructor Summary
Constructors Constructor Description Identity()Constructs anIdentity.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancheck(Identity identity)check the identity.static StringgetRootIdentityClass(String rootName)static StringgetRootName(String rootName)abstract StringgetUserName()Get the user name.static Identityread(InputStream is)voidreadExternal(ObjectInput in)abstract voidsetIdentity(String user, String passwd)set the identity.abstract voidsetUserName(String userName)set user name.static voidwrite(Identity identity, OutputStream os)***** ***** ***** ***** ***** ***** ***** Streamable interface ***** ***** ***** ***** ***** ***** ***** *****voidwriteExternal(ObjectOutput out)***** ***** ***** ***** ***** ***** ***** Externalizable interface ***** ***** ***** ***** ***** ***** ***** *****-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.dyade.aaa.common.stream.Streamable
readFrom, writeTo
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Define serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
logger
protected static final Logger logger
-
DEBUG
protected static final boolean DEBUG
-
SEPARATE_CHAR
private static final String SEPARATE_CHAR
separate identity class name and root name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getUserName
public abstract String getUserName()
Get the user name.- Returns:
- username.
-
setUserName
public abstract void setUserName(String userName)
set user name.- Parameters:
userName-
-
setIdentity
public abstract void setIdentity(String user, String passwd) throws Exception
set the identity.- Parameters:
user-passwd-- Throws:
Exception
-
check
public abstract boolean check(Identity identity) throws Exception
check the identity.- Parameters:
identity- the identity to check- Returns:
- true if ok
- Throws:
Exception- the exception
-
getRootIdentityClass
public static String getRootIdentityClass(String rootName)
- Parameters:
rootName-- Returns:
- identity class name.
-
getRootName
public static String getRootName(String rootName)
- Parameters:
rootName-- Returns:
- the rootName without Identity class name.
-
writeExternal
public final void writeExternal(ObjectOutput out) throws IOException
***** ***** ***** ***** ***** ***** ***** Externalizable interface ***** ***** ***** ***** ***** ***** ***** *****- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public final void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
write
public static void write(Identity identity, OutputStream os) throws IOException
***** ***** ***** ***** ***** ***** ***** Streamable interface ***** ***** ***** ***** ***** ***** ***** *****- Throws:
IOException
-
read
public static Identity read(InputStream is) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException
-
-