org.jboss.system.server.profileservice.repository.clustered.local.file
Class FilesystemLocalContentManager

java.lang.Object
  extended by org.jboss.system.server.profileservice.repository.clustered.local.AbstractLocalContentManager<FileBasedSynchronizationActionContext>
      extended by org.jboss.system.server.profileservice.repository.clustered.local.file.FilesystemLocalContentManager
All Implemented Interfaces:
LocalContentManager<FileBasedSynchronizationActionContext>

public class FilesystemLocalContentManager
extends AbstractLocalContentManager<FileBasedSynchronizationActionContext>

LocalContentManager that persists to the local filesystem.

Version:
$Revision: $
Author:
Brian Stansberry

Constructor Summary
protected FilesystemLocalContentManager(Map<String,URI> namedURIMap, org.jboss.profileservice.spi.ProfileKey profileKey, String localNodeName, ContentMetadataPersister contentMetadataPersister, URI tempDirURI)
          Create a new FilesystemRepositoryContentPersister.
 
Method Summary
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createDirectoryTimestampMismatchAction(ContentModification mod, boolean localLed)
          Create an action to handle the local end of a node updating a directory timestamp to match the cluster.
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createMkdirFromClusterAction(ContentModification mod, boolean localLed)
          Create an action to handle the local end of a node adding a directory due to its presence on the cluster.
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createMkdirToClusterAction(ContentModification mod, boolean localLed)
          Create an action to handle the local end of a node adding a directory to the cluster.
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPrepareRmdirFromClusterAction(ContentModification mod, boolean localLed)
           
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPrepareRmdirToClusterAction(ContentModification mod, boolean localLed)
          Create an action to handle the local end of a node removing a directory from the cluster.
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPullFromClusterAction(ContentModification mod, boolean localLed)
          Create an action to handle the local end of a node pulling content from the cluster.
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPushStreamToClusterAction(ContentModification mod, InputStream stream)
          Create an action to handle the local end of a node pushing content that is read from an external-to-the-repository stream to the cluster.
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPushToClusterAction(ContentModification mod, boolean localLed)
          Create an action to handle the local end of a node pushing content to the cluster.
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createRemoveFromClusterAction(ContentModification mod, boolean localLed)
          Create an action to handle the local end of a node removing content that the rest of the cluster regards as invalid.
protected  TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createRemoveToClusterAction(ContentModification mod, boolean localLed)
          Create an action to handle the local end of a node removing content from the cluster.
protected  FileBasedSynchronizationActionContext createSynchronizationActionContext(SynchronizationId<?> id, RepositoryContentMetadata toUpdate)
          Create a SynchronizationActionContext for the given cluster-wide content synchronization.
 
Methods inherited from class org.jboss.system.server.profileservice.repository.clustered.local.AbstractLocalContentManager
commitSynchronization, createEmptyContentMetadata, createStoreName, getCachedVirtualFile, getContentMetadataForAdd, getContentMetadataForRemove, getCurrentContentMetadata, getItemForAddition, getLocalNodeName, getOfficialContentMetadata, getRootURIForModification, getStoreName, getSynchronizationActionContext, getVirtualFileForItem, initiateSynchronization, installCurrentContentMetadata, prepareSynchronization, rollbackSynchronization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilesystemLocalContentManager

protected FilesystemLocalContentManager(Map<String,URI> namedURIMap,
                                        org.jboss.profileservice.spi.ProfileKey profileKey,
                                        String localNodeName,
                                        ContentMetadataPersister contentMetadataPersister,
                                        URI tempDirURI)
Create a new FilesystemRepositoryContentPersister.

Parameters:
namedURIMap -
storeName -
localNodeName -
contentMetadataPersister -
Method Detail

createSynchronizationActionContext

protected FileBasedSynchronizationActionContext createSynchronizationActionContext(SynchronizationId<?> id,
                                                                                   RepositoryContentMetadata toUpdate)
Description copied from class: AbstractLocalContentManager
Create a SynchronizationActionContext for the given cluster-wide content synchronization.

Specified by:
createSynchronizationActionContext in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
id - the id of the synchronization
toUpdate - metadata object that should be updated as synchronization actions are performed.

createPullFromClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPullFromClusterAction(ContentModification mod,
                                                                                                  boolean localLed)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node pulling content from the cluster.

Specified by:
createPullFromClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
localLed - true if this node is driving the synchronization process the action is part of; false if another node is
Returns:
the action. Will not return null.

createPushToClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPushToClusterAction(ContentModification mod,
                                                                                                boolean localLed)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node pushing content to the cluster.

Specified by:
createPushToClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
localLed - true if this node is driving the synchronization process the action is part of; false if another node is
Returns:
the action. Will not return null.

createPushStreamToClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPushStreamToClusterAction(ContentModification mod,
                                                                                                      InputStream stream)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node pushing content that is read from an external-to-the-repository stream to the cluster. Used to handle installation of content to the repository via DeploymentRepository.addDeployment(String, org.jboss.profileservice.spi.ProfileDeployment).

This is only invoked on the node that is driving the synchronization process.

Specified by:
createPushStreamToClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
stream - the stream from which content will be read.
Returns:
an action that will handle both the local end of pushing the stream content to other nodes in the cluster and storing the stream content in this node's repository. Will not return null.

createRemoveFromClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createRemoveFromClusterAction(ContentModification mod,
                                                                                                    boolean localLed)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node removing content that the rest of the cluster regards as invalid.

Specified by:
createRemoveFromClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
localLed - true if this node is driving the synchronization process the action is part of; false if another node is
Returns:
the action. Will not return null.

createRemoveToClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createRemoveToClusterAction(ContentModification mod,
                                                                                                  boolean localLed)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node removing content from the cluster.

Specified by:
createRemoveToClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
localLed - true if this node is driving the synchronization process the action is part of; false if another node is
Returns:
the action. Will not return null.

createDirectoryTimestampMismatchAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createDirectoryTimestampMismatchAction(ContentModification mod,
                                                                                                             boolean localLed)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node updating a directory timestamp to match the cluster.

Specified by:
createDirectoryTimestampMismatchAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
localLed - true if this node is driving the synchronization process the action is part of; false if another node is
Returns:
the action. Will not return null.

createMkdirFromClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createMkdirFromClusterAction(ContentModification mod,
                                                                                                   boolean localLed)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node adding a directory due to its presence on the cluster.

Specified by:
createMkdirFromClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
localLed - true if this node is driving the synchronization process the action is part of; false if another node is
Returns:
the action. Will not return null.

createMkdirToClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createMkdirToClusterAction(ContentModification mod,
                                                                                                 boolean localLed)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node adding a directory to the cluster.

Specified by:
createMkdirToClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
localLed - true if this node is driving the synchronization process the action is part of; false if another node is
Returns:
the action. Will not return null.

createPrepareRmdirFromClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPrepareRmdirFromClusterAction(ContentModification mod,
                                                                                                          boolean localLed)
Specified by:
createPrepareRmdirFromClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>

createPrepareRmdirToClusterAction

protected TwoPhaseCommitAction<FileBasedSynchronizationActionContext> createPrepareRmdirToClusterAction(ContentModification mod,
                                                                                                        boolean localLed)
Description copied from class: AbstractLocalContentManager
Create an action to handle the local end of a node removing a directory from the cluster.

Specified by:
createPrepareRmdirToClusterAction in class AbstractLocalContentManager<FileBasedSynchronizationActionContext>
Parameters:
mod - object describing the content modification this action is part of
localLed - true if this node is driving the synchronization process the action is part of; false if another node is
Returns:
the action. Will not return null.


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.