org.globus.wsrf.impl
Class SimpleResourcePropertySet

java.lang.Object
  extended byorg.globus.wsrf.impl.SimpleResourcePropertySet
All Implemented Interfaces:
ResourcePropertySet

public class SimpleResourcePropertySet
extends java.lang.Object
implements ResourcePropertySet

Simple in-memory implementation of ResourcePropertySet. This class is not thread-safe.


Field Summary
private static org.globus.util.I18n i18n
           
private  boolean localNameMatching
           
private  javax.xml.namespace.QName name
           
private  boolean openContent
           
private  java.util.List propertiesList
           
private  java.util.Map propertiesMap
           
 
Constructor Summary
SimpleResourcePropertySet(javax.xml.namespace.QName name)
           
 
Method Summary
 boolean add(ResourceProperty property)
          Adds a resource property to the set and makes it available to queries and subscriptions, etc.
 void clear()
          Removes all resource properties.
 ResourceProperty create(ResourcePropertyMetaData rpMetaData)
          Creates a resource property entry with the specified meta data.
 ResourceProperty get(javax.xml.namespace.QName name)
          Retrieves a resource property.
 javax.xml.namespace.QName getName()
          Returns the element name of the entire resource properties document.
 boolean isEmpty()
          Returns true if the set has at least one resource property.
 boolean isLocalNameMatching()
          Returns whether local name matching is allowed.
 boolean isOpenContent()
          Indicates if the resource property set allows adding of new arbitrary resource property elements.
 java.util.Iterator iterator()
          Returns an iterator over ResourceProperty entries.
 boolean remove(javax.xml.namespace.QName name)
          Removes a resource property.
 void setLocalNameMatching(boolean matching)
          Configures if ResourceProperty can be retrieved just by matching the local name (namespace part is ignored).
 void setOpenContent(boolean open)
          Configures open content property.
 int size()
          Returns the number of resource properties this set contains.
 org.w3c.dom.Element toElement()
          Returns the entire Resource Property document as a DOM Element.
protected  org.w3c.dom.Element toElementGeneral()
           
protected  org.w3c.dom.Element toElementSpecific()
           
 javax.xml.soap.SOAPElement toSOAPElement()
          Returns the entire Resource Property document as a SOAPElement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i18n

private static org.globus.util.I18n i18n

name

private javax.xml.namespace.QName name

propertiesMap

private java.util.Map propertiesMap

propertiesList

private java.util.List propertiesList

openContent

private boolean openContent

localNameMatching

private boolean localNameMatching
Constructor Detail

SimpleResourcePropertySet

public SimpleResourcePropertySet(javax.xml.namespace.QName name)
Method Detail

getName

public javax.xml.namespace.QName getName()
Description copied from interface: ResourcePropertySet
Returns the element name of the entire resource properties document.

Specified by:
getName in interface ResourcePropertySet
Returns:
the element name of the entire resource properties document.

create

public ResourceProperty create(ResourcePropertyMetaData rpMetaData)
Description copied from interface: ResourcePropertySet
Creates a resource property entry with the specified meta data. Note the resource property is not added to the set (and thus not target to queries or subscriptions)until the add method is called.

Specified by:
create in interface ResourcePropertySet

get

public ResourceProperty get(javax.xml.namespace.QName name)
Description copied from interface: ResourcePropertySet
Retrieves a resource property.

Specified by:
get in interface ResourcePropertySet
Parameters:
name - the name of the ResourceProperty to retrieve.
Returns:
the ResourceProperty that was retrieved. Null if the property does not exist.

add

public boolean add(ResourceProperty property)
Description copied from interface: ResourcePropertySet
Adds a resource property to the set and makes it available to queries and subscriptions, etc.

Specified by:
add in interface ResourcePropertySet
Parameters:
property - the ResourceProperty to add.
Returns:
true if property was successfully added, false otherwise.

remove

public boolean remove(javax.xml.namespace.QName name)
Description copied from interface: ResourcePropertySet
Removes a resource property.

Specified by:
remove in interface ResourcePropertySet
Parameters:
name - the name of the ResourceProperty to remove.
Returns:
true if property was successfully removed, false otherwise.

iterator

public java.util.Iterator iterator()
Description copied from interface: ResourcePropertySet
Returns an iterator over ResourceProperty entries.

Specified by:
iterator in interface ResourcePropertySet
Returns:
an iterator over ResourceProperty entries.

isOpenContent

public boolean isOpenContent()
Description copied from interface: ResourcePropertySet
Indicates if the resource property set allows adding of new arbitrary resource property elements.

Specified by:
isOpenContent in interface ResourcePropertySet
Returns:
true if adding new resource property elements is allowed. False otherwise. Please note that isOpenContent might return true but only certain subset of resource properties will be allowed to be added.

clear

public void clear()
Description copied from interface: ResourcePropertySet
Removes all resource properties.

Specified by:
clear in interface ResourcePropertySet

size

public int size()
Description copied from interface: ResourcePropertySet
Returns the number of resource properties this set contains.

Specified by:
size in interface ResourcePropertySet
Returns:
the number of resource properties contained.

isEmpty

public boolean isEmpty()
Description copied from interface: ResourcePropertySet
Returns true if the set has at least one resource property.

Specified by:
isEmpty in interface ResourcePropertySet
Returns:
true if the set has at least one resource property. False, otherwise.

setOpenContent

public void setOpenContent(boolean open)
Configures open content property.

Parameters:
open - true if arbitrary resource property can be added to the set.

isLocalNameMatching

public boolean isLocalNameMatching()
Returns whether local name matching is allowed. Local name matching is disabled by default.

Returns:
true if local name matching is allowed. False otherwise.

setLocalNameMatching

public void setLocalNameMatching(boolean matching)
Configures if ResourceProperty can be retrieved just by matching the local name (namespace part is ignored).

Parameters:
matching - true to allow local name matching.

toElement

public org.w3c.dom.Element toElement()
                              throws SerializationException
Description copied from interface: ResourcePropertySet
Returns the entire Resource Property document as a DOM Element.

Specified by:
toElement in interface ResourcePropertySet
Throws:
SerializationException

toElementGeneral

protected org.w3c.dom.Element toElementGeneral()
                                        throws SerializationException
Throws:
SerializationException

toElementSpecific

protected org.w3c.dom.Element toElementSpecific()
                                         throws SerializationException
Throws:
SerializationException

toSOAPElement

public javax.xml.soap.SOAPElement toSOAPElement()
                                         throws SerializationException
Description copied from interface: ResourcePropertySet
Returns the entire Resource Property document as a SOAPElement.

Specified by:
toSOAPElement in interface ResourcePropertySet
Throws:
SerializationException