Class JobWorkspaceRestore
- java.lang.Object
-
- java.lang.Thread
-
- org.exoplatform.services.jcr.ext.backup.impl.JobWorkspaceRestore
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
JobExistingWorkspaceRestore,JobExistingWorkspaceSameConfigRestore
public class JobWorkspaceRestore extends Thread
Created by The eXo Platform SAS.
Date: 24.02.2009- Version:
- $Id: WorkspaceRestore.java 111 2008-11-11 11:11:11Z rainf0x $
- Author:
- Alex Reshetnyak
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected FilebackupChainLogFileThe file with BackupChainLog for restore.protected StringrepositoryNameThe destination repository.protected org.exoplatform.services.jcr.RepositoryServicerepositoryServiceThe repository service.static intRESTORE_FAILRESTORE_FAIL.static intRESTORE_INITIALIZEDRESTORE_STARTED.static intRESTORE_STARTEDRESTORE_STARTED.static intRESTORE_SUCCESSFULRESTORE_SUCCESSFUL.protected org.exoplatform.services.jcr.config.WorkspaceEntrywEntryThe WorkspaceEntry to restored workspace.-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description JobWorkspaceRestore(org.exoplatform.services.jcr.RepositoryService repositoryService, BackupManager backupManager, String repositoryName, File logFile, org.exoplatform.services.jcr.config.WorkspaceEntry wEntry)JobWorkspaceRestore constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BackupChainLoggetBackupChainLog()getBackupChainLog.CalendargetEndTime()getEndTime.StringgetRepositoryName()getRepositoryName.ThrowablegetRestoreException()getRestoreException.CalendargetStartTime()getBeginTime.intgetStateRestore()getStateRestore.org.exoplatform.services.jcr.config.WorkspaceEntrygetWorkspaceEntry()getWorkspaceEntryStringgetWorkspaceName()getWorkspaceName.protected voidremoveWorkspace(org.exoplatform.services.jcr.core.ManageableRepository mr, String workspaceName)Remove workspace.protected voidrestore()Will be restored the workspace.protected voidrestoreWorkspace()Will be restored the workspace.voidrun()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
RESTORE_STARTED
public static final int RESTORE_STARTED
RESTORE_STARTED. The state of start restore.- See Also:
- Constant Field Values
-
RESTORE_SUCCESSFUL
public static final int RESTORE_SUCCESSFUL
RESTORE_SUCCESSFUL. The state of restore successful.- See Also:
- Constant Field Values
-
RESTORE_FAIL
public static final int RESTORE_FAIL
RESTORE_FAIL. The state of restore fail.- See Also:
- Constant Field Values
-
RESTORE_INITIALIZED
public static final int RESTORE_INITIALIZED
RESTORE_STARTED. The state of initialized restore.- See Also:
- Constant Field Values
-
repositoryName
protected final String repositoryName
The destination repository.
-
wEntry
protected final org.exoplatform.services.jcr.config.WorkspaceEntry wEntry
The WorkspaceEntry to restored workspace.
-
repositoryService
protected final org.exoplatform.services.jcr.RepositoryService repositoryService
The repository service.
-
backupChainLogFile
protected final File backupChainLogFile
The file with BackupChainLog for restore.
-
-
Constructor Detail
-
JobWorkspaceRestore
public JobWorkspaceRestore(org.exoplatform.services.jcr.RepositoryService repositoryService, BackupManager backupManager, String repositoryName, File logFile, org.exoplatform.services.jcr.config.WorkspaceEntry wEntry)JobWorkspaceRestore constructor.- Parameters:
repositoryService- the RepositoryServicebackupManager- the BackupManagerrepositoryName- the destination repositorylogFile- the backup chain logwEntry- the workspace entry
-
-
Method Detail
-
restore
protected final void restore() throws ThrowableWill be restored the workspace.- Throws:
Throwable- will be generated the Throwable
-
restoreWorkspace
protected void restoreWorkspace() throws ThrowableWill be restored the workspace.- Throws:
Throwable- will be generated the Throwable
-
removeWorkspace
protected void removeWorkspace(org.exoplatform.services.jcr.core.ManageableRepository mr, String workspaceName) throws javax.jcr.RepositoryExceptionRemove workspace.- Parameters:
mr- ManageableRepository, the manageable repositoryworkspaceName- String, the workspace name- Throws:
javax.jcr.RepositoryException- will be generated the RepositoryException
-
getRestoreException
public Throwable getRestoreException()
getRestoreException.- Returns:
- Throwable return the exception of restore.
-
getStateRestore
public int getStateRestore()
getStateRestore.- Returns:
- int return state of restore.
-
getStartTime
public Calendar getStartTime()
getBeginTime.- Returns:
- Calendar return the start time of restore
-
getEndTime
public Calendar getEndTime()
getEndTime.- Returns:
- Calendar return the end time of restore
-
getBackupChainLog
public BackupChainLog getBackupChainLog() throws BackupOperationException
getBackupChainLog.- Returns:
- BackupChainLog return the backup chain log for this restore.
- Throws:
BackupOperationException
-
getRepositoryName
public String getRepositoryName()
getRepositoryName.- Returns:
- String the name of destination repository
-
getWorkspaceName
public String getWorkspaceName()
getWorkspaceName.- Returns:
- String the name of destination workspace
-
getWorkspaceEntry
public org.exoplatform.services.jcr.config.WorkspaceEntry getWorkspaceEntry()
getWorkspaceEntry- Returns:
- WorkspaceEntry
-
-