org.alfresco.repo.node.archive
Class NodeArchiveServiceImpl

java.lang.Object
  extended by org.alfresco.repo.node.archive.NodeArchiveServiceImpl
All Implemented Interfaces:
NodeArchiveService

public class NodeArchiveServiceImpl
extends java.lang.Object
implements NodeArchiveService

Implementation of the node archive abstraction.


Constructor Summary
NodeArchiveServiceImpl()
           
 
Method Summary
 NodeRef getArchivedNode(NodeRef originalNodeRef)
          Get the likely node reference for the original node.
 NodeRef getStoreArchiveNode(StoreRef originalStoreRef)
          Get the parent node that holds all nodes archived from the given store.
 void purgeAllArchivedNodes(StoreRef originalStoreRef)
          Permanently delete all archived nodes.
 void purgeArchivedNode(NodeRef archivedNodeRef)
          This is the primary purge methd that all purge methods fall back on.
 void purgeArchivedNodes(java.util.List archivedNodes)
          Permanently delete the archived nodes.
 java.util.List restoreAllArchivedNodes(StoreRef originalStoreRef)
          Attempt to restore all archived nodes into their original locations.
 java.util.List restoreAllArchivedNodes(StoreRef originalStoreRef, NodeRef destinationNodeRef, QName assocTypeQName, QName assocQName)
          Finds the archive location for nodes that were deleted from the given store and attempt to restore each node.
 RestoreNodeReport restoreArchivedNode(NodeRef archivedNodeRef)
          Attempt to restore the given archived node into its original location.
 RestoreNodeReport restoreArchivedNode(NodeRef archivedNodeRef, NodeRef destinationNodeRef, QName assocTypeQName, QName assocQName)
          This is the primary restore method that all restore methods fall back on.
 java.util.List restoreArchivedNodes(java.util.List archivedNodeRefs)
          Attempt to restore a list of archived nodes into their original locations, using the original association types and names.
 java.util.List restoreArchivedNodes(java.util.List archivedNodeRefs, NodeRef destinationNodeRef, QName assocTypeQName, QName assocQName)
          Attempt to restore a list of archived nodes into a new location.
 void setNodeService(NodeService nodeService)
           
 void setSearchService(SearchService searchService)
           
 void setTransactionService(TransactionService transactionService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeArchiveServiceImpl

public NodeArchiveServiceImpl()
Method Detail

setNodeService

public void setNodeService(NodeService nodeService)

setTransactionService

public void setTransactionService(TransactionService transactionService)

setSearchService

public void setSearchService(SearchService searchService)

getStoreArchiveNode

public NodeRef getStoreArchiveNode(StoreRef originalStoreRef)
Description copied from interface: NodeArchiveService
Get the parent node that holds all nodes archived from the given store.

Specified by:
getStoreArchiveNode in interface NodeArchiveService
Returns:
Returns the parent of the archived nodes, or null if archiving is not configured for the store

getArchivedNode

public NodeRef getArchivedNode(NodeRef originalNodeRef)
Description copied from interface: NodeArchiveService
Get the likely node reference for the original node. There is no guarantee that the node exists in the archive store.

Specified by:
getArchivedNode in interface NodeArchiveService
Parameters:
originalNodeRef - the original node reference
Returns:
Returns the node ref of the node if it was archived.

restoreArchivedNode

public RestoreNodeReport restoreArchivedNode(NodeRef archivedNodeRef,
                                             NodeRef destinationNodeRef,
                                             QName assocTypeQName,
                                             QName assocQName)
This is the primary restore method that all restore methods fall back on. It executes the restore for the node in a separate transaction and attempts to catch the known conditions that can be reported back to the client.

Specified by:
restoreArchivedNode in interface NodeArchiveService
Parameters:
archivedNodeRef - the node's reference in the archive. This must be valid.
destinationNodeRef - the parent of the restored node, or null to use the original parent node reference
assocTypeQName - the type of the primary association to link the restored node to the destination parent, or null to use the orginal association type
assocQName - the name of the primary association to be created, or null to use the original association name
Returns:
Returns the results of the restore operation

restoreArchivedNode

public RestoreNodeReport restoreArchivedNode(NodeRef archivedNodeRef)
Description copied from interface: NodeArchiveService
Attempt to restore the given archived node into its original location.

TRANSACTIONS: This method will execute in a new transaction.

Specified by:
restoreArchivedNode in interface NodeArchiveService
Parameters:
archivedNodeRef - the node's reference in the archive
Returns:
Returns the results of the restore operation
See Also:
NodeArchiveServiceImpl.restoreArchivedNode(NodeRef, NodeRef, QName, QName)

restoreArchivedNodes

public java.util.List restoreArchivedNodes(java.util.List archivedNodeRefs)
Description copied from interface: NodeArchiveService
Attempt to restore a list of archived nodes into their original locations, using the original association types and names.

TRANSACTIONS: This method will execute in a new transaction.

Specified by:
restoreArchivedNodes in interface NodeArchiveService
Parameters:
archivedNodeRefs - the nodes' references in the archive. These must be valid.
Returns:
Returns the results of the each attempted restore operation
See Also:
NodeArchiveServiceImpl.restoreArchivedNodes(List, NodeRef, QName, QName)

restoreArchivedNodes

public java.util.List restoreArchivedNodes(java.util.List archivedNodeRefs,
                                           NodeRef destinationNodeRef,
                                           QName assocTypeQName,
                                           QName assocQName)
Description copied from interface: NodeArchiveService
Attempt to restore a list of archived nodes into a new location.

TRANSACTIONS: This method will execute in a new transaction.

Specified by:
restoreArchivedNodes in interface NodeArchiveService
Parameters:
archivedNodeRefs - the nodes' references in the archive. These must be valid.
destinationNodeRef - the parent of the restored nodes, or null to use the original parent node references
assocTypeQName - the type of the primary associations to link the restored node to the destination parent, or null to use the orginal association types
assocQName - the name of the primary associations to be created, or null to use the original association names
Returns:
Returns the results of the each attempted restore operation
See Also:
NodeArchiveServiceImpl.restoreArchivedNode(NodeRef, NodeRef, QName, QName)

restoreAllArchivedNodes

public java.util.List restoreAllArchivedNodes(StoreRef originalStoreRef)
Description copied from interface: NodeArchiveService
Attempt to restore all archived nodes into their original locations.

TRANSACTIONS: This method will execute in a new transaction.

Specified by:
restoreAllArchivedNodes in interface NodeArchiveService
Parameters:
originalStoreRef - the store that the items originally came from
Returns:
Returns the results of the each attempted restore operation
See Also:
NodeArchiveServiceImpl.restoreAllArchivedNodes(StoreRef, NodeRef, QName, QName)

restoreAllArchivedNodes

public java.util.List restoreAllArchivedNodes(StoreRef originalStoreRef,
                                              NodeRef destinationNodeRef,
                                              QName assocTypeQName,
                                              QName assocQName)
Finds the archive location for nodes that were deleted from the given store and attempt to restore each node.

Specified by:
restoreAllArchivedNodes in interface NodeArchiveService
Parameters:
originalStoreRef - the store that the items originally came from
destinationNodeRef - the parent of the restored nodes, or null to use the original parent node references
assocTypeQName - the type of the primary associations to link the restored node to the destination parent, or null to use the orginal association types
assocQName - the name of the primary associations to be created, or null to use the original association names
Returns:
Returns the results of the each attempted restore operation
See Also:
NodeService.getStoreArchiveNode(StoreRef), NodeArchiveServiceImpl.restoreArchivedNode(NodeRef, NodeRef, QName, QName)

purgeArchivedNode

public void purgeArchivedNode(NodeRef archivedNodeRef)
This is the primary purge methd that all purge methods fall back on. It isolates the delete work in a new transaction.

Specified by:
purgeArchivedNode in interface NodeArchiveService
Parameters:
archivedNodeRef - the archived node to delete.

purgeArchivedNodes

public void purgeArchivedNodes(java.util.List archivedNodes)
Description copied from interface: NodeArchiveService
Permanently delete the archived nodes.

Specified by:
purgeArchivedNodes in interface NodeArchiveService
Parameters:
archivedNodes - the archived nodes to delete.
See Also:
NodeArchiveServiceImpl.purgeArchivedNode(NodeRef)

purgeAllArchivedNodes

public void purgeAllArchivedNodes(StoreRef originalStoreRef)
Description copied from interface: NodeArchiveService
Permanently delete all archived nodes.

Specified by:
purgeAllArchivedNodes in interface NodeArchiveService
Parameters:
originalStoreRef - the store that the items originally came from


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