Package org.gitana.platform.client.branch

# Interface Branch

All Superinterfaces:
  `AccessControllable`, `Copyable`, `Document`, `org.gitana.platform.GitanaObject`, `org.gitana.platform.JSONable`, `PlatformDocument`, `Referenceable`, `RepositoryDocument`, `Selfable`, `Serializable`, `TitleDescription`, `Transferable`, `TypedID`

All Known Implementing Classes:
  `BranchImpl`

public interface Branch extends RepositoryDocument, AccessControllable, Selfable

Author:
  uzi

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`FIELD_BRANCH_TYPE`
`static final String`
`FIELD_FROZEN`
`static final String`
`FIELD_JOIN_BRANCH`
`static final String`
`FIELD_READONLY`
`static final String`
`FIELD_ROOT`
`static final String`
`FIELD_ROOT_BRANCH`
`static final String`
`FIELD_SNAPSHOT`
`static final String`
`FIELD_TIP`

### 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`

## Method Summary

Modifier and Type
Method
Description
`PermissionCheckResults`
`checkNodePermissions(List<PermissionCheck> list)`
Check node permissions.
`NodeList`
`createList(String listKey, org.gitana.platform.support.QName itemTypeQName)`
Creates a new node list.
`BaseNode`
`createNode()`
Creates an empty node on the branch.
`BaseNode`
`createNode(com.fasterxml.jackson.databind.node.ObjectNode object)`
Creates a node on the branch.
`BaseNode`
`createNode(org.gitana.platform.support.QName typeQName)`
Creates an empty node on the branch.
`Map<String,BaseNode>`
`createNodes(Map<String,String> params, org.gitana.http.HttpPayload... payloads)`
Creates multiple nodes from binary payloads (single attachment each).
`AssociationDefinition`
`defineAssociationType(org.gitana.platform.support.QName definitionQName)`
Creates an association type definition.
`AssociationDefinition`
`defineAssociationType(org.gitana.platform.support.QName definitionQName, com.fasterxml.jackson.databind.node.ObjectNode object)`
Creates an association type definition.
`TypeDefinition`
`defineType(org.gitana.platform.support.QName definitionQName)`
Creates a type definition.
`TypeDefinition`
`defineType(org.gitana.platform.support.QName definitionQName, com.fasterxml.jackson.databind.node.ObjectNode object)`
Creates a type definition.
`List<String>`
`deleteNodes(List<String> nodeIds)`
Delete multiple nodes
`org.gitana.platform.support.ResultMap<BaseNode>`
`findNodes(com.fasterxml.jackson.databind.node.ObjectNode query, String searchTerm)`
Queries and searches for nodes.
`org.gitana.platform.support.ResultMap<BaseNode>`
`findNodes(com.fasterxml.jackson.databind.node.ObjectNode query, String searchTerm, LookupOptions options)`
Queries and searches for nodes.
`org.gitana.platform.support.ResultMap<BaseNode>`
`findNodes(com.fasterxml.jackson.databind.node.ObjectNode query, String searchTerm, org.gitana.platform.support.Pagination pagination)`
Queries and searches for nodes.
`String`
`getJoinBranchId()`
`String`
`getRootBranchId()`
`String`
`getRootChangesetId()`
`String`
`getTipChangesetId()`
`org.gitana.platform.services.branch.BranchType`
`getType()`
`com.fasterxml.jackson.databind.node.ObjectNode`
`graphqlQuery(String query)`
Performs a graphql query
`com.fasterxml.jackson.databind.node.ObjectNode`
`graphqlQuery(String query, String operationName, Map<String,Object> variables)`
Performs a graphql query
`String`
`graphqlSchema()`
Finds the graphql schema for types on this branch
`boolean`
`isFrozen()`
`boolean`
`isMaster()`
`boolean`
`isReadOnly()`
`boolean`
`isSnapshot()`
`Map<org.gitana.platform.support.QName,Definition>`
`listDefinitions()`
Retrieves definitions for the branch
`Map<org.gitana.platform.support.QName,Definition>`
`listDefinitions(DefinitionFilterType filter, boolean custom, boolean system, org.gitana.platform.support.Pagination pagination)`
`org.gitana.platform.support.ResultMap<Node>`
`listNodes()`
Retrieves the mount nodes for this branch.
`org.gitana.platform.support.ResultMap<Node>`
`listNodes(LookupOptions options)`
Retrieves the mount nodes for this branch.
`org.gitana.platform.support.ResultMap<Node>`
`listNodes(org.gitana.platform.support.Pagination pagination)`
Retrieves the mount nodes for this branch.
`void`
`markDirty()`
`void`
`moveNodes(List<String> sourceNodeIds, String targetNodeId)`
`void`
`moveNodes(List<String> sourceNodeIds, String targetNodeId, String targetPath)`
Moves a list of nodes to a configured target node
`void`
`purgeAllDeletions()`
Purges all deletions for the current branch.
`org.gitana.platform.support.ResultMap<Deletion>`
`queryDeletions(com.fasterxml.jackson.databind.node.ObjectNode query)`
Queries for deletions.
`org.gitana.platform.support.ResultMap<Deletion>`
`queryDeletions(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)`
Queries for deletions.
`org.gitana.platform.support.ResultMap<BaseNode>`
`queryNodes(com.fasterxml.jackson.databind.node.ObjectNode query)`
Performs a query for nodes.
`org.gitana.platform.support.ResultMap<BaseNode>`
`queryNodes(com.fasterxml.jackson.databind.node.ObjectNode query, LookupOptions options)`
Performs a query for nodes.
`org.gitana.platform.support.ResultMap<BaseNode>`
`queryNodes(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)`
Performs a query for nodes.
`Definition`
`readDefinition(org.gitana.platform.support.QName qname)`
Reads a definition
`Deletion`
`readDeletion(String nodeId)`
Reads a deletion by node ID.
`Group`
`readGroup(String groupId, boolean createIfNotFound)`
Reads the group object for a security group.
`NodeList`
`readList(String listKey)`
Reads a node list.
`BaseNode`
`readNode(String nodeId)`
Reads a single node from the branch.
`BaseNode`
`readNode(String nodeId, String path)`
Reads a single node from the brancnh.
`BaseNode`
`readNode(String nodeId, LookupOptions options)`
Reads a single node from the brancnh.
`Person`
`readPerson(String userId, boolean createIfNotFound)`
Reads the person object for a security user.
`Node`
`rootNode()`
`org.gitana.platform.support.ResultMap<BaseNode>`
`searchNodes(com.fasterxml.jackson.databind.node.ObjectNode searchObject)`
Search
`org.gitana.platform.support.ResultMap<BaseNode>`
`searchNodes(com.fasterxml.jackson.databind.node.ObjectNode searchObject, LookupOptions options)`
Search
`org.gitana.platform.support.ResultMap<BaseNode>`
`searchNodes(com.fasterxml.jackson.databind.node.ObjectNode searchObject, org.gitana.platform.support.Pagination pagination)`
Search
`org.gitana.platform.support.ResultMap<BaseNode>`
`searchNodes(String text)`
Full-text search
`org.gitana.platform.support.ResultMap<BaseNode>`
`searchNodes(String text, LookupOptions options)`
Full-text search
`org.gitana.platform.support.ResultMap<BaseNode>`
`searchNodes(String text, org.gitana.platform.support.Pagination pagination)`
Full-text search
`void`
`setRootChangesetId(String rootChangesetId)`
`void`
`setTipChangesetId(String tipChangesetId)`
`Job`
`startCopyFrom(String sourceRepositoryId, String sourceBranchId, List<String> nodeIds, com.fasterxml.jackson.databind.node.ObjectNode config)`

