org.apache.lokahi.core.api.user
Class User

java.lang.Object
  extended by org.apache.lokahi.core.common.interfaces.RestObject
      extended by org.apache.lokahi.core.common.interfaces.TMCDao<User>
          extended by org.apache.lokahi.core.api.user.User
All Implemented Interfaces:
java.io.Serializable, Collectable, Dao<User>, Restable

public class User
extends TMCDao<User>
implements java.io.Serializable

Version:
$Id: User.java,v 1.3 2006/03/07 20:18:50 drtobes Exp $
Author:
Stephen Toback
See Also:
Serialized Form

Constructor Summary
User()
           
User(int userId, java.lang.String userName, java.lang.String firstName, java.lang.String lastName, java.lang.String jobTitle, java.lang.String comments, java.lang.String email)
           
User(int userId, java.lang.String userName, java.lang.String firstName, java.lang.String lastName, java.lang.String jobTitle, java.lang.String comments, java.lang.String email, int stateId)
           
User(java.lang.String userName)
           
User(java.lang.String userName, java.lang.String firstName, java.lang.String lastName, java.lang.String jobTitle, java.lang.String comments, java.lang.String email)
           
 
Method Summary
 boolean addProject(java.util.Collection<Project> c)
           
 boolean addProject(Project p)
           
static User addUser(User u)
           
 java.lang.StringBuilder buildShortXMLRepresentation()
          Builds a short xml representation of this object containing name, and primary key.
 java.lang.StringBuilder buildXMLRepresention()
          Builds a xml representation of this object
static boolean delete(User u)
           
 boolean equals(java.lang.Object o)
           
 User fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 User get(int id)
           
 java.util.Collection<Project> getAddableProjects()
           
 java.util.Collection<Project> getAdministratableProjects()
           
 java.util.Collection<Function> getAllMyFunctions()
           
 java.util.Collection<Function> getAllowedFunctions()
           
 java.util.Collection<Function> getAllowedFunctions(FunctionableEntity fe, Project p)
           
 java.util.Collection<Function> getAllowedFunctions(Project p)
           
static java.util.Collection<User> getAllUsers()
           
 AuthorizationManager getAuthManager()
           
 java.lang.String getComments()
           
 java.util.Collection<Function> getContextFunctions(int projectId, TomcatContext tc)
           
 java.util.Collection<Function> getContextFunctions(Project project, TomcatContext tc)
           
 java.util.Collection<Function> getContextFunctions(java.lang.String projectId, TomcatContext tc)
           
 java.util.Collection<Function> getContextFunctions(TomcatContext tc)
           
 java.lang.String getEmail()
           
 java.lang.String getEmpIndicator()
           
 java.lang.String getFirstName()
           
 java.lang.String getFullName()
           
 java.util.Collection<Function> getFunctions(java.lang.String projectId)
          Deprecated. to be removed
 java.lang.String getJobTitle()
           
 java.lang.String getLastName()
           
 java.lang.String getManager()
           
 java.lang.String getName()
          Gets the name.
 int getPk()
          Gets the primary key
 Project getProject(int projectId)
           
 Project getProject(java.lang.String pId)
           
 java.util.Collection<Project> getProjects()
           
 java.util.TreeMap getProjects(java.lang.String str)
           
 java.util.TreeMap<java.lang.Integer,JobPool> getRecentJobPools(int number)
           
 java.util.TreeMap<java.lang.Integer,JobPool> getRecentJobPools(java.lang.String number)
           
 java.util.Collection<Project> getRecentProjects()
           
 State getState()
           
static User getUser(int id)
           
static User getUser(java.lang.String uName)
           
 java.lang.String getUserName()
           
