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

java.lang.Object
  extended by org.exoplatform.services.jcr.ext.backup.impl.AbstractBackupJob
All Implemented Interfaces:
java.lang.Runnable, BackupJob
Direct Known Subclasses:
AbstractFullBackupJob, AbstractIncrementalBackupJob

public abstract class AbstractBackupJob
extends java.lang.Object
implements BackupJob

Created by The eXo Platform SAS Date: 05.02.2008

Version:
$Id: AbstractBackupJob.java 35186 2009-08-07 14:23:43Z pnedonosko $
Author:
Peter Nedonosko

Field Summary
protected  BackupConfig config
           
protected  int id
           
protected  ManageableRepository repository
           
protected  int state
           
protected  java.util.Calendar timeStamp
           
protected  java.net.URL url
           
protected  java.lang.String workspaceName
           
 
Fields inherited from interface org.exoplatform.services.jcr.ext.backup.BackupJob
FINISHED, FULL, INCREMENTAL, STARTING, WAITING, WORKING
 
Constructor Summary
AbstractBackupJob()
           
 
Method Summary
 void addListener(BackupJobListener listener)
           
protected abstract  java.net.URL createStorage()
          This method is called by run() and resume() Backup implementation knows how to create new storage
 int getId()
           
 int getState()
           
 java.net.URL getStorageURL()
           
protected  void notifyError(java.lang.String message, java.lang.Throwable error)
          Notify all listeners about an error
protected  void notifyListeners()
          Notify all listeners about the job state changed
 void removeListener(BackupJobListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exoplatform.services.jcr.ext.backup.BackupJob
getType, init, stop
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

state

protected int state

id

protected int id

config

protected BackupConfig config

repository

protected ManageableRepository repository

workspaceName

protected java.lang.String workspaceName

timeStamp

protected java.util.Calendar timeStamp

url

protected java.net.URL url
Constructor Detail

AbstractBackupJob

public AbstractBackupJob()
Method Detail

createStorage

protected abstract java.net.URL createStorage()
                                       throws java.io.FileNotFoundException,
                                              java.io.IOException
This method is called by run() and resume() Backup implementation knows how to create new storage

Returns:
URL of new storage
Throws:
java.io.FileNotFoundException
java.io.IOException

getStorageURL

public final java.net.URL getStorageURL()
Specified by:
getStorageURL in interface BackupJob
See Also:
BackupJob.getStorageURL()

getState

public final int getState()
Specified by:
getState in interface BackupJob

getId

public final int getId()
Specified by:
getId in interface BackupJob

addListener

public void addListener(BackupJobListener listener)
Specified by:
addListener in interface BackupJob

removeListener

public void removeListener(BackupJobListener listener)
Specified by:
removeListener in interface BackupJob

notifyListeners

protected void notifyListeners()
Notify all listeners about the job state changed


notifyError

protected void notifyError(java.lang.String message,
                           java.lang.Throwable error)
Notify all listeners about an error

Parameters:
error - - Throwable instance


Copyright © 2012 eXo Platform SAS. All Rights Reserved.