### 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.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.PlatformDocument

`getPlatform, getPlatformId`

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

`ref`

### Methods inherited from interface org.gitana.platform.client.repository.RepositoryDocument

`getRepository, getRepositoryId`

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

`delete, reload, update`

### 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, getTypeId`

## Field Details

### FIELD_ROOT

static final String FIELD_ROOT

See Also:
  - Constant Field Values

### FIELD_TIP

static final String FIELD_TIP

See Also:
  - Constant Field Values

### FIELD_READONLY

static final String FIELD_READONLY

See Also:
  - Constant Field Values

### FIELD_SNAPSHOT

static final String FIELD_SNAPSHOT

See Also:
  - Constant Field Values

### FIELD_FROZEN

static final String FIELD_FROZEN

See Also:
  - Constant Field Values

### FIELD_JOIN_BRANCH

static final String FIELD_JOIN_BRANCH

See Also:
  - Constant Field Values

### FIELD_ROOT_BRANCH

static final String FIELD_ROOT_BRANCH

See Also:
  - Constant Field Values

### FIELD_BRANCH_TYPE

static final String FIELD_BRANCH_TYPE

See Also:
  - Constant Field Values

## Method Details

### setRootChangesetId

void setRootChangesetId(String rootChangesetId)

### getRootChangesetId

String getRootChangesetId()

### setTipChangesetId

void setTipChangesetId(String tipChangesetId)

### getTipChangesetId

String getTipChangesetId()

### isReadOnly

boolean isReadOnly()

### isSnapshot

boolean isSnapshot()

### isFrozen

boolean isFrozen()

### getJoinBranchId

String getJoinBranchId()

### getRootBranchId

String getRootBranchId()

### isMaster

boolean isMaster()

### getType

