de.fzj.unicore.wsrflite.xmlbeans.impl
Class WSResourceImpl

java.lang.Object
  extended by de.fzj.unicore.wsrflite.impl.WSRFInstanceImpl
      extended by de.fzj.unicore.wsrflite.xmlbeans.impl.WSResourceImpl
All Implemented Interfaces:
WSRFConstants, WSRFInstance, ResourceLifetime, ResourceProperties, WSResource
Direct Known Subclasses:
AdminServiceImpl, NotificationProducerImpl, ServiceGroupEntryImpl, ServiceGroupImpl, SubscriptionImpl

public abstract class WSResourceImpl
extends WSRFInstanceImpl
implements WSResource

Implementation of the WSResource Interface. This offers basic rp functions.

Author:
schuller

Field Summary
static int DELETE
           
static int INSERT
           
protected static org.apache.log4j.Logger logger
           
protected  HashMap<QName,ResourceProperty> properties
           
protected static long serialVersionUID
           
static int UPDATE
           
 
Fields inherited from class de.fzj.unicore.wsrflite.impl.WSRFInstanceImpl
home, INIT_INITIAL_TERMINATION_TIME, INIT_UNIQUE_ID, isDirty
 
Fields inherited from interface de.fzj.unicore.wsrflite.xmlbeans.ResourceProperties
WSRP_DELETE_RP, WSRP_GET_MULTIPLE_RP, WSRP_GET_RP, WSRP_GET_RP_DOCUMENT, WSRP_INSERT_RP, WSRP_PUT_RP_DOCUMENT, WSRP_QUERY_RP, WSRP_RP_QueryExpressionDialect, WSRP_SET_RP, WSRP_UPDATE_RP
 
Fields inherited from interface de.fzj.unicore.wsrflite.WSRFConstants
QUERY_EXPRESSION_DIALECT_XPATH, RPcurrentTimeQName, RPterminationTimeQName, WSRL_BASENS, WSRL_DESTROY, WSRL_DESTROY_PORT, WSRL_SCHEDULED, WSRL_SET_TERMTIME_PORT, WSRP_BASENS, WSRP_DELETE_RP_PORT, WSRP_GET_MULTIPLE_RP_PORT, WSRP_GET_RP_DOCUMENT_PORT, WSRP_GET_RP_PORT, WSRP_INSERT_RP_PORT, WSRP_PUT_RP_DOCUMENT_PORT, WSRP_QUERY_RP_PORT, WSRP_SET_RP_PORT, WSRP_UPDATE_RP_PORT
 
Constructor Summary
WSResourceImpl()
          default constructor
further initialisation is done through initialise() or activate()
 
Method Summary
 void activate(Map<String,Serializable> state)
          reactivate the instance
 org.oasisOpen.docs.wsrf.rp2.DeleteResourcePropertiesResponseDocument DeleteResourceProperties(org.oasisOpen.docs.wsrf.rp2.DeleteResourcePropertiesDocument in)
          delete RP
 org.oasisOpen.docs.wsrf.rl2.DestroyResponseDocument Destroy(org.oasisOpen.docs.wsrf.rl2.DestroyDocument in)
           
 org.apache.xmlbeans.XmlObject fillResourcePropertyDocument()
          fills the given resource property document in a schema-compliant way
 org.oasisOpen.docs.wsrf.rp2.GetMultipleResourcePropertiesResponseDocument GetMultipleResourceProperties(org.oasisOpen.docs.wsrf.rp2.GetMultipleResourcePropertiesDocument in)
           
 org.oasisOpen.docs.wsrf.rp2.GetResourcePropertyResponseDocument GetResourceProperty(org.oasisOpen.docs.wsrf.rp2.GetResourcePropertyDocument in)
           
 ResourceProperty<?> getResourceProperty(QName qn)
          retrieve the XML for a resource property by QName.
 org.oasisOpen.docs.wsrf.rp2.GetResourcePropertyDocumentResponseDocument GetResourcePropertyDocument(org.oasisOpen.docs.wsrf.rp2.GetResourcePropertyDocumentDocument1 in)
          Retrieve all the resource properties.
