com.openexchange.admin.storage.interfaces
Class OXUtilStorageInterface

java.lang.Object
  extended by com.openexchange.admin.storage.interfaces.OXUtilStorageInterface
Direct Known Subclasses:
OXUtilSQLStorage

public abstract class OXUtilStorageInterface
extends java.lang.Object

This interface provides an abstraction to the storage of the util information

Author:
d7, cutmasta

Constructor Summary
OXUtilStorageInterface()
           
 
Method Summary
abstract  void changeDatabase(com.openexchange.admin.rmi.dataobjects.Database db)
           
abstract  void changeFilestore(com.openexchange.admin.rmi.dataobjects.Filestore fstore)
          Changes a given filestore
abstract  void createDatabase(com.openexchange.admin.rmi.dataobjects.Database db)
          Creates a new database from scratch on the given database host.
abstract  int createMaintenanceReason(com.openexchange.admin.rmi.dataobjects.MaintenanceReason reason)
          Create a new maintenance reason in configdb.They are needed to disable a context.
abstract  void deleteDatabase(com.openexchange.admin.rmi.dataobjects.Database db)
          Delete a complete database(scheme) from the given database host.
abstract  void deleteMaintenanceReason(int[] reason_ids)
          Delete reason from configdb
abstract  com.openexchange.admin.rmi.dataobjects.Filestore findFilestoreForContext()
          Iterates across all existing filestores and searches for one having enough space for a context.
abstract  com.openexchange.admin.rmi.dataobjects.MaintenanceReason[] getAllMaintenanceReasons()
           
abstract  com.openexchange.admin.rmi.dataobjects.Filestore getFilestore(int id)
          get filestore by ID
static OXUtilStorageInterface getInstance()
          Creates a new instance implementing the group storage interface.
abstract  com.openexchange.admin.rmi.dataobjects.MaintenanceReason[] getMaintenanceReasons(int[] reason_id)
           
abstract  boolean hasSpaceForAnotherContext(com.openexchange.admin.rmi.dataobjects.Filestore filestore)
           
abstract  com.openexchange.admin.rmi.dataobjects.Filestore[] listFilestores(java.lang.String search_pattern)
          List all registered filestores
abstract  com.openexchange.admin.rmi.dataobjects.MaintenanceReason[] listMaintenanceReasons(java.lang.String search_pattern)
           
abstract  int registerDatabase(com.openexchange.admin.rmi.dataobjects.Database db)
          Register a new Database in configdb
abstract  int registerFilestore(com.openexchange.admin.rmi.dataobjects.Filestore fstore)
          Register filestore in configbdb.
abstract  int registerServer(java.lang.String serverName)
          Registers a new server in the configdb
abstract  com.openexchange.admin.rmi.dataobjects.Database[] searchForDatabase(java.lang.String search_pattern)
          Searches for databases matching search_pattern
abstract  com.openexchange.admin.rmi.dataobjects.Server[] searchForServer(java.lang.String search_pattern)
          Searchs for server matching given search_pattern
abstract  void unregisterDatabase(int db_id)
          Unregister a database from configdb
abstract  void unregisterFilestore(int store_id)
          Unregister filestore from configbdb
abstract  void unregisterServer(int server_id)
          Unregister a server from configdb
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OXUtilStorageInterface

public OXUtilStorageInterface()
Method Detail

getInstance

public static OXUtilStorageInterface getInstance()
                                          throws com.openexchange.admin.rmi.exceptions.StorageException
Creates a new instance implementing the group storage interface.

Returns:
an instance implementing the group storage interface.
Throws:
com.openexchange.admin.rmi.exceptions.StorageException - Storage exception

registerFilestore

public abstract int registerFilestore(com.openexchange.admin.rmi.dataobjects.Filestore fstore)
                               throws com.openexchange.admin.rmi.exceptions.StorageException
Register filestore in configbdb.

Parameters:
fstore - filestore object
Returns:
the id of the created filestore as a long.
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

changeFilestore

public abstract void changeFilestore(com.openexchange.admin.rmi.dataobjects.Filestore fstore)
                              throws com.openexchange.admin.rmi.exceptions.StorageException
Changes a given filestore

Parameters:
fstore - filestore object
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

listFilestores

public abstract com.openexchange.admin.rmi.dataobjects.Filestore[] listFilestores(java.lang.String search_pattern)
                                                                           throws com.openexchange.admin.rmi.exceptions.StorageException
List all registered filestores

Parameters:
search_pattern - a pattern to search for
Returns:
an array of filestore objects
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

getFilestore

public abstract com.openexchange.admin.rmi.dataobjects.Filestore getFilestore(int id)
                                                                       throws com.openexchange.admin.rmi.exceptions.StorageException
get filestore by ID

Parameters:
id -
Returns:
Filestore
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

unregisterFilestore

public abstract void unregisterFilestore(int store_id)
                                  throws com.openexchange.admin.rmi.exceptions.StorageException
