com.buildforge.services.client.dbo
Class Register

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

public class Register
extends java.lang.Object

Build and project registers. These registers are shared, named values bound to projects or builds.


Field Summary
static java.lang.Class<Register> CLASS
           
 
Constructor Summary
Register(APIClientConnection conn)
           
 
Method Summary
 Register create()
          Creates a new register in the database
 void delete()
          Removes this Register from the database
static void deleteAllRegistersByBuild(APIClientConnection conn, int buildId)
          Removes all Registers associated with the provided Build from the database
static void deleteAllRegistersByProject(APIClientConnection conn, int projectId)
          Removes all Registers associated with the provided Project from the database
static java.util.List<Register> findAllRegistersByBuild(APIClientConnection conn, int buildId)
          Retrieves all registers bound to a particular build
static java.util.List<Register> findAllRegistersByProject(APIClientConnection conn, int projectId)
          Retrieves all registers bound to a particular project
static Register findBuildRegisterById(APIClientConnection conn, int buildId, java.lang.String registerName)
          Retrieves a specific build register by name
static Register findProjectRegisterById(APIClientConnection conn, int projectId, java.lang.String registerName)
          Retrieves a specific project register by name
 int getBuildId()
          Returns the identifier of the Build to which this Register is associated.
 java.lang.String getDataText()
          Returns the value of this register
 int getProjectId()
          Returns the identifier of the Project to which this Register is associated.
 java.lang.String getRegister()
          Returns the name of the Register
 int getStamp()
          Returns the timestamp of the last register update in seconds since epoch (not millis)
 int getUserId()
          Returns the identifier of the user that created this Register with a build, for Registers created with projects, it will return 0
 void setBuildId(int buildId)
          Sets the identifier of the Build to which this Register is associated.
 void setDataText(java.lang.String newText)
          Sets the value of this register
 void setProjectId(int projectId)
          Sets the identifier of the Project to which this Register is associated.
 void setRegister(java.lang.String register)
          Sets the name of the Register
 void setStamp(int stamp)
          Sets the timestamp of the last register update
 java.lang.String toString()
           
 Register update()
          Commits the new state of this 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<Register> CLASS
Constructor Detail

Register

public Register(APIClientConnection conn)
Method Detail

findAllRegistersByBuild

public static java.util.List<Register> findAllRegistersByBuild(APIClientConnection conn,
                                                               int buildId)
                                                        throws java.io.IOException,
                                                               ServiceException
Retrieves all registers bound to a particular build

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

findAllRegistersByProject

public static java.util.List<Register> findAllRegistersByProject(APIClientConnection conn,
                                                                 int projectId)
                                                          throws java.io.IOException,
                                                                 ServiceException
Retrieves all registers bound to a particular project

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

findBuildRegisterById

public static Register findBuildRegisterById(APIClientConnection conn,
                                             int buildId,
                                             java.lang.String registerName)
                                      throws java.io.IOException,
                                             ServiceException
Retrieves a specific build register by name

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

findProjectRegisterById

public static Register findProjectRegisterById(APIClientConnection conn,
                                               int projectId,
                                               java.lang.String registerName)
                                        throws java.io.IOException,
                                               ServiceException
Retrieves a specific project register by name

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

create

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

Returns:
Throws:
java.io.IOException
ServiceException

update

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

Throws:
java.io.IOException
ServiceException

delete

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

Throws:
java.io.IOException
ServiceException

deleteAllRegistersByBuild

public static void deleteAllRegistersByBuild(APIClientConnection conn,
                                             int buildId)
                                      throws java.io.IOException,
                                             ServiceException
Removes all Registers associated with the provided Build from the database

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

deleteAllRegistersByProject

public static void deleteAllRegistersByProject(APIClientConnection conn,
                                               int projectId)
                                        throws java.io.IOException,
                                               ServiceException
Removes all Registers associated with the provided Project from the database

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

getBuildId

public int getBuildId()
Returns the identifier of the Build to which this Register is associated. In general, either this or the Project identifier will be filled in, but not both.


getDataText

public java.lang.String getDataText()
Returns the value of this register


getProjectId

public int getProjectId()
Returns the identifier of the Project to which this Register is associated. In general, either this or the Project identifier will be filled in, but not both.


getRegister

public java.lang.String getRegister()
Returns the name of the Register


getStamp

public int getStamp()
Returns the timestamp of the last register update in seconds since epoch (not millis)


getUserId

public int getUserId()
Returns the identifier of the user that created this Register with a build, for Registers created with projects, it will return 0


setBuildId

public void setBuildId(int buildId)
Sets the identifier of the Build to which this Register is associated. In general, either this or the Project identifier will be filled in, but not both.

Parameters:
buildId - The new build identifier

setDataText

public void setDataText(java.lang.String newText)
Sets the value of this register

Parameters:
newText - The new value

setRegister

public void setRegister(java.lang.String register)
Sets the name of the Register

Parameters:
register - The register's new name

setStamp

public void setStamp(int stamp)
Sets the timestamp of the last register update

Parameters:
stamp - The new timestamp in seconds since epoch (not millis)

setProjectId

public void setProjectId(int projectId)
Sets the identifier of the Project to which this Register is associated. In general, either this or the Project identifier will be filled in, but not both.

Parameters:
projectId -

toString

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