abstract  QName getResourcePropertyDocumentQName()
          returns the QName of the resource properties document
 Object getResourcePropertyObject(QName qn)
          retrieve the "backing object" of a resource property by its QName.
 QName[] getResourcePropertyQNames()
          get the QNames of all registered resource properties
 org.apache.xmlbeans.XmlObject getResourcePropertyResponseDocument()
          returns the resource property document
 org.apache.xmlbeans.XmlObject[] getResourcePropertyXML(QName qn)
          retrieve the XML for a resource property by QName.
 void initialise(String serviceName, Map<String,Object> initobjs)
          initialise this WS Resource
In subclasses, a call to super.initialise() is highly recommended!
 org.oasisOpen.docs.wsrf.rp2.InsertResourcePropertiesResponseDocument InsertResourceProperties(org.oasisOpen.docs.wsrf.rp2.InsertResourcePropertiesDocument in)
          insert RP
protected  boolean isModifyable(ResourceProperty<?> rp, int operation)
          check whether the given rp is modifyable using the given operation
 org.oasisOpen.docs.wsrf.rp2.PutResourcePropertyDocumentResponseDocument PutResourcePropertyDocument(org.oasisOpen.docs.wsrf.rp2.PutResourcePropertyDocumentDocument1 in)
           
 org.oasisOpen.docs.wsrf.rp2.QueryResourcePropertiesResponseDocument QueryResourceProperties(org.oasisOpen.docs.wsrf.rp2.QueryResourcePropertiesDocument in)
          query resource properties.
 org.oasisOpen.docs.wsrf.rp2.SetResourcePropertiesResponseDocument SetResourceProperties(org.oasisOpen.docs.wsrf.rp2.SetResourcePropertiesDocument in)
           
 org.oasisOpen.docs.wsrf.rl2.SetTerminationTimeResponseDocument SetTerminationTime(org.oasisOpen.docs.wsrf.rl2.SetTerminationTimeDocument in)
           
 org.oasisOpen.docs.wsrf.rp2.UpdateResourcePropertiesResponseDocument UpdateResourceProperties(org.oasisOpen.docs.wsrf.rp2.UpdateResourcePropertiesDocument in)
           
 
Methods inherited from class de.fzj.unicore.wsrflite.impl.WSRFInstanceImpl
clearChangeFlag, clearSecurityContext, destroy, getDefaultLifetime, getSecurityContext, getServiceName, getTerminationTime, getUniqueID, hasChanged, isDestroyed, isExpired, passivate, postActivate, processMessages, setDirty, setHome, setSecurityContext, setServiceName, setTerminationTime, setUniqueID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.fzj.unicore.wsrflite.WSRFInstance
clearChangeFlag, clearSecurityContext, destroy, getSecurityContext, getServiceName, getTerminationTime, getUniqueID, hasChanged, isDestroyed, isExpired, passivate, postActivate, processMessages, setHome, setSecurityContext, setServiceName, setUniqueID
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
See Also:
Constant Field Values

logger

protected static final org.apache.log4j.Logger logger

INSERT

public static final int INSERT
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

UPDATE

public static final int UPDATE
See Also:
Constant Field Values

properties

@Persist
protected HashMap<QName,ResourceProperty> properties
Constructor Detail

WSResourceImpl

public WSResourceImpl()
default constructor
further initialisation is done through initialise() or activate()

Method Detail

getResourcePropertyXML

public org.apache.xmlbeans.XmlObject[] getResourcePropertyXML(QName qn)
retrieve the XML for a resource property by QName.
The update() method on the ResourceProperty is invoked

Parameters:
qn - the QName of the resource property
Returns:
XmlObject[] the resource property

getResourceProperty

public ResourceProperty<?> getResourceProperty(QName qn)
retrieve the XML for a resource property by QName.
The update() method on the ResourceProperty is invoked

