|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--edu.ucsb.nceas.metacat.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.lang.String user,
java.lang.String[] groups,
int serverCode)
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 |
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 |
getACL(java.lang.String docid,
java.lang.String user,
java.lang.String[] groups)
Get Access Control List information for document from db connetion. |
java.lang.String |
getDocname()
Get the document name. |
boolean |
hasPermission(java.lang.String permission,
java.lang.String user,
java.lang.String[] groups,
java.lang.String docid)
Check from db connection if at least one of the list of @principals has @permission on @docid. |
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. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AccessControlList(java.sql.Connection conn) throws java.sql.SQLException
conn
- the JDBC connection where acl info is getpublic AccessControlList(java.sql.Connection conn, java.lang.String aclid, java.lang.String user, java.lang.String[] groups, int serverCode) throws org.xml.sax.SAXException, java.io.IOException, McdbException
conn
- the JDBC connection where acl data are loadedaclid
- the Accession# of the document with the acl dataacl
- the acl file containing acl datauser
- the user connected to MetaCat servlet and owns the documentgroups
- the groups to which user belongsserverCode
- the serverid from xml_replication on which this document
resides.Method Detail |
public void startDocument() throws org.xml.sax.SAXException
startDocument
in class org.xml.sax.helpers.DefaultHandler
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
startElement
in class org.xml.sax.helpers.DefaultHandler
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in class org.xml.sax.helpers.DefaultHandler
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in class org.xml.sax.helpers.DefaultHandler
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
name
- name of the DTDpublicId
- Public Identifier of the DTDsystemId
- System Identifier of the DTDpublic void startEntity(java.lang.String name) throws org.xml.sax.SAXException
name
- name of the entitypublic void endEntity(java.lang.String name) throws org.xml.sax.SAXException
name
- name of the entitypublic java.lang.String getDocname()
public boolean processingDTD()
public boolean hasPermission(java.lang.String permission, java.lang.String user, java.lang.String[] groups, java.lang.String docid) throws java.sql.SQLException
permission
- permission type to check forprincipals
- list of names of principals to check for @permissiondocid
- document identifier to check onpublic java.lang.String getACL(java.lang.String docid, java.lang.String user, java.lang.String[] groups) throws java.sql.SQLException
docid
- document identifier which acl info to getuser
- name of user connected to Metacat systemgroups
- names of user's groups to which user belongs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |