edu.ucsb.nceas.metacat
Class AccessControlList

edu.ucsb.nceas.metacat.AccessControlList

public class AccessControlList

A Class that loads eml-access.xml file containing ACL for a metadata document into relational DB. It extends DefaultHandler class to handle SAX parsing events when processing the XML stream.


Constructor Summary
AccessControlList(java.sql.Connection conn)
          Construct an instance of the AccessControlList class.
AccessControlList(java.sql.Connection conn, java.lang.String aclid, java.io.Reader acl, java.lang.String user, java.lang.String group)
          Construct an instance of the AccessControlList class.
AccessControlList(java.sql.Connection conn, java.lang.String aclid, java.lang.String aclfilename, java.lang.String user, java.lang.String group)
          Construct an instance of the AccessControlList class.
 
Method Summary
 void characters(char[] ch, int start, int length)
          callback method used by the SAX Parser when the text sequences of an xml stream are detected.
 void deleteRelations(java.lang.String docid)
          Deletes all of the relations with a docid of @docid.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          callback method used by the SAX Parser when the end tag of an element is detected.
 void endEntity(java.lang.String name)
          SAX Handler that receives notification of the end of entities
 java.lang.String getDocname()
          get the document name
 boolean hasPermission(java.lang.String permission, java.lang.String principal, java.lang.String resourceID)
          Check for @permission for @principal on @resourceID from db connection
 boolean processingDTD()
          get the document processing state
 void startDocument()
          callback method used by the SAX Parser when beginning of the document
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          SAX Handler that receives notification of DOCTYPE.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          callback method used by the SAX Parser when the start tag of an element is detected.
 void startEntity(java.lang.String name)
          SAX Handler that receives notification of the start of entities
 

Constructor Detail

AccessControlList

public AccessControlList(java.sql.Connection conn)
                  throws java.sql.SQLException
Construct an instance of the AccessControlList class. It is used by the permission check up from DBQuery and DocumentImpl
Parameters:
conn - the JDBC connection where acl data are loaded

AccessControlList

public AccessControlList(java.sql.Connection conn,
                         java.lang.String aclid,
                         java.io.Reader acl,
                         java.lang.String user,
                         java.lang.String group)
                  throws org.xml.sax.SAXException,
                         java.io.IOException,
                         java.lang.ClassNotFoundException
Construct an instance of the AccessControlList class. It parse acl file and loads acl data into db connection.
Parameters:
conn - the JDBC connection where acl data are loaded
docid - the Accession# of the document with the acl data
acl - the acl file containing acl data

AccessControlList

public AccessControlList(java.sql.Connection conn,
                         java.lang.String aclid,
                         java.lang.String aclfilename,
                         java.lang.String user,
                         java.lang.String group)
                  throws org.xml.sax.SAXException,
                         java.io.IOException,
                         java.lang.ClassNotFoundException
Construct an instance of the AccessControlList class. It parse acl file and loads acl data into db connection.
Parameters:
conn - the JDBC connection where acl data are loaded
docid - the Accession# of the document with the acl data
aclfilename - the name of acl file containing acl data
Method Detail

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
callback method used by the SAX Parser when beginning of the document

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
callback method used by the SAX Parser when the start tag of an element is detected. Used in this context to parse and store the acl information in class variables.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
callback method used by the SAX Parser when the text sequences of an xml stream are detected. Used in this context to parse and store the acl information in class variables.

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
callback method used by the SAX Parser when the end tag of an element is detected. Used in this context to parse and store the acl information in class variables.

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
              throws org.xml.sax.SAXException
SAX Handler that receives notification of DOCTYPE. Sets the DTD

startEntity

public void startEntity(java.lang.String name)
                 throws org.xml.sax.SAXException
SAX Handler that receives notification of the start of entities

endEntity

public void endEntity(java.lang.String name)
               throws org.xml.sax.SAXException
SAX Handler that receives notification of the end of entities

getDocname

public java.lang.String getDocname()
get the document name

processingDTD

public boolean processingDTD()
get the document processing state

deleteRelations

public void deleteRelations(java.lang.String docid)
                     throws java.sql.SQLException
Deletes all of the relations with a docid of @docid.
Parameters:
docid - the docid to delete.

hasPermission

public boolean hasPermission(java.lang.String permission,
                             java.lang.String principal,
                             java.lang.String resourceID)
                      throws java.sql.SQLException
Check for @permission for @principal on @resourceID from db connection


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.