org.naregi.rns
Class RNSDBXML

java.lang.Object
  extended by org.naregi.rns.RNSDBFile
      extended by org.naregi.rns.RNSDBXML
All Implemented Interfaces:
RNSDB

public class RNSDBXML
extends RNSDBFile

An implementation to store into local files as XML (using XMLEncoder).


Field Summary
 
Fields inherited from class org.naregi.rns.RNSDBFile
aclents, id, list, rnsProps
 
Fields inherited from interface org.naregi.rns.RNSDB
TYPE_DERBY, TYPE_FILE, TYPE_MEMORY, TYPE_XML
 
Constructor Summary
RNSDBXML()
           
 
Method Summary
 void destroy()
          Delete this directory permanently.
 void insertEntryData(java.lang.String name, RNSEntryData ent)
          Create a new entry and Insert a new entry data.
protected  void load()
           
 void removeACL(short type, java.lang.String[] names)
          Remove the ACL of this directory.
 void removeEntryData(java.lang.String name)
          Remove an entry.
 void rename(java.lang.String from, java.lang.String to)
          Change an entry name.
 void replaceMetadata(java.lang.String name, org.apache.axis.message.MessageElement[] xmls)
          Replace a Metadata of the entry.
 void setAccessTime(java.util.Calendar t)
          Set a time at which the RNS directory is last accessed.
 void setACL(ACL acl)
          Replace an ACL information to this directory.
 void setCreateTime(java.util.Calendar t)
          Set a time at which the RNS directory is created.
 void setDirectoryProperties(RNSDirectoryProperties props)
          Set properties to this directory.
 void setModificationTime(java.util.Calendar t)
          Set a time at which the RNS directory is last modified.
protected  void store()
           
 
Methods inherited from class org.naregi.rns.RNSDBFile
commit, createAndSetNewID, createAndSetNewRootID, getACL, getDirectoryProperties, getEntryData, getID, getIdAsFile, getList, getListSize, getLockAndStartTransaction, getRootID, getStorageDirBase, rollback, setDataSuffix, setID, setMaxDir, setMaxFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RNSDBXML

public RNSDBXML()
Method Detail

load

protected void load()
             throws org.globus.wsrf.ResourceException
Overrides:
load in class RNSDBFile
Throws:
org.globus.wsrf.ResourceException

store

protected void store()
              throws org.globus.wsrf.ResourceException
Overrides:
store in class RNSDBFile
Throws:
org.globus.wsrf.ResourceException

setDirectoryProperties

public void setDirectoryProperties(RNSDirectoryProperties props)
Description copied from interface: RNSDB
Set properties to this directory.

Specified by:
setDirectoryProperties in interface RNSDB
Overrides:
setDirectoryProperties in class RNSDBFile

setAccessTime

public void setAccessTime(java.util.Calendar t)
Description copied from interface: RNSDB
Set a time at which the RNS directory is last accessed.

Specified by:
setAccessTime in interface RNSDB
Overrides:
setAccessTime in class RNSDBFile
Parameters:
t - a time at which the RNS directory is last accessed

setCreateTime

public void setCreateTime(java.util.Calendar t)
Description copied from interface: RNSDB
Set a time at which the RNS directory is created.

Specified by:
setCreateTime in interface RNSDB
Overrides:
setCreateTime in class RNSDBFile
Parameters:
t - a time at which the RNS resource is created.

setModificationTime

public void setModificationTime(java.util.Calendar t)
Description copied from interface: RNSDB
Set a time at which the RNS directory is last modified.

Specified by:
setModificationTime in interface RNSDB
Overrides:
setModificationTime in class RNSDBFile
Parameters:
t - a time at which the RNS directory is last modified

insertEntryData

public void insertEntryData(java.lang.String name,
                            RNSEntryData ent)
Description copied from interface: RNSDB
Create a new entry and Insert a new entry data.

Specified by:
insertEntryData in interface RNSDB
Overrides:
insertEntryData in class RNSDBFile
Parameters:
name - an entry name
ent - the entry data (should not be null)

removeEntryData

public void removeEntryData(java.lang.String name)
                     throws java.lang.Exception
Description copied from interface: RNSDB
Remove an entry.

Specified by:
removeEntryData in interface RNSDB
Overrides:
removeEntryData in class RNSDBFile
Parameters:
name - a name to be removed.
Throws:
java.lang.Exception

rename

public void rename(java.lang.String from,
                   java.lang.String to)
            throws java.lang.Exception
Description copied from interface: RNSDB
Change an entry name.

Specified by:
rename in interface RNSDB
Overrides:
rename in class RNSDBFile
Parameters:
from - old name
to - new name
Throws:
java.lang.Exception

replaceMetadata

public void replaceMetadata(java.lang.String name,
                            org.apache.axis.message.MessageElement[] xmls)
                     throws java.lang.Exception
Description copied from interface: RNSDB
Replace a Metadata of the entry.

Specified by:
replaceMetadata in interface RNSDB
Overrides:
replaceMetadata in class RNSDBFile
Parameters:
name - an entry name.
xmls - Metadata
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Description copied from interface: RNSDB
Delete this directory permanently.

Specified by:
destroy in interface RNSDB
Overrides:
destroy in class RNSDBFile
Throws:
java.lang.Exception

setACL

public void setACL(ACL acl)
            throws java.lang.Exception
Description copied from interface: RNSDB
Replace an ACL information to this directory.

Specified by:
setACL in interface RNSDB
Overrides:
setACL in class RNSDBFile
Parameters:
acl - ACL
Throws:
java.lang.Exception

removeACL

public void removeACL(short type,
                      java.lang.String[] names)
               throws java.lang.Exception
Description copied from interface: RNSDB
Remove the ACL of this directory.

Specified by:
removeACL in interface RNSDB
Overrides:
removeACL in class RNSDBFile
Parameters:
type - ACL type (see ACL)
names - if names is null, the entries of type are removed.
Throws:
java.lang.Exception - if an error occurs