|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection
public class SimpleResourcePropertyCollection
SimpleResourcePropertyCollection is Muse's default implementation of the WS-RF state model. It delegates the handling of actual WS-RP methods to capabilities that define the resource properties, serving only to enforce WS-RP schema and metadata constraints and the formatting of WS-RP faults. It also provides the implementation of the listener framework that allows other components to hook into various parts of the WS-RP operations.
Constructor Summary | |
---|---|
SimpleResourcePropertyCollection()
|
Method Summary | |
---|---|
void |
addCapability(WsResourceCapability capability)
Registers the capability with the schema so that users of the schema can determine which capability is responsible for which resource properties. |
void |
addChangeApprover(PropertyChangeApprover approver)
Associates the given approver with the appropriate property. |
void |
addChangeListener(PropertyChangeListener listener)
Associates the given listener with the appropriate property. |
protected void |
addInitialValues(QName qname)
|
protected void |
addPermissions(QName qname)
|
void |
addReadListener(PropertyReadListener listener)
Associates the given listener with the appropriate property. |
protected void |
addStaticValues(QName qname)
|
protected void |
addValidValues(QName qname)
|
void |
applyMetadata()
Takes the RMD that has been provided through setMetadata() and creates components that will enforce it. |
protected void |
changeCompleted(QName qname,
Element oldValue,
Element newValue)
Reports the completed property change to all PropertyChangeListeners. |
protected void |
changeRequested(QName qname,
Element oldValue,
Element newValue,
Object securityToken)
Reports the pending property change to all PropertyChangeApprovers. |
protected SetRequest |
createInsertRequests(Element newDoc)
|
protected void |
deleteMutableProperties()
|
void |
deleteResourceProperty(QName qname)
Removes all properties with the given name. |
void |
deleteResourceProperty(QName qname,
Object securityToken)
Removes all properties with the given name. |
WsResourceCapability |
getCapability(QName qname)
|
Iterator |
getChangeApprovers(QName property)
|
Iterator |
getChangeListeners(QName property)
|
MetadataDescriptor |
getMetadata()
|
Element[] |
getMultipleResourceProperties(QName[] qnames)
Returns zero or more instances of the given properties. |
Object |
getPropertyAsObject(QName qname,
Class type)
Returns zero or more instances of the given property, deserialized into instances of the given type. |
Collection |
getPropertyNames()
|
Iterator |
getReadListeners(QName property)
|
Element[] |
getResourceProperty(QName qname)
Returns zero or more instances of the given property. |
Element |
getResourcePropertyDocument()
|
ResourcePropertiesSchema |
getSchema()
|
Object |
getSecurityToken()
Returns the security token that can be used by users of the WS-RP document to verify that they are internal callers with permission to circumvent published restrictions on property changes, etc. |
boolean |
hasPropertyDefinition(QName qname)
|
void |
insertOrUpdate(QName property,
Object value)
This is just a convenience method that will call insertOrUpdate(QName, Object[]) with a one-element array. |
void |
insertOrUpdate(QName property,
Object[] values)
Checks to see if there is already an instance of the property, and if so, updates it with the given values; otherwise, it inserts the values. |
void |
insertResourceProperty(QName qname,
Object[] values)
Creates new instances of the given property using the given values. |
void |
insertResourceProperty(QName qname,
Object[] values,
Object securityToken)
Creates a new instance of the given property for each value specified in the array of values. |
Element |
putResourcePropertyDocument(Element newDoc)
|
protected Element[] |
readRequested(QName qname,
Element[] properties)
Reports all property read requests to the PropertyReadListeners. |
void |
removeChangeApprover(PropertyChangeApprover approver)
Removes the assocation between the given approver and its property. |
void |
removeChangeListener(PropertyChangeListener listener)
Removes the assocation between the given listener and its property. |
void |
removeReadListener(PropertyReadListener listener)
Removes the assocation between the given listener and its property. |
void |
setMetadata(MetadataDescriptor metadata)
Provides the given WS-RMD MetadataDescriptor to this WS-RP document. |
void |
setResourceProperties(SetRequest request)
Modifies one or more property instances according to the definition of the three WS-RP write operations: Insert, Update, and Delete. |
void |
setSchema(ResourcePropertiesSchema schema)
Applies the given XMLSchema definitions to this WS-RP document. |
String |
toString()
|
Element |
toXML()
Converts this object into an XML representation, as defined by its related schema or specification. |
Element |
toXML(Document factory)
Converts this object into an XML representation, as defined by its related schema or specification. |
void |
updateResourceProperty(QName qname,
Object[] values)
Replaces all of a property's current values with the given values. |
void |
updateResourceProperty(QName qname,
Object[] values,
Object securityToken)
Updates all instances of the given property using the given values; all previous values will be removed in lieu of these new values. |
protected void |
validateDelete(QName qname,
int currentSize,
int toDelete)
Confirms that deleting the desired number of property instances will result in a WS-RP document that is valid according to the schema. |
protected void |
validateInsert(QName qname,
int currentSize,
Element[] values)
Confirms that inserting the desired property instances will result in a WS-RP document that is valid according to the schema. |
void |
validateMetadata()
Iterates through every property in the WS-RMD metadata and verifies that the current WS-RP document is valid. |
protected void |
validateNillable(QName qname,
Element[] instances,
boolean isNillable)
|
void |
validateSchema()
Iterates through every property in the WS-RP document's XMLSchema and verifies current document is valid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleResourcePropertyCollection()
Method Detail |
---|
public void addCapability(WsResourceCapability capability)
ResourcePropertiesSchemaValidation
addCapability
in interface ResourcePropertiesSchemaValidation
public final void addChangeApprover(PropertyChangeApprover approver)
ResourcePropertyListeners
addChangeApprover
in interface ResourcePropertyListeners
approver
- The approver that will be notified of all pending changes.PropertyChangeApprover.getPropertyName()
,
ResourcePropertyListeners.removeChangeApprover(PropertyChangeApprover)
public final void addChangeListener(PropertyChangeListener listener)
ResourcePropertyListeners
addChangeListener
in interface ResourcePropertyListeners
listener
- The listener that will be notified of all completed changes.PropertyChangeListener.getPropertyName()
,
ResourcePropertyListeners.removeChangeListener(PropertyChangeListener)
protected void addInitialValues(QName qname)
protected void addPermissions(QName qname)
public final void addReadListener(PropertyReadListener listener)
ResourcePropertyListeners
addReadListener
in interface ResourcePropertyListeners
listener
- The listener that will be notified of all pending read requests.PropertyReadListener.getPropertyName()
,
ResourcePropertyListeners.removeReadListener(PropertyReadListener)
protected void addStaticValues(QName qname)
protected void addValidValues(QName qname)
public void applyMetadata()
ResourcePropertiesMetadataValidation
applyMetadata
in interface ResourcePropertiesMetadataValidation
protected final void changeCompleted(QName qname, Element oldValue, Element newValue) throws BaseFault
qname
- oldValue
- newValue
-
BaseFault
- protected final void changeRequested(QName qname, Element oldValue, Element newValue, Object securityToken) throws BaseFault
qname
- oldValue
- newValue
- securityToken
-
BaseFault
- protected SetRequest createInsertRequests(Element newDoc) throws UnableToPutResourcePropertyDocumentFault, BaseFault
UnableToPutResourcePropertyDocumentFault
BaseFault
protected void deleteMutableProperties() throws BaseFault
BaseFault
public void deleteResourceProperty(QName qname) throws BaseFault
SetResourcePropertiesComponents
deleteResourceProperty
in interface SetResourcePropertiesComponents
BaseFault
public void deleteResourceProperty(QName qname, Object securityToken) throws BaseFault
SetResourcePropertiesPermissions
deleteResourceProperty
in interface SetResourcePropertiesPermissions
qname
- The name of the property to delete.securityToken
- The token used to verify permission to call this method.
BaseFault
- public WsResourceCapability getCapability(QName qname)
getCapability
in interface ResourcePropertiesSchemaValidation
qname
- The name of the resource property whose capability is being queried.
public final Iterator getChangeApprovers(QName property)
getChangeApprovers
in interface ResourcePropertyListeners
public final Iterator getChangeListeners(QName property)
getChangeListeners
in interface ResourcePropertyListeners
public final MetadataDescriptor getMetadata()
getMetadata
in interface ResourcePropertiesMetadataValidation
public Element[] getMultipleResourceProperties(QName[] qnames) throws InvalidResourcePropertyQNameFault, BaseFault
GetMultipleResourceProperties
getMultipleResourceProperties
in interface GetMultipleResourceProperties
qnames
- The names of the properties to find.
BaseFault
- InvalidResourcePropertyQNameFault
public Object getPropertyAsObject(QName qname, Class type) throws BaseFault
GetResourcePropertyExtensions
getPropertyAsObject
in interface GetResourcePropertyExtensions
qname
- The name of the property to find.type
- The type of the property instances returned by this method.
Every object in the returned array can be cast to this type.
BaseFault
- GetResourceProperty
public Collection getPropertyNames()
getPropertyNames
in interface ResourcePropertiesSchemaValidation
public final Iterator getReadListeners(QName property)
getReadListeners
in interface ResourcePropertyListeners
public Element[] getResourceProperty(QName qname) throws InvalidResourcePropertyQNameFault, BaseFault
getResourceProperty
in interface GetResourceProperty
qname
- The name of the property to find.
InvalidResourcePropertyQNameFault
- BaseFault
getPropertyAsObject(QName, Class)
public Element getResourcePropertyDocument() throws BaseFault
getResourcePropertyDocument
in interface GetResourcePropertyDocument
BaseFault
public final ResourcePropertiesSchema getSchema()
getSchema
in interface ResourcePropertiesSchemaValidation
public Object getSecurityToken()
SetResourcePropertiesPermissions
getSecurityToken
in interface SetResourcePropertiesPermissions
public boolean hasPropertyDefinition(QName qname)
hasPropertyDefinition
in interface ResourcePropertiesSchemaValidation
qname
- The name of a resource property to search the schema for.
public void insertOrUpdate(QName property, Object value) throws BaseFault
SetResourcePropertiesExtensions
insertOrUpdate
in interface SetResourcePropertiesExtensions
BaseFault
public void insertOrUpdate(QName property, Object[] values) throws BaseFault
SetResourcePropertiesExtensions
insertOrUpdate
in interface SetResourcePropertiesExtensions
BaseFault
public void insertResourceProperty(QName qname, Object[] values) throws BaseFault
SetResourcePropertiesComponents
insertResourceProperty
in interface SetResourcePropertiesComponents
BaseFault
public void insertResourceProperty(QName qname, Object[] values, Object securityToken) throws BaseFault
SetResourcePropertiesPermissions
insertResourceProperty
in interface SetResourcePropertiesPermissions
qname
- The name of the property instances to create.values
- The set of values that will be assigned to the new property
instances. Each value will be created once.securityToken
- The token used to verify permission to call this method.
BaseFault
- public Element putResourcePropertyDocument(Element newDoc) throws UnableToPutResourcePropertyDocumentFault, BaseFault
putResourcePropertyDocument
in interface PutResourcePropertyDocument
newDoc
- The new WSRP document for the resource instance.
BaseFault
UnableToPutResourcePropertyDocumentFault
protected final Element[] readRequested(QName qname, Element[] properties) throws BaseFault
qname
- The name of the property being read.properties
- The current values of the property, which will be given to
the caller once all listeners have been invoked.
BaseFault
- public final void removeChangeApprover(PropertyChangeApprover approver)
ResourcePropertyListeners
removeChangeApprover
in interface ResourcePropertyListeners
public final void removeChangeListener(PropertyChangeListener listener)
ResourcePropertyListeners
removeChangeListener
in interface ResourcePropertyListeners
public final void removeReadListener(PropertyReadListener listener)
ResourcePropertyListeners
removeReadListener
in interface ResourcePropertyListeners
public void setMetadata(MetadataDescriptor metadata)
ResourcePropertiesMetadataValidation
setMetadata
in interface ResourcePropertiesMetadataValidation
metadata
- The WS-RMD metadata for this WS-RP document.ResourcePropertiesMetadataValidation.applyMetadata()
,
ResourcePropertiesMetadataValidation.validateMetadata()
public void setResourceProperties(SetRequest request) throws BaseFault
SetResourceProperties
setResourceProperties
in interface SetResourceProperties
request
- The SetResourceProperties request that contains the individual
operations { Insert, Update, Delete } to perform on the document.
BaseFault
- SetResourceProperties
public void setSchema(ResourcePropertiesSchema schema)
ResourcePropertiesSchemaValidation
setSchema
in interface ResourcePropertiesSchemaValidation
schema
- The XSD properties definition for this WS-RP document.ResourcePropertiesSchemaValidation.validateSchema()
public String toString()
toString
in class Object
public Element toXML()
XmlSerializable
toXML
in interface XmlSerializable
public Element toXML(Document factory)
XmlSerializable
toXML
in interface XmlSerializable
factory
- The DOM Document that will be used to create all of the nodes
in the resulting XML fragment.
public void updateResourceProperty(QName qname, Object[] values) throws BaseFault
SetResourcePropertiesComponents
updateResourceProperty
in interface SetResourcePropertiesComponents
BaseFault
public void updateResourceProperty(QName qname, Object[] values, Object securityToken) throws BaseFault
SetResourcePropertiesPermissions
updateResourceProperty
in interface SetResourcePropertiesPermissions
qname
- The name of the property to update.values
- The values to assign to the property.securityToken
- The token used to verify permission to call this method.
BaseFault
- protected void validateDelete(QName qname, int currentSize, int toDelete) throws BaseFault
qname
- The name of the property whose instances are being deleted.currentSize
- The current number of instances (before the delete).toDelete
- The number of instances being deleted.
BaseFault
- protected void validateInsert(QName qname, int currentSize, Element[] values) throws BaseFault
qname
- The name of the property that is being inserted.currentSize
- The current number of instances (before the insertion).values
- The property values to insert into the document.
BaseFault
- public void validateMetadata() throws BaseFault
ResourcePropertiesMetadataValidation
validateMetadata
in interface ResourcePropertiesMetadataValidation
BaseFault
- protected void validateNillable(QName qname, Element[] instances, boolean isNillable) throws SchemaValidationFault
SchemaValidationFault
public void validateSchema() throws BaseFault
ResourcePropertiesSchemaValidation
validateSchema
in interface ResourcePropertiesSchemaValidation
BaseFault
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |