All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.archive.ArchiveMan

java.lang.Object
   |
   +----semper.archive.ArchiveMan

public class ArchiveMan
extends Object
Archive Manager. Main component of the archive service block, that class gives the means for storing and retrieving objects in the SEMPER archive.

All the objects are stored into the same base :
  • ArGeneral.db

    Other specific bases :
  • ArContext.db : used to store data relative to the archive manager,
  • ArWaste.db : the waste basket base,
  • ArLog.db : the log base.

    The path for the location of the database files is given by the semper configuration file (see semper.Preferences.Configuration), field semper.archive.dbDir.
    The default location is ./database/

    Version:
    $Revision: 1.25 $ $Date: 1997/07/21 05:57:07 $
    Author:
    Marc Mazoue ([email protected])
    Philippe Magliulo ([email protected])

    Constructor Index

     o ArchiveMan()
    Prevents instantiation of objects of this class.

    Method Index

     o add(AccessName, ArchiveSecurityOption, ArchiveAvailabilityOption, Date, Object)
    Add the given object to the archive.
    The handle for further retrieval is the given access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o contains(AccessName)
    Tells if there is an object associated with the given access name in the archive.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o del(AccessName)
    Removes from the archive the object associated with the specified access name.
     o getAvailabilityReq(AccessName)
    Get the 'availability requirement' storage attribute of the archived object associated with the specified access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o getExpiryDate(AccessName)
    Get the 'expiry date' storage attribute of the archived object associated with the specified access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o getSecurityReq(AccessName)
    Get the 'security requirement' storage attribute of the archived object associated with the specified access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o getSerialNumber()
    Gives the next available serial number.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o init()
    Initialises the static archive manager.
     o isInitialised()
    Checks whether the archive manager has been initialised
     o log(AccessName, Serializable)
    Add the given object to the log base.
     o modifyAttr(AccessName, ArchiveSecurityOption, ArchiveAvailabilityOption, Date)
    Modify the storage attributes of the archived object associated with the specified access name.
    The object itself and the date of storage are not modified.
     o read(AccessName)
    Gets from the archive the object associated with the specified access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o readLog()
    Read the log base.
     o search(String)
    This version of search returns an array of Strings ; another version called vSearch (see below) returns a Vector of AccessName objects

    Search in the archive for all access names that include the given token (a partial access name).
    Note, to get the whole list of access names, use [search ""]
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o search(String, Date, Date)
    This version of search returns an array of Strings ; another version called vSearch (see below) returns a Vector of AccessName objects

    Search in the archive for all access names that include the given token (a partial access name) according the given time window.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o setAvailabilityReq(AccessName, ArchiveAvailabilityOption)
    Set the 'availability requirement' storage attribute of the archived object associated with the specified access name.
    The object itself and the date of storage are not modified.
     o setExpiryDate(AccessName, Date)
    Set the 'expiry date requirement' storage attribute of the archived object associated with the specified access name.
    The object itself and the date of storage are not modified.
     o setSecurityReq(AccessName, ArchiveSecurityOption)
    Set the 'security requirement' storage attribute of the archived object associated with the specified access name.
    The object itself and the date of storage are not modified.
     o update(AccessName, Object)
    Updates in the archive the object associated with the specified access name.
    The storage attributes (security requirement, availability requirement and expiry date) are kept.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o vSearch(String)
    Search in the archive for all access names that include the given token (a partial access name).
    Note, to get the whole list of access names, use [search ""]
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.
     o vSearch(String, Date, Date)
    Search in the archive for all access names that include the given token (a partial access name) according the given time window.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Constructors

     o ArchiveMan
     public ArchiveMan() throws ArchiveManException
    
    Prevents instantiation of objects of this class. All the methods of ArchiveMan are class methods.

    Throws: ArchiveManException
    when this method is called.

    Methods

     o isInitialised
     public static boolean isInitialised()
    
    Checks whether the archive manager has been initialised

     o init
     public static void init() throws ArchiveManException
    
    Initialises the static archive manager.

    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o getSerialNumber
     public static synchronized long getSerialNumber() throws ArchiveManException
    
    Gives the next available serial number.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Returns:
    a long integer serial number
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o add
     public static synchronized void add(AccessName a_n,
                                         ArchiveSecurityOption security_option,
                                         ArchiveAvailabilityOption availability_option,
                                         Date expiry_date,
                                         Object obj) throws ArchiveManException, ArchiveOverwriteException, ArchiveObjNotFoundException
    
    Add the given object to the archive.
    The handle for further retrieval is the given access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the object to be stored
    security_option - the level of security required
    The secutity requirement is figured by the class ArchiveSecurityOption
    ArchiveSecurityOption.NOPASSWORD : simple storage
    ArchiveSecurityOption.PASSWORD : user's password required for store and retrieve
    ArchiveSecurityOption.ENCRYPTED : encrypted storage
    availability_option - the level of availability required
    The availability requirement is figured by the class ArchiveAvailabilityOption
    ArchiveAvailabilityOption.NOBACKUP : backup of the stored data is not required
    ArchiveAvailabilityOption.BACKUP : backup of the stored data is required
    expiry_date - the date used for further archive garbage collections
    If this parameter is null the date is set to the particular value 0 and the object will never be removed by garbage collection.
    obj - the object to be archived
    Throws: ArchiveManException
    throwed when DatabaseException is caught or the security_req argument has a bad value or the capability for add() is not satisfied.
    Throws: ArchiveOverwriteException
    throwed when trying to add an object the access name of which is already in archive.
     o read
     public static synchronized Object read(AccessName a_n) throws ArchiveManException, ArchiveObjNotFoundException
    
    Gets from the archive the object associated with the specified access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the stored object.
    Returns:
    the handle of the object
    Throws: ArchiveManException
    throwed when DatabaseException is caught or the capability for read the object is not satisfied.
    Throws: ArchiveObjNotFoundException
    throwed when trying to read an object the access name of which is not in archive.
     o update
     public static synchronized void update(AccessName a_n,
                                            Object new_obj) throws ArchiveManException, ArchiveObjNotFoundException
    
    Updates in the archive the object associated with the specified access name.
    The storage attributes (security requirement, availability requirement and expiry date) are kept.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    access_name - the reference to the stored object.
    new_obj - the object to be updated
    Throws: ArchiveManException
    throwed when DatabaseException is caught or the capability for update() is not satisfied.
    Throws: ArchiveObjNotFoundException
    throwed when trying to update an object the access name of which is not in archive.
     o modifyAttr
     public static synchronized void modifyAttr(AccessName a_n,
                                                ArchiveSecurityOption security_option,
                                                ArchiveAvailabilityOption availability_option,
                                                Date expiry_date) throws ArchiveManException, ArchiveObjNotFoundException
    
    Modify the storage attributes of the archived object associated with the specified access name.
    The object itself and the date of storage are not modified. But, regarding the old and the new security requirement, the way of storage can be changed, e.g., simply stored -> stored with encryption.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the object to be stored
    security_option - the level of security required
    The secutity requirement is figured by the class ArchiveSecurityOption
    ArchiveSecurityOption.NOPASSWORD : simple storage
    ArchiveSecurityOption.PASSWORD : user's password required for store and retrieve
    ArchiveSecurityOption.ENCRYPTED : encrypted storage
    availability_option - the level of availability required
    The availability requirement is figured by the class ArchiveAvailabilityOption
    ArchiveAvailabilityOption.NOBACKUP : backup of the stored data is not required
    ArchiveAvailabilityOption.BACKUP : backup of the stored data is required
    expiry_date - the date used for further archive garbage collections
    Throws: ArchiveManException
    throwed when DatabaseException is caught or the capability for modifyAttr() is not satisfied.
    Throws: ArchiveObjNotFoundException
    throwed when trying to modify the storage attributes of an object the access name of which is not in archive.
     o getSecurityReq
     public static synchronized ArchiveSecurityOption getSecurityReq(AccessName a_n) throws ArchiveManException, ArchiveObjNotFoundException
    
    Get the 'security requirement' storage attribute of the archived object associated with the specified access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the object to be stored
    Returns:
    the 'security requirement' storage attributes of the object.
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
    Throws: ArchiveObjNotFoundException
    throwed when trying to get the storage attributes of an object the access name of which is not in archive.
     o setSecurityReq
     public static synchronized void setSecurityReq(AccessName a_n,
                                                    ArchiveSecurityOption security_option) throws ArchiveManException, ArchiveObjNotFoundException
    
    Set the 'security requirement' storage attribute of the archived object associated with the specified access name.
    The object itself and the date of storage are not modified. But, regarding the old and the new security requirement, the way of storage can be changed, e.g., simply stored -> stored with encryption.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the object to be stored
    security_option - the 'security requirement' storage attribute of the object The secutity requirement is figured by the class ArchiveSecurityOption
    ArchiveSecurityOption.NOPASSWORD : simple storage
    ArchiveSecurityOption.PASSWORD : user's password required for store and retrieve
    ArchiveSecurityOption.ENCRYPTED : encrypted storage
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
    Throws: ArchiveObjNotFoundException
    throwed when trying to set the storage attributes of an object the access name of which is not in archive.
     o getAvailabilityReq
     public static synchronized ArchiveAvailabilityOption getAvailabilityReq(AccessName a_n) throws ArchiveManException, ArchiveObjNotFoundException
    
    Get the 'availability requirement' storage attribute of the archived object associated with the specified access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the object to be stored
    Returns:
    the 'availability requirement' storage attributes of the object.
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
    Throws: ArchiveObjNotFoundException
    throwed when trying to get the storage attributes of an object the access name of which is not in archive.
     o setAvailabilityReq
     public static synchronized void setAvailabilityReq(AccessName a_n,
                                                        ArchiveAvailabilityOption availability_option) throws ArchiveManException, ArchiveObjNotFoundException
    
    Set the 'availability requirement' storage attribute of the archived object associated with the specified access name.
    The object itself and the date of storage are not modified. But, regarding the old and the new security requirement, the way of storage can be changed, e.g., simply stored -> stored with encryption.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the object to be stored
    availability_option - the 'availability requirement' storage attribute of the object The availability requirement is figured by the class ArchiveAvailabilityOption
    ArchiveAvailabilityOption.NOBACKUP : backup of the stored data is not required
    ArchiveAvailabilityOption.BACKUP : backup of the stored data is required
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
    Throws: ArchiveObjNotFoundException
    throwed when trying to get the storage attributes of an object the access name of which is not in archive.
     o getExpiryDate
     public static synchronized Date getExpiryDate(AccessName a_n) throws ArchiveManException, ArchiveObjNotFoundException
    
    Get the 'expiry date' storage attribute of the archived object associated with the specified access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the object to be stored
    Returns:
    the 'expiry date' storage attributes of the object.
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
    Throws: ArchiveObjNotFoundException
    throwed when trying to get the storage attributes of an object the access name of which is not in archive.
     o setExpiryDate
     public static synchronized void setExpiryDate(AccessName a_n,
                                                   Date expiry_date) throws ArchiveManException, ArchiveObjNotFoundException
    
    Set the 'expiry date requirement' storage attribute of the archived object associated with the specified access name.
    The object itself and the date of storage are not modified. But, regarding the old and the new security requirement, the way of storage can be changed, e.g., simply stored -> stored with encryption.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    a_n - the reference to the object to be stored
    expiry_date - the date used for further archive garbage collections
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
    Throws: ArchiveObjNotFoundException
    throwed when trying to get the storage attributes of an object the access name of which is not in archive.
     o del
     public static synchronized void del(AccessName a_n) throws ArchiveManException, ArchiveObjNotFoundException
    
    Removes from the archive the object associated with the specified access name. The removed object is put in the waste basket database file.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    access_name - the reference to the stored object.
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o search
     public static synchronized String[] search(String token) throws ArchiveManException
    
    This version of search returns an array of Strings ; another version called vSearch (see below) returns a Vector of AccessName objects

    Search in the archive for all access names that include the given token (a partial access name).
    Note, to get the whole list of access names, use [search ""]
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    token - the string to be searched in the access names
    Returns:
    the set of fitting access names Strings
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o search
     public static synchronized String[] search(String token,
                                                Date start_date,
                                                Date end_date) throws ArchiveManException
    
    This version of search returns an array of Strings ; another version called vSearch (see below) returns a Vector of AccessName objects

    Search in the archive for all access names that include the given token (a partial access name) according the given time window.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    token - the string to be searched in the access names
    start_date - the begining of time window for the search.
    end_date - the end of time window for the search.
    Returns:
    the set of fitting access names Strings
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o vSearch
     public static synchronized Vector vSearch(String token) throws ArchiveManException
    
    Search in the archive for all access names that include the given token (a partial access name).
    Note, to get the whole list of access names, use [search ""]
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    token - the string to be searched in the access names
    Returns:
    as a Vector the set of fitting access names Strings
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o vSearch
     public static synchronized Vector vSearch(String token,
                                               Date start_date,
                                               Date end_date) throws ArchiveManException
    
    Search in the archive for all access names that include the given token (a partial access name) according the given time window.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    token - the string to be searched in the access names
    start_date - the begining of time window for the search.
    end_date - the end of time window for the search.
    Returns:
    as a Vector the set of fitting access names Strings
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o contains
     public static synchronized boolean contains(AccessName a_n) throws ArchiveManException
    
    Tells if there is an object associated with the given access name in the archive.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    access_name - the reference to the object to be looked for
    Returns:
    true if the object is present in the archive, false otherwise.
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o log
     public static synchronized void log(AccessName a_n,
                                         Serializable obj) throws ArchiveManException
    
    Add the given object to the log base. The current date is added to the access name.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Parameters:
    access_name - the reference to the object to be stored
    obj - the object to be archived
    Throws: ArchiveManException
    throwed when DatabaseException is caught.
     o readLog
     public static synchronized void readLog() throws ArchiveManException
    
    Read the log base. Not yet implemented.
    The Archive Manager must be initialized before calling this method, otherwise an exception is risen.

    Throws: ArchiveManException
    throwed when this method is called (function readLog not implemented).

    All Packages  Class Hierarchy  This Package  Previous  Next  Index