com.buildforge.services.client.dbo
Class Adaptor

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

public class Adaptor
extends java.lang.Object

An object representing an adaptor within the Build Forge system. Adaptors consist of XML documents that specify the integration behavior between Build Forge and other systems, such as Source Control Management (SCM) software like Rational ClearCase or defect tracking software like Rational ClearQuest.


Constructor Summary
Adaptor(APIClientConnection conn)
          Define a new adaptor object.
 
Method Summary
 Adaptor create()
          Creates a new adaptor as defined by this object.
 void delete()
          Deletes this adaptor from the system.
static void deleteById(APIClientConnection conn, java.lang.String interfaceId)
          Deletes the adaptor with the specified name from the system.
static java.util.List<Adaptor> findAll(APIClientConnection conn)
          Finds all adaptors defined within the system to which the user has access.
static Adaptor findById(APIClientConnection conn, java.lang.String adaptorName)
          Finds the adaptor with the specified name.
 java.lang.String getAdaptorName()
          Returns the descriptive name of this adaptor.
 java.lang.String getDataText()
          Returns the XML document that describes the logic flow of this adaptor.
 int getLevel()
          Returns the access level assigned to this interface.
 int getLineId()
           
 java.lang.String getTemplate()
           
 InterfaceDBO.Type getType()
           
static java.util.List<java.lang.String> listTemplateIds(APIClientConnection conn)
          Finds all adaptor templates that are installed in the system.
 void setAdaptorName(java.lang.String adaptorName)
           
 void setDataText(java.lang.String dataText)
           
 void setLevel(int level)
           
 void setTemplate(java.lang.String template)
          Sets the template identifier for this Interface.
 void setType(InterfaceDBO.Type type)
           
 java.lang.String toString()
           
 Adaptor update()
          Updates this existing adaptor to use the modified values in this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Adaptor

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

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

findAll

public static java.util.List<Adaptor> findAll(APIClientConnection conn)
                                       throws java.io.IOException,
                                              ServiceException
Finds all adaptors defined within the system to which the user has access. A user has access to all adaptors for which the user has direct or indirect membership in the adaptor's assigned access group.

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

findById

public static Adaptor findById(APIClientConnection conn,
                               java.lang.String adaptorName)
                        throws java.io.IOException,
                               ServiceException
Finds the adaptor with the specified name.

Parameters:
conn - the API client connection to use for the request
adaptorName - the name of the adaptor to find
Returns:
the adaptor, or null if the adaptor does not exist or the user does not have direct or indirect membership in its assigned access group.
Throws:
java.io.IOException - if an I/O error occurs
ServiceException - if the request fails

listTemplateIds

public static java.util.List<java.lang.String> listTemplateIds(APIClientConnection conn)
                                                        throws java.io.IOException,
                                                               ServiceException
Finds all adaptor templates that are installed in the system. Adaptor templates are installed as XML files in the interface directory of the Build Forge engine installation. They are loaded into the database by the engine during its initialization. One of these templates may be used during the creation of a new adaptor.

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

create

public Adaptor create()
               throws java.io.IOException,
                      ServiceException
Creates a new adaptor as defined by this object.

Restrictions: Requires Permission.AddInterface and direct or indirect membership in the access group. The adaptor name must be unique.

Returns:
the newly created adaptor
Throws:
java.io.IOException - if an I/O error occurs
ServiceException - if the request fails

update

public Adaptor update()
               throws java.io.IOException,
                      ServiceException
Updates this existing adaptor to use the modified values in this object.

Restrictions: Requires Permission.EditInterface and direct or indirect membership in the access group. The adaptor name must be unique.

Returns:
the updated access group
Throws:
java.io.IOException - if an I/O error occurs
ServiceException - if the request fails

delete

public void delete()
            throws java.io.IOException,
                   ServiceException
Deletes this adaptor from the system.

Restrictions: Requires Permission.DeleteInterface. The adaptor may not be referenced by any existing AdaptorLink.

Throws:
java.io.IOException
ServiceException

deleteById

public static void deleteById(APIClientConnection conn,
                              java.lang.String interfaceId)
                       throws java.io.IOException,
                              ServiceException
Deletes the adaptor with the specified name from the system.

Restrictions: Requires Permission.DeleteInterface. The adaptor may not be referenced by any existing AdaptorLink.

Throws:
java.io.IOException
ServiceException

getDataText

public java.lang.String getDataText()
Returns the XML document that describes the logic flow of this adaptor.


getAdaptorName

public java.lang.String getAdaptorName()
Returns the descriptive name of this adaptor.


getLevel

public int getLevel()
Returns the access level assigned to this interface. Users must be a direct or indirect member of the specified access group to access this adaptor for any purpose.


getLineId

public int getLineId()

getTemplate

public java.lang.String getTemplate()

getType

public InterfaceDBO.Type getType()

setDataText

public void setDataText(java.lang.String dataText)

setAdaptorName

public void setAdaptorName(java.lang.String adaptorName)

setLevel

public void setLevel(int level)

setTemplate

public void setTemplate(java.lang.String template)
Sets the template identifier for this Interface. If .create() is called on a new Interface with a template identifer set on it, the specified template content will be used for the data text, replacing whatever may have been previously set there. For a list of allowable template identifiers, see listTemplateIds(APIClientConnection)

Parameters:
template -

setType

public void setType(InterfaceDBO.Type type)

toString

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