Class DeploymentSynchronizer
java.lang.Object
org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizer
This class is responsible for maintaining a repository in the local file system in sync with a
remote repository. The local repository could be an artifact repository used by Carbon, Axis2 or
Synapse. In fact it could be any directory hierarchy in the local file system. The remote repository
could be a registry instance, a version control system or an online data storage service. This
implementation can commit the changes in the local file system to the remote repository, and
checkout any updated artifacts from the repository to the local file system. Commit operations
and checkout operations are synchronized so that both operations will never run at the same time.
This implementation also supports triggering checkouts on events.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckout()Checkout the artifacts stored in the repository to the file system.booleanDeprecated.booleancommit()Commit the artifacts in the file system repository to the remote repositorybooleanCommit the artifacts from the given path in the file system repository to the remote repositoryvoidlonglongbooleanbooleanbooleanvoidrequestCheckout(long timestamp) Notify the synchronizer that a checkout needs to be performed.voidsetAutoCheckout(boolean autoCheckout) voidsetAutoCommit(boolean autoCommit) voidsetPeriod(long period) voidsetUseEventing(boolean useEventing) voidstart()Start this DeploymentSynchronizer instance.voidstop()voidsync()booleanDeprecated.booleanDeprecated.
-
Method Details
-
start
public void start()Start this DeploymentSynchronizer instance. If the autoCommit and autoCheckout modes are not enabled, this method will do nothing. If such additional features are enabled, this method will schedule the necessary periodic tasks and get the auto-sync tasks up and running. -
stop
public void stop() -
commit
Commit the artifacts in the file system repository to the remote repository- Throws:
DeploymentSynchronizerException- If an error occurs while committing the artifacts
-
commit
Commit the artifacts from the given path in the file system repository to the remote repository- Throws:
DeploymentSynchronizerException- If an error occurs while committing the artifacts
-
checkout
Checkout the artifacts stored in the repository to the file system. If the artifacts have already been checked out, an update will be executed instead.- Throws:
DeploymentSynchronizerException- If an error occurs while checking out or updating the resources
-
checkout
@Deprecated public boolean checkout(String filePath, int depth) throws DeploymentSynchronizerException Deprecated.This method is deprecated. ReferArtifactRepository.checkout(int, String, int)for more info.- Throws:
DeploymentSynchronizerException
-
update
@Deprecated public boolean update(String rootPath, String filePath, int depth) throws DeploymentSynchronizerException Deprecated.Checkout the artifacts stored in the repository to the file system. If the artifacts have already been checked out, an update will be executed instead.- Throws:
DeploymentSynchronizerException- If an error occurs while checking out or updating the resources
-
requestCheckout
public void requestCheckout(long timestamp) Notify the synchronizer that a checkout needs to be performed. This method is mainly used in conjunction with the eventing mode of operation. Once this method is invoked, synchronizer will set a flag to indicate that a checkout needs to be performed. During the next execution of the synchronizer task, the checkout will be performed and the flag will be unset.- Parameters:
timestamp- A timestamp corresponding to the time of the notification
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) -
setAutoCheckout
public void setAutoCheckout(boolean autoCheckout) -
setPeriod
public void setPeriod(long period) -
setUseEventing
public void setUseEventing(boolean useEventing) -
isUseEventing
public boolean isUseEventing() -
isAutoCommit
public boolean isAutoCommit() -
isAutoCheckout
public boolean isAutoCheckout() -
getLastCheckoutTime
public long getLastCheckoutTime() -
getLastCommitTime
public long getLastCommitTime() -
getArtifactRepository
-
doInitialSyncUp
- Throws:
DeploymentSynchronizerException
-
syncGhostMetaArtifacts
Deprecated.This method is deprecated. ReferArtifactRepository.checkout(int, String, int)for more info.- Throws:
DeploymentSynchronizerException
-
sync
public void sync()
-