org.camunda.bpm.cycle.connector.git
Class GitConnector

java.lang.Object
  extended by org.camunda.bpm.cycle.connector.Connector
      extended by org.camunda.bpm.cycle.connector.git.GitConnector

@Component
public class GitConnector
extends Connector

This connector just delegates to a VfsConnector and pulls from remote before and push to remote after any read or write action.

Author:
Joerg Bellmann

Field Summary
protected  String branch
           
static String CONFIG_KEY_BRANCH_NAME
           
static String CONFIG_KEY_REPOSITORY_PATH
           
static String DEFAULT_BRANCH_NAME
           
protected  VfsConnector delegate
           
protected  String password
           
protected  String username
           
 
Constructor Summary
GitConnector()
           
 
Method Summary
 ConnectorNode createNode(String parentId, String label, ConnectorNodeType type, String message)
           
 void deleteNode(ConnectorNode node, String message)
           
 void dispose()
           
protected  void disposeRepository()
          Last Push when Connector will be disposed happens here.
 List<ConnectorNode> getChildren(ConnectorNode node)
           
 InputStream getContent(ConnectorNode node)
          Get the contents of the given node as an input stream.
 ContentInformation getContentInformation(ConnectorNode node)
          Returns a ContentInformation for the given connector node.
 ConnectorNode getNode(String id)
          Returns a ConnectorNode to the assigned id.
 ConnectorNode getRoot()
           
 void init()
           
 void init(ConnectorConfiguration config)
           
protected  void initRepository()
           
protected  boolean isConnectorDelegateInitialized()
          Returns true if the delegate is not null.
protected  boolean isRepositoryInitialized()
          Returns true if the repository is not null.
 boolean isSupportsCommitMessage()
           
 void login(String userName, String password)
           
 boolean needsLogin()
           
protected  void pullFromRemote()
           
protected  void pushToRemote(ConnectorNode node, String message)
           
 void setConfiguration(ConnectorConfiguration configuration)
           
 ContentInformation updateContent(ConnectorNode node, InputStream newContent, String message)
           
 
Methods inherited from class org.camunda.bpm.cycle.connector.Connector
getConfiguration, getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_KEY_REPOSITORY_PATH

public static final String CONFIG_KEY_REPOSITORY_PATH
See Also:
Constant Field Values

CONFIG_KEY_BRANCH_NAME

public static final String CONFIG_KEY_BRANCH_NAME
See Also:
Constant Field Values

DEFAULT_BRANCH_NAME

public static final String DEFAULT_BRANCH_NAME
See Also:
Constant Field Values

delegate

protected VfsConnector delegate

username

protected String username

password

protected String password

branch

protected String branch
Constructor Detail

GitConnector

public GitConnector()
Method Detail

init

public void init(ConnectorConfiguration config)
Overrides:
init in class Connector

getChildren

public List<ConnectorNode> getChildren(ConnectorNode node)
Specified by:
getChildren in class Connector

getContent

public InputStream getContent(ConnectorNode node)
Description copied from class: Connector
Get the contents of the given node as an input stream. Implementations must handle the node correctly, especially concerning the nodes type accessible via ConnectorNode.getType().

Specified by:
getContent in class Connector
Returns:
the input stream of the file

initRepository

protected void initRepository()

isRepositoryInitialized

protected boolean isRepositoryInitialized()
Returns true if the repository is not null.

Returns:

isConnectorDelegateInitialized

protected boolean isConnectorDelegateInitialized()
Returns true if the delegate is not null.

Returns:
See Also:
delegate

getRoot

public ConnectorNode getRoot()
Specified by:
getRoot in class Connector

updateContent

public ContentInformation updateContent(ConnectorNode node,
                                        InputStream newContent,
                                        String message)
                                 throws Exception
Specified by:
updateContent in class Connector
Throws:
Exception

pullFromRemote

protected void pullFromRemote()

pushToRemote

protected void pushToRemote(ConnectorNode node,
                            String message)

getNode

public ConnectorNode getNode(String id)
Description copied from class: Connector
Returns a ConnectorNode to the assigned id. If a ConnectorNode could not be found, the value null will be returned.

Specified by:
getNode in class Connector
Parameters:
id - Represents the id of a ConnectorNode to search.
Returns:
A ConnectorNode to the assigned id or null if no ConnectorNode found.

createNode

public ConnectorNode createNode(String parentId,
                                String label,
                                ConnectorNodeType type,
                                String message)
Specified by:
createNode in class Connector

deleteNode

public void deleteNode(ConnectorNode node,
                       String message)
Specified by:
deleteNode in class Connector

getContentInformation

public ContentInformation getContentInformation(ConnectorNode node)
Description copied from class: Connector
Returns a ContentInformation for the given connector node. May never return null or throw an exception.

Specified by:
getContentInformation in class Connector
Returns:

login

public void login(String userName,
                  String password)
Overrides:
login in class Connector

needsLogin

public boolean needsLogin()
Specified by:
needsLogin in class Connector

isSupportsCommitMessage

public boolean isSupportsCommitMessage()
Specified by:
isSupportsCommitMessage in class Connector

setConfiguration

public void setConfiguration(ConnectorConfiguration configuration)
Overrides:
setConfiguration in class Connector

init

public void init()
Overrides:
init in class Connector

dispose

public void dispose()
Overrides:
dispose in class Connector

disposeRepository

protected void disposeRepository()
Last Push when Connector will be disposed happens here.



Copyright © 2014 camunda services GmbH. All rights reserved.