org.gitana.platform.services.branch.BranchType getType()

### markDirty

void markDirty()

### listNodes

org.gitana.platform.support.ResultMap<Node> listNodes()
Retrieves the mount nodes for this branch.

Returns:
  a map of node objects keyed by node id

### listNodes

org.gitana.platform.support.ResultMap<Node> listNodes(org.gitana.platform.support.Pagination pagination)
Retrieves the mount nodes for this branch.

Parameters:
  `pagination` -
Returns:
  a map of node objects keyed by node id

### listNodes

org.gitana.platform.support.ResultMap<Node> listNodes(LookupOptions options)
Retrieves the mount nodes for this branch.

Parameters:
  `options` -
Returns:
  a map of node objects keyed by node id

### readNode

BaseNode readNode(String nodeId)
Reads a single node from the branch.

Parameters:
  `nodeId` -
Returns:
  node

### readNode

BaseNode readNode(String nodeId, String path)
Reads a single node from the brancnh.

Parameters:
  `nodeId` -
  `path` -
Returns:
  node

### readNode

BaseNode readNode(String nodeId, LookupOptions options)
Reads a single node from the brancnh.

Parameters:
  `nodeId` -
  `options` -
Returns:
  node

### createNode

BaseNode createNode()
Creates an empty node on the branch.

Returns:
  branch

### createNode

BaseNode createNode(org.gitana.platform.support.QName typeQName)
Creates an empty node on the branch.

Parameters:
  `typeQName` -
Returns:
  branch

### createNode

BaseNode createNode(com.fasterxml.jackson.databind.node.ObjectNode object)
Creates a node on the branch.

Parameters:
  `object` -
Returns:
  node

### createNodes

Map<String,BaseNode> createNodes(Map<String,String> params, org.gitana.http.HttpPayload... payloads)
Creates multiple nodes from binary payloads (single attachment each).

Parameters:
  `params` -
  `payloads` -
Returns:

### queryNodes

org.gitana.platform.support.ResultMap<BaseNode> queryNodes(com.fasterxml.jackson.databind.node.ObjectNode query)
Performs a query for nodes.

Parameters:
  `query` -
Returns:
  map of nodes

### queryNodes

org.gitana.platform.support.ResultMap<BaseNode> queryNodes(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)
Performs a query for nodes.

Parameters:
  `query` -
  `pagination` -
Returns:
  map of nodes

### queryNodes

org.gitana.platform.support.ResultMap<BaseNode> queryNodes(com.fasterxml.jackson.databind.node.ObjectNode query, LookupOptions options)
Performs a query for nodes.

Parameters:
  `query` -
  `options` -
Returns:
  map of nodes

### searchNodes

org.gitana.platform.support.ResultMap<BaseNode> searchNodes(String text)
Full-text search

Parameters:
  `text` -
Returns:
  map of nodes

### searchNodes

org.gitana.platform.support.ResultMap<BaseNode> searchNodes(String text, org.gitana.platform.support.Pagination pagination)
Full-text search

Parameters:
  `text` -
  `pagination` -
Returns:
  map of nodes

### searchNodes

org.gitana.platform.support.ResultMap<BaseNode> searchNodes(String text, LookupOptions options)
Full-text search

Parameters:
  `text` -
  `options` -
Returns:
  map of nodes

### searchNodes

org.gitana.platform.support.ResultMap<BaseNode> searchNodes(com.fasterxml.jackson.databind.node.ObjectNode searchObject)
Search

Parameters:
  `searchObject` -
Returns:
  map of nodes

### searchNodes

org.gitana.platform.support.ResultMap<BaseNode> searchNodes(com.fasterxml.jackson.databind.node.ObjectNode searchObject, org.gitana.platform.support.Pagination pagination)
Search

Parameters:
  `searchObject` -
  `pagination` -
Returns:
  map of nodes

### searchNodes

org.gitana.platform.support.ResultMap<BaseNode> searchNodes(com.fasterxml.jackson.databind.node.ObjectNode searchObject, LookupOptions options)
Search

Parameters:
  `searchObject` -
  `options` -
Returns:
  map of nodes

### deleteNodes

List<String> deleteNodes(List<String> nodeIds)
Delete multiple nodes

Parameters:
  `nodeIds` -
Returns:
  list of node ids deleted

### moveNodes

void moveNodes(List<String> sourceNodeIds, String targetNodeId, String targetPath)
Moves a list of nodes to a configured target node

Parameters:
  `sourceNodeIds` - list of nodes to move
  `targetNodeId` - id of target folder, default is "root" for top folder
  `targetPath` - optional relative path to apply to targetNodeId for determining move target

### moveNodes

void moveNodes(List<String> sourceNodeIds, String targetNodeId)

### rootNode

Node rootNode()

### checkNodePermissions

