org.objectweb.cjdbc.controller.backup
Class AbstractPostgreSQLBackuper

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.backup.AbstractPostgreSQLBackuper
All Implemented Interfaces:
Backuper
Direct Known Subclasses:
PostgreSQLBinaryBackuper, PostgreSQLPlainTextBackuper

public abstract class AbstractPostgreSQLBackuper
extends java.lang.Object
implements Backuper

This abstract class provides base methods for PostgreSQL backupers.

Version:
1.1
Author:
Dylan Hansen

Field Summary
(package private) static Trace logger
           
protected  java.util.HashMap optionsMap
           
protected  java.lang.String optionsString
           
 
Constructor Summary
AbstractPostgreSQLBackuper()
          Creates a new AbstractPostgreSQLBackuper object
 
Method Summary
 void deleteDump(java.lang.String path, java.lang.String dumpName)
          Delete the specified dump.
 void fetchDump(DumpTransferInfo dumpTransferInfo, java.lang.String path, java.lang.String dumpName)
          Client side: Fetch a remote dump from specified dump server.
 BackupManager getBackupManager()
          Return the BackupManager this Backuper belongs to.
protected  java.lang.String getDatabaseNameFromURL(java.lang.String url)
          Get the database name of a given PostgreSQL connection string
protected  java.lang.String getDumpPhysicalPath(java.lang.String path, java.lang.String dumpName)
          Get the dump physical path from its logical name
protected  java.lang.String getHostFromURL(java.lang.String url)
          Get the host of a given PostgreSQL connection string
 java.lang.String getOptions()
          Retrieve the backuper options that were used to initialize the backuper.
protected  java.lang.String getPortFromURL(java.lang.String url)
          Get the port of a given PostgreSQL connection string
 void setOptions(java.lang.String options)
          Options that can be set at backuper initialization.
 DumpTransferInfo setupServer()
          Server side: setup a server and returns a DumpTransferInfo suitable for authenticated communication by a client using fetchDump().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.cjdbc.controller.backup.Backuper
backup, getDumpFormat, restore
 

Field Detail

logger

static Trace logger

optionsMap

protected java.util.HashMap optionsMap

optionsString

protected java.lang.String optionsString
Constructor Detail

AbstractPostgreSQLBackuper

public AbstractPostgreSQLBackuper()
Creates a new AbstractPostgreSQLBackuper object

Method Detail

getOptions

public java.lang.String getOptions()
Description copied from interface: Backuper
Retrieve the backuper options that were used to initialize the backuper.

Specified by:
getOptions in interface Backuper
Returns:
the backuper options
See Also:
Backuper.getOptions()

setOptions

public void setOptions(java.lang.String options)
Description copied from interface: Backuper
Options that can be set at backuper initialization. These options are provided in the definition of the Backuper element (see dtd).

Specified by:
setOptions in interface Backuper
Parameters:
options - Backuper specific options
See Also:
Backuper.setOptions(java.lang.String)

deleteDump

public void deleteDump(java.lang.String path,
                       java.lang.String dumpName)
                throws BackupException
Description copied from interface: Backuper
Delete the specified dump.

Specified by:
deleteDump in interface Backuper
Parameters:
path - the path where to retrieve the dump
dumpName - the dump to delete
Throws:
BackupException - if we failed to delete the dump
See Also:
Backuper.deleteDump(java.lang.String, java.lang.String)

getDumpPhysicalPath

protected java.lang.String getDumpPhysicalPath(java.lang.String path,
                                               java.lang.String dumpName)
Get the dump physical path from its logical name

Parameters:
path - the path where the dump is stored
dumpName - dump logical name
Returns:
path to dump file

getHostFromURL

protected java.lang.String getHostFromURL(java.lang.String url)
Get the host of a given PostgreSQL connection string

Parameters:
url - The full PostgreSQL URL
Returns:
Host of the URL

getPortFromURL

protected java.lang.String getPortFromURL(java.lang.String url)
Get the port of a given PostgreSQL connection string

Parameters:
url - The full PostgreSQL URL
Returns:
Port of the URL

getDatabaseNameFromURL

protected java.lang.String getDatabaseNameFromURL(java.lang.String url)
Get the database name of a given PostgreSQL connection string

Parameters:
url - The full PostgreSQL URL
Returns:
Name of the database

fetchDump

public void fetchDump(DumpTransferInfo dumpTransferInfo,
                      java.lang.String path,
                      java.lang.String dumpName)
               throws BackupException
Description copied from interface: Backuper
Client side: Fetch a remote dump from specified dump server.

Specified by:
fetchDump in interface Backuper
Parameters:
dumpTransferInfo - the address and session key of the dump server to contact for fetching.
path - the path part of the remote dump spec (interpreted by server)
dumpName - the name part of the remote dump spec (interpreted by server)
Throws:
BackupException - in any error case: authentication error, transfer error, else.
See Also:
Backuper.fetchDump(org.objectweb.cjdbc.controller.backup.DumpTransferInfo, java.lang.String, java.lang.String)

setupServer

public DumpTransferInfo setupServer()
Description copied from interface: Backuper
Server side: setup a server and returns a DumpTransferInfo suitable for authenticated communication by a client using fetchDump().

Specified by:
setupServer in interface Backuper
Returns:
a DumpTransferInfo to be used by a client for authenticated communication upon fetchDump invocation.
See Also:
Backuper.setupServer()

getBackupManager

public BackupManager getBackupManager()
Description copied from interface: Backuper
Return the BackupManager this Backuper belongs to.

Specified by:
getBackupManager in interface Backuper
Returns:
the BackupManager this Backuper belongs to.
See Also:
Backuper.getBackupManager()


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.