com.buildforge.services.client.dbo
Class AdaptorLink

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

public class AdaptorLink
extends java.lang.Object

An object representing and adaptor link within the Build Forge system. An adaptor link connects an Adaptor (adaptor) to a Project.


Constructor Summary
AdaptorLink(APIClientConnection conn)
          Define a new adaptor link object.
 
Method Summary
 void activate()
          Activates the AdaptorLink.
 void activate(ScopeDBO.Active active)
          Sets the AdaptorLink into the activated, deactivated, or debug state.
 AdaptorLink create()
          Creates this new AdaptorLink in the database.
 void deactivate()
          Deactivates the AdaptorLink.
 void debug()
          Sets the AdaptorLink into debug mode.
 void delete()
          Removes this AdaptorLink for the database.
static java.util.List<AdaptorLink> findAll(APIClientConnection conn)
          Finds all adaptor links to which the user has access.
static java.util.List<AdaptorLink> findByAdaptorName(APIClientConnection conn, java.lang.String adaptorName)
          Finds all adaptor links to which the user has access that make use of the specified interface.
static AdaptorLink findById(APIClientConnection conn, int scopeId)
          Finds an adaptor link by its system-generated ID.
static AdaptorLink findByName(APIClientConnection conn, java.lang.String name)
          Locates an AdaptorLink based using its display name
static java.util.List<AdaptorLink> findByProjectId(APIClientConnection conn, int projectId)
          Finds all adaptor links to which the user has access that are linked to the specified project.
static AdaptorLink findByProjectIdAndAdaptorName(APIClientConnection conn, int projectId, java.lang.String adaptorName)
          Locates an AdaptorLink based using its Adaptor name and its Project ID.
 ScopeDBO.Active getActive()
          Returns the activation state of this AdaptorLink
 int getAdaptorLinkId()
          Returns the Id of this AdaptorLink
 java.lang.String getAdaptorName()
          Returns the display name of the Adaptor to which this AdaptorLink is bound.
 int getEnvironmentGroupId()
          The Environment Group ID to which this AdaptorLink is attached.
 int getJobId()
           
 java.lang.String getName()
          Gets the display name of this AdaptorLink.
 int getProjectId()
          Returns the ID of the Project to which this AdaptorLink is attached.
 int getStamp()
           
 java.lang.String getStatus()
           
 void setActive(ScopeDBO.Active active)
          Sets the activation state for this AdaptorLink
 void setAdaptorName(java.lang.String adaptorName)
          Sets the associated Adaptor or Adaptor Template by name that is associated with this AdaptorLink.
 void setEnvironmentGroupId(int environmentGroupId)
          Sets the ID of the Environment to be referenced by this AdaptorLink.
 void setJobId(int jobId)
           
 void setName(java.lang.String name)
          Sets the display name of this AdaptorLink.
 void setProjectId(int projectId)
           
 void setStamp(int stamp)
           
 void setStatus(java.lang.String status)
           
 java.lang.String toString()
           
 AdaptorLink update()
          Commits all changes to this AdaptorLink to the database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdaptorLink

public AdaptorLink(APIClientConnection conn)
Define a new adaptor link object. The adaptor link does not exist until after it has been created using the create() method.

Parameters:
conn - the services layer connection that the adaptor link object should use when submitting requests
Method Detail

findAll

public static final java.util.List<AdaptorLink> findAll(APIClientConnection conn)
                                                 throws java.io.IOException,
                                                        ServiceException
Finds all adaptor links to which the user has access. A user has access to an adaptor link if and only if the user has access to both the Adaptor and the Project that it links.

Parameters:
conn - the API client connection to use for the request
Returns:
the list of adaptor links
Throws:
java.io.IOException - if an I/O error occurs
ServiceException - if the request fails

findByProjectId

public static final java.util.List<AdaptorLink> findByProjectId(APIClientConnection conn,
                                                                int projectId)
                                                         throws java.io.IOException,
                                                                ServiceException
Finds all adaptor links to which the user has access that are linked to the specified project. A user has access to an adaptor link if and only if the user has access to both the Adaptor and the Project that it links. A APIException will be thrown if the given Project doesn't exist.

Parameters:
conn - the API client connection to use for the request
projectId - the project ID of the project for which adaptor links should be found
Returns:
the list of adaptor links
Throws:
ServiceException
java.io.IOException

findByAdaptorName

public static final java.util.List<AdaptorLink> findByAdaptorName(APIClientConnection conn,
                                                                  java.lang.String adaptorName)
                                                           throws java.io.IOException,
                                                                  ServiceException
Finds all adaptor links to which the user has access that make use of the specified interface. A user has access to an adaptor link if and only if the user has access to both the Adaptor and the Project that it links. A APIException will be thrown if the given Adaptor doesn't exist.

Parameters:
conn - the API client connection to use for the request
adaptorName - the name of the adaptor for which links should be found
Returns:
the list of adaptor links
Throws:
java.io.IOException
ServiceException