Unregister filestore from configbdb

Parameters:
store_id - the id of the filestore
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

findFilestoreForContext

public abstract com.openexchange.admin.rmi.dataobjects.Filestore findFilestoreForContext()
                                                                                  throws com.openexchange.admin.rmi.exceptions.StorageException
Iterates across all existing filestores and searches for one having enough space for a context.

Throws:
com.openexchange.admin.rmi.exceptions.StorageException

hasSpaceForAnotherContext

public abstract boolean hasSpaceForAnotherContext(com.openexchange.admin.rmi.dataobjects.Filestore filestore)
                                           throws com.openexchange.admin.rmi.exceptions.StorageException
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

createMaintenanceReason

public abstract int createMaintenanceReason(com.openexchange.admin.rmi.dataobjects.MaintenanceReason reason)
                                     throws com.openexchange.admin.rmi.exceptions.StorageException
Create a new maintenance reason in configdb.They are needed to disable a context.

Parameters:
reason - the MaintenanceReason
Returns:
the id as a long of the new created reason
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

deleteMaintenanceReason

public abstract void deleteMaintenanceReason(int[] reason_ids)
                                      throws com.openexchange.admin.rmi.exceptions.StorageException
Delete reason from configdb

Parameters:
reason - the MaintenanceReason
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

getMaintenanceReasons

public abstract com.openexchange.admin.rmi.dataobjects.MaintenanceReason[] getMaintenanceReasons(int[] reason_id)
                                                                                          throws com.openexchange.admin.rmi.exceptions.StorageException
Parameters:
reason_id - the id of a MaintenanceReason
Returns:
MaintenanceReason from configdb identified by the reason_id
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

getAllMaintenanceReasons

public abstract com.openexchange.admin.rmi.dataobjects.MaintenanceReason[] getAllMaintenanceReasons()
                                                                                             throws com.openexchange.admin.rmi.exceptions.StorageException
Returns:
an array of all available MaintenanceReasons in configdb.
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

listMaintenanceReasons

public abstract com.openexchange.admin.rmi.dataobjects.MaintenanceReason[] listMaintenanceReasons(java.lang.String search_pattern)
                                                                                           throws com.openexchange.admin.rmi.exceptions.StorageException
Returns:
an array of all available MaintenanceReasons in configdb match the specified pattern
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

registerDatabase

public abstract int registerDatabase(com.openexchange.admin.rmi.dataobjects.Database db)
                              throws com.openexchange.admin.rmi.exceptions.StorageException
Register a new Database in configdb

Parameters:
db - a database object to register
Returns:
long with the id of the database
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

createDatabase

public abstract void createDatabase(com.openexchange.admin.rmi.dataobjects.Database db)
                             throws com.openexchange.admin.rmi.exceptions.StorageException
Creates a new database from scratch on the given database host. Is used ONLY internally at the moment.

Parameters:
db - a database object to create
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

deleteDatabase

public abstract void deleteDatabase(com.openexchange.admin.rmi.dataobjects.Database db)
                             throws com.openexchange.admin.rmi.exceptions.StorageException
Delete a complete database(scheme) from the given database host. Is used ONYL internally at the moment.

Parameters:
db - a database object to be deleted
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

changeDatabase

public abstract void changeDatabase(com.openexchange.admin.rmi.dataobjects.Database db)
                             throws com.openexchange.admin.rmi.exceptions.StorageException
Parameters:
db - a database object to be changed
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

registerServer

public abstract int registerServer(java.lang.String serverName)
                            throws com.openexchange.admin.rmi.exceptions.StorageException
Registers a new server in the configdb

Parameters:
serverName - a server name to be registered
Returns:
long with the id of the server
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

unregisterDatabase

public abstract void unregisterDatabase(int db_id)
                                 throws com.openexchange.admin.rmi.exceptions.StorageException
Unregister a database from configdb

Parameters:
db_id - a database id which is unregistered
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

unregisterServer

public abstract void unregisterServer(int server_id)
                               throws com.openexchange.admin.rmi.exceptions.StorageException
Unregister a server from configdb

Parameters:
server_id - a server id which is unregistered
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

searchForDatabase

public abstract com.openexchange.admin.rmi.dataobjects.Database[] searchForDatabase(java.lang.String search_pattern)
                                                                             throws com.openexchange.admin.rmi.exceptions.StorageException
Searches for databases matching search_pattern

Parameters:
search_pattern - a pattern to search for
Returns:
a database array
Throws:
com.openexchange.admin.rmi.exceptions.StorageException

searchForServer

public abstract com.openexchange.admin.rmi.dataobjects.Server[] searchForServer(java.lang.String search_pattern)
                                                                         throws com.openexchange.admin.rmi.exceptions.StorageException
Searchs for server matching given search_pattern

Parameters:
search_pattern - a pattern to search for
Returns:
Server array with found servers
Throws:
com.openexchange.admin.rmi.exceptions.StorageException