Parameters:
qn - the QName of the resource property
Returns:
XmlObject[] the resource property

getResourcePropertyObject

public Object getResourcePropertyObject(QName qn)
retrieve the "backing object" of a resource property by its QName. The update() method on the ResourceProperty is invoked

Parameters:
qn - the QName of the resource property
Returns:
Object the resource property's "backing" object if it exists, else "null"

getResourcePropertyQNames

public QName[] getResourcePropertyQNames()
get the QNames of all registered resource properties


Destroy

public org.oasisOpen.docs.wsrf.rl2.DestroyResponseDocument Destroy(org.oasisOpen.docs.wsrf.rl2.DestroyDocument in)
                                                            throws ResourceNotDestroyedFault,
                                                                   ResourceUnknownFault,
                                                                   ResourceUnavailableFault
Specified by:
Destroy in interface ResourceLifetime
Throws:
ResourceNotDestroyedFault
ResourceUnknownFault
ResourceUnavailableFault

SetTerminationTime

public org.oasisOpen.docs.wsrf.rl2.SetTerminationTimeResponseDocument SetTerminationTime(org.oasisOpen.docs.wsrf.rl2.SetTerminationTimeDocument in)
                                                                                  throws UnableToSetTerminationTimeFault,
                                                                                         TerminationTimeChangeRejectedFault,
                                                                                         ResourceUnknownFault,
                                                                                         ResourceUnavailableFault
Specified by:
SetTerminationTime in interface ResourceLifetime
Throws:
UnableToSetTerminationTimeFault
TerminationTimeChangeRejectedFault
ResourceUnknownFault
ResourceUnavailableFault

DeleteResourceProperties

public org.oasisOpen.docs.wsrf.rp2.DeleteResourcePropertiesResponseDocument DeleteResourceProperties(org.oasisOpen.docs.wsrf.rp2.DeleteResourcePropertiesDocument in)
                                                                                              throws ResourceUnknownFault,
                                                                                                     ResourceUnavailableFault,
                                                                                                     BaseFault
delete RP

Specified by:
DeleteResourceProperties in interface ResourceProperties
Throws:
ResourceUnknownFault
ResourceUnavailableFault
BaseFault

PutResourcePropertyDocument

public org.oasisOpen.docs.wsrf.rp2.PutResourcePropertyDocumentResponseDocument PutResourcePropertyDocument(org.oasisOpen.docs.wsrf.rp2.PutResourcePropertyDocumentDocument1 in)
                                                                                                    throws ResourceUnknownFault,
                                                                                                           ResourceUnavailableFault,
                                                                                                           BaseFault
Specified by:
PutResourcePropertyDocument in interface ResourceProperties
Throws:
ResourceUnknownFault
ResourceUnavailableFault
BaseFault

InsertResourceProperties

public org.oasisOpen.docs.wsrf.rp2.InsertResourcePropertiesResponseDocument InsertResourceProperties(org.oasisOpen.docs.wsrf.rp2.InsertResourcePropertiesDocument in)
                                                                                              throws ResourceUnknownFault,
                                                                                                     ResourceUnavailableFault,
                                                                                                     BaseFault
insert RP

Specified by:
InsertResourceProperties in interface ResourceProperties
Throws:
ResourceUnknownFault
ResourceUnavailableFault
BaseFault

getResourcePropertyResponseDocument

public org.apache.xmlbeans.XmlObject getResourcePropertyResponseDocument()
                                                                  throws Exception
returns the resource property document

Returns:
Throws:
Exception

getResourcePropertyDocumentQName

public abstract QName getResourcePropertyDocumentQName()
returns the QName of the resource properties document

Returns:

fillResourcePropertyDocument

public org.apache.xmlbeans.XmlObject fillResourcePropertyDocument()
fills the given resource property document in a schema-compliant way

Type Parameters:
T -
Parameters:
rp -

GetResourcePropertyDocument

