org.alfresco.deployment
Interface DeploymentTarget

All Known Implementing Classes:
FileSystemDeploymentTarget

public interface DeploymentTarget

The deployment target is the interface that is provided by deployment targets.

See Also:
FileSystemDeploymentTarget, org.alfresco.deployment.impl.asr.AVMDeploymentTarget

Method Summary
 void abort(java.lang.String ticket)
          Signals that the deployment should be aborted and rolled back.
 java.lang.String begin(java.lang.String target, java.lang.String storeName, int version, java.lang.String user, char[] password)
          Start a new deployment.
 void commit(java.lang.String ticket)
          Signals that the deployment is finished and should commit.
 void createDirectory(java.lang.String ticket, java.lang.String path, java.lang.String guid, java.util.Set aspects, java.util.Map properties)
          Create a directory.
 void delete(java.lang.String ticket, java.lang.String path)
          Delete a file or directory.
 int getCurrentVersion(java.lang.String target, java.lang.String storeName)
          Get the current version for this target and source Store
 java.util.List getListing(java.lang.String ticket, java.lang.String path)
          Get a listing of a directory.
 void prepare(java.lang.String ticket)
          Signals that the deployment should be prepared.
 java.io.OutputStream send(java.lang.String ticket, boolean create, java.lang.String path, java.lang.String guid, java.lang.String encoding, java.lang.String mimeType, java.util.Set aspects, java.util.Map props)
          Send a file to a path.
 void updateDirectory(java.lang.String ticket, java.lang.String path, java.lang.String guid, java.util.Set aspects, java.util.Map properties)
          Update a directory .
 

Method Detail

begin

java.lang.String begin(java.lang.String target,
                       java.lang.String storeName,
                       int version,
                       java.lang.String user,
                       char[] password)
Start a new deployment.

Parameters:
target - The name of the target which is being deployed to.
storeName - the name of the store being deployed. (authoring instance)
version - the version of the store being deployed. (authoring instance)
user - The user name for authentication.
password - The password for authentication.
Returns:
A deployment ticket which uniquely identifies the deployment.
Throws:
DeploymentException - - unable to start a new deployment

prepare

void prepare(java.lang.String ticket)
             throws DeploymentException
Signals that the deployment should be prepared.

Parameters:
ticket - The deployment ticket.
Throws:
DeploymentException

commit

void commit(java.lang.String ticket)
Signals that the deployment is finished and should commit.

Parameters:
ticket - The deployment ticket, returned by an earlier call to 'begin'.

abort

void abort(java.lang.String ticket)
Signals that the deployment should be aborted and rolled back.

Parameters:
ticket - The deployment ticket, returned by an earlier call to 'begin'.

send

java.io.OutputStream send(java.lang.String ticket,
                          boolean create,
                          java.lang.String path,
                          java.lang.String guid,
                          java.lang.String encoding,
                          java.lang.String mimeType,
                          java.util.Set aspects,
                          java.util.Map props)
                          throws DeploymentException
Send a file to a path.
The file may either be new or may be an update.
Implementations should also deal with the case where a directory becomes a file. If a file is created via this method then it should overwrite any existing directory on the same path.

Parameters:
ticket - The deployment ticket, returned by an earlier call to 'begin'
create - - true - create a new file, false update an existing file.
path - path of the new file
guid - unique identifier for this particular version of the file
encoding - the encoding of the file
mimeType - the mime type of the file
aspects - aspects to apply to the file
props - properties.
Returns:
an open output stream to receive content.
Throws:
DeploymentException - - unable to send, deployment should be aborted

createDirectory

void createDirectory(java.lang.String ticket,
                     java.lang.String path,
                     java.lang.String guid,
                     java.util.Set aspects,
                     java.util.Map properties)
                     throws DeploymentException
Create a directory.
Implementations should also deal with the case where a file becomes a directory. If a directory is created via this method then it should overwrite any existing file on the same path.

Parameters:
ticket - the deployment ticket, returned by an earlier call to 'begin'
path - path of the new file
guid - The GUID (version) of the directory to be created.
aspects - aspects to apply to the new directory
props - properties for the new directory
Throws:
DeploymentException - - unable to get the listing, deployment should be aborted

updateDirectory

void updateDirectory(java.lang.String ticket,
                     java.lang.String path,
                     java.lang.String guid,
                     java.util.Set aspects,
                     java.util.Map properties)
                     throws DeploymentException
Update a directory .

Parameters:
ticket - the deployment ticket, returned by an earlier call to 'begin'
path - path of the new file
guid - The GUID (version) of the directory to be created.
aspects - aspects to apply to the new directory
props - properties for the new directory
Throws:
DeploymentException - - unable to set the GUID, deployment should be aborted

delete

void delete(java.lang.String ticket,
            java.lang.String path)
            throws DeploymentException
Delete a file or directory.

Parameters:
ticket - the deployment ticket, returned by an earlier call to 'begin'
path -
Throws:
DeploymentException - - unable to delete, deployment should be aborted

getListing

java.util.List getListing(java.lang.String ticket,
                          java.lang.String path)
                          throws DeploymentException
Get a listing of a directory.

Parameters:
ticket - the deployment ticket, returned by an earlier call to 'begin'
path -
Returns:
The listing in name sorted order.
Throws:
DeploymentException - - unable to get the listing, deployment should be aborted

getCurrentVersion

int getCurrentVersion(java.lang.String target,
                      java.lang.String storeName)
Get the current version for this target and source Store

Parameters:
target -
storeName - Returns the current version (authoring version), 0 means no version has been deployed, -1 means the version is unknown or not implemented by this target.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.