PermissionCheckResults checkNodePermissions(List<PermissionCheck> list)
Check node permissions.

Parameters:
  `list` -
Returns:

### readPerson

Person readPerson(String userId, boolean createIfNotFound)
Reads the person object for a security user.

Parameters:
  `userId` - userId
  `createIfNotFound` - whether to create the person object if it isn't found
Returns:
  Person node

### readGroup

Group readGroup(String groupId, boolean createIfNotFound)
Reads the group object for a security group.

Parameters:
  `groupId` - groupd ID
  `createIfNotFound` - whether to create the group object if it isn't found
Returns:
  Group node

### listDefinitions

Map<org.gitana.platform.support.QName,Definition> listDefinitions()
Retrieves definitions for the branch

Returns:
  a map of node objects keyed by node id

### listDefinitions

Map<org.gitana.platform.support.QName,Definition> listDefinitions(DefinitionFilterType filter, boolean custom, boolean system, org.gitana.platform.support.Pagination pagination)

### readDefinition

Definition readDefinition(org.gitana.platform.support.QName qname)
Reads a definition

Parameters:
  `qname` -
Returns:
  node

### defineType

TypeDefinition defineType(org.gitana.platform.support.QName definitionQName)
Creates a type definition.

Returns:
  node

### defineType

TypeDefinition defineType(org.gitana.platform.support.QName definitionQName, com.fasterxml.jackson.databind.node.ObjectNode object)
Creates a type definition.

Parameters:
  `definitionQName` -
  `object` -
Returns:

### defineAssociationType

AssociationDefinition defineAssociationType(org.gitana.platform.support.QName definitionQName)
Creates an association type definition.

Parameters:
  `definitionQName` -
Returns:

### defineAssociationType

AssociationDefinition defineAssociationType(org.gitana.platform.support.QName definitionQName, com.fasterxml.jackson.databind.node.ObjectNode object)
Creates an association type definition.

Parameters:
  `definitionQName` -
  `object` -
Returns:

### findNodes

org.gitana.platform.support.ResultMap<BaseNode> findNodes(com.fasterxml.jackson.databind.node.ObjectNode query, String searchTerm)
Queries and searches for nodes.

Parameters:
  `query` -
  `searchTerm` -
Returns:

### findNodes

org.gitana.platform.support.ResultMap<BaseNode> findNodes(com.fasterxml.jackson.databind.node.ObjectNode query, String searchTerm, org.gitana.platform.support.Pagination pagination)
Queries and searches for nodes.

Parameters:
  `query` -
  `searchTerm` -
  `pagination` -
Returns:

### findNodes

org.gitana.platform.support.ResultMap<BaseNode> findNodes(com.fasterxml.jackson.databind.node.ObjectNode query, String searchTerm, LookupOptions options)
Queries and searches for nodes.

Parameters:
  `query` -
  `searchTerm` -
  `options` -
Returns:

### createList

NodeList createList(String listKey, org.gitana.platform.support.QName itemTypeQName)
Creates a new node list.

Parameters:
  `listKey` -
  `itemTypeQName` -
Returns:
  node list

### readList

NodeList readList(String listKey)
Reads a node list.

Parameters:
  `listKey` -
Returns:
  node list

### readDeletion

Deletion readDeletion(String nodeId)
Reads a deletion by node ID.

Parameters:
  `nodeId` -
Returns:
  deletion

### queryDeletions

org.gitana.platform.support.ResultMap<Deletion> queryDeletions(com.fasterxml.jackson.databind.node.ObjectNode query)
Queries for deletions.

Parameters:
  `query` -
Returns:
  result map of deletions

### queryDeletions

org.gitana.platform.support.ResultMap<Deletion> queryDeletions(com.fasterxml.jackson.databind.node.ObjectNode query, org.gitana.platform.support.Pagination pagination)
Queries for deletions.

Parameters:
  `query` -
  `pagination` -
Returns:
  result map of deletions

### purgeAllDeletions

void purgeAllDeletions()
Purges all deletions for the current branch.

### graphqlQuery

com.fasterxml.jackson.databind.node.ObjectNode graphqlQuery(String query)
Performs a graphql query

Parameters:
  `query` -
Returns:

### graphqlQuery

com.fasterxml.jackson.databind.node.ObjectNode graphqlQuery(String query, String operationName, Map<String,Object> variables)
Performs a graphql query

Parameters:
  `query` -
  `operationName` -
  `variables` -
Returns:
  query results json

### graphqlSchema

String graphqlSchema()
Finds the graphql schema for types on this branch

Returns:
  schema string

### startCopyFrom

Job startCopyFrom(String sourceRepositoryId, String sourceBranchId, List<String> nodeIds, com.fasterxml.jackson.databind.node.ObjectNode config)