org.tranche.users
Class User

java.lang.Object
  extended by org.tranche.commons.Debuggable
      extended by org.tranche.users.User
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
UserZipFile

public class User
extends org.tranche.commons.Debuggable
implements java.lang.Comparable

Represents a Tranche user.

Author:
Jayson Falkner - jfalkner@umich.edu, James "Augie" Hill - augman85@gmail.com

Field Summary
static int ALL_PRIVILEGES
          Flag to allow user to do everything, like an admin.
static int CAN_DELETE_DATA
          Flag for whether the User can delete data.
static int CAN_DELETE_META_DATA
          Flag for whether the User can delete meta data.
static int CAN_GET_CONFIGURATION
          Flag for whether the User can get configuration.
static int CAN_SET_CONFIGURATION
          Flag for whether the User can set configuration.
static int CAN_SET_DATA
          Flag for whether the User can set data.
static int CAN_SET_META_DATA
          Flag for whether the User can set meta data.
static int NO_PRIVILEGES
          User can do nothing.
static int VERSION_ONE
          Flag for User version 1.0.
 
Constructor Summary
User()
           
 
Method Summary
 boolean canDeleteData()
          The permission flag for whether this user can delete data.
 boolean canDeleteMetaData()
          The permission flag for whether this user can delete meta data.
 boolean canGetConfiguration()
          The permission flag for whether this user can get configuration.
 boolean canSetConfiguration()
          The permission flag for whether this user can set configuration.
 boolean canSetData()
          The permission flag for whether this user can set data.
 boolean canSetMetaData()
          The permission flag for whether this user can set meta data.
 int compareTo(java.lang.Object o)
          Compare the certificates between User objects.
 boolean equals(User u)
          Compare two user objects.
 java.security.cert.X509Certificate getCertificate()
          Get the certificate.
 int getFlags()
          Get the flags.
 boolean isVersionOne()
          The flag for whether the User object version is 1.0.
 void setCertificate(java.security.cert.X509Certificate certificate)
          Set the certificate
 void setFlags(int flags)
          Set the flags.
 
Methods inherited from class org.tranche.commons.Debuggable
debugErr, debugErr, debugOut, isDebug, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAN_SET_DATA

public static final int CAN_SET_DATA

Flag for whether the User can set data.


CAN_SET_META_DATA

public static final int CAN_SET_META_DATA

Flag for whether the User can set meta data.


CAN_DELETE_DATA

public static final int CAN_DELETE_DATA

Flag for whether the User can delete data.


CAN_DELETE_META_DATA

public static final int CAN_DELETE_META_DATA

Flag for whether the User can delete meta data.


CAN_GET_CONFIGURATION

public static final int CAN_GET_CONFIGURATION

Flag for whether the User can get configuration.


CAN_SET_CONFIGURATION

public static final int CAN_SET_CONFIGURATION

Flag for whether the User can set configuration.


VERSION_ONE

public static final int VERSION_ONE

Flag for User version 1.0.


ALL_PRIVILEGES

public static final int ALL_PRIVILEGES

Flag to allow user to do everything, like an admin.


NO_PRIVILEGES

public static final int NO_PRIVILEGES

User can do nothing.

See Also:
Constant Field Values
Constructor Detail

User

public User()
Method Detail

getCertificate

public java.security.cert.X509Certificate getCertificate()

Get the certificate.

Returns:

setCertificate

public void setCertificate(java.security.cert.X509Certificate certificate)

Set the certificate

Parameters:
certificate -

getFlags

public int getFlags()

Get the flags.

Returns:

setFlags

public void setFlags(int flags)

Set the flags.

Parameters:
flags -

canSetData

public boolean canSetData()

The permission flag for whether this user can set data.

Returns:

canSetMetaData

public boolean canSetMetaData()

The permission flag for whether this user can set meta data.

Returns:

canDeleteData

public boolean canDeleteData()

The permission flag for whether this user can delete data.

Returns:

canDeleteMetaData

public boolean canDeleteMetaData()

The permission flag for whether this user can delete meta data.

Returns:

canGetConfiguration

public boolean canGetConfiguration()

The permission flag for whether this user can get configuration.

Returns:

canSetConfiguration

public boolean canSetConfiguration()

The permission flag for whether this user can set configuration.

Returns:

isVersionOne

public boolean isVersionOne()

The flag for whether the User object version is 1.0.

Returns:

compareTo

public int compareTo(java.lang.Object o)

Compare the certificates between User objects.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o -
Returns:

equals

public boolean equals(User u)

Compare two user objects. To be equal, they must be the same certificate and have the same permissions.

Parameters:
u -
Returns:


This code is free for use both commercially and non-commercially as stated in the project's license