|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.activity.ActivityFactoryImpl
Class that provided the implementation of an activity factory. The configuration of this class specifies which activities are supported by a data service. It also specifies the implementation class and their schemas and well as activity properties and activity specific configuration.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE Copyright statement. |
private static DAILogger |
LOG Logger object for logging in this class |
private java.util.Map |
mActivityMap Maps String ActivityCreator objects |
private ActivityTypesDocumentCreator |
mActivityTypes Used to construct the activityTypes property |
private org.w3c.dom.Document |
mSchema Perform document schema |
private DocumentValidator |
mValidator Validation chain for perform documents |
Constructor Summary | |
ActivityFactoryImpl(ActivitiesConfig config) Constructs an ActivityFactory . |
Method Summary | |
private org.w3c.dom.Document |
buildPerformDocumentSchema(org.w3c.dom.Document baseSchema, ActivityConfig[] activityConfigs) Constructs the perform document schema dynamically from the activity schemas. |
Activity[] |
createActivities(org.w3c.dom.Document document) Constructs the activity implementations for each of the activity elements contained in the given perform document. |
private Activity |
createActivity(org.w3c.dom.Element element) Creates an Activity instance using an ActivityCreator . |
private java.util.Map |
createActivityMap(ActivityConfig[] activityConfigs) Creates an activity map. |
Property[] |
getProperties() Returns the resource properties associated with the supported activities. |
java.lang.Object |
getValue(javax.xml.namespace.QName name) Return the value of the property with the given name. |
private void |
parseChildren(org.w3c.dom.Node root, java.util.List list) Recursively parses the children of the specified node of a perform document, creating activities as their specifications are encountered and adding these to a list. |
void |
setSecurityContext(SecurityContext sec) 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 |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
private final java.util.Map mActivityMap
String
ActivityCreator objects
private final ActivityTypesDocumentCreator mActivityTypes
activityTypes
property
private final DocumentValidator mValidator
private org.w3c.dom.Document mSchema
Constructor Detail |
public ActivityFactoryImpl(ActivitiesConfig config)
ActivityFactory
.
config
- Configuration details of supported activities - their names, implementation classes and configurations.java.lang.IllegalArgumentException
- If config
is null
.Method Detail |
public Activity[] createActivities(org.w3c.dom.Document document) throws DocumentValidationException, ActivitySpecificationException, ActivityCreationException
ActivityFactory
createActivities
in interface ActivityFactory
document
- The perform document containing the element to use to create the activities.Activity
objects.DocumentValidationException
- If the perform document as a whole is in some way invalid e.g. contains unsupported pipes or unsupported activities.ActivitySpecificationException
- If a client mistake prevents one or more activities from being constructed successfully. This may be raised in either of the following circumstances:
ActivityCreationException
- If there is some problem that prevents an activity being created. This is typically caused by a configuration or programming error.private void parseChildren(org.w3c.dom.Node root, java.util.List list) throws DocumentValidationException, ActivitySpecificationException, ActivityCreationException
root
- Node from a perform document.list
- List of Activity
objects.DocumentValidationException
- If the perform document as a whole is in some way invalid.ActivitySpecificationException
- If a client mistake prevents one or more activities from being constructed successfully. This may be raised in either of the following circumstances:
ActivityCreationException
- If there is some problem that prevents an activity being created. This is typically caused by a configuration or programming error.java.lang.IllegalArgumentException
- If the document
is null
.createActivity(org.w3c.dom.Element)
private Activity createActivity(org.w3c.dom.Element element) throws ActivitySpecificationException, ActivityCreationException
Activity
instance using an ActivityCreator
.
element
- Element from a perform document containing a specific activity.Activity
.java.lang.IllegalArgumentException
- If element
is null
.ActivitySpecificationException
- If a client mistake prevents the activity from being constructed successfully. This may be raised in either of the following circumstances:
ActivityCreationException
- If there is some problem that prevents an activity being created. This is typically caused by a configuration or programming error.private java.util.Map createActivityMap(ActivityConfig[] activityConfigs)
activityConfigs
- Array of configuration details for each activity.private org.w3c.dom.Document buildPerformDocumentSchema(org.w3c.dom.Document baseSchema, ActivityConfig[] activityConfigs)
baseSchema
- Base perform document schemaactivityConfigs
- Configuration details of each activity - this includes the schema for each activity.public Property[] getProperties()
getProperties
in interface ActivityFactory
public java.lang.Object getValue(javax.xml.namespace.QName name) throws PropertyValueException
PropertyCallback
getValue
in interface PropertyCallback
name
- Property name.PropertyValueException
- if a problem occurs.public void setValue(javax.xml.namespace.QName name, java.lang.Object value)
PropertyCallback
setValue
in interface PropertyCallback
name
- Property name.value
- Property value.public void setSecurityContext(SecurityContext sec)
PropertyCallback
setSecurityContext
in interface PropertyCallback
sec
- Security context.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |