org.apache.muse.ws.resource.metadata
Interface MetadataDescriptor

All Superinterfaces:
XmlSerializable
All Known Implementing Classes:
OpenMetadataDescriptor, SimpleMetadataDescriptor

public interface MetadataDescriptor
extends XmlSerializable

MetadataDescriptor is an interface for a single metadata descriptor. It defines a lookup service for property metadata; in addition to actual metadata values, the interface has convenience methods for answering common questions ("Can I delete this property?", etc.) rather than requiring the user to calculate the answers based on metadata values. This interface is based on WS-RMD 1.0.

Author:
Dan Jemiolo (danj)

Method Summary
 void addProperty(QName property, String modifiability, String mutability)
          Adds another wsrmd:Property element to the descriptor with the basic metadata attributes required by the spec.
 boolean canDelete(QName property)
           
 boolean canInsert(QName property)
           
 boolean canUpdate(QName property)
           
 String getExtendedMetadata(QName property, QName elementName)
          This method allows you to extend a wsrmd:Property definition and provide application-specific metadata for a property.
 Collection getExtendedMetadataNames(QName property)
           
 Collection getInitialValues(QName property)
           
 Collection getInitialValues(QName property, Class javaType)
           
 QName getInterface()
           
 String getLowerBound(QName property)
           
 String getModifiability(QName property)
          Most users will probably want to use the canDelete(), canInsert(), and canUpdate() methods to test the permissions of a property; these methods handle the Boolean logic between modifiability and mutability values so you don't have to litter your code with messy if/else blocks.
 String getMutability(QName property)
          Most users will probably want to use the canDelete(), canInsert(), and canUpdate() methods to test the permissions of a property; these methods handle the Boolean logic between modifiability and mutability values so you don't have to litter your code with messy if/else blocks.
 String getName()
           
 Collection getPropertyNames()
           
 Collection getStaticValues(QName property)
           
 Collection getStaticValues(QName property, Class javaType)
           
 String getUpperBound(QName property)
           
 Collection getValidValues(QName property)
           
 Collection getValidValues(QName property, Class javaType)
           
 String getWsdlLocation()
           
 boolean hasProperty(QName property)
           
 boolean isInitialValue(QName property, Object value)
           
 boolean isReadOnlyExternal(QName property)
           
 boolean isStaticValue(QName property, Object value)
           
 boolean isValidValue(QName property, Object value)
           
 void removeProperty(QName property)
          Removes the wsrmd:Property element with the given name.
 void setExtendedMetadata(QName property, QName elementName, String value)
          This method allows you to extend a wsrmd:Property definition and provide application-specific metadata for a property.
 void setInitialValues(QName property, Collection values)
           
 void setLowerBound(QName property, String value)
           
 void setModifiability(QName property, String value)
           
 void setMutability(QName property, String value)
           
 void setPropertyName(QName currentProperty, QName newProperty)
          Change the name of one of the current wsrmd:Property elements.
 void setStaticValues(QName property, Collection values)
           
 void setUpperBound(QName property, String value)
           
 void setValidValues(QName property, Collection values)
           
 
Methods inherited from interface org.apache.muse.util.xml.XmlSerializable
toXML, toXML
 

Method Detail

addProperty

void addProperty(QName property,
                 String modifiability,
                 String mutability)
Adds another wsrmd:Property element to the descriptor with the basic metadata attributes required by the spec.

Parameters:
property - The name of the property this metadata refers to.
modifiability - Use WsrmdConstants.READ_ONLY or WsrmdConstants.READ_WRITE.
mutability - Use WsrmdConstants.CONSTANT, WsrmdConstants.APPENDABLE, or WsrmdConstants.MUTABLE.
See Also:
WsrmdConstants

canDelete

boolean canDelete(QName property)
Parameters:
property -
Returns:
True if the property can be deleted (it is read-write and mutable)

canInsert

boolean canInsert(QName property)
Parameters:
property -
Returns:
True if the property can have new instances inserted (it is read-write and mutable/appendable).

canUpdate

boolean canUpdate(QName property)
Parameters:
property -
Returns:
True if the property's instances can be updated (it is read-write and mutable).

getExtendedMetadata

String getExtendedMetadata(QName property,
                           QName elementName)
This method allows you to extend a wsrmd:Property definition and provide application-specific metadata for a property. These will be parsed as simple name-value pairs - you cannot associate complex types or XML fragments with an extended metadata item.

Parameters:
property -
elementName - The name of the extended metadata item.
Returns:
The value of the extended metadata item, or null if there is no such item.

getExtendedMetadataNames

Collection getExtendedMetadataNames(QName property)
Parameters:
property -
Returns:
The names (QNames) of all extended metadata elements defined for this property. The collection may be empty.

getInitialValues

Collection getInitialValues(QName property)
Parameters:
property -
Returns:
The collection of initial values defined for this property.

The actual values are DOM Elements, since that is how they are described in the RMD. They can be compared to the results of a WS-RP GetResourceProperty call.
See Also:
getInitialValues(QName, Class)

getInitialValues

Collection getInitialValues(QName property,
                            Class javaType)
                            throws SoapFault
Parameters:
property -
javaType - The type whose serializer should be used to convert the property values (DOM Elements) into POJOs.
Returns:
The array of getInitialValues(QName) in POJO form.
Throws:
SoapFault -
  • If there is no Serializer registered for the given type.
  • If the property value XML can not be translated into an instance of the given type.
See Also:
getValidValues(QName)

getInterface

QName getInterface()

getLowerBound

String getLowerBound(QName property)
Parameters:
property -
Returns:
The lower bound of the property's valid value range, if one is defined. The user must interpret the string value in the context of the property's type. The method returns null if no range is defined.

getModifiability

String getModifiability(QName property)
Most users will probably want to use the canDelete(), canInsert(), and canUpdate() methods to test the permissions of a property; these methods handle the Boolean logic between modifiability and mutability values so you don't have to litter your code with messy if/else blocks. This method returns the actual string value of the attribute that is used in the RMD doc.

Returns:
WsrmdConstants.READ_ONLY or WsrmdConstants.READ_WRITE
See Also:
canDelete(QName), canInsert(QName), canUpdate(QName)

getMutability

String getMutability(QName property)
Most users will probably want to use the canDelete(), canInsert(), and canUpdate() methods to test the permissions of a property; these methods handle the Boolean logic between modifiability and mutability values so you don't have to litter your code with messy if/else blocks. This method returns the actual string value of the attribute that is used in the RMD doc.

Returns:
WsrmdConstants.CONSTANT, WsrmdConstants.APPENDABLE, or WsrmdConstants.MUTABLE
See Also:
canDelete(QName), canInsert(QName), canUpdate(QName)

getName

String getName()
Returns:
The name of the metadata descriptor (defined in XML by its "name" attribute).

getPropertyNames

Collection getPropertyNames()
Returns:
The collection of property names that are defined in this descriptor.

getStaticValues

Collection getStaticValues(QName property)
Parameters:
property -
Returns:
The collection of static values defined for this property. If no static values exist, the collection will be empty.

The actual values are DOM Elements, since that is how they are described in the RMD. They can be compared to the results of a WS-RP GetResourceProperty call.
See Also:
getStaticValues(QName, Class)

getStaticValues

Collection getStaticValues(QName property,
                           Class javaType)
                           throws SoapFault
Parameters:
property -
javaType - The type whose serializer should be used to convert the property values (DOM Elements) into POJOs.
Returns:
The array of getStaticValues(QName) in POJO form.
Throws:
SoapFault -
  • If there is no Serializer registered for the given type.
  • If the property value XML can not be translated into an instance of the given type.
See Also:
getStaticValues(QName)

getUpperBound

String getUpperBound(QName property)
Parameters:
property -
Returns:
The upper bound of the property's valid value range, if one is defined. The user must interpret the string value in the context of the property's type. The method returns null if no range is defined.

getValidValues

Collection getValidValues(QName property)
Parameters:
property -
Returns:
The collection of valid values defined for this property. If no valid values exist, the collection will be empty (in this case, all values are valid).

The actual values are DOM Elements, since that is how they are described in the RMD (unlike a valid value range, the valid values are complete property instances). They can be compared to the results of a WS-RP GetResourceProperty call.
See Also:
getValidValues(QName, Class)

getValidValues

Collection getValidValues(QName property,
                          Class javaType)
                          throws SoapFault
Parameters:
property -
javaType - The type whose serializer should be used to convert the property values (DOM Elements) into POJOs.
Returns:
The array of getValidValues(QName) in POJO form.
Throws:
SoapFault -
  • If there is no Serializer registered for the given type.
  • If the property value XML can not be translated into an instance of the given type.
See Also:
getValidValues(QName)

getWsdlLocation

String getWsdlLocation()

hasProperty

boolean hasProperty(QName property)
Parameters:
property -
Returns:
True if the descriptor defines a property with the given name.

isInitialValue

boolean isInitialValue(QName property,
                       Object value)
Parameters:
property -
value -
Returns:
True if the given value is found in the property's set of initial values. If the property has no initial values defined, the method returns "false".

isReadOnlyExternal

boolean isReadOnlyExternal(QName property)
Parameters:
property -
Returns:
True if the property cannot be modified by external clients, but is mutable by internal code (it is read-only but mutable).

isStaticValue

boolean isStaticValue(QName property,
                      Object value)
Parameters:
property -
value -
Returns:
True if the given value is found in the property's set of static values. If the property has no static values defined, the method returns "false".

isValidValue

boolean isValidValue(QName property,
                     Object value)
Parameters:
property -
value -
Returns:
True if the given value is found in the property's set of valid values. If the property has no valid values defined, the method returns "true".

removeProperty

void removeProperty(QName property)
Removes the wsrmd:Property element with the given name.

Parameters:
property - The name of the property to remove.

setExtendedMetadata

void setExtendedMetadata(QName property,
                         QName elementName,
                         String value)
This method allows you to extend a wsrmd:Property definition and provide application-specific metadata for a property.

Parameters:
property - The wsrmd:Property element to which the new element should be added.
elementName - The name of the extended metadata item. param value The value of the extended metadata item(may be null).

setInitialValues

void setInitialValues(QName property,
                      Collection values)
                      throws SoapFault
Throws:
SoapFault

setLowerBound

void setLowerBound(QName property,
                   String value)

setModifiability

void setModifiability(QName property,
                      String value)
Parameters:
property - The wsrmd:Property element whose modifiability attribute will be changed.
value - WsrmdConstants.READ_ONLY or WsrmdConstants.READ_WRITE

setMutability

void setMutability(QName property,
                   String value)
Parameters:
property - The wsrmd:Property element whose mutability attribute will be changed.
value - WsrmdConstants.CONSTANT, WsrmdConstants.APPENDABLE, or WsrmdConstants.MUTABLE

setPropertyName

void setPropertyName(QName currentProperty,
                     QName newProperty)
Change the name of one of the current wsrmd:Property elements. The new name cannot be one of the existing properties' names.

Parameters:
currentProperty -
newProperty -

setStaticValues

void setStaticValues(QName property,
                     Collection values)
                     throws SoapFault
Throws:
SoapFault

setUpperBound

void setUpperBound(QName property,
                   String value)

setValidValues

void setValidValues(QName property,
                    Collection values)
                    throws SoapFault
Throws:
SoapFault


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