uk.org.ogsadai.dataresource
Class MetaDataExtractor

java.lang.Object
  |
  +--uk.org.ogsadai.dataresource.MetaDataExtractor
All Implemented Interfaces:
PropertyCallback
Direct Known Subclasses:
SimpleXMLDBMetaDataExtractor

public abstract class MetaDataExtractor
extends java.lang.Object
implements PropertyCallback

Base class for meta data extractors.

Author:
The OGSA-DAI Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private static DAILogger LOG
           
protected  SecurityContext mSecurityContext
           
 
Constructor Summary
MetaDataExtractor()
           
 
Method Summary
protected abstract  java.lang.Object getMetaData(SecurityContext securityContext, javax.xml.namespace.QName name)
          Gets the meta data using the given security context to access the data resource.
 java.lang.Object getValue(javax.xml.namespace.QName name)
          Return the value of the property with the given name.
 void setSecurityContext(SecurityContext sc)
          Set a security context to be used if authorisation needs to be done when get/setting the value.
 void setValue(javax.xml.namespace.QName name, java.lang.Object value)
          Set the value of the property with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

LOG

private static DAILogger LOG

mSecurityContext

protected SecurityContext mSecurityContext
Constructor Detail

MetaDataExtractor

public MetaDataExtractor()
Method Detail

setSecurityContext

public void setSecurityContext(SecurityContext sc)
Description copied from interface: PropertyCallback
Set a security context to be used if authorisation needs to be done when get/setting the value.

Specified by:
setSecurityContext in interface PropertyCallback
Parameters:
sc - Security context.

setValue

public void setValue(javax.xml.namespace.QName name,
                     java.lang.Object value)
Description copied from interface: PropertyCallback
Set the value of the property with the given name.

Specified by:
setValue in interface PropertyCallback
Parameters:
name - Property name.
value - Property value.

getValue

public java.lang.Object getValue(javax.xml.namespace.QName name)
                          throws PropertyValueException
Description copied from interface: PropertyCallback
Return the value of the property with the given name.

Specified by:
getValue in interface PropertyCallback
Parameters:
name - Property name.
Returns:
property value
Throws:
PropertyValueException - if a problem occurs.

getMetaData

protected abstract java.lang.Object getMetaData(SecurityContext securityContext,
                                                javax.xml.namespace.QName name)
                                         throws MetaDataAuthorizationException,
                                                MetaDataExtractionException
Gets the meta data using the given security context to access the data resource.

Parameters:
securityContext - User details used to access the data resource.
name - Name of meta data property being sought.
Returns:
an XML serializable object containing the metadata.
Throws:
MetaDataAuthorizationException - if the user is not authorized to access the data resource meta data.
MetaDataExtractionException - if some problem occurs when extracting the meta data.