Package org.gitana.platform.client.repository

# Class RepositoryImpl

java.lang.Object
org.gitana.platform.support.GitanaObjectImpl
org.gitana.platform.client.document.DocumentImpl
org.gitana.platform.client.datastore.AbstractDataStoreImpl
org.gitana.platform.client.cluster.AbstractClusterDataStoreImpl
org.gitana.platform.client.platform.AbstractPlatformDataStoreImpl
org.gitana.platform.client.repository.RepositoryImpl

All Implemented Interfaces:
  `Serializable`, `ClusterDataStore`, `DataStore`, `Document`, `PlatformDataStore`, `Repository`, `AccessControllable`, `Copyable`, `Referenceable`, `Selfable`, `TitleDescription`, `Transferable`, `TypedID`, `Teamable`, `org.gitana.platform.GitanaObject`, `org.gitana.platform.JSONable`

public class RepositoryImpl extends AbstractPlatformDataStoreImpl implements Repository

Author:
  uzi
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class org.gitana.platform.support.GitanaObjectImpl

`serialVersionUID`

### Fields inherited from interface org.gitana.platform.client.document.Document

`FIELD_ID, SYSTEM, SYSTEM_CREATED_BY, SYSTEM_CREATED_ON, SYSTEM_MODIFIED_BY, SYSTEM_MODIFIED_ON`

### Fields inherited from interface org.gitana.platform.client.support.TitleDescription

`FIELD_DESCRIPTION, FIELD_TITLE`

## Constructor Summary

Constructors
Constructor
Description
`RepositoryImpl(Platform platform, com.fasterxml.jackson.databind.node.ObjectNode obj, boolean isSaved)`

## Method Summary

Modifier and Type
Method
Description
`PermissionCheckResults`
`checkBranchPermissions(List<PermissionCheck> list)`
Check branch permissions.
`PermissionCheckResults`
`checkReleasePermissions(List<PermissionCheck> list)`
Check release permissions.
`Branch`
`createBranch(String changesetId)`
Creates an empty branch on the server.
`Branch`
`createBranch(String changesetId, com.fasterxml.jackson.databind.node.ObjectNode object)`
Creates a branch on the server.
`Branch`
`createBranch(String rootBranchId, String changesetId, com.fasterxml.jackson.databind.node.ObjectNode object)`
Creates a branch on the server.
`Release`
`createRelease(com.fasterxml.jackson.databind.node.ObjectNode object)`
Creates a release on the server.
`Release`
`createRelease(com.fasterxml.jackson.databind.node.ObjectNode object, String sourceReleaseId)`
Creates a release on the server by copying a source release.
`void`
`deleteFile(String filename)`
Deletes a file from the repository file system.
`byte[]`
`downloadFile(String filename)`
Downloads a file from the repository file system.
`String`
`getResourceUri()`
`String`
`getTypeId()`
`org.gitana.platform.support.ResultMap<Branch>`
`listBranches()`
Retrieves branches for the repository
`org.gitana.platform.support.ResultMap<Branch>`
`listBranches(org.gitana.platform.support.Pagination pagination)`
Retrieves branches for the repository
`org.gitana.platform.support.ResultMap<Changeset>`
`listChangesets()`
Retrieves changesets for the repository
`org.gitana.platform.support.ResultMap<Changeset>`
`listChangesets(org.gitana.platform.support.Pagination pagination)`
Retrieves changesets for the repository
`org.gitana.platform.support.ResultMap<Release>`
`listReleases()`
Retrieves releases for the repository
`org.gitana.platform.support.ResultMap<Release>`
`listReleases(org.gitana.platform.support.Pagination pagination)`
Retrieves releases for the repository
`org.gitana.platform.support.ResultMap<Branch>`
`queryBranches(com.fasterxml.jackson.databind.node.ObjectNode query)`
Performs a query over the branch index.
`org.gitana.platform.support.ResultMap<Branch>`
`queryBranches(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)`
Performs a query over the branch index.
`org.gitana.platform.support.ResultMap<Changeset>`
`queryChangesets(com.fasterxml.jackson.databind.node.ObjectNode query)`
Performs a query over the changeset index.
`org.gitana.platform.support.ResultMap<Changeset>`
`queryChangesets(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)`
Performs a query over the changeset index.
`org.gitana.platform.support.ResultMap<Release>`
`queryReleases(com.fasterxml.jackson.databind.node.ObjectNode query)`
Queries for releases.
`org.gitana.platform.support.ResultMap<Release>`
`queryReleases(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)`
Queries for releases.
`Branch`
`readBranch(String branchId)`
Reads a single branch from the server.
`Changeset`
`readChangeset(String changesetId)`
Reads a single changeset.
`Release`
`readRelease(String releaseId)`
Reads a single release from the server.
`void`
`reload()`
Reload
`void`
`uploadFile(String filename, byte[] bytes, String contentType)`
Uploads a file into the repository file system.

### Methods inherited from class org.gitana.platform.client.platform.AbstractPlatformDataStoreImpl

`copy, copy, copyAsync, copyAsync, getPlatform, ref`

### Methods inherited from class org.gitana.platform.client.cluster.AbstractClusterDataStoreImpl

`getCluster`

### Methods inherited from class org.gitana.platform.client.datastore.AbstractDataStoreImpl

`createTeam, createTeam, delete, deleteTeam, equals, exportArchive, exportArchive, exportArchive, getACL, getACL, getAuthorityGrants, getDriver, getFactory, getId, getOwnersTeam, getRemote, getTeamableBaseUri, grant, grant, hasAuthority, hasAuthority, hasPermission, hasPermission, importArchive, importArchive, importArchive, listTeams, readTeam, revoke, revoke, revokeAll, revokeAll, update`

### Methods inherited from class org.gitana.platform.client.document.DocumentImpl

`dateCreated, dateModified, getCreatedBy, getDescription, getModifiedBy, getSystemObject, getTitle, isSaved, mergeProperties, mergePropertyIfExists, reload, reload, setDescription, setId, setSaved, setTitle`

### Methods inherited from class org.gitana.platform.support.GitanaObjectImpl

`_objectGetFloat, _objectGetInt, _objectGetLong, _objectGetObject, _objectGetString, _objectSet, get, getArray, getAsJsonNode, getBigDecimal, getBoolean, getDouble, getInt, getLong, getObject, getObject, getString, has, putAll, putAll, putObject, remove, set, toJSON, toJSONString, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.gitana.platform.client.support.AccessControllable

`getACL, getACL, getAuthorityGrants, grant, grant, hasAuthority, hasAuthority, hasPermission, hasPermission, revoke, revoke, revokeAll, revokeAll`

### Methods inherited from interface org.gitana.platform.client.cluster.ClusterDataStore

`getCluster`

### Methods inherited from interface org.gitana.platform.client.support.Copyable

`copy, copy, copyAsync, copyAsync`

### Methods inherited from interface org.gitana.platform.client.document.Document

`dateCreated, dateModified, getCreatedBy, getId, getModifiedBy, getSystemObject, isSaved, reload, reload, setId, setSaved`

### Methods inherited from interface org.gitana.platform.GitanaObject

`get, getArray, getAsJsonNode, getBigDecimal, getBoolean, getDouble, getInt, getLong, getObject, getObject, getString, has, putAll, putAll, remove, set`

### Methods inherited from interface org.gitana.platform.JSONable

`toJSON, toJSONString`

### Methods inherited from interface org.gitana.platform.client.platform.PlatformDataStore

`getPlatform`

### Methods inherited from interface org.gitana.platform.client.support.Referenceable

`ref`

### Methods inherited from interface org.gitana.platform.client.support.Selfable

`delete, update`

### Methods inherited from interface org.gitana.platform.client.team.Teamable

`createTeam, createTeam, deleteTeam, getOwnersTeam, getTeamableBaseUri, listTeams, readTeam`

### Methods inherited from interface org.gitana.platform.client.support.TitleDescription

`getDescription, getTitle, setDescription, setTitle`

### Methods inherited from interface org.gitana.platform.client.support.Transferable

`exportArchive, exportArchive, exportArchive, importArchive, importArchive, importArchive`

### Methods inherited from interface org.gitana.platform.client.support.TypedID

`getId`

## Constructor Details

### RepositoryImpl

public RepositoryImpl(Platform platform, com.fasterxml.jackson.databind.node.ObjectNode obj, boolean isSaved)

## Method Details

### getTypeId

public String getTypeId()

Specified by:
  `getTypeId` in interface `TypedID`

### getResourceUri

public String getResourceUri()

Specified by:
  `getResourceUri` in class `AbstractDataStoreImpl`

### reload

public void reload()
Description copied from interface: `Selfable`
Reload

Specified by:
  `reload` in interface `Selfable`
Specified by:
  `reload` in class `AbstractDataStoreImpl`

### listBranches

public org.gitana.platform.support.ResultMap<Branch> listBranches()
Description copied from interface: `Repository`
Retrieves branches for the repository

Specified by:
  `listBranches` in interface `Repository`
Returns:
  a map of branch objects keyed by branch id

### listBranches

public org.gitana.platform.support.ResultMap<Branch> listBranches(org.gitana.platform.support.Pagination pagination)
Description copied from interface: `Repository`
Retrieves branches for the repository

Specified by:
  `listBranches` in interface `Repository`
Parameters:
  `pagination` -
Returns:
  a map of branch objects keyed by branch id

### readBranch

public Branch readBranch(String branchId)
Description copied from interface: `Repository`
Reads a single branch from the server.

Specified by:
  `readBranch` in interface `Repository`
Parameters:
  `branchId` -
Returns:
  branch

### createBranch

public Branch createBranch(String changesetId)
Description copied from interface: `Repository`
Creates an empty branch on the server.

Specified by:
  `createBranch` in interface `Repository`
Parameters:
  `changesetId` - the root changeset
Returns:
  branch

### createBranch

public Branch createBranch(String changesetId, com.fasterxml.jackson.databind.node.ObjectNode object)
Description copied from interface: `Repository`
Creates a branch on the server.

Specified by:
  `createBranch` in interface `Repository`
Parameters:
  `changesetId` - the root changeset id
  `object` -
Returns:
  branch

### createBranch

public Branch createBranch(String rootBranchId, String changesetId, com.fasterxml.jackson.databind.node.ObjectNode object)
Description copied from interface: `Repository`
Creates a branch on the server.

Specified by:
  `createBranch` in interface `Repository`
Parameters:
  `rootBranchId` - the root branch id
  `changesetId` - the root changeset id
  `object` -
Returns:
  branch

### queryBranches

public org.gitana.platform.support.ResultMap<Branch> queryBranches(com.fasterxml.jackson.databind.node.ObjectNode query)
Description copied from interface: `Repository`
Performs a query over the branch index.

Specified by:
  `queryBranches` in interface `Repository`
Parameters:
  `query` -
Returns:

### queryBranches

public org.gitana.platform.support.ResultMap<Branch> queryBranches(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)
Description copied from interface: `Repository`
Performs a query over the branch index.

Specified by:
  `queryBranches` in interface `Repository`
Parameters:
  `query` -
  `pagination` -
Returns:

### checkBranchPermissions

public PermissionCheckResults checkBranchPermissions(List<PermissionCheck> list)
Description copied from interface: `Repository`
Check branch permissions.

Specified by:
  `checkBranchPermissions` in interface `Repository`
Parameters:
  `list` -
Returns:

### uploadFile

public void uploadFile(String filename, byte[] bytes, String contentType)
Description copied from interface: `Repository`
Uploads a file into the repository file system.

Specified by:
  `uploadFile` in interface `Repository`
Parameters:
  `filename` -
  `bytes` -
  `contentType` -

### deleteFile

public void deleteFile(String filename)
Description copied from interface: `Repository`
Deletes a file from the repository file system.

Specified by:
  `deleteFile` in interface `Repository`
Parameters:
  `filename` -

### downloadFile

public byte[] downloadFile(String filename)
Description copied from interface: `Repository`
Downloads a file from the repository file system.

Specified by:
  `downloadFile` in interface `Repository`
Parameters:
  `filename` -
Returns:
  the byte array constituting the downloaded file

### listChangesets

public org.gitana.platform.support.ResultMap<Changeset> listChangesets()
Description copied from interface: `Repository`
Retrieves changesets for the repository

Specified by:
  `listChangesets` in interface `Repository`
Returns:
  a map of changeset objects keyed by changeset id

### listChangesets

public org.gitana.platform.support.ResultMap<Changeset> listChangesets(org.gitana.platform.support.Pagination pagination)
Description copied from interface: `Repository`
Retrieves changesets for the repository

Specified by:
  `listChangesets` in interface `Repository`
Parameters:
  `pagination` -
Returns:
  a map of changeset objects keyed by changeset id

### readChangeset

public Changeset readChangeset(String changesetId)
Description copied from interface: `Repository`
Reads a single changeset.

Specified by:
  `readChangeset` in interface `Repository`
Parameters:
  `changesetId` -
Returns:
  branch

### queryChangesets

public org.gitana.platform.support.ResultMap<Changeset> queryChangesets(com.fasterxml.jackson.databind.node.ObjectNode query)
Description copied from interface: `Repository`
Performs a query over the changeset index.

Specified by:
  `queryChangesets` in interface `Repository`
Parameters:
  `query` -
Returns:

### queryChangesets

public org.gitana.platform.support.ResultMap<Changeset> queryChangesets(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)
Description copied from interface: `Repository`
Performs a query over the changeset index.

Specified by:
  `queryChangesets` in interface `Repository`
Parameters:
  `query` -
  `pagination` -
Returns:

### listReleases

public org.gitana.platform.support.ResultMap<Release> listReleases()
Description copied from interface: `Repository`
Retrieves releases for the repository

Specified by:
  `listReleases` in interface `Repository`
Returns:
  a map of release objects keyed by release id

### listReleases

public org.gitana.platform.support.ResultMap<Release> listReleases(org.gitana.platform.support.Pagination pagination)
Description copied from interface: `Repository`
Retrieves releases for the repository

Specified by:
  `listReleases` in interface `Repository`
Parameters:
  `pagination` -
Returns:
  a map of release objects keyed by release id

### readRelease

public Release readRelease(String releaseId)
Description copied from interface: `Repository`
Reads a single release from the server.

Specified by:
  `readRelease` in interface `Repository`
Parameters:
  `releaseId` -
Returns:
  release

### createRelease

public Release createRelease(com.fasterxml.jackson.databind.node.ObjectNode object)
Description copied from interface: `Repository`
Creates a release on the server.

Specified by:
  `createRelease` in interface `Repository`
Parameters:
  `object` -
Returns:
  release

### createRelease

public Release createRelease(com.fasterxml.jackson.databind.node.ObjectNode object, String sourceReleaseId)
Description copied from interface: `Repository`
Creates a release on the server by copying a source release.

Specified by:
  `createRelease` in interface `Repository`
Parameters:
  `object` -
  `sourceReleaseId` - source release id
Returns:
  release

### queryReleases

public org.gitana.platform.support.ResultMap<Release> queryReleases(com.fasterxml.jackson.databind.node.ObjectNode query)
Description copied from interface: `Repository`
Queries for releases.

Specified by:
  `queryReleases` in interface `Repository`
Parameters:
  `query` -
Returns:
  map of releases

### queryReleases

public org.gitana.platform.support.ResultMap<Release> queryReleases(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)
Description copied from interface: `Repository`
Queries for releases.

Specified by:
  `queryReleases` in interface `Repository`
Parameters:
  `query` -
  `pagination` -
Returns:
  map of releases

### checkReleasePermissions

public PermissionCheckResults checkReleasePermissions(List<PermissionCheck> list)
Description copied from interface: `Repository`
Check release permissions.

Specified by:
  `checkReleasePermissions` in interface `Repository`
Parameters:
  `list` -
Returns:
  results