com.xebialabs.deployit.engine.api
Interface RepositoryService


public interface RepositoryService

Provides access to the Deployit repository.


Method Summary
 java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> create(java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> configurationItems)
          Creates multiple configuration items.
 com.xebialabs.deployit.plugin.api.udm.ConfigurationItem create(java.lang.String ID, ArtifactAndData artifactAndData)
          Creates a new artifact CI with data.
 com.xebialabs.deployit.plugin.api.udm.ConfigurationItem create(java.lang.String ID, com.xebialabs.deployit.plugin.api.udm.ConfigurationItem configurationItem)
          Creates a new configuration item.
 void delete(java.lang.String ID)
          Deletes a configuration item.
 java.lang.Boolean exists(java.lang.String ID)
          Checks if a configuration item exists.
 com.xebialabs.deployit.plugin.api.udm.ConfigurationItem move(java.lang.String ID, java.lang.String newLocation)
          Moves a configuration item in the repository.
 java.util.List<ConfigurationItemId> query(com.xebialabs.deployit.plugin.api.reflect.Type type, java.lang.String parent, java.lang.String namePattern, org.joda.time.DateTime lastModifiedBefore, org.joda.time.DateTime lastModifiedAfter, long page, long resultPerPage)
          Retrieves configuration items by way of a query.
 java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> read(java.util.List<java.lang.String> ids)
          Reads multiple configuration items from the repository.
 com.xebialabs.deployit.plugin.api.udm.ConfigurationItem read(java.lang.String ID)
          Reads a configuration item from the repository.
 com.xebialabs.deployit.plugin.api.udm.ConfigurationItem rename(java.lang.String ID, java.lang.String newName)
          Changes the name of a configuration item in the repository.
 java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> update(java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> configurationItems)
          Modifies multiple configuration items.
 com.xebialabs.deployit.plugin.api.udm.ConfigurationItem update(java.lang.String ID, ArtifactAndData artifactAndData)
          Modifies an artifact (upload new data).
 com.xebialabs.deployit.plugin.api.udm.ConfigurationItem update(java.lang.String ID, com.xebialabs.deployit.plugin.api.udm.ConfigurationItem configurationItem)
          Modifies a configuration item.
 java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> validate(java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> cis)
          Validate the configuration items, returning any validation errors found.
 

Method Detail

read

com.xebialabs.deployit.plugin.api.udm.ConfigurationItem read(java.lang.String ID)
Reads a configuration item from the repository.

Parameters:
ID - the ID of the CI
Returns:
the CI, or a 404 error code if not found.

create

com.xebialabs.deployit.plugin.api.udm.ConfigurationItem create(java.lang.String ID,
                                                               com.xebialabs.deployit.plugin.api.udm.ConfigurationItem configurationItem)
Creates a new configuration item.

Parameters:
ID - the ID/path of the new CI.
configurationItem - the data of the CI.
Returns:
the newly created CI

create

com.xebialabs.deployit.plugin.api.udm.ConfigurationItem create(java.lang.String ID,
                                                               ArtifactAndData artifactAndData)
Creates a new artifact CI with data.

Parameters:
ID - the ID/path of the new artifact.
artifactAndData - the data of the artifact.
Returns:
the newly created artifact

update

com.xebialabs.deployit.plugin.api.udm.ConfigurationItem update(java.lang.String ID,
                                                               com.xebialabs.deployit.plugin.api.udm.ConfigurationItem configurationItem)
Modifies a configuration item.

Parameters:
ID - the ID of the CI to modify.
configurationItem - the new data of the CI.
Returns:
the updated CI, or a 409 error code if the CI has been updated on the server and you are sending modifications on an old version.

update

com.xebialabs.deployit.plugin.api.udm.ConfigurationItem update(java.lang.String ID,
                                                               ArtifactAndData artifactAndData)
Modifies an artifact (upload new data).

Parameters:
ID - the ID of the artifact to modify.
artifactAndData - the new data of the artifact.
Returns:
the updated artifact, or a 409 error code if the CI has been updated on the server and you are sending modifications on an old version.

delete

void delete(java.lang.String ID)
Deletes a configuration item.

Parameters:
ID - the ID of the CI to delete.

read

java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> read(java.util.List<java.lang.String> ids)
Reads multiple configuration items from the repository.

Parameters:
ids - the ids of the CIs
Returns:
the CIs, or a 404 error code if one of them was not found.

create

java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> create(java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> configurationItems)
Creates multiple configuration items.

Parameters:
configurationItems - the data of the CIs.
Returns:
the newly created CIs

update

java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> update(java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> configurationItems)
Modifies multiple configuration items.

Parameters:
configurationItems - the new data of the CIs.
Returns:
the updated CIs, or a 409 error code if one of the CIs has been updated on the server and you are sending modifications on an old version.

exists

java.lang.Boolean exists(java.lang.String ID)
Checks if a configuration item exists.

Parameters:
ID - the ID of the CI to check
Returns:
true if the CI exists, false if not.

move

com.xebialabs.deployit.plugin.api.udm.ConfigurationItem move(java.lang.String ID,
                                                             java.lang.String newLocation)
Moves a configuration item in the repository.

Parameters:
ID - the ID of the CI to move
newLocation - the new ID of the CI, reflecting the path in the repository.
Returns:
the moved CI

rename

com.xebialabs.deployit.plugin.api.udm.ConfigurationItem rename(java.lang.String ID,
                                                               java.lang.String newName)
Changes the name of a configuration item in the repository.

Parameters:
ID - the ID of the CI to rename
newName - the new name.
Returns:
the renamed CI

query

java.util.List<ConfigurationItemId> query(com.xebialabs.deployit.plugin.api.reflect.Type type,
                                          java.lang.String parent,
                                          java.lang.String namePattern,
                                          org.joda.time.DateTime lastModifiedBefore,
                                          org.joda.time.DateTime lastModifiedAfter,
                                          long page,
                                          long resultPerPage)
Retrieves configuration items by way of a query. All parameters are optional.

Parameters:
type - the type of the CI
parent - the parent ID of the CI. If set, only the subtree of this CI is searched.
namePattern - a search pattern for the name. This is like the SQL "LIKE" pattern: the character '%' represents any string of zero or more characters, and the character '_' (underscore) represents any single character. Any literal use of these two characters must be escaped with a backslash ('\'). Consequently, any literal instance of a backslash must also be escaped, resulting in a double backslash ('\\').
lastModifiedBefore - look for CIs modified before this date.
lastModifiedAfter - look for CIs modified after this date.
page - the desired page, in case of a paged query.
resultPerPage - the page size, or -1 for no paging.
Returns:
a list of references to CIs

validate

java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> validate(java.util.List<com.xebialabs.deployit.plugin.api.udm.ConfigurationItem> cis)
Validate the configuration items, returning any validation errors found.

Parameters:
cis - The list of configuration items to valdiate.
Returns:
The validated configuration items, including any validation messages.