com.sun.messaging

## Class AdministeredObject

- java.lang.Object
- - com.sun.messaging.AdministeredObject

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    AdminConnectionFactory, BasicConnectionFactory, Destination

      public abstract class AdministeredObject
      extends java.lang.Object
      implements java.io.Serializable

  An `AdministeredObject` encapsulates behavior common to all Sun MQ Administered Objects and MQ Administered Object classes extend this class.

  All MQ Administered Objects contain a configuration and maintain a state flag indicating whether they are modifiable or read only. They are also versioned to support migration of previous formats of MQ Administered Objects to the current format.

  When a MQ Administered Object is first created it contains the default configuration and the configuration is modifiable. After modification (either programmatically, or by the administrator using the MQ Administration utilities), an `AdministeredObject` can be set to read only to prevent further modification.

  Typically, the Sun MQ Administration utilities would be used to create MQ Administered Objects, optionally set their state to read only, and store them using the Java Naming and Directory Service (JNDI).

  When Sun MQ applications use JNDI and `lookup()` MQ Administered Objects that have had their state set to read only, the applications will not be able to modify the administrator stored configurations.

  Sun MQ automatically converts JMQ, iMQ and Sun ONE MQ Administered Objects from the following previous versions of JMQ, iMQ and Sun ONE MQ to the current version of Oracle GlassFish(tm) Server Message Queue Administered Objects.

    JMQ 1.1 Beta
    JMQ 1.1 FCS
    JMQ 2.0 FCS
    JMQ 2.1 SP1
    iMQ 3.0 FCS
    S1MQ 3.5 FCS

  Conversion of JMQ Administered Objects created using JMQ1.1 EA and versions of JMQ prior to JMQ1.1 EA is not supported.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `AO_PROPERTY_TYPE_BOOLEAN` AdministeredObject configuration property type designator for Boolean
    `static java.lang.String` | `AO_PROPERTY_TYPE_INTEGER` AdministeredObject configuration property type designator for Integer
    `static java.lang.String` | `AO_PROPERTY_TYPE_LIST` AdministeredObject configuration property type designator for List
    `static java.lang.String` | `AO_PROPERTY_TYPE_LONG` AdministeredObject configuration property type designator for Long
    `static java.lang.String` | `AO_PROPERTY_TYPE_PROPERTYOWNER` AdministeredObject configuration property type designator for PropertyOwner
    `static java.lang.String` | `AO_PROPERTY_TYPE_STRING` AdministeredObject configuration property type designator for String
    `protected static java.util.Map<java.lang.String,java.util.Properties[]>` | `cachedConfigurationMap` cachedConfigurationMap key = defaultsBase, value is a Properties[] where value[0] is the cached initial value of configuration where value[1] is the cached initial value of configurationTypes where value[2] is the cached initial value of configurationLabels
    `protected java.util.Properties` | `configuration` The configuration of this `AdministeredObject`
    `protected java.util.Properties` | `configurationLabels`
    `protected java.util.Properties` | `configurationTypes`
    `static com.sun.messaging.jmq.jmsclient.resources.ClientResources` | `cr`
    `java.lang.String` | `storedVersion` The original version # of this object stored in JNDI
    `static java.lang.String` | `VERSION` The Version string of this `AdministeredObject` is `3.0`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdministeredObject(java.lang.String defaultsBase)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `dump()` Returns the provider specific name for this `AdministeredObject` along with a complete listing of its configuration, configuration attribute label keys and configuration attribute types.
    `java.util.Enumeration` | `enumeratePropertyNames()` Returns an enumeration of the configuration property names of this `AdministeredObject`.
    `java.util.Properties` | `getConfiguration()` Returns the configuration of this `AdministeredObject`.
    `java.util.Properties` | `getCurrentConfiguration()` Returns the current (runtime) configuration of this `AdministeredObject` modified by any System properties.
    `java.lang.String` | `getLabelForGroup(java.lang.String group)` Returns the label for a given group.
    `java.lang.String` | `getPropertiesForGroup(java.lang.String group)` Returns an ordered property list for a given group.
    `java.lang.String` | `getProperty(java.lang.String propname)` Returns a single configuration property value given the property name.
    `java.lang.String` | `getPropertyForListValue(java.lang.String listpropname, java.lang.String listvalue)` Returns the property name for any selection on Properties of Type List.
    `java.lang.String` | `getPropertyGroups()` Returns an ordered property groups list.
    `java.lang.String` | `getPropertyLabel(java.lang.String propname)` Returns the configuration label of a single configuration property name.
    `java.lang.String` | `getPropertyListOtherName(java.lang.String propname)` Returns the property name for the ...
    `java.lang.String` | `getPropertyListValues(java.lang.String propname)` Returns an ordered property list for Properties of Type List.
    `java.lang.String` | `getPropertyType(java.lang.String propname)` Returns the configuration type of a single configuration property name.
    `java.lang.String` | `getPropertyValueForListValue(java.lang.String listpropname, java.lang.String listvalue, java.lang.String propname)` Returns the property values set when a property of type List is set to a particular value.
    `java.lang.String` | `getStoredVersion()` Returns the storedVersion of this `AministeredObject`.
    `static java.lang.String` | `getVERSION()` Returns the Version string used for this MQ `AdministeredObject`.
    `boolean` | `isPropertyDeprecated(java.lang.String propname)` Returns whether a single configuration property name is deprecated or not.
    `boolean` | `isPropertyHidden(java.lang.String propname)` Returns whether a single configuration property name should be hidden or not.
    `boolean` | `isReadOnly()` Returns the readOnly state of this `AministeredObject`.
    `boolean` | `isStoredVersionCompatible()` Tests whether the storedVersion of this `AministeredObject` is compatible with the current runtime VERSION
    `abstract void` | `setDefaultConfiguration()` Subclasses must implement this to set their default configuration.
    `java.lang.String` | `setProperty(java.lang.String propname, java.lang.String propval)` Sets a single configuration property in this `AdministeredObject`.
    `void` | `setReadOnly()` Sets this `AdministeredObject` to be read only.
    `java.lang.String` | `toString()` Returns the provider specific name for this `AdministeredObject` along with a listing of its configuration.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### VERSION

          public static final java.lang.String VERSION

      The Version string of this `AdministeredObject` is `3.0`
      See Also:
        Constant Field Values

    - #### AO_PROPERTY_TYPE_STRING

          public static final java.lang.String AO_PROPERTY_TYPE_STRING

      AdministeredObject configuration property type designator for String
      See Also:
        Constant Field Values

    - #### AO_PROPERTY_TYPE_INTEGER

          public static final java.lang.String AO_PROPERTY_TYPE_INTEGER

      AdministeredObject configuration property type designator for Integer
      See Also:
        Constant Field Values

    - #### AO_PROPERTY_TYPE_LONG

          public static final java.lang.String AO_PROPERTY_TYPE_LONG

      AdministeredObject configuration property type designator for Long
      See Also:
        Constant Field Values

    - #### AO_PROPERTY_TYPE_BOOLEAN

          public static final java.lang.String AO_PROPERTY_TYPE_BOOLEAN

      AdministeredObject configuration property type designator for Boolean
      See Also:
        Constant Field Values

    - #### AO_PROPERTY_TYPE_PROPERTYOWNER

          public static final java.lang.String AO_PROPERTY_TYPE_PROPERTYOWNER

      AdministeredObject configuration property type designator for PropertyOwner
      See Also:
        Constant Field Values

    - #### AO_PROPERTY_TYPE_LIST

          public static final java.lang.String AO_PROPERTY_TYPE_LIST

      AdministeredObject configuration property type designator for List
      See Also:
        Constant Field Values

    - #### storedVersion

          public java.lang.String storedVersion

      The original version # of this object stored in JNDI

    - #### configuration

          protected java.util.Properties configuration

      The configuration of this `AdministeredObject`

    - #### configurationTypes

          protected java.util.Properties configurationTypes

    - #### configurationLabels

          protected java.util.Properties configurationLabels

    - #### cr

          public static final transient com.sun.messaging.jmq.jmsclient.resources.ClientResources cr

    - #### cachedConfigurationMap

          protected static final java.util.Map<java.lang.String,java.util.Properties[]> cachedConfigurationMap

      cachedConfigurationMap key = defaultsBase, value is a Properties[] where value[0] is the cached initial value of configuration where value[1] is the cached initial value of configurationTypes where value[2] is the cached initial value of configurationLabels

  - ### Constructor Detail

    - #### AdministeredObject

          public AdministeredObject(java.lang.String defaultsBase)

  - ### Method Detail

    - #### setDefaultConfiguration

          public abstract void setDefaultConfiguration()

      Subclasses must implement this to set their default configuration.

    - #### isReadOnly

          public final boolean isReadOnly()

      Returns the readOnly state of this `AministeredObject`.
      Returns:
        the readOnly state of this `AministeredObject```

    - #### getStoredVersion

          public final java.lang.String getStoredVersion()

      Returns the storedVersion of this `AministeredObject`.
      Returns:
        the storedVersion of this `AministeredObject```

    - #### isStoredVersionCompatible

          public final boolean isStoredVersionCompatible()

      Tests whether the storedVersion of this `AministeredObject` is compatible with the current runtime VERSION

      This methods flags mismatches between this `Administered Object` and the version stored in JNDI using an earlier or different version of this class. It is advisable to check before an earlier version of Administered Object is being overwritten by a newer version, otherwise an earlier version of the MQ Client will fail when attempting to use JNDI to `lookup()` that earlier version of the Administered Object.

      Returns:
        the storedVersion of this `AministeredObject```

    - #### setReadOnly

          public final void setReadOnly()

      Sets this `AdministeredObject` to be read only. Once this `AdministeredObject` has been set to read only it cannot be reset back to read write.

    - #### getConfiguration

          public java.util.Properties getConfiguration()

      Returns the configuration of this `AdministeredObject`.

      The configuration returned is the one that has been administratively or programmatically set in this `AdministeredObject` This configuration is unaffected by runtime overrides using System properties.

      Use `getCurrentConfiguration()` to get the current configuration, which takes into account any overriding System properties that have been set at runtime.

      Returns:
        the configuration of this `AdministeredObject`.
      See Also:
        `getCurrentConfiguration()`

    - #### getPropertyGroups

          public java.lang.String getPropertyGroups()

      Returns an ordered property groups list.
      Returns:
        The String that represents an ordered property groups list. This list uses the ' `|` ' character as the separator.

    - #### getPropertiesForGroup

          public java.lang.String getPropertiesForGroup(java.lang.String group)

      Returns an ordered property list for a given group.
      Parameters:
        `group` - The group for which the property list is desired.
      Returns:
        The String that represents an ordered property list for a given group. This list uses the ' `|` ' character as the separator.

    - #### getLabelForGroup

          public java.lang.String getLabelForGroup(java.lang.String group)

      Returns the label for a given group.
      Parameters:
        `group` - The group for which the label is desired.
      Returns:
        The label the given group.

    - #### getPropertyListValues

          public java.lang.String getPropertyListValues(java.lang.String propname)

      Returns an ordered property list for Properties of Type List.
      Parameters:
        `propname` - The name of the configuration property that is of type List.
      Returns:
        The String that represents an ordered property list. This list uses the ' `|` ' character as the separator.

    - #### getPropertyForListValue

          public java.lang.String getPropertyForListValue(java.lang.String listpropname,
                                                          java.lang.String listvalue)

      Returns the property name for any selection on Properties of Type List.
      Parameters:
        `listpropname` - The name of the configuration property that is of type List.
        `listvalue` - The value of the configuration property that is of type List.
      Returns:
        The property that is pre set when a property of type List is set to the value `listvalue`.

    - #### getPropertyValueForListValue

          public java.lang.String getPropertyValueForListValue(java.lang.String listpropname,
                                                               java.lang.String listvalue,
                                                               java.lang.String propname)

      Returns the property values set when a property of type List is set to a particular value.
      Parameters:
        `listpropname` - The name of the configuration property that is of type List.
        `listvalue` - The value of the configuration property that is of type List.
        `propname` - The name of the property for which the value is being sought.
      Returns:
        The value that property `propname` is pre set to when the property `listpropname` of type list is set to the value `listvalue`.

    - #### getPropertyListOtherName

          public java.lang.String getPropertyListOtherName(java.lang.String propname)

      Returns the property name for the ... selection on Properties of Type List.
      Returns:
        The property to be exposed for editing when the `...` selection on Properties of Type List is selected.

    - #### enumeratePropertyNames

          public java.util.Enumeration enumeratePropertyNames()

      Returns an enumeration of the configuration property names of this `AdministeredObject`.
      Returns:
        The enumeration of configuration property names.

    - #### setProperty

          public java.lang.String setProperty(java.lang.String propname,
                                              java.lang.String propval)
                                       throws javax.jms.JMSException

      Sets a single configuration property in this `AdministeredObject`.
      Parameters:
        `propname` - The name of the configuration property to set.
        `propval` - The value of the configuration property to set.
      Returns:
        The previous value of the configuration property being set.
      Throws:
        `InvalidPropertyException` - If an invalid property name is being set. The Exception string is the name of the invalid property.
        `InvalidPropertyValueException` - If an invalid property value is being set. The Exception string is the invalid value of the property.
        `ReadOnlyPropertyException` - If an attempt is made to modify this `AdministeredObject` when the readOnly flag has been set.
        `javax.jms.JMSException`

    - #### getProperty

          public java.lang.String getProperty(java.lang.String propname)
                                       throws javax.jms.JMSException

      Returns a single configuration property value given the property name.
      Parameters:
        `propname` - The name of the configuration property.
      Returns:
        The value of the configuration property `propname`.
      Throws:
        `InvalidPropertyException` - If an invalid property name is being requested. The Exception string is the name of the invalid property.
        `javax.jms.JMSException`

    - #### getPropertyType

          public java.lang.String getPropertyType(java.lang.String propname)
                                           throws javax.jms.JMSException

      Returns the configuration type of a single configuration property name.
      Parameters:
        `propname` - The name of the configuration property.
      Returns:
        The type of the configuration property `propname`.
      Throws:
        `InvalidPropertyException` - If an invalid property name is being requested. The Exception string is the name of the invalid property.
        `javax.jms.JMSException`

    - #### getPropertyLabel

          public java.lang.String getPropertyLabel(java.lang.String propname)
                                            throws javax.jms.JMSException

      Returns the configuration label of a single configuration property name.
      Parameters:
        `propname` - The name of the configuration property.
      Returns:
        The label of the configuration property `propname`.
      Throws:
        `InvalidPropertyException` - If an invalid property name is being requested. The Exception string is the name of the invalid property.
        `javax.jms.JMSException`

    - #### isPropertyHidden

          public boolean isPropertyHidden(java.lang.String propname)
                                   throws javax.jms.JMSException

      Returns whether a single configuration property name should be hidden or not.
      Parameters:
        `propname` - The name of the configuration property.
      Returns:
        `true` If the configuration property `propname` should be hidden; `false` if it should not be hidden i.e. it is still supported in this version.
      Throws:
        `InvalidPropertyException` - If an invalid property name is being requested. The Exception string is the name of the invalid property.
        `javax.jms.JMSException`

    - #### isPropertyDeprecated

          public boolean isPropertyDeprecated(java.lang.String propname)
                                       throws javax.jms.JMSException

      Returns whether a single configuration property name is deprecated or not.
      Parameters:
        `propname` - The name of the configuration property.
      Returns:
        `true` If the configuration property `propname` has been deprecated; `false` if it has not been deprecated i.e. it is still supported in this version.
      Throws:
        `InvalidPropertyException` - If an invalid property name is being requested. The Exception string is the name of the invalid property.
        `javax.jms.JMSException`

    - #### toString

          public java.lang.String toString()

      Returns the provider specific name for this `AdministeredObject` along with a listing of its configuration.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A formatted String containing the provider specific name for this `AdministeredObject` along with a listing of its configuration.

    - #### dump

          public java.lang.String dump()

      Returns the provider specific name for this `AdministeredObject` along with a complete listing of its configuration, configuration attribute label keys and configuration attribute types.
      Returns:
        A formatted String containing the provider specific name for this `AdministeredObject` along with a listing of its configuration.

    - #### getVERSION

          public static final java.lang.String getVERSION()

      Returns the Version string used for this MQ `AdministeredObject`.
      Returns:
        the Version string

    - #### getCurrentConfiguration

          public java.util.Properties getCurrentConfiguration()

      Returns the current (runtime) configuration of this `AdministeredObject` modified by any System properties.

      If the readOnly flag of this `AdministeredObject` is set, then this `AdministeredObject` is not affected by any System Properties set at runtime.

      Returns:
        The current (runtime) configuration of this `AdministeredObject` modified by any System properties.
      See Also:
        `getConfiguration()`

Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved.