org.alfresco.repo.transfer
Class TransferServiceImpl

java.lang.Object
  extended by org.alfresco.repo.transfer.TransferServiceImpl
All Implemented Interfaces:
TransferService

public class TransferServiceImpl
extends java.lang.Object
implements TransferService

Implementation of the Transfer Service. Note: The TransferService interface is now deprecated (replaced by TransferService2). This implementation delegates to the implementation of TransferService2.


Constructor Summary
TransferServiceImpl()
           
 
Method Summary
 void cancelAsync(java.lang.String transferId)
          Asynchronously cancel an in-progress transfer This method tells an in-process transfer to give up, rollback and stop as soon as possible.
 TransferTarget createAndSaveTransferTarget(java.lang.String name, java.lang.String title, java.lang.String description, java.lang.String endpointProtocol, java.lang.String endpointHost, int endpointPort, java.lang.String endpointPath, java.lang.String username, char[] password)
          Create and save a new transfer target.
 TransferTarget createTransferTarget(java.lang.String name)
          Creates an in memory transfer target.
 void deleteTransferTarget(java.lang.String name)
          Delete a transfer target.
 void enableTransferTarget(java.lang.String name, boolean enable)
          Enables/Disables the named transfer target
 TransferTarget getTransferTarget(java.lang.String name)
          Get a transfer target by its name
 java.util.Set getTransferTargets()
          Get all the transfer targets
 java.util.Set getTransferTargets(java.lang.String groupName)
          Get All the transfer targets for a particular transfer target group.
 TransferTarget saveTransferTarget(TransferTarget update)
          Save TransferTarget, will create a transfer target if it does not already exist or update an existing transfer target.
 void setTransferServiceImpl2(TransferServiceImpl2 transferServiceImpl2)
           
 boolean targetExists(java.lang.String name)
          Test to see if the target with the specified name exists
 org.alfresco.service.cmr.repository.NodeRef transfer(java.lang.String targetName, TransferDefinition definition)
          Transfer nodes, sync.
 org.alfresco.service.cmr.repository.NodeRef transfer(java.lang.String targetName, TransferDefinition definition, java.util.Collection callbacks)
          Transfer nodes sync, with callback.
 org.alfresco.service.cmr.repository.NodeRef transfer(java.lang.String targetName, TransferDefinition definition, TransferCallback[] callbacks)
          Transfer nodes sync, with callback.
 void transferAsync(java.lang.String targetName, TransferDefinition definition, java.util.Collection callbacks)
          Transfer nodes async with callback.
 void transferAsync(java.lang.String targetName, TransferDefinition definition, TransferCallback[] callbacks)
          Transfer nodes async with callback.
 void verify(TransferTarget target)
          Verify a target is available and that the configured credentials are valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransferServiceImpl

public TransferServiceImpl()
Method Detail

setTransferServiceImpl2

public void setTransferServiceImpl2(TransferServiceImpl2 transferServiceImpl2)

createTransferTarget

public TransferTarget createTransferTarget(java.lang.String name)
Description copied from interface: TransferService
Creates an in memory transfer target. Before it is used it must be populated with the following values and saved with the saveTransferTarget method. The name of the transfer target must be unique.

Specified by:
createTransferTarget in interface TransferService
Returns:
an in memory transfer target

createAndSaveTransferTarget

public TransferTarget createAndSaveTransferTarget(java.lang.String name,
                                                  java.lang.String title,
                                                  java.lang.String description,
                                                  java.lang.String endpointProtocol,
                                                  java.lang.String endpointHost,
                                                  int endpointPort,
                                                  java.lang.String endpointPath,
                                                  java.lang.String username,
                                                  char[] password)
Description copied from interface: TransferService
Create and save a new transfer target. Creates and saves a new transfer target with a single, but long, method call.

Specified by:
createAndSaveTransferTarget in interface TransferService
Returns:
the newly created transfer target.

getTransferTargets

public java.util.Set getTransferTargets()
Description copied from interface: TransferService
Get all the transfer targets

Specified by:
getTransferTargets in interface TransferService

getTransferTargets

public java.util.Set getTransferTargets(java.lang.String groupName)
Description copied from interface: TransferService
Get All the transfer targets for a particular transfer target group.

Specified by:
getTransferTargets in interface TransferService

deleteTransferTarget

public void deleteTransferTarget(java.lang.String name)
Description copied from interface: TransferService
Delete a transfer target. After calling this method the transfer target will no longer exist.

Specified by:
deleteTransferTarget in interface TransferService

enableTransferTarget

public void enableTransferTarget(java.lang.String name,
                                 boolean enable)
Description copied from interface: TransferService
Enables/Disables the named transfer target

Specified by:
enableTransferTarget in interface TransferService
Parameters:
name - the name of the transfer target
enable - (or false=disable)

targetExists

public boolean targetExists(java.lang.String name)
Description copied from interface: TransferService
Test to see if the target with the specified name exists

Specified by:
targetExists in interface TransferService
Returns:
true if the specified target exists, and false otherwise

getTransferTarget

public TransferTarget getTransferTarget(java.lang.String name)
Description copied from interface: TransferService
Get a transfer target by its name

Specified by:
getTransferTarget in interface TransferService

saveTransferTarget

public TransferTarget saveTransferTarget(TransferTarget update)
Description copied from interface: TransferService
Save TransferTarget, will create a transfer target if it does not already exist or update an existing transfer target. The following properties may be updated: endpointHost, endpointPort, endpointProtocol, endpointPath, username, password, title, description The following properties may not be updated: name, must be specified. nodeRef, if specified will be ignored.

Specified by:
saveTransferTarget in interface TransferService

transferAsync

public void transferAsync(java.lang.String targetName,
                          TransferDefinition definition,
                          TransferCallback[] callbacks)
Description copied from interface: TransferService
Transfer nodes async with callback. The asynchronous version of the transfer method starts a transfer and returns as soon as possible. The transfer callbacks will be called by a different thread to that used to call the transferAsync method so transaction context will be different to the calling context. The asychronous transfer does not have access to uncommitted data in the calling transaction.

Specified by:
transferAsync in interface TransferService
Parameters:
targetName - the name of the target to transfer to
definition - - the definition of the transfer. Specifies which nodes to transfer. The following properties must be set, nodes
callbacks - - a collection of callback handlers that will be called as transfer proceeds. May be null.

transferAsync

public void transferAsync(java.lang.String targetName,
                          TransferDefinition definition,
                          java.util.Collection callbacks)
Description copied from interface: TransferService
Transfer nodes async with callback. The asynchronous version of the transfer method starts a transfer and returns as soon as possible. The transfer callbacks will be called by a different thread to that used to call the transferAsync method so transaction context will be different to the calling context. The asychronous transfer does not have access to uncommitted data in the calling transaction.

Specified by:
transferAsync in interface TransferService
Parameters:
targetName - the name of the target to transfer to
definition - - the definition of the transfer. Specifies which nodes to transfer. The following properties must be set, nodes
callbacks - - a collection of callback handlers that will be called as transfer proceeds. May be null.

transfer

public org.alfresco.service.cmr.repository.NodeRef transfer(java.lang.String targetName,
                                                            TransferDefinition definition)
Description copied from interface: TransferService
Transfer nodes, sync. This synchronous version of the transfer method waits for the transfer to complete before returning to the caller. Callbacks are called in the current thread context, so will be associated with the current transaction and user.

Specified by:
transfer in interface TransferService
Parameters:
targetName - the name of the target to transfer to The following properties must be set, nodes
Returns:
the node reference of the transfer report

transfer

public org.alfresco.service.cmr.repository.NodeRef transfer(java.lang.String targetName,
                                                            TransferDefinition definition,
                                                            TransferCallback[] callbacks)
Description copied from interface: TransferService
Transfer nodes sync, with callback. This synchronous version of the transfer method waits for the transfer to complete before returning to the caller. Callbacks are called in the current thread context, so will be associated with the current transaction and user.

Specified by:
transfer in interface TransferService
Parameters:
targetName - the name of the target to transfer to
definition - - the definition of the transfer. Specifies which nodes to transfer. The following properties must be set, nodes
callbacks - - a list of callback handlers that will be called as transfer proceeds. May be null.
Returns:
the node reference of the transfer report

transfer

public org.alfresco.service.cmr.repository.NodeRef transfer(java.lang.String targetName,
                                                            TransferDefinition definition,
                                                            java.util.Collection callbacks)
Description copied from interface: TransferService
Transfer nodes sync, with callback. This synchronous version of the transfer method waits for the transfer to complete before returning to the caller. Callbacks are called in the current thread context, so will be associated with the current transaction and user.

Specified by:
transfer in interface TransferService
Parameters:
targetName - the name of the target to transfer to
definition - - the definition of the transfer. Specifies which nodes to transfer. The following properties must be set, nodes
callbacks - - a set of callback handlers that will be called as transfer proceeds. May be null.
Returns:
the node reference of the transfer report

verify

public void verify(TransferTarget target)
            throws TransferException
Description copied from interface: TransferService
Verify a target is available and that the configured credentials are valid.

Specified by:
verify in interface TransferService
Throws:
TransferException

cancelAsync

public void cancelAsync(java.lang.String transferId)
Description copied from interface: TransferService
Asynchronously cancel an in-progress transfer This method tells an in-process transfer to give up, rollback and stop as soon as possible. Depending upon the state of the in-progress transfer, the transfer may still complete, despite calling this method, however in most cases the transfer will not complete. Calling this method for a transfer that does not exist, possibly because it has already finished, has no effect and will not throw an exception. The transfer identifier can be obtained from the TransferEventBegin event that is passed to registered callbacks when transfer starts.

Specified by:
cancelAsync in interface TransferService
Parameters:
transferId - the unique identifier of the transfer to cancel.
See Also:
TransferEventBegin;


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