@ConcurrentAccess
public org.oasisOpen.docs.wsrf.rp2.GetResourcePropertyDocumentResponseDocument GetResourcePropertyDocument(org.oasisOpen.docs.wsrf.rp2.GetResourcePropertyDocumentDocument1 in)
                                                                                                    throws BaseFault,
                                                                                                           ResourceUnknownFault,
                                                                                                           ResourceUnavailableFault
Retrieve all the resource properties. This will return the RPs as an "array" of xml. In general, this will not correspond to the schema doc. If you need schema-compliance, you'll have to override the protected method getResourcePropertyDocument() in your WSResource implementation class

Specified by:
GetResourcePropertyDocument in interface ResourceProperties
Throws:
BaseFault
ResourceUnknownFault
ResourceUnavailableFault

UpdateResourceProperties

public org.oasisOpen.docs.wsrf.rp2.UpdateResourcePropertiesResponseDocument UpdateResourceProperties(org.oasisOpen.docs.wsrf.rp2.UpdateResourcePropertiesDocument in)
                                                                                              throws BaseFault
Specified by:
UpdateResourceProperties in interface ResourceProperties
Throws:
BaseFault

GetResourceProperty

@ConcurrentAccess
public org.oasisOpen.docs.wsrf.rp2.GetResourcePropertyResponseDocument GetResourceProperty(org.oasisOpen.docs.wsrf.rp2.GetResourcePropertyDocument in)
                                                                                    throws BaseFault,
                                                                                           ResourceUnknownFault,
                                                                                           ResourceUnavailableFault,
                                                                                           InvalidResourcePropertyQNameFault
Specified by:
GetResourceProperty in interface ResourceProperties
Throws:
BaseFault
ResourceUnknownFault
ResourceUnavailableFault
InvalidResourcePropertyQNameFault

GetMultipleResourceProperties

@ConcurrentAccess
public org.oasisOpen.docs.wsrf.rp2.GetMultipleResourcePropertiesResponseDocument GetMultipleResourceProperties(org.oasisOpen.docs.wsrf.rp2.GetMultipleResourcePropertiesDocument in)
                                                                                                        throws BaseFault
Specified by:
GetMultipleResourceProperties in interface ResourceProperties
Throws:
BaseFault

QueryResourceProperties

@ConcurrentAccess
public org.oasisOpen.docs.wsrf.rp2.QueryResourcePropertiesResponseDocument QueryResourceProperties(org.oasisOpen.docs.wsrf.rp2.QueryResourcePropertiesDocument in)
                                                                                            throws BaseFault
query resource properties.
As per the wsrf spec, we support only XPath, without needing to announce the query expression dialect as an rp.

Specified by:
QueryResourceProperties in interface ResourceProperties
Throws:
BaseFault

SetResourceProperties

public org.oasisOpen.docs.wsrf.rp2.SetResourcePropertiesResponseDocument SetResourceProperties(org.oasisOpen.docs.wsrf.rp2.SetResourcePropertiesDocument in)
                                                                                        throws BaseFault
Specified by:
SetResourceProperties in interface ResourceProperties
Throws:
BaseFault

initialise

public void initialise(String serviceName,
                       Map<String,Object> initobjs)
                throws Exception
initialise this WS Resource
In subclasses, a call to super.initialise() is highly recommended!

Specified by:
initialise in interface WSRFInstance
Overrides:
initialise in class WSRFInstanceImpl
Parameters:
home - - the Home of this wsresource
initobjs - - a Map containing initialisation params
Throws:
Exception

activate

public void activate(Map<String,Serializable> state)
reactivate the instance

Specified by:
activate in interface WSRFInstance
Overrides:
activate in class WSRFInstanceImpl
Parameters:
state - a map containing the state of the WS-Resource

isModifyable

protected boolean isModifyable(ResourceProperty<?> rp,
                               int operation)
check whether the given rp is modifyable using the given operation

Parameters:
rp -
operation -
Returns:


Copyright © 2010. All Rights Reserved.