org.neo4j.onlinebackup
Class Neo4jBackup

java.lang.Object
  extended by org.neo4j.onlinebackup.Neo4jBackup
All Implemented Interfaces:
Backup

public class Neo4jBackup
extends Object
implements Backup

Online backup implementation for Neo4j.


Method Summary
static Backup allDataSources(EmbeddedGraphDatabase source, EmbeddedGraphDatabase destination)
          Backup from a running EmbeddedGraphDatabase to another running EmbeddedGraphDatabase.
static Backup allDataSources(EmbeddedGraphDatabase source, String destinationDir)
          Backup from a running EmbeddedGraphDatabase to a destination directory.
static Backup customDataSources(EmbeddedGraphDatabase source, EmbeddedGraphDatabase destination, String... xaDataSourceNames)
          Backup from a running EmbeddedGraphDatabase to another running EmbeddedGraphDatabase.
static Backup customDataSources(EmbeddedGraphDatabase source, String destinationDir, String... xaDataSourceNames)
          Backup from a running EmbeddedGraphDatabase to a destination directory.
 void disableFileLogger()
          Disable logging to file.
 void doBackup()
          Perform the backup.
 void enableFileLogger()
          Enable logging to file.
 void enableFileLogger(FileHandler handler)
          Enable a user-provided FileHandler
 void enableFileLogger(String filename)
          Enable logging to the specified file.
static Backup neo4jDataSource(EmbeddedGraphDatabase source, EmbeddedGraphDatabase destination)
          Backup from a running EmbeddedGraphDatabase to another running EmbeddedGraphDatabase.
static Backup neo4jDataSource(EmbeddedGraphDatabase source, String destinationDir)
          Backup from a running EmbeddedGraphDatabase to a destination directory.
 void setLogLevelDebug()
          Enable debug logging.
 void setLogLevelNormal()
          Set logging to normal.
 void setLogLevelOff()
          Turn off all logging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

neo4jDataSource

public static Backup neo4jDataSource(EmbeddedGraphDatabase source,
                                     String destinationDir)
Backup from a running EmbeddedGraphDatabase to a destination directory. Only the data source representing the Neo4j database will be used and if it isn't set to keep logical logs an IllegalStateException will be thrown.

Parameters:
source - running database as backup source
destinationDir - location of backup destination
Returns:
instance for creating backup

neo4jDataSource

public static Backup neo4jDataSource(EmbeddedGraphDatabase source,
                                     EmbeddedGraphDatabase destination)
Backup from a running EmbeddedGraphDatabase to another running EmbeddedGraphDatabase. Only the data source representing the Neo4j database will be used and if it isn't set to keep logical logs an IllegalStateException will be thrown.

Parameters:
source - running database as backup source
destination - running database as backup destination
Returns:
instance for creating backup

allDataSources

public static Backup allDataSources(EmbeddedGraphDatabase source,
                                    String destinationDir)
Backup from a running EmbeddedGraphDatabase to a destination directory. All registered XA data sources will be used and all those data sources will have to be set to keep their logical logs, otherwise an IllegalStateException will be thrown.

Parameters:
source - running database as backup source
destinationDir - location of backup destination
Returns:
instance for creating backup

allDataSources

public static Backup allDataSources(EmbeddedGraphDatabase source,
                                    EmbeddedGraphDatabase destination)
Backup from a running EmbeddedGraphDatabase to another running EmbeddedGraphDatabase. All registered XA data sources will be used and all those data sources will have to be set to keep their logical logs, otherwise an IllegalStateException will be thrown.

Parameters:
source - running database as backup source
destination - running database as backup destination
Returns:
instance for creating backup

customDataSources

public static Backup customDataSources(EmbeddedGraphDatabase source,
                                       String destinationDir,
                                       String... xaDataSourceNames)
Backup from a running EmbeddedGraphDatabase to a destination directory. Which XA data sources to include in the backup can here be explicitly specified. This is considered to be more of an "expert-mode". If any of the specified data sources isn't set to keep its logical logs an IllegalStateException will be thrown.

Parameters:
source - running database as backup source
destinationDir - location of backup destination
xaDataSourceNames - names of data sources to backup
Returns:
instance for creating backup

customDataSources

public static Backup customDataSources(EmbeddedGraphDatabase source,
                                       EmbeddedGraphDatabase destination,
                                       String... xaDataSourceNames)
Backup from a running EmbeddedGraphDatabase to another running EmbeddedGraphDatabase. Which XA data sources to include in the backup can here be explicitly specified. This is considered to be more of an "expert-mode". If any of the specified data sources isn't set to keep its logical logs an IllegalStateException will be thrown.

Parameters:
source - running database as backup source
destination - running database as backup destination
xaDataSourceNames - names of data sources to backup
Returns:
instance for creating backup

doBackup

public void doBackup()
              throws IOException
Description copied from interface: Backup
Perform the backup.

Specified by:
doBackup in interface Backup
Throws:
IOException

enableFileLogger

public void enableFileLogger()
                      throws SecurityException,
                             IOException
Description copied from interface: Backup
Enable logging to file. The log messages will be appended to the backup.log file in the current working directory.

Specified by:
enableFileLogger in interface Backup
Throws:
SecurityException
IOException

enableFileLogger

public void enableFileLogger(String filename)
                      throws SecurityException,
                             IOException
Description copied from interface: Backup
Enable logging to the specified file.

Specified by:
enableFileLogger in interface Backup
Parameters:
filename - file name of log file
Throws:
SecurityException
IOException

enableFileLogger

public void enableFileLogger(FileHandler handler)
Description copied from interface: Backup
Enable a user-provided FileHandler

Specified by:
enableFileLogger in interface Backup
Parameters:
handler - file handler for logging

disableFileLogger

public void disableFileLogger()
Description copied from interface: Backup
Disable logging to file.

Specified by:
disableFileLogger in interface Backup

setLogLevelDebug

public void setLogLevelDebug()
Description copied from interface: Backup
Enable debug logging. Adds debug output to both console and file (if file output is enabled).

Specified by:
setLogLevelDebug in interface Backup

setLogLevelNormal

public void setLogLevelNormal()
Description copied from interface: Backup
Set logging to normal. Changes settings for both console and file output.

Specified by:
setLogLevelNormal in interface Backup

setLogLevelOff

public void setLogLevelOff()
Description copied from interface: Backup
Turn off all logging.

Specified by:
setLogLevelOff in interface Backup


Copyright © 2010 Neo4j. All Rights Reserved.