com.buildforge.services.client.dbo
Class ServerAuth

java.lang.Object
  extended by com.buildforge.services.client.dbo.ServerAuth

public class ServerAuth
extends java.lang.Object

ServerAuths are the authentication credentials associated with Servers. They tie a username and a password to a particular Server and will be be used to authenticate with that Server's agent process at Build execution time. For security reasons, passwords will never be returned to clients loading ServerAuth objects from the database. These passwords may be updated using the loaded ServerAuth objects, but the original contents of that password field may not be retrieved.


Field Summary
static java.lang.Class<ServerAuth> CLASS
           
 
Constructor Summary
ServerAuth(APIClientConnection conn)
          Defines a new ServerAuth object
 
Method Summary
 ServerAuth create()
          Creates a new ServerAuth in the database
 void delete()
          Removes this ServerAuth from the database
static void deleteById(APIClientConnection conn, java.lang.String authId)
          Removes the specified ServerAuth from the database, by identifier
static java.util.List<ServerAuth> findAll(APIClientConnection conn)
          Retrieves all ServerAuth objects from the database
static ServerAuth findById(APIClientConnection conn, java.lang.String authId)
          Retrieves the specificed ServerAuth object by identifier
 java.lang.String getAuthId()
          Returns the unique identifier of this ServerAuth
 int getLevel()
          Returns the security level required to access this ServerAuth
 java.lang.String getPassword()
          Returns the password of this ServerAuth.
 java.lang.String getUsername()
          Returns the username of this ServerAuth
 void setAuthId(java.lang.String auth_id)
          Sets the unique identifier of this ServerAuth
 void setLevel(int level)
          Sets the security level required to access this ServerAuth
 void setPassword(java.lang.String password)
          Sets the password of this ServerAuth.
 void setUsername(java.lang.String username)
          Sets the username of this ServerAuth
 java.lang.String toString()
           
 ServerAuth update()
          Commits any new state of this ServerAuth object to the database
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS

public static final java.lang.Class<ServerAuth> CLASS
Constructor Detail

ServerAuth

public ServerAuth(APIClientConnection conn)
Defines a new ServerAuth object

Parameters:
conn -
Method Detail

findAll

public static java.util.List<ServerAuth> findAll(APIClientConnection conn)
                                          throws java.io.IOException,
                                                 ServiceException
Retrieves all ServerAuth objects from the database

Parameters:
conn -
Returns:
Throws:
java.io.IOException
ServiceException

findById

public static ServerAuth findById(APIClientConnection conn,
                                  java.lang.String authId)
                           throws java.io.IOException,
                                  ServiceException
Retrieves the specificed ServerAuth object by identifier

Parameters:
conn -
authId -
Returns:
Throws:
java.io.IOException
ServiceException

create

public ServerAuth create()
                  throws java.io.IOException,
                         ServiceException
Creates a new ServerAuth in the database

Returns:
Throws:
java.io.IOException
ServiceException

update

public ServerAuth update()
                  throws java.io.IOException,
                         ServiceException
Commits any new state of this ServerAuth object to the database

Returns:
Throws:
java.io.IOException
ServiceException

delete

public void delete()
            throws java.io.IOException,
                   ServiceException
Removes this ServerAuth from the database

Throws:
java.io.IOException
ServiceException

deleteById

public static void deleteById(APIClientConnection conn,
                              java.lang.String authId)
                       throws java.io.IOException,
                              ServiceException
Removes the specified ServerAuth from the database, by identifier

Parameters:
conn -
authId -
Throws:
java.io.IOException
ServiceException

getAuthId

public java.lang.String getAuthId()
Returns the unique identifier of this ServerAuth


getLevel

public int getLevel()
Returns the security level required to access this ServerAuth


getPassword

public java.lang.String getPassword()
Returns the password of this ServerAuth. Note that this field will left null in loaded ServerAuth objects for security reasons.


getUsername

public java.lang.String getUsername()
Returns the username of this ServerAuth


setAuthId

public void setAuthId(java.lang.String auth_id)
Sets the unique identifier of this ServerAuth

Parameters:
auth_id -

setLevel

public void setLevel(int level)
Sets the security level required to access this ServerAuth

Parameters:
level -

setPassword

public void setPassword(java.lang.String password)
Sets the password of this ServerAuth. This value should be encrypted using TextUtils.bf_encrypt(String)

Parameters:
password -

setUsername

public void setUsername(java.lang.String username)
Sets the username of this ServerAuth

Parameters:
username -

toString

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