static java.util.Collection<User> getUsers(Project p)
           
 java.util.Collection<Function> getVhostFunctions(int projectId, VirtualHost vh)
           
 java.util.Collection<Function> getVhostFunctions(java.lang.String projectId, VirtualHost vh)
           
 java.util.Collection<Project> getVisibleProjects()
           
 int hashCode()
           
 boolean isActive()
           
 boolean isAllowed(Function f)
           
 boolean isAllowed(Function f, int projectId)
           
 boolean isAllowed(Function f, Project p)
           
 boolean isAllowed(Function f, Project p, FunctionableEntity object)
           
 boolean isAllowed(Function f, java.lang.String projectId)
           
 boolean isAllowed(java.lang.String functionCommand)
           
 boolean isAllowed(java.lang.String functionCommand, int projectId)
           
 boolean isAllowed(java.lang.String func, int projectId, FunctionableEntity object)
           
 boolean isAllowed(java.lang.String func, int projectId, TomcatContext object)
           
 boolean isAllowed(java.lang.String func, int projectId, VirtualHost object)
           
 boolean isAllowed(java.lang.String func, Project p, FunctionableEntity object)
           
 boolean isAllowed(java.lang.String functionCommand, java.lang.String projectId)
           
 boolean isAllowed(java.lang.String func, java.lang.String projectId, TomcatContext object)
           
 boolean isAllowed(java.lang.String func, java.lang.String projectId, VirtualHost object)
           
 boolean removeProject(java.util.Collection<Project> c)
           
 boolean removeProject(Project p)
           
 void setComments(java.lang.String comments)
           
 void setEmail(java.lang.String email)
           
 void setEmpIndicator(java.lang.String empIndicator)
           
 void setFirstName(java.lang.String firstName)
           
 void setJobTitle(java.lang.String jobTitle)
           
 void setLastName(java.lang.String lastName)
           
 void setManager(java.lang.String manager)
           
 void setName(java.lang.String name)
           
 void setPk(int userId)
           
 void setProjects(java.util.Collection<Project> c)
           
 void setUserName(java.lang.String userName)
           
static User store(User u)
           
 java.lang.String toString()
           
static void update(User u)
           
 
Methods inherited from class org.apache.lokahi.core.common.interfaces.RestObject
elementBuilder, elementBuilder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

User

public User()

User

public User(java.lang.String userName)

User

public User(java.lang.String userName,
            java.lang.String firstName,
            java.lang.String lastName,
            java.lang.String jobTitle,
            java.lang.String comments,
            java.lang.String email)

User

public User(int userId,
            java.lang.String userName,
            java.lang.String firstName,
            java.lang.String lastName,
            java.lang.String jobTitle,
            java.lang.String comments,
            java.lang.String email)

User

public User(int userId,
            java.lang.String userName,
            java.lang.String firstName,
            java.lang.String lastName,
            java.lang.String jobTitle,
            java.lang.String comments,
            java.lang.String email,
            int stateId)
Method Detail

getPk

public int getPk()
Description copied from interface: Collectable
Gets the primary key

Specified by:
getPk in interface Collectable
Returns:
the int primary key

setPk

public void setPk(int userId)

getName

public java.lang.String getName()
Description copied from interface: Collectable
Gets the name.

Specified by:
getName in interface Collectable
Returns:
the String name.

setName

public void setName(java.lang.String name)

getUserName

public java.lang.String getUserName()

setUserName

public void setUserName(java.lang.String userName)

getFirstName

public java.lang.String getFirstName()

setFirstName

public void setFirstName(java.lang.String firstName)

getLastName

public java.lang.String getLastName()

setLastName

public void setLastName(java.lang.String lastName)

getJobTitle

public java.lang.String getJobTitle()

setJobTitle

public void setJobTitle(java.lang.String jobTitle)

getComments

public java.lang.String getComments()

setComments

public void setComments(java.lang.String comments)

getFullName

public java.lang.String getFullName()

getEmail

public java.lang.String getEmail()

setEmail

public void setEmail(java.lang.String email)

getManager

public java.lang.String getManager()

setManager

public void setManager(java.lang.String manager)

getEmpIndicator

public java.lang.String getEmpIndicator()

setEmpIndicator

public void setEmpIndicator(java.lang.String empIndicator)

isActive

public boolean isActive()

getState

public State getState()

getAuthManager

public AuthorizationManager getAuthManager()

getAddableProjects

public java.util.Collection<Project> getAddableProjects()

getVisibleProjects

public java.util.Collection<Project> getVisibleProjects()

getProjects

public java.util.Collection<Project> getProjects()

setProjects

public void setProjects(java.util.Collection<Project> c)

getProject

public Project getProject(java.lang.String pId)

getProject

public Project getProject(int projectId)

getAllMyFunctions

public java.util.Collection<Function> getAllMyFunctions()

addProject

public boolean addProject(Project p)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

addProject

public boolean addProject(java.util.Collection<Project> c)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

removeProject

public boolean removeProject(Project p)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

removeProject

public boolean removeProject(java.util.Collection<Project> c)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getUser

public static User getUser(java.lang.String uName)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

addUser

