eXo JCR :: Component :: Extension Service 1.16.0-CR2

org.exoplatform.services.jcr.ext.backup.impl
Class JobWorkspaceRestore

java.lang.Object
  extended by java.lang.Thread
      extended by 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
protected  File backupChainLogFile
          The file with BackupChainLog for restore.
protected  String repositoryName
          The destination repository.
protected  RepositoryService repositoryService
          The repository service.
static int RESTORE_FAIL
          RESTORE_FAIL.
static int RESTORE_INITIALIZED
          RESTORE_STARTED.
static int RESTORE_STARTED
          RESTORE_STARTED.
static int RESTORE_SUCCESSFUL
          RESTORE_SUCCESSFUL.
protected  WorkspaceEntry wEntry
          The WorkspaceEntry to restored workspace.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JobWorkspaceRestore(RepositoryService repositoryService, BackupManager backupManager, String repositoryName, File logFile, WorkspaceEntry wEntry)
          JobWorkspaceRestore constructor.
 
Method Summary
 BackupChainLog getBackupChainLog()
          getBackupChainLog.
 Calendar getEndTime()
          getEndTime.
 String getRepositoryName()
          getRepositoryName.
 Throwable getRestoreException()
          getRestoreException.
 Calendar getStartTime()
          getBeginTime.
 int getStateRestore()
          getStateRestore.
 WorkspaceEntry getWorkspaceEntry()
          getWorkspaceEntry
 String getWorkspaceName()
          getWorkspaceName.
protected  void removeWorkspace(ManageableRepository mr, String workspaceName)
          Remove workspace.
protected  void restore()
          Will be restored the workspace.
protected  void restoreWorkspace()
          Will be restored the workspace.
 void run()
          
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 WorkspaceEntry wEntry
The WorkspaceEntry to restored workspace.


repositoryService

protected final RepositoryService repositoryService
The repository service.


backupChainLogFile

protected final File backupChainLogFile
The file with BackupChainLog for restore.

Constructor Detail

JobWorkspaceRestore

public JobWorkspaceRestore(RepositoryService repositoryService,
                           BackupManager backupManager,
                           String repositoryName,
                           File logFile,
                           WorkspaceEntry wEntry)
JobWorkspaceRestore constructor.

Parameters:
repositoryService - the RepositoryService
backupManager - the BackupManager
repositoryName - the destination repository
log - the backup chain log
wEntry - the workspace entry
Method Detail

run

public void run()

Specified by:
run in interface Runnable
Overrides:
run in class Thread

restore

protected final void restore()
                      throws Throwable
Will be restored the workspace.

Throws:
Throwable - will be generated the Throwable

restoreWorkspace

protected void restoreWorkspace()
                         throws Throwable
Will be restored the workspace.

Throws:
Throwable - will be generated the Throwable

removeWorkspace

protected void removeWorkspace(ManageableRepository mr,
                               String workspaceName)
                        throws javax.jcr.RepositoryException
Remove workspace.

Parameters:
mr - ManageableRepository, the manageable repository
workspaceName - 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 WorkspaceEntry getWorkspaceEntry()
getWorkspaceEntry

Returns:
WorkspaceEntry

eXo JCR :: Component :: Extension Service 1.16.0-CR2

Copyright © 2014 eXo Platform SAS. All Rights Reserved.