findById

public static final AdaptorLink findById(APIClientConnection conn,
                                         int scopeId)
                                  throws java.io.IOException,
                                         ServiceException
Finds an adaptor link by its system-generated ID.

Parameters:
conn - the API client connection to use for the request
scopeId - the getAdaptorLinkId()
Returns:
the adaptor link, or null if no such adaptor link can be found
Throws:
java.io.IOException
ServiceException

findByName

public static final AdaptorLink findByName(APIClientConnection conn,
                                           java.lang.String name)
                                    throws java.io.IOException,
                                           ServiceException
Locates an AdaptorLink based using its display name

Parameters:
conn - the API client connection to use for the request
name - the AdaptorLink's display name, found by getName()
Returns:
the resulting AdaptorLink, or null if not found.
Throws:
java.io.IOException
ServiceException

findByProjectIdAndAdaptorName

public static final AdaptorLink findByProjectIdAndAdaptorName(APIClientConnection conn,
                                                              int projectId,
                                                              java.lang.String adaptorName)
                                                       throws java.io.IOException,
                                                              ServiceException
Locates an AdaptorLink based using its Adaptor name and its Project ID. If a AdaptorLink doesn't exist with those values, null is returned.

Parameters:
conn - the API client connection to use for the request
projectId - the Project ID
adaptorName - the Adaptor name
Returns:
the resulting AdaptorLink, or null if not found.
Throws:
java.io.IOException
ServiceException

create

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

Returns:
the newly created adaptor link
Throws:
java.io.IOException
ServiceException

delete

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

Throws:
java.io.IOException
ServiceException

update

public AdaptorLink update()
                   throws java.io.IOException,
                          ServiceException
Commits all changes to this AdaptorLink to the database.

Returns:
the updated adaptor link
Throws:
java.io.IOException
ServiceException

deactivate

public void deactivate()
                throws java.io.IOException,
                       ServiceException

Deactivates the AdaptorLink.

This convenience method is exactly equivalent to calling activate(ScopeDBO.Active.NO).

Throws:
java.io.IOException
ServiceException

debug

public void debug()
           throws java.io.IOException,
                  ServiceException

Sets the AdaptorLink into debug mode.

This convenience method is exactly equivalent to calling activate(ScopeDBO.Active.DEBUG).

Throws:
java.io.IOException
ServiceException

activate

public void activate()
              throws java.io.IOException,
                     ServiceException

Activates the AdaptorLink.

This convenience method is exactly equivalent to calling activate(ScopeDBO.Active.YES).

Throws:
java.io.IOException
ServiceException

activate

public void activate(ScopeDBO.Active active)
              throws java.io.IOException,
                     ServiceException
Sets the AdaptorLink into the activated, deactivated, or debug state. Note that while setActive(ScopeDBO.Active) requires an explicit call to update(), this method takes effect immediately.

Parameters:
active - the activation state to set
Throws:
java.io.IOException
ServiceException

getActive

public ScopeDBO.Active getActive()
Returns the activation state of this AdaptorLink


getAdaptorLinkId

public int getAdaptorLinkId()
Returns the Id of this AdaptorLink


getAdaptorName

public java.lang.String getAdaptorName()
Returns the display name of the Adaptor to which this AdaptorLink is bound.

Returns:
the display name of the adaptor

getEnvironmentGroupId

public int getEnvironmentGroupId()
The Environment Group ID to which this AdaptorLink is attached. The value may be 0, indicating that no environment group is assigned; otherwise, Environment.findById(APIClientConnection, int) may be used to load the environment group.

Returns:
the Environment Group ID to which this AdaptorLink is attached.

getJobId

public int getJobId()

getName

public java.lang.String getName()
Gets the display name of this AdaptorLink.

Parameters:
name -

getProjectId

public int getProjectId()
Returns the ID of the Project to which this AdaptorLink is attached.


getStamp

public int getStamp()

getStatus

public java.lang.String getStatus()

setActive

public void setActive(ScopeDBO.Active active)
Sets the activation state for this AdaptorLink

Parameters:
active -

setAdaptorName

public void setAdaptorName(java.lang.String adaptorName)
Sets the associated Adaptor or Adaptor Template by name that is associated with this AdaptorLink.

Parameters:
adaptorName - the name of the Adaptor

setEnvironmentGroupId

public void setEnvironmentGroupId(int environmentGroupId)
Sets the ID of the Environment to be referenced by this AdaptorLink. Passing 0 indicates that no Environment should be associated with this AdaptorLink

Parameters:
environmentUuid - the id of the Environment

setJobId

public void setJobId(int jobId)

setName

public void setName(java.lang.String name)
Sets the display name of this AdaptorLink.

Parameters:
name -

setProjectId

public void setProjectId(int projectId)

setStamp

public void setStamp(int stamp)

setStatus

public void setStatus(java.lang.String status)

toString

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