public static User addUser(User u)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

get

public User get(int id)
         throws java.sql.SQLException
Specified by:
get in class TMCDao<User>
Throws:
java.sql.SQLException

getUser

public static User getUser(int id)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getAllUsers

public static java.util.Collection<User> getAllUsers()
                                              throws java.sql.SQLException
Throws:
java.sql.SQLException

getUsers

public static java.util.Collection<User> getUsers(Project p)
                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getRecentJobPools

public java.util.TreeMap<java.lang.Integer,JobPool> getRecentJobPools(java.lang.String number)

getRecentJobPools

public java.util.TreeMap<java.lang.Integer,JobPool> getRecentJobPools(int number)

getRecentProjects

public java.util.Collection<Project> getRecentProjects()

fillObject

public User fillObject(java.sql.ResultSet r)
                throws java.sql.SQLException
Description copied from interface: Dao
Creates the Dao from the passed resultset, internally calling the appriate constructor.

Specified by:
fillObject in interface Dao<User>
Parameters:
r - the resultset from a database call, should include the entire object
Returns:
Object populated from the resultset
Throws:
java.sql.SQLException

update

public static void update(User u)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

store

public static User store(User u)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

delete

public static boolean delete(User u)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getFunctions

public java.util.Collection<Function> getFunctions(java.lang.String projectId)
Deprecated. to be removed


getProjects

public java.util.TreeMap getProjects(java.lang.String str)

isAllowed

public boolean isAllowed(java.lang.String functionCommand)

isAllowed

public boolean isAllowed(Function f)

isAllowed

public boolean isAllowed(java.lang.String functionCommand,
                         java.lang.String projectId)

isAllowed

public boolean isAllowed(java.lang.String functionCommand,
                         int projectId)

isAllowed

public boolean isAllowed(Function f,
                         Project p)

isAllowed

public boolean isAllowed(Function f,
                         java.lang.String projectId)

getAllowedFunctions

public java.util.Collection<Function> getAllowedFunctions()

getAllowedFunctions

public java.util.Collection<Function> getAllowedFunctions(Project p)

getAllowedFunctions

public java.util.Collection<Function> getAllowedFunctions(FunctionableEntity fe,
                                                          Project p)

isAllowed

public boolean isAllowed(Function f,
                         int projectId)

isAllowed

public boolean isAllowed(java.lang.String func,
                         Project p,
                         FunctionableEntity object)

isAllowed

public boolean isAllowed(Function f,
                         Project p,
                         FunctionableEntity object)

isAllowed

public boolean isAllowed(java.lang.String func,
                         java.lang.String projectId,
                         VirtualHost object)

isAllowed

public boolean isAllowed(java.lang.String func,
                         java.lang.String projectId,
                         TomcatContext object)

isAllowed

public boolean isAllowed(java.lang.String func,
                         int projectId,
                         VirtualHost object)

isAllowed

public boolean isAllowed(java.lang.String func,
                         int projectId,
                         TomcatContext object)

isAllowed

public boolean isAllowed(java.lang.String func,
                         int projectId,
                         FunctionableEntity object)

getContextFunctions

public java.util.Collection<Function> getContextFunctions(java.lang.String projectId,
                                                          TomcatContext tc)

getContextFunctions

public java.util.Collection<Function> getContextFunctions(Project project,
                                                          TomcatContext tc)

getContextFunctions

public java.util.Collection<Function> getContextFunctions(TomcatContext tc)

getContextFunctions

public java.util.Collection<Function> getContextFunctions(int projectId,
                                                          TomcatContext tc)

getVhostFunctions

public java.util.Collection<Function> getVhostFunctions(java.lang.String projectId,
                                                        VirtualHost vh)

getVhostFunctions

public java.util.Collection<Function> getVhostFunctions(int projectId,
                                                        VirtualHost vh)

getAdministratableProjects

public java.util.Collection<Project> getAdministratableProjects()

buildShortXMLRepresentation

public java.lang.StringBuilder buildShortXMLRepresentation()
Description copied from interface: Restable
Builds a short xml representation of this object containing name, and primary key.

Specified by:
buildShortXMLRepresentation in interface Restable
Returns:
the xml representation

buildXMLRepresention

public java.lang.StringBuilder buildXMLRepresention()
Description copied from interface: Restable
Builds a xml representation of this object

Specified by:
buildXMLRepresention in interface Restable
Returns:
the xml representation

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object