org.wso2.carbon.registry.synchronization
Class RegistrySynchronizer

java.lang.Object
  extended by org.wso2.carbon.registry.synchronization.RegistrySynchronizer

public final class RegistrySynchronizer
extends java.lang.Object

An interface to the synchronization API of the Registry Kernel. Using the methods of this class, it is possible to synchronize a Registry with the filesystem and vice versa.

Three synchronization operations are currently supported. These are, checkIn(org.wso2.carbon.registry.core.session.UserRegistry, java.lang.String, java.lang.String, boolean, boolean), checkOut(org.wso2.carbon.registry.core.session.UserRegistry, java.lang.String, java.lang.String) and update(org.wso2.carbon.registry.core.session.UserRegistry, java.lang.String).


Method Summary
static void checkIn(UserRegistry registry, java.lang.String filePath)
          Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.
static void checkIn(UserRegistry registry, java.lang.String filePath, boolean ignoreConflicts)
          Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.
static void checkIn(UserRegistry registry, java.lang.String filePath, java.lang.String registryPath)
          Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.
static void checkIn(UserRegistry registry, java.lang.String filePath, java.lang.String registryPath, boolean ignoreConflicts)
          Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.
static void checkIn(UserRegistry registry, java.lang.String filePath, java.lang.String registryPath, boolean ignoreConflicts, boolean forcedCheckIn)
          Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.
static void checkOut(UserRegistry registry, java.lang.String filePath, java.lang.String resourcePath)
          Method to check-out some resources and collections on a registry into a filesystem which will create some files and directories in the process.
static boolean isCheckedOut(java.lang.String directoryPath)
          Method to determine whether a check-out has already been made at the given directory location.
static void update(UserRegistry registry, java.lang.String filePath)
          Method to update an already checked out resource or collection to the latest version found on the specified registry instance.
static void update(UserRegistry registry, java.lang.String filePath, boolean ignoreConflicts)
          Method to update an already checked out resource or collection to the latest version found on the specified registry instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkIn

public static void checkIn(UserRegistry registry,
                           java.lang.String filePath,
                           java.lang.String registryPath,
                           boolean ignoreConflicts,
                           boolean forcedCheckIn)
                    throws SynchronizationException
Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.

Parameters:
registry - the registry instance to be used.
filePath - the path on the filesystem containing the corresponding resources and collections.
registryPath - the target path of the registry that check-in should be done.
ignoreConflicts - to ignore the conflicts
forcedCheckIn - check-in the changes irrespective of whether the content has changed or not.
Throws:
SynchronizationException - if an error occurred while performing the operation.

checkIn

public static void checkIn(UserRegistry registry,
                           java.lang.String filePath,
                           java.lang.String registryPath,
                           boolean ignoreConflicts)
                    throws SynchronizationException
Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.

Parameters:
registry - the registry instance to be used.
filePath - the path on the filesystem containing the corresponding resources and collections.
registryPath - the target path of the registry that check-in should be done.
ignoreConflicts - to ignore the conflicts
Throws:
SynchronizationException - if an error occurred while performing the operation.

checkIn

public static void checkIn(UserRegistry registry,
                           java.lang.String filePath,
                           java.lang.String registryPath)
                    throws SynchronizationException
Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.

Parameters:
registry - the registry instance to be used.
filePath - the path on the filesystem containing the corresponding resources and collections.
registryPath - the target path of the registry that check-in should be done.
Throws:
SynchronizationException - if an error occurred while performing the operation.

checkIn

public static void checkIn(UserRegistry registry,
                           java.lang.String filePath)
                    throws SynchronizationException
Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.

Parameters:
registry - the registry instance to be used.
filePath - the path on the filesystem containing the corresponding resources and collections.
Throws:
SynchronizationException - if an error occurred while performing the operation.

checkIn

public static void checkIn(UserRegistry registry,
                           java.lang.String filePath,
                           boolean ignoreConflicts)
                    throws SynchronizationException
Method to check-in some filesystem based resources and collections (which are files and directories), into a specified registry instance.

Parameters:
registry - the registry instance to be used.
filePath - the path on the filesystem containing the corresponding resources and collections.
ignoreConflicts - to ignore the conflicts
Throws:
SynchronizationException - if an error occurred while performing the operation.

checkOut

public static void checkOut(UserRegistry registry,
                            java.lang.String filePath,
                            java.lang.String resourcePath)
                     throws SynchronizationException
Method to check-out some resources and collections on a registry into a filesystem which will create some files and directories in the process. This will also create some metadata directories which will be used in future check-in and update operations.

Parameters:
registry - the registry instance to be used.
filePath - the path on the filesystem to which the corresponding resources and collections will be checked out.
resourcePath - the path on the registry instance where the resources and the collections can be found.
Throws:
SynchronizationException - if an error occurred while performing the operation.

update

public static void update(UserRegistry registry,
                          java.lang.String filePath)
                   throws SynchronizationException
Method to update an already checked out resource or collection to the latest version found on the specified registry instance.

Parameters:
registry - the registry instance to be used.
filePath - the path on the filesystem containing the corresponding resources and collections.
Throws:
SynchronizationException - if an error occurred while performing the operation.

update

public static void update(UserRegistry registry,
                          java.lang.String filePath,
                          boolean ignoreConflicts)
                   throws SynchronizationException
Method to update an already checked out resource or collection to the latest version found on the specified registry instance. In the case of the update(UserRegistry, String) command, a .mine and a .server file will be created if a conflict occurred. However, in this method, you could specify whether conflicts should simply be ignored.

Parameters:
registry - the registry instance to be used.
filePath - the path on the filesystem containing the corresponding resources and collections.
ignoreConflicts - ignore any conflicts, and avoid creating .mine and .server files.
Throws:
SynchronizationException - if an error occurred while performing the operation.

isCheckedOut

public static boolean isCheckedOut(java.lang.String directoryPath)
Method to determine whether a check-out has already been made at the given directory location.

Parameters:
directoryPath - the path of the directory on the filesystem
Returns:
true if a check-out has been made at the given path.


Copyright © 2011 WSO2 Inc. All Rights Reserved.