org.openorb.property
Class PropertySetImpl

java.lang.Object
  |
  +--org.omg.PortableServer.Servant
        |
        +--org.omg.CosPropertyService.PropertySetPOA
              |
              +--org.openorb.property.PropertySetImpl
All Implemented Interfaces:
org.omg.CORBA.portable.InvokeHandler, PropertySetOperations

public class PropertySetImpl
extends PropertySetPOA

This class provides a PropertySet implementation.

Author:
Jerome Daniel

Constructor Summary
PropertySetImpl(org.omg.CORBA.ORB orb)
          Constructor
PropertySetImpl(org.omg.CORBA.ORB orb, Property[] initial_properties)
          Constructor
PropertySetImpl(org.omg.CORBA.ORB orb, org.omg.CORBA.TypeCode[] allowed_property_types, Property[] allowed_properties)
          Constructor
 
Method Summary
 void define_properties(Property[] nproperties)
          Modify or add each of the properties in Properties parameter to the PropertySet.
 void define_property(java.lang.String property_name, org.omg.CORBA.Any property_value)
          Modify or add a property to the PropertySet.
 boolean delete_all_properties()
          Variation of delete_properties.
 void delete_properties(java.lang.String[] property_names)
          delete_properties Deletes the properties defined in the property_names parameter.
 void delete_property(java.lang.String property_name)
          delete_property Deletes the specified property if it exists from a PropertySet.
 void get_all_properties(int how_many, PropertiesHolder nproperties, PropertiesIteratorHolder rest)
          get_all_properties Returns all of the properties defined in the PropertySet.
 void get_all_property_names(int how_many, PropertyNamesHolder property_names, PropertyNamesIteratorHolder rest)
          Returns all of the property names currently defined in the PropertySet.
 int get_number_of_properties()
          get_number_of_properties Returns the current number of properties associated with this PropertySet.
 boolean get_properties(java.lang.String[] property_names, PropertiesHolder nproperties)
          get_properties Returns the values of the properties listed in property_names.
 org.omg.CORBA.Any get_property_value(java.lang.String property_name)
          Returns the value of a property in the PropertySet.
 Property get_property(java.lang.String property_name)
           
 boolean is_property_defined(java.lang.String property_name)
          The is_property_defined operation returns true if the property is defined in the PropertySet, and returns false otherwise.
 
Methods inherited from class org.omg.CosPropertyService.PropertySetPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _get_interface, _is_a, _non_existent, _object_id, _orb, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertySetImpl

public PropertySetImpl(org.omg.CORBA.ORB orb)
Constructor

PropertySetImpl

public PropertySetImpl(org.omg.CORBA.ORB orb,
                       org.omg.CORBA.TypeCode[] allowed_property_types,
                       Property[] allowed_properties)
                throws ConstraintNotSupported
Constructor

PropertySetImpl

public PropertySetImpl(org.omg.CORBA.ORB orb,
                       Property[] initial_properties)
                throws MultipleExceptions
Constructor
Method Detail

define_property

public void define_property(java.lang.String property_name,
                            org.omg.CORBA.Any property_value)
                     throws InvalidPropertyName,
                            ConflictingProperty,
                            UnsupportedTypeCode,
                            UnsupportedProperty,
                            ReadOnlyProperty
Modify or add a property to the PropertySet. If the property already exists, then the property type is checked before the value is overwritten. If the property does not exist, then the property is added to the PropertySet. To change the any TypeCode portion of the property_value of a property, a client must first delete_property, then invoke the define_property.

define_properties

public void define_properties(Property[] nproperties)
                       throws MultipleExceptions
Modify or add each of the properties in Properties parameter to the PropertySet. For each property in the list, if the property already exists, then the property type is checked before overwriting the value. If the property does not exist, then the property is added to the PropertySet. This is a batch operation that returns the MultipleExceptions exception if any define operation failed.

get_number_of_properties

public int get_number_of_properties()
get_number_of_properties Returns the current number of properties associated with this PropertySet.

get_all_property_names

public void get_all_property_names(int how_many,
                                   PropertyNamesHolder property_names,
                                   PropertyNamesIteratorHolder rest)
Returns all of the property names currently defined in the PropertySet. If the PropertySet contains more than how_many property names, then the remaining property names are put into the PropertyNamesIterator.

get_property_value

public org.omg.CORBA.Any get_property_value(java.lang.String property_name)
                                     throws PropertyNotFound,
                                            InvalidPropertyName
Returns the value of a property in the PropertySet.

get_properties

public boolean get_properties(java.lang.String[] property_names,
                              PropertiesHolder nproperties)
get_properties Returns the values of the properties listed in property_names. When the boolean flag is true, the Properties parameter contains valid values for all requested property names. If false, then all properties with a value of type tk_void may have failed due to PropertyNotFound or InvalidPropertyName. A separate invocation of get_property for each such property name is necessary to determine the specific exception or to verify that tk_void is the correct any TypeCode for that property name. This approach was taken to avoid a complex, hard to program structure to carry mixed results.

get_property

public Property get_property(java.lang.String property_name)
                      throws PropertyNotFound,
                             InvalidPropertyName

get_all_properties

public void get_all_properties(int how_many,
                               PropertiesHolder nproperties,
                               PropertiesIteratorHolder rest)
get_all_properties Returns all of the properties defined in the PropertySet. If more than how_many properties are found, then the remaining properties are returned in rest.

delete_property

public void delete_property(java.lang.String property_name)
                     throws PropertyNotFound,
                            InvalidPropertyName,
                            FixedProperty
delete_property Deletes the specified property if it exists from a PropertySet.

delete_properties

public void delete_properties(java.lang.String[] property_names)
                       throws MultipleExceptions
delete_properties Deletes the properties defined in the property_names parameter. This is a batch operation that returns the MultipleExceptions exception if any delete failed.

delete_all_properties

public boolean delete_all_properties()
Variation of delete_properties. Applies to all properties. Since some properties may be defined as fixed property types, it may be that not all properties are deleted. The boolean flag is set to false to indicate that not all properties were deleted. A client could invoke get_number_of_properties to determine how many properties remain. Then invoke get_all_property_names to extract the property names remaining. A separate invocation of delete_property for each such property name is necessary to determine the specific exception.

is_property_defined

public boolean is_property_defined(java.lang.String property_name)
                            throws InvalidPropertyName
The is_property_defined operation returns true if the property is defined in the PropertySet, and returns false otherwise.