org.apache.muse.ws.resource.properties.schema
Interface ResourcePropertiesSchemaValidation

All Known Subinterfaces:
ResourcePropertyCollection
All Known Implementing Classes:
SimpleResourcePropertyCollection

public interface ResourcePropertiesSchemaValidation

ResourcePropertiesSchemaValidation is a set of methods for WSRP implementations that provide schema validation and a capability delegation model.

Author:
Dan Jemiolo (danj)

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.
 WsResourceCapability getCapability(QName qname)
           
 Collection getPropertyNames()
           
 ResourcePropertiesSchema getSchema()
           
 boolean hasPropertyDefinition(QName qname)
           
 void setSchema(ResourcePropertiesSchema schema)
          Applies the given XMLSchema definitions to this WS-RP document.
 void validateSchema()
          Iterates through every property in the WS-RP document's XMLSchema and verifies current document is valid.
 

Method Detail

addCapability

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.

Parameters:
capability -

getCapability

WsResourceCapability getCapability(QName qname)
Parameters:
qname - The name of the resource property whose capability is being queried.
Returns:
The capability that defines the given property, or null if the property does not exist.

getPropertyNames

Collection getPropertyNames()
Returns:
All of the resource properties defined by the schema.

getSchema

ResourcePropertiesSchema getSchema()
Returns:
The XSD for this WS-RP document.

hasPropertyDefinition

boolean hasPropertyDefinition(QName qname)
Parameters:
qname - The name of a resource property to search the schema for.
Returns:
True if there is a schema definition with the given name.

setSchema

void setSchema(ResourcePropertiesSchema schema)
Applies the given XMLSchema definitions to this WS-RP document. This schema will be used for all subsequent validations, including calls to validateSchema() and SetResourceProperties-like operations.

Note that this method does not perform validation.

Parameters:
schema - The XSD properties definition for this WS-RP document.
See Also:
validateSchema()

validateSchema

void validateSchema()
                    throws BaseFault
Iterates through every property in the WS-RP document's XMLSchema and verifies current document is valid. This method should be used sparingly, as it will validate every property; for cases such as SetResourceProperties, the implementation of the operations should validate the individual property being targeted, not the whole document.

Throws:
BaseFault -
  • If the number of instances of a property is below the required minimum.
  • If the number of instances of a property is above the required maximum.
  • If an instance of the property is null (the equivalent of an empty XML element) but the property is not nillable.


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.