org.alfresco.deployment.impl.fsr
Class FileSystemDeploymentTarget

java.lang.Object
  extended by org.alfresco.deployment.impl.fsr.FileSystemDeploymentTarget
All Implemented Interfaces:
java.io.Serializable, DeploymentTarget

public class FileSystemDeploymentTarget
extends java.lang.Object
implements java.io.Serializable, DeploymentTarget

This represents a target for deployment to a filesystem A file system deployment can only process a single deployment

See Also:
Serialized Form

Constructor Summary
FileSystemDeploymentTarget()
           
 
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 targetName, 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 props)
          Create a directory.
 void delete(java.lang.String ticket, java.lang.String path)
          Delete a file or directory.
 DeploymentReceiverAuthenticator getAuthenticator()
           
 int getCurrentVersion(java.lang.String target, java.lang.String storeName)
          Get the current version for this target and source Store
 FileSystemReceiverService getFileSystemReceiverService()
           
 java.util.List getListing(java.lang.String ticket, java.lang.String path)
          Get a listing of a directory.
 java.lang.String getMetaDataDirectory()
          Get the directory in which metadata
 java.lang.String getName()
          Get the target name.
 java.util.List getPostCommit()
           
 java.util.List getPrepare()
           
 java.lang.String getRootDirectory()
          Get the root directory.
 void init()
          initialise this target
 boolean isAutoFix()
           
 boolean isBusy()
           
 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 setAuthenticator(DeploymentReceiverAuthenticator authenticator)
           
 void setAutoFix(boolean autoFix)
          tell this target to autofix data during validation
 void setBusy(boolean isBusy)
           
 void setFileSystemReceiverService(FileSystemReceiverService fileSystemReceiverService)
           
 void setMetaDataDirectory(java.lang.String dir)
           
 void setName(java.lang.String name)
          Set the target name.
 void setPostCommit(java.util.List postCommit)
           
 void setPrepare(java.util.List prepare)
           
 void setRootDirectory(java.lang.String root)
           
 void updateDirectory(java.lang.String ticket, java.lang.String path, java.lang.String guid, java.util.Set aspects, java.util.Map props)
          Update a directory .
 void validate()
          Validate this target
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemDeploymentTarget

public FileSystemDeploymentTarget()
Method Detail

setAuthenticator

public void setAuthenticator(DeploymentReceiverAuthenticator authenticator)

getAuthenticator

public DeploymentReceiverAuthenticator getAuthenticator()

init

public void init()
initialise this target


getName

public java.lang.String getName()
Get the target name.

Returns:

setName

public void setName(java.lang.String name)
Set the target name.


getRootDirectory

public java.lang.String getRootDirectory()
Get the root directory.

Returns:

setRootDirectory

public void setRootDirectory(java.lang.String root)

setAutoFix

public void setAutoFix(boolean autoFix)
tell this target to autofix data during validation

Parameters:
autoFix -

isAutoFix

public boolean isAutoFix()

setFileSystemReceiverService

public void setFileSystemReceiverService(FileSystemReceiverService fileSystemReceiverService)

getFileSystemReceiverService

public FileSystemReceiverService getFileSystemReceiverService()

begin

public java.lang.String begin(java.lang.String targetName,
                              java.lang.String storeName,
                              int version,
                              java.lang.String user,
                              char[] password)
Description copied from interface: DeploymentTarget
Start a new deployment.

Specified by:
begin in interface DeploymentTarget
Parameters:
targetName - 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.

prepare

public void prepare(java.lang.String ticket)
Description copied from interface: DeploymentTarget
Signals that the deployment should be prepared.

Specified by:
prepare in interface DeploymentTarget
Parameters:
ticket - The deployment ticket.

abort

public void abort(java.lang.String ticket)
Description copied from interface: DeploymentTarget
Signals that the deployment should be aborted and rolled back.

Specified by:
abort in interface DeploymentTarget
Parameters:
ticket - The deployment ticket, returned by an earlier call to 'begin'.

commit

public void commit(java.lang.String ticket)
Description copied from interface: DeploymentTarget
Signals that the deployment is finished and should commit.

Specified by:
commit in interface DeploymentTarget
Parameters:
ticket - The deployment ticket, returned by an earlier call to 'begin'.

delete

public void delete(java.lang.String ticket,
                   java.lang.String path)
Description copied from interface: DeploymentTarget
Delete a file or directory.

Specified by:
delete in interface DeploymentTarget
Parameters:
ticket - the deployment ticket, returned by an earlier call to 'begin'

getListing

public java.util.List getListing(java.lang.String ticket,
                                 java.lang.String path)
Description copied from interface: DeploymentTarget
Get a listing of a directory.

Specified by:
getListing in interface DeploymentTarget
Parameters:
ticket - the deployment ticket, returned by an earlier call to 'begin'
Returns:
The listing in name sorted order.

createDirectory

public void createDirectory(java.lang.String ticket,
                            java.lang.String path,
                            java.lang.String guid,
                            java.util.Set aspects,
                            java.util.Map props)
Description copied from interface: DeploymentTarget
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.

Specified by:
createDirectory in interface DeploymentTarget
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

send

public 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)
Description copied from interface: DeploymentTarget
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.

Specified by:
send in interface DeploymentTarget
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.

updateDirectory

public void updateDirectory(java.lang.String ticket,
                            java.lang.String path,
                            java.lang.String guid,
                            java.util.Set aspects,
                            java.util.Map props)
Description copied from interface: DeploymentTarget
Update a directory .

Specified by:
updateDirectory in interface DeploymentTarget
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

validate

public void validate()
Validate this target


setBusy

public void setBusy(boolean isBusy)

isBusy

public boolean isBusy()

setPostCommit

public void setPostCommit(java.util.List postCommit)

getPostCommit

public java.util.List getPostCommit()

setPrepare

public void setPrepare(java.util.List prepare)

getPrepare

public java.util.List getPrepare()

getCurrentVersion

public int getCurrentVersion(java.lang.String target,
                             java.lang.String storeName)
Description copied from interface: DeploymentTarget
Get the current version for this target and source Store

Specified by:
getCurrentVersion in interface DeploymentTarget
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.

setMetaDataDirectory

public void setMetaDataDirectory(java.lang.String dir)

getMetaDataDirectory

public java.lang.String getMetaDataDirectory()
Get the directory in which metadata

Returns:


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