org.alfresco.deployment.impl.server
Class Target

java.lang.Object
  extended by org.alfresco.deployment.impl.server.Target
All Implemented Interfaces:
java.io.Serializable

public class Target
extends java.lang.Object
implements java.io.Serializable

This class manages the metadata for a Target in the FSR.

See Also:
Serialized Form

Constructor Summary
Target(java.lang.String name, java.lang.String metadataDirectory)
          Make one up.
 
Method Summary
 void cloneMetaData(Deployment deployment)
          Clone and update all the metadata files for the commit phase of a deployment.
 void commitMetaData(Deployment deployment)
          Commit cloned metadata.
 java.util.SortedSet getListing(java.lang.String path)
          Get the metadata listing for a directory
 java.lang.String getMetaDataDirectory()
          Get the meta data directory.
 java.lang.String getName()
          Get the target name.
 boolean isBusy()
           
 FileDescriptor lookupMetadataFile(java.lang.String path, java.lang.String fileName)
          Looks up the metadata for the specified file.
 void rollbackMetaData()
          Roll back metadata changes.
 void setBusy(boolean busy)
          set that this target is busy
 boolean validateMetaData(java.lang.String rootDir, boolean autoFix)
          Validate the metadata 1) Checks whether files and directories have been deleted from the destination filesystem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Target

public Target(java.lang.String name,
              java.lang.String metadataDirectory)
Make one up.

Parameters:
name -
root -
metadata -
Method Detail

validateMetaData

public boolean validateMetaData(java.lang.String rootDir,
                                boolean autoFix)
Validate the metadata 1) Checks whether files and directories have been deleted from the destination filesystem. 2) Checks whether metadata can be read from disk (metadata may be corrupt or otherwise unreadable). 3) Checks whether files and directories are of correct type (a file may have replaced a dir and vice versa)

Parameters:
fixit - if true then the validator will attempt to fix the problem
Returns:
true meta data has had an error (the problem may have been fixed if fixit==true)

getName

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

Returns:

getMetaDataDirectory

public java.lang.String getMetaDataDirectory()
Get the meta data directory.

Returns:

lookupMetadataFile

public FileDescriptor lookupMetadataFile(java.lang.String path,
                                         java.lang.String fileName)
Looks up the metadata for the specified file. Returns the file descriptor from meta-data.

Parameters:
path -
Returns:
the file descriptor or null if the file does not exist in the metadata

getListing

public java.util.SortedSet getListing(java.lang.String path)
Get the metadata listing for a directory

Parameters:
path -
Returns:
the listng for the specified directory
Throws:
DeploymentException - - the directory does not exist

cloneMetaData

public void cloneMetaData(Deployment deployment)
Clone and update all the metadata files for the commit phase of a deployment.

Parameters:
deployment - the deployment

rollbackMetaData

public void rollbackMetaData()
Roll back metadata changes.


commitMetaData

public void commitMetaData(Deployment deployment)
Commit cloned metadata.


setBusy

public void setBusy(boolean busy)
set that this target is busy


isBusy

public boolean isBusy()


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