cdqa.repository
Class Repository

java.lang.Object
  extended by cdqa.repository.Repository
All Implemented Interfaces:
IRepository

public final class Repository
extends java.lang.Object
implements IRepository


Field Summary
(package private)  java.net.URL baseURL
           
(package private)  java.util.HashMap doc2forest
          DR***************
(package private)  java.util.HashMap doc2XDoc
           
(package private)  java.util.HashMap file2name
           
(package private)  java.util.HashMap forests
           
(package private)  IdGen IdGen
          DR**************
(package private)  java.lang.String origUri
          DR*********
(package private)  java.util.HashMap replicationCounters
          DR **************
(package private)  java.util.HashMap url2XDoc
           
 
Constructor Summary
Repository(java.net.URL url)
          Constructor
Repository(java.net.URL url, boolean useDataGuides)
           
 
Method Summary
 boolean addDocToForest(java.lang.String forestName, java.lang.String fileName, java.lang.String docName)
          *******************************ADD DOCUMENT TO FOREST ************************************
 void addDocToForest(java.lang.String forestName, XDocument xdoc)
           
 boolean clear()
           
(package private)  void createForest(org.w3c.dom.Element forest)
           
 boolean createForest(java.lang.String forestName)
          creates forest with the given name
 Iterator find(java.lang.String name)
           
 java.net.URL getbaseURL()
           
 java.util.HashMap getData()
           
 java.util.ArrayList getDataGuide(java.lang.String name)
          D&R*******************************************
 XDocument getDocument(java.lang.String fileName)
           
 XDocument getDocument(java.lang.String forestName, java.lang.String fileName)
           
(package private)  XDocument getDocument(java.net.URL url, java.lang.String xdocName, java.lang.String forestName)
          Returns a XDocument representing the document located at url
 XDocument getDocument(java.net.URL docURL, java.lang.String fileName, java.lang.String docName, java.lang.String forestName)
          D&R*******************************************
 XDocument getDocument(XDocument doc, java.lang.String fileName)
           
 java.lang.String[] getDocumentFileNames()
           
 java.lang.String getDocumentName(org.w3c.dom.Document doc)
           
 java.lang.String getDocumentName(java.lang.String fileName)
          returns a real name of a document
 java.lang.String[] getDocumentNames()
           
 java.lang.String[] getDocumentsPaths()
           
 java.net.URL[] getDocumentURLs()
           
 java.lang.String getForestByDocument(org.w3c.dom.Document doc)
           
 java.lang.String getForestName(java.lang.String fileName)
           
 java.lang.String[] getForestNames()
           
 java.lang.String getOrigUri()
          DR********
 java.lang.String getOrigURI()
           
 ReplicationCounter getReplicationCounter(java.lang.String forestName)
           
 XDocument getXDocument(org.w3c.dom.Document doc)
           
 boolean isDocInForest(java.lang.String forestName, java.lang.String fileName)
           
(package private) static boolean isElement(org.w3c.dom.Node n, java.lang.String name)
           
(package private)  void readbaseURL(java.net.URL baseURL)
           
 void releaseDocuments()
           
 boolean removeDocFromForest(java.lang.String forestName, XDocument xdoc)
           
 boolean removeDocument(java.lang.String fileName, org.w3c.dom.Document doc)
           
 boolean removeDocument(java.net.URL url)
           
 void removeForest(java.lang.String forestName)
           
 boolean save()
           
 void updateDocument(org.w3c.dom.Document doc)
           
 void updateDocument(java.lang.String forestName, java.net.URL docURL, org.w3c.dom.Document doc)
           
 boolean useDataGuides()
           
 void xmlSerialize(java.io.PrintWriter pw)
           
(package private)  void xmlSerializeForest(java.io.PrintWriter pw, java.lang.String forestName, java.util.ArrayList forest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origUri

java.lang.String origUri
DR*********


url2XDoc

java.util.HashMap url2XDoc

doc2XDoc

java.util.HashMap doc2XDoc

forests

java.util.HashMap forests

IdGen

IdGen IdGen
DR**************


replicationCounters

java.util.HashMap replicationCounters
DR **************


baseURL

java.net.URL baseURL

doc2forest

java.util.HashMap doc2forest
DR***************


file2name

java.util.HashMap file2name
Constructor Detail

Repository

public Repository(java.net.URL url)
Constructor


Repository

public Repository(java.net.URL url,
                  boolean useDataGuides)
Method Detail

getbaseURL

public java.net.URL getbaseURL()

find

public Iterator find(java.lang.String name)
Specified by:
find in interface IRepository
Parameters:
name -

getDataGuide

public java.util.ArrayList getDataGuide(java.lang.String name)
D&R*******************************************


getDocument

public XDocument getDocument(java.net.URL docURL,
                             java.lang.String fileName,
                             java.lang.String docName,
                             java.lang.String forestName)
D&R*******************************************


getDocument

public XDocument getDocument(java.lang.String fileName)
Specified by:
getDocument in interface IRepository

getDocument

public XDocument getDocument(java.lang.String forestName,
                             java.lang.String fileName)

getDocument

public XDocument getDocument(XDocument doc,
                             java.lang.String fileName)
Specified by:
getDocument in interface IRepository

getXDocument

public XDocument getXDocument(org.w3c.dom.Document doc)
Specified by:
getXDocument in interface IRepository
Parameters:
doc -

createForest

public boolean createForest(java.lang.String forestName)
creates forest with the given name

Parameters:
forestName -
Returns:

addDocToForest

public boolean addDocToForest(java.lang.String forestName,
                              java.lang.String fileName,
                              java.lang.String docName)
*******************************ADD DOCUMENT TO FOREST ************************************

Parameters:
forestName -
fileName -
docName -

addDocToForest

public void addDocToForest(java.lang.String forestName,
                           XDocument xdoc)
Parameters:
forestName -
xdoc -

removeDocFromForest

public boolean removeDocFromForest(java.lang.String forestName,
                                   XDocument xdoc)

removeDocument

public boolean removeDocument(java.net.URL url)

removeDocument

public boolean removeDocument(java.lang.String fileName,
                              org.w3c.dom.Document doc)

removeForest

public void removeForest(java.lang.String forestName)
Parameters:
forestName -

isDocInForest

public boolean isDocInForest(java.lang.String forestName,
                             java.lang.String fileName)

getForestNames

public java.lang.String[] getForestNames()

getDocumentFileNames

public java.lang.String[] getDocumentFileNames()

getDocumentsPaths

public java.lang.String[] getDocumentsPaths()

getDocumentName

public java.lang.String getDocumentName(java.lang.String fileName)
returns a real name of a document

Parameters:
fileName -

getDocumentNames

public java.lang.String[] getDocumentNames()
Returns:

getDocumentURLs

public java.net.URL[] getDocumentURLs()
Returns:

save

public boolean save()

xmlSerializeForest

void xmlSerializeForest(java.io.PrintWriter pw,
                        java.lang.String forestName,
                        java.util.ArrayList forest)

xmlSerialize

public void xmlSerialize(java.io.PrintWriter pw)

getDocument

XDocument getDocument(java.net.URL url,
                      java.lang.String xdocName,
                      java.lang.String forestName)
                throws java.lang.Exception
Returns a XDocument representing the document located at url

Throws:
java.lang.Exception

isElement

static boolean isElement(org.w3c.dom.Node n,
                         java.lang.String name)

readbaseURL

void readbaseURL(java.net.URL baseURL)

createForest

void createForest(org.w3c.dom.Element forest)

updateDocument

public void updateDocument(java.lang.String forestName,
                           java.net.URL docURL,
                           org.w3c.dom.Document doc)

getForestName

public java.lang.String getForestName(java.lang.String fileName)

getForestByDocument

public java.lang.String getForestByDocument(org.w3c.dom.Document doc)
Specified by:
getForestByDocument in interface IRepository

getData

public java.util.HashMap getData()

getDocumentName

public java.lang.String getDocumentName(org.w3c.dom.Document doc)
Parameters:
doc -
Returns:

updateDocument

public void updateDocument(org.w3c.dom.Document doc)

getOrigUri

public java.lang.String getOrigUri()
DR********

Specified by:
getOrigUri in interface IRepository

getReplicationCounter

public ReplicationCounter getReplicationCounter(java.lang.String forestName)
Parameters:
forestName -
Returns:

getOrigURI

public java.lang.String getOrigURI()

clear

public boolean clear()

useDataGuides

public boolean useDataGuides()
Specified by:
useDataGuides in interface IRepository

releaseDocuments

public void releaseDocuments()
Specified by:
releaseDocuments in interface IRepository