se.kmr.scam.server.impl
Class AdministerBean

java.lang.Object
  extended byse.kmr.scam.server.impl.BeanCommon
      extended byse.kmr.scam.server.impl.AdministerBean
All Implemented Interfaces:
AdministerI, EnterpriseBean, Serializable, SessionBean

public class AdministerBean
extends BeanCommon
implements AdministerI, SessionBean

Administration of SCAM.

Author:
Stefan, jand
See Also:
Serialized Form
Created:
den 6 augusti 2002

Field Summary
 
Fields inherited from class se.kmr.scam.server.impl.BeanCommon
ADMIN_ROLE, GUEST_ROLE
 
Constructor Summary
AdministerBean()
           
 
Method Summary
 void add(String identity, Model model)
          Insert all statements in model into Manifest.
 void backup(String identity)
          Create a backup of a Manifest.
 void createManifest(String identity)
          Create a new Manifest (nothing will happen if it already exists).
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 Model get(String identity)
          Get all statements in Manifest (compared to dump).
protected  SessionContext getSessionContext()
          Get the sessioncontext
 Model getUser(String name)
           
 Boolean hasManifest(String identity)
          Check if manifest exists.
 void insertUser(Model model)
           
 Collection listBackupManifests()
          List all manifests that have been backed up.
 Collection listBackups(String identity)
          List all backups of a certain Manifest.
 Collection listManifests()
          List the identities of all Manifests.
 Collection listUsers()
           
 void removeManifest(String identity)
          Remove all statements and files in Manifest.
 void removeUser(String name)
           
 void restore(String identity, Date date)
          Restore a backup of a Manifest.
 void setSessionContext(SessionContext sessionContext)
           
 
Methods inherited from class se.kmr.scam.server.impl.BeanCommon
abort, assertPermission, assertPermission, begin, close, commit, contains, create, filter, filter, getCaller, hasPermission, hasPermission, isCaller, isCallerInRole, list, lookup, open, open, remove, rollback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdministerBean

public AdministerBean()
Method Detail

getSessionContext

protected SessionContext getSessionContext()
Description copied from class: BeanCommon
Get the sessioncontext

Specified by:
getSessionContext in class BeanCommon
Returns:
the context

ejbCreate

public void ejbCreate()
               throws CreateException
Throws:
CreateException

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface SessionBean

setSessionContext

public void setSessionContext(SessionContext sessionContext)
Specified by:
setSessionContext in interface SessionBean

createManifest

public void createManifest(String identity)
                    throws ArchiveException
Create a new Manifest (nothing will happen if it already exists).

Specified by:
createManifest in interface AdministerI
Parameters:
identity - Manifest
Throws:
ArchiveException

hasManifest

public Boolean hasManifest(String identity)
                    throws ArchiveException
Check if manifest exists.

Specified by:
hasManifest in interface AdministerI
Parameters:
identity - Manifest
Returns:
true is manifest exists
Throws:
ArchiveException

listManifests

public Collection listManifests()
                         throws ArchiveException
List the identities of all Manifests.

Specified by:
listManifests in interface AdministerI
Returns:
Collection of Strings
Throws:
ArchiveException

removeManifest

public void removeManifest(String identity)
                    throws ArchiveException
Remove all statements and files in Manifest.

Specified by:
removeManifest in interface AdministerI
Parameters:
identity - Manifest
Throws:
ArchiveException

add

public void add(String identity,
                Model model)
         throws ArchiveException
Insert all statements in model into Manifest.
Note: this will not replace existing components!

Specified by:
add in interface AdministerI
Parameters:
identity - Manifest
model - Model to insert
Throws:
ArchiveException

get

public Model get(String identity)
          throws ArchiveException
Get all statements in Manifest (compared to dump).

Specified by:
get in interface AdministerI
Parameters:
identity - Manifest
Returns:
Memory model
Throws:
ArchiveException

listBackupManifests

public Collection listBackupManifests()
                               throws ArchiveException
List all manifests that have been backed up.

Specified by:
listBackupManifests in interface AdministerI
Returns:
Collection of String
Throws:
ArchiveException
See Also:
listBackups(String)

listBackups

public Collection listBackups(String identity)
                       throws ArchiveException
List all backups of a certain Manifest. The backup-folder is defined by the environment variable scam.repository.backup.base in the SCAM property file. Will look for filenames that start with identity and ends with "_backup".

Specified by:
listBackups in interface AdministerI
Parameters:
identity - Manifest
Returns:
Collection of java.util.Date
Throws:
ArchiveException

backup

public void backup(String identity)
            throws ArchiveException
Create a backup of a Manifest. A backup will be created in the folder defined by scam.repository.backup.base. The filename syntax: [identity]_[date]/manifest.[n3|rdf] The date syntax is defined by scam.repository.backup.dateFormat.

Specified by:
backup in interface AdministerI
Parameters:
identity - Manifest
Throws:
ArchiveException
See Also:
SimpleDateFormat

restore

public void restore(String identity,
                    Date date)
             throws ArchiveException
Restore a backup of a Manifest. The old data will be removed.

Specified by:
restore in interface AdministerI
Parameters:
identity - Manifest
date - Date of backup
Throws:
ArchiveException
See Also:
backup(String), listBackups(String)

insertUser

public void insertUser(Model model)
                throws ArchiveException
Specified by:
insertUser in interface AdministerI
Throws:
ArchiveException

getUser

public Model getUser(String name)
              throws ArchiveException
Specified by:
getUser in interface AdministerI
Throws:
ArchiveException

removeUser

public void removeUser(String name)
                throws ArchiveException
Specified by:
removeUser in interface AdministerI
Throws:
ArchiveException

listUsers

public Collection listUsers()
                     throws ArchiveException
Specified by:
listUsers in interface AdministerI
Throws:
ArchiveException


Copyright © 2003 SCAM. All Rights Reserved.