aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1348069 - in /aries/trunk/sandbox/jmx-next: jmx-api/src/main/java/org/osgi/jmx/framework/wiring/ jmx-api/src/main/java/org/osgi/jmx/service/useradmin/ jmx-core/src/main/java/org/apache/aries/jmx/codec/
Date Fri, 08 Jun 2012 13:45:38 GMT
Author: davidb
Date: Fri Jun  8 13:45:38 2012
New Revision: 1348069

URL: http://svn.apache.org/viewvc?rev=1348069&view=rev
Log:
Updated BundleWiringStateMBean and UserAdminMBean from originals at OSGi and update the UserAdmin Role variants with properties.

Modified:
    aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java
    aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java
    aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/GroupData.java
    aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/RoleData.java
    aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/UserData.java

Modified: aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java?rev=1348069&r1=1348068&r2=1348069&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/wiring/BundleWiringStateMBean.java Fri Jun  8 13:45:38 2012
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2010-2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.osgi.jmx.framework.wiring;
 
 import java.io.IOException;
@@ -28,333 +29,524 @@ import javax.management.openmbean.Tabula
 import org.osgi.jmx.Item;
 import org.osgi.jmx.JmxConstants;
 
-
 /**
  * This MBean represents the bundle wiring state.
  * <p>
- * It can be used to retrieve the declared capabilities, declared requirements, and wiring
- * for the current and past revisions of bundles.
+ * It can be used to retrieve the declared capabilities, declared requirements,
+ * and wiring for the current and past revisions of bundles.
  *
  * @ThreadSafe
  */
 public interface BundleWiringStateMBean {
-    /*
-     * The Object Name for a Bundle Revisions MBean.
-     */
-    String OBJECTNAME = JmxConstants.OSGI_CORE
-        + ":type=wiringState,version=1.7";
-
-    /**
-     * To be specified on any operation that takes a 'namespace' argument when results from all namespaces are wanted.
-     */
-    String ALL_NAMESPACE = "osgi.wiring.all";
-
-    /*
-     * Items, CompositeData, TabularData, ArrayTypes
-     *
-     */
-    String KEY = "Key";
-    Item KEY_ITEM = new Item(KEY, "The directive key", SimpleType.STRING);
-
-    String VALUE = "Value";
-    Item VALUE_ITEM = new Item(VALUE, "The directive value",
-            SimpleType.STRING);
-
-    CompositeType DIRECTIVE_TYPE = Item.compositeType("DIRECTIVE",
-            "Describes a directive of a capability or requirement",
-            KEY_ITEM, VALUE_ITEM);
-    TabularType DIRECTIVES_TYPE = Item.tabularType("DIRECTIVES",
-            "Describes the directives of a capability or requirement",
-            DIRECTIVE_TYPE, KEY
-            );
-
-    String DIRECTIVES = "Directives";
-    Item DIRECTIVES_ITEM = new Item(DIRECTIVES,
-            "The directives of a capability or requirement",
-            DIRECTIVES_TYPE);
-
-    TabularType ATTRIBUTES_TYPE = Item.tabularType("ATTRIBUTES",
-            "Describes attributes of a capability or requirement",
-            JmxConstants.PROPERTY_TYPE, JmxConstants.KEY
-            );
-    String ATTRIBUTES = "Attributes";
-    Item ATTRIBUTES_ITEM = new Item(ATTRIBUTES,
-            "The attributes of a capability or requirement",
-            ATTRIBUTES_TYPE);
-
-    String NAMESPACE = "Namespace";
-    Item NAMESPACE_ITEM = new Item(NAMESPACE,
-            "The namespace of a capability or requirement",
-            SimpleType.STRING);
-
-    CompositeType BUNDLE_REQUIREMENT_TYPE =
-        Item.compositeType("BUNDLE_REQUIREMENT",
-                "Describes the live wired requirements of a bundle",
-                ATTRIBUTES_ITEM, DIRECTIVES_ITEM, NAMESPACE_ITEM);
-
-    CompositeType BUNDLE_CAPABILITY_TYPE =
-        Item.compositeType("BUNDLE_CAPABILITY",
-                "Describes the live wired capabilities of a bundle",
-                ATTRIBUTES_ITEM, DIRECTIVES_ITEM, NAMESPACE_ITEM);
-
-    String PROVIDER_BUNDLE_ID = "ProviderBundleId";
-    Item PROVIDER_BUNDLE_ID_ITEM = new Item(PROVIDER_BUNDLE_ID,
-            "The identifier of the bundle that is the provider of the capability",
-            SimpleType.LONG);
-
-    String REQUIRER_BUNDLE_ID = "RequirerBundleId";
-    Item REQUIRER_BUNDLE_ID_ITEM = new Item(REQUIRER_BUNDLE_ID,
-            "The identifier of the bundle that is the requirer of the requirement",
-            SimpleType.LONG);
-
-    String BUNDLE_REQUIREMENT = "BundleRequirement";
-    Item BUNDLE_REQUIREMENT_ITEM = new Item(BUNDLE_REQUIREMENT,
-            "The wired requirements of a bundle",
-            BUNDLE_REQUIREMENT_TYPE);
-
-    String BUNDLE_CAPABILITY = "BundleCapability";
-    Item BUNDLE_CAPABILITY_ITEM = new Item(BUNDLE_CAPABILITY,
-            "The wired capabilities of a bundle",
-            BUNDLE_CAPABILITY_TYPE);
-
-    String PROVIDER_BUNDLE_REVISION_ID = "ProviderBundleRevisionId";
-    Item PROVIDER_BUNDLE_REVISION_ID_ITEM = new Item(PROVIDER_BUNDLE_REVISION_ID,
-            "A local id for the bundle revision that is the provider of the capability",
-            SimpleType.INTEGER);
-
-    String REQUIRER_BUNDLE_REVISION_ID = "RequirerBundleRevisionId";
-    Item REQUIRER_BUNDLE_REVISION_ID_ITEM =  new Item(REQUIRER_BUNDLE_REVISION_ID,
-            "A local id for the bundle revision that is the requirer of the requirement",
-            SimpleType.INTEGER);
-
-    /**
-     * Describes the live association between a provider of
-     * a capability and a requirer of the corresponding requirement.
-     */
-    CompositeType BUNDLE_WIRE_TYPE =
-        Item.compositeType("BUNDLE_WIRE",
-                "Describes the live association between a provider and a requirer",
-                BUNDLE_REQUIREMENT_ITEM,
-                BUNDLE_CAPABILITY_ITEM,
-                PROVIDER_BUNDLE_ID_ITEM,
-                PROVIDER_BUNDLE_REVISION_ID_ITEM,
-                REQUIRER_BUNDLE_ID_ITEM,
-                REQUIRER_BUNDLE_REVISION_ID_ITEM
-                );
-    ArrayType BUNDLE_WIRES_TYPE_ARRAY =
-        Item.arrayType(1, BUNDLE_WIRE_TYPE);
-
-    String BUNDLE_REVISION_ID = "BundleRevisionId";
-    Item BUNDLE_REVISION_ID_ITEM = new Item(BUNDLE_REVISION_ID,
-            "The local identifier of the bundle revision",
-            SimpleType.INTEGER);
-
-    String BUNDLE_ID = "BundleId";
-    Item BUNDLE_ID_ITEM = new Item(BUNDLE_ID,
-            "The bundle identifier of the bundle revision",
-            SimpleType.LONG);
-
-    ArrayType REQUIREMENT_TYPE_ARRAY =
-        Item.arrayType(1, BUNDLE_REQUIREMENT_TYPE);
-    ArrayType CAPABILITY_TYPE_ARRAY =
-        Item.arrayType(1, BUNDLE_CAPABILITY_TYPE);
-
-    String REQUIREMENTS = "Requirements";
-    Item REQUIREMENTS_ITEM = new Item(REQUIREMENTS,
-            "The bundle requirements of a bundle revision wiring",
-            REQUIREMENT_TYPE_ARRAY);
-
-    CompositeType REVISION_REQUIREMENTS_TYPE =
-        Item.compositeType("REVISION_REQUIREMENTS",
-            "Describes the requirements for a bundle revision",
-            BUNDLE_REVISION_ID_ITEM,
-            REQUIREMENTS_ITEM);
-
-    TabularType REVISIONS_REQUIREMENTS_TYPE =
-        Item.tabularType("REVISIONS_REQUIREMENTS",
-            "The bundle requirements for all bundle revisions",
-            REVISION_REQUIREMENTS_TYPE,
-            BUNDLE_REVISION_ID);
-
-    String CAPABILITIES = "Capabilities";
-    Item CAPABILITIES_ITEM = new Item(CAPABILITIES,
-            "The bundle capabilities of a bundle revision wiring",
-            CAPABILITY_TYPE_ARRAY);
-
-    CompositeType REVISION_CAPABILITIES_TYPE =
-        Item.compositeType("REVISION_CAPABILITIES",
-            "Describes the capabilities for a bundle revision",
-            BUNDLE_REVISION_ID_ITEM,
-            CAPABILITIES_ITEM);
-
-    TabularType REVISIONS_CAPABILITIES_TYPE =
-        Item.tabularType("REVISIONS_CAPABILITIES",
-            "The bundle capabilities for all bundle revisions",
-            REVISION_CAPABILITIES_TYPE,
-            BUNDLE_REVISION_ID);
-
-    String PROVIDED_WIRES = "ProvidedWires";
-    Item PROVIDED_WIRES_ITEM = new Item(PROVIDED_WIRES,
-            "The bundle wires to the capabilities provided by this bundle wiring.",
-            BUNDLE_WIRES_TYPE_ARRAY);
-
-    String REQUIRED_WIRES = "RequiredWires";
-    Item REQUIRED_WIRES_ITEM = new Item(REQUIRED_WIRES,
-            "The bundle wires to requirements in use by this bundle wiring",
-            BUNDLE_WIRES_TYPE_ARRAY);
-
-    CompositeType BUNDLE_WIRING_TYPE =
-        Item.compositeType("BUNDLE_WIRING",
-                "Describes the runtime association between a provider and a requirer",
-                BUNDLE_ID_ITEM,
-                BUNDLE_REVISION_ID_ITEM,
-                REQUIREMENTS_ITEM,
-                CAPABILITIES_ITEM,
-                REQUIRED_WIRES_ITEM,
-                PROVIDED_WIRES_ITEM);
-
-    TabularType BUNDLES_WIRING_TYPE =
-        Item.tabularType("BUNDLES_WIRING",
-            "The bundle wiring for all bundle revisions",
-            BUNDLE_WIRING_TYPE,
-            BUNDLE_ID, BUNDLE_REVISION_ID);
-
-    /**
-     * Returns the requirements for the current bundle revision.
-     *
-     * @see #REQUIREMENT_TYPE_ARRAY for the details of the CompositeData.
-     *
-     * @param bundleId The bundle ID.
-     * @param namespace The name space of the requirements to be returned by this operation.
-     * @return the declared requirements for the current revision of <code>bundleId</code>
-     * and <code>namespace</code>.
-     * @throws JMException if there is a JMX problem.
-     * @throws IOException if the connection could not be made because of a communication problem.
-     */
-    CompositeData[] getCurrentRevisionDeclaredRequirements(long bundleId, String namespace)
-            throws IOException, JMException;
-
-    /**
-     * Returns the capabilities for the current bundle revision.
-     *
-     * @see #CAPABILITY_TYPE_ARRAY for the details of the CompositeData.
-     *
-     * @param bundleId The bundle ID.
-     * @param namespace The name space of the capabilities to be returned by this operation.
-     * @return the declared capabilities for the current revision of <code>bundleId</code>
-     * and <code>namespace</code>.
-     * @throws JMException if there is a JMX problem.
-     * @throws IOException if the connection could not be made because of a communication problem.
-     */
-    CompositeData[] getCurrentRevisionDeclaredCapabilities(long bundleId, String namespace)
-            throws IOException, JMException;
-
-    /**
-     * Returns the bundle wiring for the current bundle revision.
-     *
-     * @see #BUNDLE_WIRING_TYPE for the details of the CompositeData.
-     *
-     * @param bundleId The bundle ID.
-     * @param namespace The name space of the requirements and capabilities for which to return information.
-     * @return the wiring information for the current revision of <code>bundleId</code>
-     * and <code>namespace</code>.
-     * @throws JMException if there is a JMX problem.
-     * @throws IOException if the connection could not be made because of a communication problem.
-     */
-    CompositeData getCurrentWiring(long bundleId, String namespace)
-            throws IOException, JMException;
-
-    /**
-     * Returns the bundle wiring closure for the current revision of the specified bundle. The
-     * wiring closure contains all the wirings from the root bundle revision to all bundle revisions
-     * it is wired to and all their transitive wirings.
-     *
-     * @see #BUNDLES_WIRING_TYPE for the details of the TabularData.
-     *
-     * @param rootBundleId the root bundle of the closure.
-     * @param namespace The name space of the requirements and capabilities for which to return information.
-     * @return a tabular representation of all the wirings in the closure. The bundle revision IDs
-     * only have meaning in the context of the current result. The revision of the rootBundle is set
-     * to 0. Therefore the root bundle of the closure can be looked up in the table by its bundle ID and
-     * revision 0.
-     * @throws JMException if there is a JMX problem.
-     * @throws IOException if the connection could not be made because of a communication problem.
-     */
-    TabularData getCurrentWiringClosure(long rootBundleId, String namespace)
-            throws IOException, JMException;
-
-    /**
-     * Returns the requirements for all revisions of the bundle.
-     *
-     * @see #REVISIONS_REQUIREMENTS_TYPE for the details of TabularData.
-     *
-     * The requirements are in no particular order, and may change in
-     *  subsequent calls to this operation.
-     *
-     * @param bundleId The bundle ID.
-     * @param namespace The name space of the requirements to be returned by this operation.
-     * @return the declared requirements for all revisions of <code>bundleId</code>.
-     * @throws JMException if there is a JMX problem.
-     * @throws IOException if the connection could not be made because of a communication problem.
-     */
-    TabularData getRevisionsDeclaredRequirements(long bundleId, String namespace)
-            throws IOException, JMException;
-
-
-    /**
-     * Returns the capabilities for all revisions of the bundle.
-     *
-     * @see #REVISIONS_CAPABILITIES_TYPE for the details of TabularData.
-     *
-     * The capabilities are in no particular order, and may change in
-     *  subsequent calls to this operation.
-     *
-     * @param bundleId The bundle ID.
-     * @param namespace The name space of the capabilities to be returned by this operation.
-     * @return the declared capabilities for all revisions of <code>bundleId</code>
-     * @throws JMException if there is a JMX problem.
-     * @throws IOException if the connection could not be made because of a communication problem.
-     */
-    TabularData getRevisionsDeclaredCapabilities(long bundleId, String namespace)
-            throws IOException, JMException;
-
-    /**
-     * Returns the bundle wirings for all revisions of the bundle.
-     *
-     * @see #BUNDLES_WIRING_TYPE for the details of TabularData.
-     *
-     * The bundle wirings are in no particular order, and may
-     *  change in subsequent calls to this operations.
-     *
-     * @param bundleId The bundle ID.
-     * @param namespace The name space of the requirements and capabilities for which to return information.
-     * @return the wiring information for all revisions of <code>bundleId</code> and <code>namespace</code>.
-     * @throws JMException if there is a JMX problem.
-     * @throws IOException if the connection could not be made because of a communication problem.
-     */
-    TabularData getRevisionsWiring(long bundleId, String namespace)
-            throws IOException, JMException;
-
-    /**
-     * Returns the bundle wiring closure for all revisions of the specified bundle. The
-     * wiring closure contains all the wirings from the root bundle revision to all bundle revisions
-     * it is wired to and all their transitive wirings.
-     *
-     * @see #BUNDLES_WIRING_TYPE for the details of TabularData.
-     *
-     * The bundle wirings are in no particular order, and may
-     * change in subsequent calls to this operation. Furthermore,
-     * the bundle revision IDs are local and cannot be reused across invocations.
-     *
-     * @param rootBundleId The root bundle ID.
-     * @param namespace The name space of the requirements and capabilities for which to return information.
-     * @return a closure of bundle wirings linked together by wires.
-     * @return a tabular representation of all the wirings in the closures. The bundle revision IDs
-     * only have meaning in the context of the current result.
-     * @throws JMException if there is a JMX problem.
-     * @throws IOException if the connection could not be made because of a communication problem.
-     */
-    TabularData getRevisionsWiringClosure(long rootBundleId, String namespace)
-            throws IOException, JMException;
+	/**
+	 * The Object Name prefix for this mbean. The full object name also contains
+	 * the framework name and uuid as properties.
+	 */
+	String			OBJECTNAME							= JmxConstants.OSGI_CORE + ":type=wiringState,version=1.1";
+
+	/**
+	 * The key of {@link #KEY_ITEM}.
+	 */
+	String			KEY									= "Key";
+
+	/**
+	 * The item containing the key of a capability or requirement directive.
+	 * Used in {@link #DIRECTIVE_TYPE}. The key is {@link #KEY} and the type is
+	 * a String.
+	 */
+	Item			KEY_ITEM							= new Item(KEY, "The directive key", SimpleType.STRING);
+
+	/**
+	 * The key of {@link #VALUE}.
+	 */
+	String			VALUE								= "Value";
+
+	/**
+	 * The item containing the value of a capability or requirement directive.
+	 * Used in {@link #DIRECTIVE_TYPE}. They key is {@link #VALUE} and the type
+	 * is a String.
+	 */
+	Item			VALUE_ITEM							= new Item(VALUE, "The directive value", SimpleType.STRING);
+
+	/**
+	 * The Composite Type that represents a directive for a capability or
+	 * requirement. The composite consists of:
+	 * <ul>
+	 * <li>{@link #KEY}</li>
+	 * <li>{@link #VALUE}</li>
+	 * </ul>
+	 */
+	CompositeType	DIRECTIVE_TYPE						= Item.compositeType("DIRECTIVE", "Describes a directive of a capability or requirement", KEY_ITEM, VALUE_ITEM);
+
+	/**
+	 * The Tabular Type that holds the directives for a capability or
+	 * requirement. The row type is {@link #DIRECTIVE_TYPE} and the index is
+	 * {@link #KEY}.
+	 */
+	TabularType		DIRECTIVES_TYPE						= Item.tabularType("DIRECTIVES", "Describes the directives of a capability or requirement", DIRECTIVE_TYPE, KEY);
+
+	/**
+	 * The key of {@link #DIRECTIVES_ITEM}.
+	 */
+	String			DIRECTIVES							= "Directives";
+
+	/**
+	 * The item containing the directives of a capability or requirement. Used
+	 * in {@link #BUNDLE_REQUIREMENT_TYPE} and {@link #BUNDLE_CAPABILITY_TYPE}.
+	 * The key is {@link #DIRECTIVES} and the type is {@link #DIRECTIVES_TYPE}.
+	 */
+	Item			DIRECTIVES_ITEM						= new Item(DIRECTIVES, "The directives of a capability or requirement", DIRECTIVES_TYPE);
+
+	/**
+	 * The Tabular Type that holds the attributes for a capability or
+	 * requirements. The row type is {@link JmxConstants#PROPERTY_TYPE} and the
+	 * index is {@link JmxConstants#KEY}.
+	 */
+	TabularType		ATTRIBUTES_TYPE						= Item.tabularType("ATTRIBUTES", "Describes attributes of a capability or requirement", JmxConstants.PROPERTY_TYPE, JmxConstants.KEY);
+
+	/**
+	 * The key of {@link #ATTRIBUTES_ITEM}.
+	 */
+	String			ATTRIBUTES							= "Attributes";
+
+	/**
+	 * The item containing the attributes of a capability or requirement. Used
+	 * in {@link #BUNDLE_REQUIREMENT_TYPE} and {@link #BUNDLE_CAPABILITY_TYPE}.
+	 * The key is {@link #ATTRIBUTES} and the type is {@link #ATTRIBUTES_TYPE}.
+	 */
+	Item			ATTRIBUTES_ITEM						= new Item(ATTRIBUTES, "The attributes of a capability or requirement", ATTRIBUTES_TYPE);
+
+	/**
+	 * The key of {@link #NAMESPACE_ITEM}.
+	 */
+	String			NAMESPACE							= "Namespace";
+
+	/**
+	 * The item containing the namespace for a capability or requirement. Used
+	 * in {@link #BUNDLE_REQUIREMENT_TYPE} and {@link #BUNDLE_CAPABILITY_TYPE}.
+	 * The key is {@link #NAMESPACE} and the type is a String.
+	 */
+	Item			NAMESPACE_ITEM						= new Item(NAMESPACE, "The namespace of a capability or requirement", SimpleType.STRING);
+
+	/**
+	 * The Composite Type that represents the requirement of a bundle.
+	 *
+	 * The composite consists of:
+	 * <ul>
+	 * <li>{@link #NAMESPACE}</li>
+	 * <li>{@link #ATTRIBUTES}</li>
+	 * <li>{@link #DIRECTIVES}</li>
+	 * </ul>
+	 */
+	CompositeType	BUNDLE_REQUIREMENT_TYPE				= Item.compositeType("BUNDLE_REQUIREMENT", "Describes the requirement of a bundle", ATTRIBUTES_ITEM, DIRECTIVES_ITEM, NAMESPACE_ITEM);
+
+	/**
+	 * The Composite Type that represents the capability of a bundle.
+	 *
+	 * The composite consists of:
+	 * <ul>
+	 * <li>{@link #NAMESPACE}</li>
+	 * <li>{@link #ATTRIBUTES}</li>
+	 * <li>{@link #DIRECTIVES}</li>
+	 * </ul>
+	 */
+	CompositeType	BUNDLE_CAPABILITY_TYPE				= Item.compositeType("BUNDLE_CAPABILITY", "Describes the capability of a bundle", ATTRIBUTES_ITEM, DIRECTIVES_ITEM, NAMESPACE_ITEM);
+
+	/**
+	 * The key of {@link #PROVIDER_BUNDLE_ID_ITEM}.
+	 */
+	String			PROVIDER_BUNDLE_ID					= "ProviderBundleId";
+
+	/**
+	 * The item containing the provider bundle ID in {@link #BUNDLE_WIRE_TYPE}.
+	 * The key is {@link #PROVIDER_BUNDLE_ID} and the type is a long.
+	 */
+	Item			PROVIDER_BUNDLE_ID_ITEM				= new Item(PROVIDER_BUNDLE_ID, "The identifier of the bundle that is the provider of the capability", SimpleType.LONG);
+
+	/**
+	 * The key of {@link #REQUIRER_BUNDLE_ID_ITEM}.
+	 */
+	String			REQUIRER_BUNDLE_ID					= "RequirerBundleId";
+
+	/**
+	 * The item containing the requirer bundle ID in {@link #BUNDLE_WIRE_TYPE}.
+	 * The key is {@link #REQUIRER_BUNDLE_ID} and the type is long.
+	 */
+	Item			REQUIRER_BUNDLE_ID_ITEM				= new Item(REQUIRER_BUNDLE_ID, "The identifier of the bundle that is the requirer of the requirement", SimpleType.LONG);
+
+	/**
+	 * The key of {@link #BUNDLE_REQUIREMENT_ITEM}.
+	 */
+	String			BUNDLE_REQUIREMENT					= "BundleRequirement";
+
+	/**
+	 * The item containing a requirement for a bundle in
+	 * {@link #BUNDLE_WIRE_TYPE}. The key is {@link #BUNDLE_REQUIREMENT} and the
+	 * type is {@link #BUNDLE_REQUIREMENT_TYPE}.
+	 */
+	Item			BUNDLE_REQUIREMENT_ITEM				= new Item(BUNDLE_REQUIREMENT, "The wired requirements of a bundle", BUNDLE_REQUIREMENT_TYPE);
+
+	/**
+	 * The key of {@link #BUNDLE_CAPABILITY_ITEM}.
+	 */
+	String			BUNDLE_CAPABILITY					= "BundleCapability";
+
+	/**
+	 * The item containing a capability for a bundle in
+	 * {@link #BUNDLE_WIRE_TYPE}. The key is {@link #BUNDLE_CAPABILITY} and the
+	 * type is {@link #BUNDLE_CAPABILITY_TYPE}.
+	 */
+	Item			BUNDLE_CAPABILITY_ITEM				= new Item(BUNDLE_CAPABILITY, "The wired capabilities of a bundle", BUNDLE_CAPABILITY_TYPE);
+
+	/**
+	 * The key of {@link #PROVIDER_BUNDLE_REVISION_ID_ITEM}.
+	 */
+	String			PROVIDER_BUNDLE_REVISION_ID			= "ProviderBundleRevisionId";
+
+	/**
+	 * The local ID of a provider revision in {@link #BUNDLE_WIRE_TYPE}. This ID
+	 * is local to the result where it resides and has no defined meaning across
+	 * multiple invocations. The key is {@link #PROVIDER_BUNDLE_REVISION_ID} and
+	 * the type is an int.
+	 */
+	Item			PROVIDER_BUNDLE_REVISION_ID_ITEM	= new Item(PROVIDER_BUNDLE_REVISION_ID, "A local id for the bundle revision that is the provider of the capability", SimpleType.INTEGER);
+
+	/**
+	 * The key of {@link #REQUIRER_BUNDLE_REVISION_ID_ITEM}.
+	 */
+	String			REQUIRER_BUNDLE_REVISION_ID			= "RequirerBundleRevisionId";
+
+	/**
+	 * The local ID of a requirer revision in {@link #BUNDLE_WIRE_TYPE}. This ID
+	 * is local to the result where it resides and has no defined meaning across
+	 * multiple invocations. The key is {@link #REQUIRER_BUNDLE_REVISION_ID} and
+	 * the type is an int.
+	 */
+	Item			REQUIRER_BUNDLE_REVISION_ID_ITEM	= new Item(REQUIRER_BUNDLE_REVISION_ID, "A local id for the bundle revision that is the requirer of the requirement", SimpleType.INTEGER);
+
+	/**
+	 * The Composite type that represents a bundle wire describing the live
+	 * association between a provider of a capability and a requirer of the
+	 * corresponding requirement.
+	 * <p/>
+	 * The composite consists of:
+	 * <ul>
+	 * <li>{@link #BUNDLE_REQUIREMENT}</li>
+	 * <li>{@link #BUNDLE_CAPABILITY}</li>
+	 * <li>{@link #PROVIDER_BUNDLE_ID}</li>
+	 * <li>{@link #PROVIDER_BUNDLE_REVISION_ID}</li>
+	 * <li>{@link #REQUIRER_BUNDLE_ID}</li>
+	 * <li>{@link #REQUIRER_BUNDLE_REVISION_ID}</li>
+	 * </ul>
+	 */
+	CompositeType	BUNDLE_WIRE_TYPE					= Item.compositeType("BUNDLE_WIRE",
+																"Describes the live association between a provider and a requirer",
+																BUNDLE_REQUIREMENT_ITEM,
+																BUNDLE_CAPABILITY_ITEM,
+																PROVIDER_BUNDLE_ID_ITEM,
+																PROVIDER_BUNDLE_REVISION_ID_ITEM,
+																REQUIRER_BUNDLE_ID_ITEM,
+																REQUIRER_BUNDLE_REVISION_ID_ITEM);
+
+	/**
+	 * An array of {@link #BUNDLE_WIRE_TYPE}s.
+	 */
+	ArrayType		BUNDLE_WIRES_TYPE_ARRAY				= Item.arrayType(1, BUNDLE_WIRE_TYPE);
+
+	/**
+	 * The key of {@link #BUNDLE_REVISION_ID_ITEM}.
+	 */
+	String			BUNDLE_REVISION_ID					= "BundleRevisionId";
+
+	/**
+	 * The item containing a bundle revision ID. A bundle revision ID is always
+	 * local to the result of a JMX invocation and do not have a defined meaning
+	 * across invocation calls. They are used where a result can potentially
+	 * contain multiple revisions of the same bundle. The key is
+	 * {@link #BUNDLE_REVISION_ID} and the type is an integer.
+	 */
+	Item			BUNDLE_REVISION_ID_ITEM				= new Item(BUNDLE_REVISION_ID, "The local identifier of the bundle revision", SimpleType.INTEGER);
+
+	/**
+	 * The key of {@link #BUNDLE_ID_ITEM}.
+	 */
+	String			BUNDLE_ID							= "BundleId";
+
+	/**
+	 * The item containing a bundle ID. They key is {@link #BUNDLE_ID} and the
+	 * type is a long.
+	 */
+	Item			BUNDLE_ID_ITEM						= new Item(BUNDLE_ID, "The bundle identifier of the bundle revision", SimpleType.LONG);
+
+	/**
+	 * An array of {@link #BUNDLE_REQUIREMENT_TYPE}s.
+	 */
+	ArrayType		REQUIREMENT_TYPE_ARRAY				= Item.arrayType(1, BUNDLE_REQUIREMENT_TYPE);
+
+	/**
+	 * An array of {@link #BUNDLE_CAPABILITY_TYPE}s.
+	 */
+	ArrayType		CAPABILITY_TYPE_ARRAY				= Item.arrayType(1, BUNDLE_CAPABILITY_TYPE);
+
+	/**
+	 * The key of {@link #REQUIREMENTS_ITEM}.
+	 */
+	String			REQUIREMENTS						= "Requirements";
+
+	/**
+	 * The item containing the requirements in
+	 * {@link #REVISION_REQUIREMENTS_TYPE} and {@link #BUNDLE_WIRING_TYPE}. The
+	 * key is {@link #REQUIREMENTS} and the type is
+	 * {@link #REQUIREMENT_TYPE_ARRAY}.
+	 */
+	Item			REQUIREMENTS_ITEM					= new Item(REQUIREMENTS, "The bundle requirements of a bundle revision wiring", REQUIREMENT_TYPE_ARRAY);
+
+	/**
+	 * The Composite Type that represents the requirements of a revision. The
+	 * composite consists of:
+	 * <ul>
+	 * <li>{@link #BUNDLE_REVISION_ID}</li>
+	 * <li>{@link #REQUIREMENTS}</li>
+	 * </ul>
+	 */
+	CompositeType	REVISION_REQUIREMENTS_TYPE			= Item.compositeType("REVISION_REQUIREMENTS", "Describes the requirements for a bundle revision", BUNDLE_REVISION_ID_ITEM, REQUIREMENTS_ITEM);
+
+	/**
+	 * The Tabular Type that hold the requirements of a revision. The row type
+	 * is {@link #REVISION_REQUIREMENTS_TYPE} and the index is
+	 * {@link #BUNDLE_REVISION_ID}.
+	 */
+	TabularType		REVISIONS_REQUIREMENTS_TYPE			= Item.tabularType("REVISIONS_REQUIREMENTS", "The bundle requirements for all bundle revisions", REVISION_REQUIREMENTS_TYPE, BUNDLE_REVISION_ID);
+
+	/**
+	 * The key of {@link #CAPABILITIES_ITEM}.
+	 */
+	String			CAPABILITIES						= "Capabilities";
+
+	/**
+	 * The item containing the capabilities in
+	 * {@link #REVISION_CAPABILITIES_TYPE} and {@link #BUNDLE_WIRING_TYPE}. The
+	 * key is {@link #CAPABILITIES} and the type is
+	 * {@link #CAPABILITY_TYPE_ARRAY}.
+	 */
+	Item			CAPABILITIES_ITEM					= new Item(CAPABILITIES, "The bundle capabilities of a bundle revision wiring", CAPABILITY_TYPE_ARRAY);
+
+	/**
+	 * The Composite Type that represents the capabilities for a revision. The
+	 * composite consists of:
+	 * <ul>
+	 * <li>{@link #BUNDLE_REVISION_ID}</li>
+	 * <li>{@link #CAPABILITIES}</li>
+	 * </ul>
+	 */
+	CompositeType	REVISION_CAPABILITIES_TYPE			= Item.compositeType("REVISION_CAPABILITIES", "Describes the capabilities for a bundle revision", BUNDLE_REVISION_ID_ITEM, CAPABILITIES_ITEM);
+
+	/**
+	 * The Tabular Type that holds the capabilities of a revision. The row type
+	 * is {@link #REVISION_CAPABILITIES_TYPE} and the index is
+	 * {@link #BUNDLE_REVISION_ID}.
+	 */
+	TabularType		REVISIONS_CAPABILITIES_TYPE			= Item.tabularType("REVISIONS_CAPABILITIES", "The bundle capabilities for all bundle revisions", REVISION_CAPABILITIES_TYPE, BUNDLE_REVISION_ID);
+
+	/**
+	 * The key of {@link #PROVIDED_WIRES_ITEM}.
+	 */
+	String			PROVIDED_WIRES						= "ProvidedWires";
+
+	/**
+	 * The item containing the provided wires in {@link #BUNDLE_WIRING_TYPE}.
+	 * The key is {@link #PROVIDED_WIRES} and the type is
+	 * {@link #BUNDLE_WIRES_TYPE_ARRAY}.
+	 */
+	Item			PROVIDED_WIRES_ITEM					= new Item(PROVIDED_WIRES, "The bundle wires to the capabilities provided by this bundle wiring.", BUNDLE_WIRES_TYPE_ARRAY);
+
+	/**
+	 * The key of {@link #REQUIRED_WIRES_ITEM}.
+	 */
+	String			REQUIRED_WIRES						= "RequiredWires";
+
+	/**
+	 * The item containing the required wires in {@link #BUNDLE_WIRING_TYPE}.
+	 * The key is {@link #REQUIRED_WIRES} and the type is
+	 * {@link #BUNDLE_WIRES_TYPE_ARRAY}.
+	 */
+	Item			REQUIRED_WIRES_ITEM					= new Item(REQUIRED_WIRES, "The bundle wires to requirements in use by this bundle wiring", BUNDLE_WIRES_TYPE_ARRAY);
+
+	/**
+	 * The Composite Type that represents a bundle wiring. The composite
+	 * consists of:
+	 * <ul>
+	 * <li>{@link #BUNDLE_ID}</li>
+	 * <li>{@link #BUNDLE_REVISION_ID}</li>
+	 * <li>{@link #REQUIREMENTS}</li>
+	 * <li>{@link #CAPABILITIES}</li>
+	 * <li>{@link #REQUIRED_WIRES}</li>
+	 * <li>{@link #PROVIDED_WIRES}</li>
+	 * </ul>
+	 */
+	CompositeType	BUNDLE_WIRING_TYPE					= Item.compositeType("BUNDLE_WIRING",
+																"Describes the runtime association between a provider and a requirer",
+																BUNDLE_ID_ITEM,
+																BUNDLE_REVISION_ID_ITEM,
+																REQUIREMENTS_ITEM,
+																CAPABILITIES_ITEM,
+																REQUIRED_WIRES_ITEM,
+																PROVIDED_WIRES_ITEM);
+
+	/**
+	 * The Tabular Type to hold the wiring of a number of bundles. The row type
+	 * is {@link #BUNDLE_WIRING_TYPE} and the index is the combination of the
+	 * {@link #BUNDLE_ID} and the {@link #BUNDLE_REVISION_ID}.
+	 */
+	TabularType		BUNDLES_WIRING_TYPE					= Item.tabularType("BUNDLES_WIRING", "The bundle wiring for all bundle revisions", BUNDLE_WIRING_TYPE, BUNDLE_ID, BUNDLE_REVISION_ID);
+
+	/**
+	 * Returns the requirements for the current bundle revision.
+	 *
+	 * @see #REQUIREMENT_TYPE_ARRAY for the details of the CompositeData.
+	 *
+	 * @param bundleId The bundle ID.
+	 * @param namespace The namespace of the requirements to be returned by this
+	 *        operation.
+	 * @return the declared requirements for the current revision of
+	 *         {@code bundleId} and {@code namespace}.
+	 * @throws JMException if there is a JMX problem.
+	 * @throws IOException if the connection could not be made because of a
+	 *         communication problem.
+	 */
+	CompositeData[] getCurrentRevisionDeclaredRequirements(long bundleId, String namespace) throws IOException, JMException;
+
+	/**
+	 * Returns the capabilities for the current bundle revision.
+	 *
+	 * @see #CAPABILITY_TYPE_ARRAY for the details of the CompositeData.
+	 *
+	 * @param bundleId The bundle ID.
+	 * @param namespace The namespace of the capabilities to be returned by this
+	 *        operation.
+	 * @return the declared capabilities for the current revision of
+	 *         {@code bundleId} and {@code namespace}.
+	 * @throws JMException if there is a JMX problem.
+	 * @throws IOException if the connection could not be made because of a
+	 *         communication problem.
+	 */
+	CompositeData[] getCurrentRevisionDeclaredCapabilities(long bundleId, String namespace) throws IOException, JMException;
+
+	/**
+	 * Returns the bundle wiring for the current bundle revision.
+	 *
+	 * @see #BUNDLE_WIRING_TYPE for the details of the CompositeData.
+	 *
+	 * @param bundleId The bundle ID.
+	 * @param namespace The namespace of the requirements and capabilities for
+	 *        which to return information.
+	 * @return the wiring information for the current revision of
+	 *         {@code bundleId} and {@code namespace}.
+	 * @throws JMException if there is a JMX problem.
+	 * @throws IOException if the connection could not be made because of a
+	 *         communication problem.
+	 */
+	CompositeData getCurrentWiring(long bundleId, String namespace) throws IOException, JMException;
+
+	/**
+	 * Returns the bundle wiring closure for the current revision of the
+	 * specified bundle. The wiring closure contains all the wirings from the
+	 * root bundle revision to all bundle revisions it is wired to and all their
+	 * transitive wirings.
+	 *
+	 * @see #BUNDLES_WIRING_TYPE for the details of the TabularData.
+	 *
+	 * @param rootBundleId the root bundle of the closure.
+	 * @param namespace The namespace of the requirements and capabilities for
+	 *        which to return information.
+	 * @return a tabular representation of all the wirings in the closure. The
+	 *         bundle revision IDs only have meaning in the context of the
+	 *         current result. The revision of the rootBundle is set to 0.
+	 *         Therefore the root bundle of the closure can be looked up in the
+	 *         table by its bundle ID and revision 0.
+	 * @throws JMException if there is a JMX problem.
+	 * @throws IOException if the connection could not be made because of a
+	 *         communication problem.
+	 */
+	TabularData getCurrentWiringClosure(long rootBundleId, String namespace) throws IOException, JMException;
+
+	/**
+	 * Returns the requirements for all revisions of the bundle.
+	 *
+	 * @see #REVISIONS_REQUIREMENTS_TYPE for the details of TabularData.
+	 *
+	 *      The requirements are in no particular order, and may change in
+	 *      subsequent calls to this operation.
+	 *
+	 * @param bundleId The bundle ID.
+	 * @param namespace The namespace of the requirements to be returned by this
+	 *        operation.
+	 * @return the declared requirements for all revisions of {@code bundleId}.
+	 * @throws JMException if there is a JMX problem.
+	 * @throws IOException if the connection could not be made because of a
+	 *         communication problem.
+	 */
+	TabularData getRevisionsDeclaredRequirements(long bundleId, String namespace) throws IOException, JMException;
+
+	/**
+	 * Returns the capabilities for all revisions of the bundle.
+	 *
+	 * @see #REVISIONS_CAPABILITIES_TYPE for the details of TabularData.
+	 *
+	 *      The capabilities are in no particular order, and may change in
+	 *      subsequent calls to this operation.
+	 *
+	 * @param bundleId The bundle ID.
+	 * @param namespace The namespace of the capabilities to be returned by this
+	 *        operation.
+	 * @return the declared capabilities for all revisions of {@code bundleId}
+	 * @throws JMException if there is a JMX problem.
+	 * @throws IOException if the connection could not be made because of a
+	 *         communication problem.
+	 */
+	TabularData getRevisionsDeclaredCapabilities(long bundleId, String namespace) throws IOException, JMException;
+
+	/**
+	 * Returns the bundle wirings for all revisions of the bundle.
+	 *
+	 * @see #BUNDLES_WIRING_TYPE for the details of TabularData.
+	 *
+	 *      The bundle wirings are in no particular order, and may change in
+	 *      subsequent calls to this operations.
+	 *
+	 * @param bundleId The bundle ID.
+	 * @param namespace The namespace of the requirements and capabilities for
+	 *        which to return information.
+	 * @return the wiring information for all revisions of {@code bundleId} and
+	 *         {@code namespace}.
+	 * @throws JMException if there is a JMX problem.
+	 * @throws IOException if the connection could not be made because of a
+	 *         communication problem.
+	 */
+	TabularData getRevisionsWiring(long bundleId, String namespace) throws IOException, JMException;
+
+	/**
+	 * Returns the bundle wiring closure for all revisions of the specified
+	 * bundle. The wiring closure contains all the wirings from the root bundle
+	 * revision to all bundle revisions it is wired to and all their transitive
+	 * wirings.
+	 *
+	 * @see #BUNDLES_WIRING_TYPE for the details of TabularData.
+	 *
+	 *      The bundle wirings are in no particular order, and may change in
+	 *      subsequent calls to this operation. Furthermore, the bundle revision
+	 *      IDs are local and cannot be reused across invocations.
+	 *
+	 * @param rootBundleId The root bundle ID.
+	 * @param namespace The namespace of the requirements and capabilities for
+	 *        which to return information.
+	 * @return a tabular representation of all the wirings in the closure. The
+	 *         bundle revision IDs only have meaning in the context of the
+	 *         current result.
+	 * @throws JMException if there is a JMX problem.
+	 * @throws IOException if the connection could not be made because of a
+	 *         communication problem.
+	 */
+	TabularData getRevisionsWiringClosure(long rootBundleId, String namespace) throws IOException, JMException;
 
-}
\ No newline at end of file
+}

Modified: aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java?rev=1348069&r1=1348068&r2=1348069&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java Fri Jun  8 13:45:38 2012
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) OSGi Alliance (2009, 2010). All Rights Reserved.
- * 
+ * Copyright (c) OSGi Alliance (2009, 2012). All Rights Reserved.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -28,16 +28,15 @@ import org.osgi.jmx.JmxConstants;
 
 /**
  * This MBean provides the management interface to the OSGi User Manager Service
- * 
- * @version $Revision$
+ *
+ * @version $Id: f7e49989d7b71ebdbdca58c1a4e0c24735576196 $
  * @ThreadSafe
  */
 public interface UserAdminMBean {
 	/**
 	 * User Admin MBean object name.
 	 */
-	String			OBJECTNAME				= JmxConstants.OSGI_COMPENDIUM
-													+ ":service=useradmin,version=1.1";
+	String			OBJECTNAME				= JmxConstants.OSGI_COMPENDIUM + ":service=useradmin,version=1.1";
 
 	/**
 	 * The key NAME, used in {@link #NAME_ITEM}.
@@ -48,10 +47,7 @@ public interface UserAdminMBean {
 	 * The item for the user name for an authorization object. The key is
 	 * {@link #NAME} and the type is {@link SimpleType#STRING}.
 	 */
-	Item			NAME_ITEM				= new Item(
-													NAME,
-													"The user name for this authorization object",
-													SimpleType.STRING);
+	Item			NAME_ITEM				= new Item(NAME, "The user name for this authorization object", SimpleType.STRING);
 
 	/**
 	 * The key ROLES, used in {@link #ROLES_ITEM}.
@@ -62,21 +58,13 @@ public interface UserAdminMBean {
 	 * The item containing the roles for this authorization object. The key is
 	 * {@link #ROLES}. and the type is {@link JmxConstants#STRING_ARRAY_TYPE}.
 	 */
-	Item			ROLES_ITEM				= new Item(
-													ROLES,
-													"The names of the roles encapsulated by this auth object",
-													JmxConstants.STRING_ARRAY_TYPE);
+	Item			ROLES_ITEM				= new Item(ROLES, "The names of the roles encapsulated by this auth object", JmxConstants.STRING_ARRAY_TYPE);
 
 	/**
 	 * The Composite Type for an Authorization object. It consists of the
 	 * {@link #NAME_ITEM} and {@link #TYPE_ITEM} items.
 	 */
-	CompositeType	AUTORIZATION_TYPE		= Item
-													.compositeType(
-															"AUTHORIZATION",
-															"An authorization object defines which roles has a user got",
-															NAME_ITEM,
-															ROLES_ITEM);
+	CompositeType	AUTORIZATION_TYPE		= Item.compositeType("AUTHORIZATION", "An authorization object defines which roles has a user got", NAME_ITEM, ROLES_ITEM);
 	/**
 	 * The Role TYPE key, used in {@link #TYPE_ITEM}.
 	 */
@@ -87,10 +75,7 @@ public interface UserAdminMBean {
 	 * authorization object. The key is {@link #TYPE} and the type is
 	 * {@link SimpleType#INTEGER}.
 	 */
-	Item			TYPE_ITEM				= new Item(
-													TYPE,
-													"An integer representing type of the role: {0=Role,1=user,2=group}",
-													SimpleType.INTEGER);
+	Item			TYPE_ITEM				= new Item(TYPE, "An integer representing type of the role: {0=Role,1=user,2=group}", SimpleType.INTEGER);
 
 	/**
 	 * The PROPERTIES key, used in {@link #PROPERTIES_ITEM}.
@@ -101,10 +86,7 @@ public interface UserAdminMBean {
 	 * The item containing the properties of a Role. The key is
 	 * {@link #PROPERTIES} and the type is {@link JmxConstants#PROPERTIES_TYPE}.
 	 */
-	Item			PROPERTIES_ITEM			= new Item(
-													PROPERTIES,
-													"A properties as defined by org.osgi.service.useradmin.Role",
-													JmxConstants.PROPERTIES_TYPE);
+	Item			PROPERTIES_ITEM			= new Item(PROPERTIES, "A properties as defined by org.osgi.service.useradmin.Role", JmxConstants.PROPERTIES_TYPE);
 	/**
 	 * The Composite Type for a Role. It contains the following items:
 	 * <ul>
@@ -112,14 +94,13 @@ public interface UserAdminMBean {
 	 * <li>{@link #TYPE}</li>
 	 * <li>{@link #PROPERTIES}</li>
 	 * </ul>
-	 * 
+	 *
 	 */
-	CompositeType	ROLE_TYPE				= Item
-													.compositeType(
-															"ROLE",
-															"Mapping of org.osgi.service.useradmin.Role for remote management purposes. User and Group extend Role",
-															NAME_ITEM,
-															TYPE_ITEM);
+	CompositeType	ROLE_TYPE				= Item.compositeType("ROLE",
+													"Mapping of org.osgi.service.useradmin.Role for remote management purposes. User and Group extend Role",
+													NAME_ITEM,
+													TYPE_ITEM,
+													PROPERTIES_ITEM);
 
 	/**
 	 * The CREDENTIALS key, used in {@link #CREDENTIALS_ITEM}.
@@ -128,28 +109,22 @@ public interface UserAdminMBean {
 
 	/**
 	 * The item containing the credentials of a user. The key is
-	 * {@link #CREDENTIALS} and the type is {@link JmxConstants#PROPERTIES_TYPE} .
+	 * {@link #CREDENTIALS} and the type is {@link JmxConstants#PROPERTIES_TYPE}
+	 * .
 	 */
-	Item			CREDENTIALS_ITEM		= new Item(
-													CREDENTIALS,
-													"The credentials for this user",
-													JmxConstants.PROPERTIES_TYPE);
+	Item			CREDENTIALS_ITEM		= new Item(CREDENTIALS, "The credentials for this user", JmxConstants.PROPERTIES_TYPE);
 
 	/**
 	 * A Composite Type for a User. A User contains its Role description and
 	 * adds the credentials. It extends {@link #ROLE_TYPE} and adds
 	 * {@link #CREDENTIALS_ITEM}.
-	 * 
+	 *
 	 * This type extends the {@link #ROLE_TYPE}. It adds:
 	 * <ul>
 	 * <li>{@link #CREDENTIALS}</li>
 	 * </ul>
 	 */
-	CompositeType	USER_TYPE				= Item
-													.extend(
-															ROLE_TYPE,
-															"USER",
-															"Mapping of org.osgi.service.useradmin.User for remote management purposes. User extends Role");
+	CompositeType	USER_TYPE				= Item.extend(ROLE_TYPE, "USER", "Mapping of org.osgi.service.useradmin.User for remote management purposes. User extends Role");
 
 	/**
 	 * The MEMBERS key, used in {@link #MEMBERS_ITEM}.
@@ -161,10 +136,7 @@ public interface UserAdminMBean {
 	 * and the type is {@link JmxConstants#STRING_ARRAY_TYPE}. It is used in
 	 * {@link #GROUP_TYPE}.
 	 */
-	Item			MEMBERS_ITEM			= new Item(
-													MEMBERS,
-													"The members of this group",
-													JmxConstants.STRING_ARRAY_TYPE);
+	Item			MEMBERS_ITEM			= new Item(MEMBERS, "The members of this group", JmxConstants.STRING_ARRAY_TYPE);
 
 	/**
 	 * The REQUIRED_MEMBERS key, used in {@link #REQUIRED_MEMBERS_ITEM}.
@@ -174,105 +146,102 @@ public interface UserAdminMBean {
 	/**
 	 * The item containing the required members of a group. The key is
 	 * {@link #REQUIRED_MEMBERS} and the type is
-	 * {@link JmxConstants#STRING_ARRAY_TYPE}. It is used in
-	 * {@link #GROUP_TYPE} .
+	 * {@link JmxConstants#STRING_ARRAY_TYPE}. It is used in {@link #GROUP_TYPE}
+	 * .
 	 */
-	Item			REQUIRED_MEMBERS_ITEM	= new Item(
-													REQUIRED_MEMBERS,
-													"The required members of this group",
-													JmxConstants.STRING_ARRAY_TYPE);
+	Item			REQUIRED_MEMBERS_ITEM	= new Item(REQUIRED_MEMBERS, "The required members of this group", JmxConstants.STRING_ARRAY_TYPE);
 
 	/**
 	 * The Composite Type for a Group. It extends {@link #USER_TYPE} and adds
 	 * {@link #MEMBERS_ITEM}, and {@link #REQUIRED_MEMBERS_ITEM}.
-	 * 
+	 *
 	 * This type extends the {@link #USER_TYPE}. It adds:
 	 * <ul>
 	 * <li>{@link #MEMBERS}</li>
 	 * <li>{@link #REQUIRED_MEMBERS}</li>
 	 * </ul>
+	 * If there are no members or required members an empty array is returned in
+	 * the respective items.
 	 */
-	CompositeType	GROUP_TYPE				= Item
-													.extend(
-															USER_TYPE,
-															"GROUP",
-															"Mapping of org.osgi.service.useradmin.Group for remote management purposes. Group extends User which in turn extends Role",
-															MEMBERS_ITEM,
-															REQUIRED_MEMBERS_ITEM);
+	CompositeType	GROUP_TYPE				= Item.extend(USER_TYPE,
+													"GROUP",
+													"Mapping of org.osgi.service.useradmin.Group for remote management purposes. Group extends User which in turn extends Role",
+													MEMBERS_ITEM,
+													REQUIRED_MEMBERS_ITEM);
 
 	/**
 	 * Add credentials to a user, associated with the supplied key
-	 * 
+	 *
 	 * @param key The key of the credential to add
 	 * @param value The value of the credential to add
 	 * @param username The name of the user that gets the credential.
 	 * @throws IOException if the operation fails
-	 * @throws IllegalArgumentException if the user name is not a User
+	 * @throws IllegalArgumentException if the username is not a User
 	 */
-	void addCredential(String key, byte[] value, String username)
-			throws IOException;
+	void addCredential(String key, byte[] value, String username) throws IOException;
 
 	/**
 	 * Add credentials to a user, associated with the supplied key
-	 * 
+	 *
 	 * @param key The key of the credential to add
 	 * @param value The value of the credential to add
 	 * @param username The name of the user that gets the credential.
 	 * @throws IOException if the operation fails
 	 * @throws IllegalArgumentException if the username is not a User
 	 */
-	void addCredentialString(String key, String value, String username)
-			throws IOException;
+	void addCredentialString(String key, String value, String username) throws IOException;
 
 	/**
 	 * Add a member to the group.
-	 * 
-	 * @param groupname The group name that receives the <code>rolename</code>
-	 *        as member.
-	 * @param rolename The <code>rolename</code> (User or Group) that must be
-	 *        added.
-	 * @return <code>true</code> if the role was added to the group
-	 * @throws IOException if the operation fails
-	 * 
+	 *
+	 * @param groupname The group name that receives the {@code rolename} as
+	 *        member.
+	 * @param rolename The {@code rolename} (User or Group) that must be added.
+	 * @return {@code true} if the role was added to the group
+	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if an invalid group name or role name is
+	 *         specified
+	 *
 	 */
 	boolean addMember(String groupname, String rolename) throws IOException;
 
 	/**
 	 * Add or update a property on a role
-	 * 
+	 *
 	 * @param key The key of the property to add
-	 * @param value The value of the property to add (<code>String</code>)
+	 * @param value The value of the property to add ({@code String})
 	 * @param rolename The role name
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if an invalid role name is specified
 	 */
-	void addPropertyString(String key, String value, String rolename)
-			throws IOException;
+	void addPropertyString(String key, String value, String rolename) throws IOException;
 
 	/**
 	 * Add or update a property on a role.
-	 * 
+	 *
 	 * @param key The added property key
 	 * @param value The added byte[] property value
 	 * @param rolename The role name that receives the property
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if an invalid role name is specified
 	 */
-	void addProperty(String key, byte[] value, String rolename)
-			throws IOException;
+	void addProperty(String key, byte[] value, String rolename) throws IOException;
 
 	/**
 	 * Add a required member to the group
-	 * 
+	 *
 	 * @param groupname The group name that is addded
 	 * @param rolename The role that
 	 * @return true if the role was added to the group
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if an invalid group name or role name is
+	 *         specified
 	 */
-	boolean addRequiredMember(String groupname, String rolename)
-			throws IOException;
+	boolean addRequiredMember(String groupname, String rolename) throws IOException;
 
 	/**
 	 * Create a User
-	 * 
+	 *
 	 * @param name Name of the user to create
 	 * @throws IOException if the operation fails
 	 */
@@ -280,25 +249,28 @@ public interface UserAdminMBean {
 
 	/**
 	 * Create a Group
-	 * 
+	 *
 	 * @param name Name of the group to create
 	 * @throws IOException if the operation fails
 	 */
 	void createGroup(String name) throws IOException;
 
 	/**
-	 * Create a Role
-	 * 
-	 * @param name of the role to create
-	 * @throws IOException if the operation fails
+	 * This method was specified in error and must not be used.
+	 *
+	 * @param name Ignored.
+	 * @throws IOException This method will throw an exception if called.
+	 * @deprecated This method was specified in error. It does not function and
+	 *             must not be used. Use either {@link #createUser(String)} or
+	 *             {@link #createGroup(String)}.
 	 */
 	void createRole(String name) throws IOException;
 
 	/**
 	 * Answer the authorization for the user name.
-	 * 
+	 *
 	 * The Composite Data is typed by {@link #AUTORIZATION_TYPE}.
-	 * 
+	 *
 	 * @param user The user name
 	 * @return the Authorization typed by {@link #AUTORIZATION_TYPE}.
 	 * @throws IOException if the operation fails
@@ -308,10 +280,10 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the credentials associated with a user.
-	 * 
+	 *
 	 * The returned Tabular Data is typed by
 	 * {@link JmxConstants#PROPERTIES_TYPE}.
-	 * 
+	 *
 	 * @param username The user name
 	 * @return the credentials associated with the user, see
 	 *         {@link JmxConstants#PROPERTIES_TYPE}
@@ -322,9 +294,9 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the Group associated with the group name.
-	 * 
+	 *
 	 * The returned Composite Data is typed by {@link #GROUP_TYPE}
-	 * 
+	 *
 	 * @param groupname The group name
 	 * @return the Group, see {@link #GROUP_TYPE}
 	 * @throws IOException if the operation fails
@@ -334,7 +306,7 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the list of group names
-	 * 
+	 *
 	 * @return The list of group names
 	 * @throws IOException if the operation fails
 	 */
@@ -342,7 +314,7 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the list of group names
-	 * 
+	 *
 	 * @param filter The filter to apply
 	 * @return The list of group names
 	 * @throws IOException if the operation fails
@@ -351,7 +323,7 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the list of implied roles for a user
-	 * 
+	 *
 	 * @param username The name of the user that has the implied roles
 	 * @return The list of role names
 	 * @throws IOException if the operation fails
@@ -361,52 +333,53 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the the user names which are members of the group
-	 * 
+	 *
 	 * @param groupname The name of the group to get the members from
 	 * @return The list of user names
 	 * @throws IOException if the operation fails
-	 * @throws IllegalArgumentException if the <code>groupname</code> is not a
-	 *         group
+	 * @throws IllegalArgumentException if the groupname is not a Group
 	 */
 	String[] getMembers(String groupname) throws IOException;
 
 	/**
 	 * Answer the properties associated with a role.
-	 * 
+	 *
 	 * The returned Tabular Data is typed by
 	 * {@link JmxConstants#PROPERTIES_TYPE}.
-	 * 
+	 *
 	 * @param rolename The name of the role to get properties from
 	 * @return the properties associated with the role, see
 	 *         {@link JmxConstants#PROPERTIES_TYPE}
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if the rolename is not a role
 	 */
 	TabularData getProperties(String rolename) throws IOException;
 
 	/**
 	 * Answer the list of user names which are required members of this group
-	 * 
+	 *
 	 * @param groupname The name of the group to get the required members from
 	 * @return The list of user names
 	 * @throws IOException if the operation fails
-	 * @throws IllegalArgumentException if the group name is not a group
+	 * @throws IllegalArgumentException if the group name is not a Group
 	 */
 	String[] getRequiredMembers(String groupname) throws IOException;
 
 	/**
 	 * Answer the role associated with a name.
-	 * 
+	 *
 	 * The returned Composite Data is typed by {@link #ROLE_TYPE}.
-	 * 
+	 *
 	 * @param name The name of the role to get the data from
 	 * @return the Role, see {@link #ROLE_TYPE}
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if the name is not a role
 	 */
 	CompositeData getRole(String name) throws IOException;
 
 	/**
 	 * Answer the list of role names in the User Admin database
-	 * 
+	 *
 	 * @return The list of role names
 	 * @throws IOException if the operation fails
 	 */
@@ -414,12 +387,12 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the list of role names which match the supplied filter
-	 * 
+	 *
 	 * @param filter The string representation of the
-	 *        <code>org.osgi.framework.Filter</code> that is used to filter
-	 *        the roles by applying to the properties, if <code>null</code>
-	 *        all roles are returned.
-	 * 
+	 *        {@code org.osgi.framework.Filter} that is used to filter the roles
+	 *        by applying to the properties, if {@code null} all roles are
+	 *        returned.
+	 *
 	 * @return The list the role names
 	 * @throws IOException if the operation fails
 	 */
@@ -427,21 +400,20 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the User associated with the user name.
-	 * 
+	 *
 	 * The returned Composite Data is typed by {@link #USER_TYPE}.
-	 * 
+	 *
 	 * @param username The name of the requested user
 	 * @return The User, see {@link #USER_TYPE}
 	 * @throws IOException if the operation fails
-	 * @throws IllegalArgumentException if the <code>username</code> is not a
-	 *         User
+	 * @throws IllegalArgumentException if the username is not a User
 	 */
 	CompositeData getUser(String username) throws IOException;
 
 	/**
 	 * Answer the user name with the given property key-value pair from the User
 	 * Admin service database.
-	 * 
+	 *
 	 * @param key The key to compare
 	 * @param value The value to compare
 	 * @return The User
@@ -451,7 +423,7 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the list of user names in the User Admin database
-	 * 
+	 *
 	 * @return The list of user names
 	 * @throws IOException if the operation fails
 	 */
@@ -459,7 +431,7 @@ public interface UserAdminMBean {
 
 	/**
 	 * Answer the list of user names in the User Admin database
-	 * 
+	 *
 	 * @param filter The filter to apply
 	 * @return The list of user names
 	 * @throws IOException if the operation fails
@@ -468,7 +440,7 @@ public interface UserAdminMBean {
 
 	/**
 	 * Remove the credential associated with the given user
-	 * 
+	 *
 	 * @param key The key of the credential to remove
 	 * @param username The name of the user for which the credential must be
 	 *        removed
@@ -479,7 +451,7 @@ public interface UserAdminMBean {
 
 	/**
 	 * Remove a role from the group
-	 * 
+	 *
 	 * @param groupname The group name
 	 * @param rolename
 	 * @return true if the role was removed from the group
@@ -490,38 +462,41 @@ public interface UserAdminMBean {
 
 	/**
 	 * Remove a property from a role
-	 * 
+	 *
 	 * @param key
 	 * @param rolename
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if the rolename is not a role
 	 */
 	void removeProperty(String key, String rolename) throws IOException;
 
 	/**
 	 * Remove the Role associated with the name
-	 * 
+	 *
 	 * @param name
 	 * @return true if the remove succeeded
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if the name is not a role
 	 */
 	boolean removeRole(String name) throws IOException;
 
 	/**
 	 * Remove the Group associated with the name
-	 * 
+	 *
 	 * @param name
 	 * @return true if the remove succeeded
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if the name is not a Group
 	 */
 	boolean removeGroup(String name) throws IOException;
 
 	/**
 	 * Remove the User associated with the name
-	 * 
+	 *
 	 * @param name
 	 * @return true if the remove succeeded
 	 * @throws IOException if the operation fails
+	 * @throws IllegalArgumentException if the name is not a User
 	 */
 	boolean removeUser(String name) throws IOException;
-
-}
\ No newline at end of file
+}

Modified: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/GroupData.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/GroupData.java?rev=1348069&r1=1348068&r2=1348069&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/GroupData.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/GroupData.java Fri Jun  8 13:45:38 2012
@@ -17,6 +17,7 @@
 package org.apache.aries.jmx.codec;
 
 import java.util.ArrayList;
+import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -24,6 +25,7 @@ import java.util.Map;
 import javax.management.openmbean.CompositeData;
 import javax.management.openmbean.CompositeDataSupport;
 import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.TabularData;
 
 import org.osgi.jmx.service.useradmin.UserAdminMBean;
 import org.osgi.service.useradmin.Group;
@@ -35,7 +37,7 @@ import org.osgi.service.useradmin.Role;
  * for the <code>CompositeData</code> representing a Group.
  * </p>
  * </p>
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class GroupData extends UserData {
@@ -56,27 +58,28 @@ public class GroupData extends UserData 
      * @param group {@link Group} instance.
      */
     public GroupData(Group group) {
-        super(group.getName(), Role.GROUP);
+        super(group.getName(), Role.GROUP, group.getProperties());
         this.members = toArray(group.getMembers());
         this.requiredMembers = toArray(group.getRequiredMembers());
     }
 
     /**
      * Constructs new GroupData.
-     * 
+     *
      * @param name group name.
+     * @param properties group properties.
      * @param members basic members.
      * @param requiredMembers required members.
      */
-    public GroupData(String name, String[] members, String[] requiredMembers) {
-        super(name, Role.GROUP);
+    public GroupData(String name, Dictionary properties, String[] members, String[] requiredMembers) {
+        super(name, Role.GROUP, properties);
         this.members = (members == null) ? new String[0] : members;
         this.requiredMembers = (requiredMembers == null) ? new String[0] : requiredMembers;
     }
 
     /**
      * Translates GroupData to CompositeData represented by compositeType {@link UserAdminMBean#GROUP_TYPE}.
-     * 
+     *
      * @return translated GroupData to compositeData.
      */
     public CompositeData toCompositeData() {
@@ -84,6 +87,7 @@ public class GroupData extends UserData 
             Map<String, Object> items = new HashMap<String, Object>();
             items.put(UserAdminMBean.NAME, name);
             items.put(UserAdminMBean.TYPE, type);
+            items.put(UserAdminMBean.PROPERTIES, getPropertiesTable());
             items.put(UserAdminMBean.MEMBERS, members);
             items.put(UserAdminMBean.REQUIRED_MEMBERS, requiredMembers);
             return new CompositeDataSupport(UserAdminMBean.GROUP_TYPE, items);
@@ -94,7 +98,7 @@ public class GroupData extends UserData 
 
     /**
      * Static factory method to create GroupData from CompositeData object.
-     * 
+     *
      * @param data
      *            {@link CompositeData} instance.
      * @return GroupData instance.
@@ -104,9 +108,11 @@ public class GroupData extends UserData 
             return null;
         }
         String name = (String) data.get(UserAdminMBean.NAME);
+        Dictionary<String, Object> props = propertiesFrom((TabularData) data.get(UserAdminMBean.PROPERTIES));
+
         String[] members = (String[]) data.get(UserAdminMBean.MEMBERS);
         String[] requiredMembers = (String[]) data.get(UserAdminMBean.REQUIRED_MEMBERS);
-        return new GroupData(name, members, requiredMembers);
+        return new GroupData(name, props, members, requiredMembers);
     }
 
     /**

Modified: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/RoleData.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/RoleData.java?rev=1348069&r1=1348068&r2=1348069&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/RoleData.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/RoleData.java Fri Jun  8 13:45:38 2012
@@ -16,11 +16,13 @@
  */
 package org.apache.aries.jmx.codec;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Map;
 
 import javax.management.openmbean.CompositeData;
@@ -43,7 +45,7 @@ import org.osgi.service.useradmin.Role;
  * @version $Rev$ $Date$
  */
 public class RoleData {
-    
+
     /**
      * role name.
      */
@@ -52,29 +54,42 @@ public class RoleData {
      * role type.
      */
     protected int type;
-    
+    /**
+     * role propeties.
+     */
+    protected List<PropertyData<? extends Object>> properties = new ArrayList<PropertyData<? extends Object>>();
+
+
     /**
      * Constructs new RoleData from Role object.
      * @param role {@link Role} instance.
      */
     public RoleData(Role role){
-        this(role.getName(),role.getType());
+        this(role.getName(), role.getType(), role.getProperties());
     }
-    
+
     /**
      * Constructs new RoleData.
      * @param name role name.
      * @param type role type.
+     * @param properties role properties.
      */
-    public RoleData(String name, int type){
+    public RoleData(String name, int type, Dictionary properties) {
         this.name = name;
         this.type = type;
+
+        if (properties != null) {
+            for (Enumeration e = properties.keys(); e.hasMoreElements(); ) {
+                String key = e.nextElement().toString();
+                this.properties.add(PropertyData.newInstance(key, properties.get(key)));
+            }
+        }
     }
-    
+
     /**
      * Translates RoleData to CompositeData represented by
      * compositeType {@link UserAdminMBean#ROLE_TYPE}.
-     * 
+     *
      * @return translated RoleData to compositeData.
      */
     public CompositeData toCompositeData() {
@@ -82,15 +97,24 @@ public class RoleData {
             Map<String, Object> items = new HashMap<String, Object>();
             items.put(UserAdminMBean.NAME, name);
             items.put(UserAdminMBean.TYPE, type);
+            items.put(UserAdminMBean.PROPERTIES, getPropertiesTable());
             return new CompositeDataSupport(UserAdminMBean.ROLE_TYPE, items);
         } catch (OpenDataException e) {
             throw new IllegalStateException("Can't create CompositeData" + e);
         }
     }
 
+    protected TabularData getPropertiesTable() {
+        TabularData propertiesTable = new TabularDataSupport(JmxConstants.PROPERTIES_TYPE);
+        for (PropertyData<? extends Object> propertyData : properties) {
+            propertiesTable.put(propertyData.toCompositeData());
+        }
+        return propertiesTable;
+    }
+
     /**
      * Static factory method to create RoleData from CompositeData object.
-     * 
+     *
      * @param data {@link CompositeData} instance.
      * @return RoleData instance.
      */
@@ -100,12 +124,14 @@ public class RoleData {
         }
         String name = (String) data.get(UserAdminMBean.NAME);
         int type = (Integer) data.get(UserAdminMBean.TYPE);
-        return new RoleData(name, type);
+        Dictionary<String, Object> props = propertiesFrom((TabularData) data.get(UserAdminMBean.PROPERTIES));
+
+        return new RoleData(name, type, props);
     }
 
     /**
      * Creates TabularData from Dictionary.
-     * 
+     *
      * @param props Dictionary instance.
      * @return TabularData instance.
      */
@@ -120,10 +146,10 @@ public class RoleData {
         }
         return data;
     }
-    
+
     /**
      * Creates properties from TabularData object.
-     * 
+     *
      * @param data {@link TabularData} instance.
      * @return translated tabular data to properties {@link Dictionary}.
      */
@@ -131,13 +157,13 @@ public class RoleData {
         if(data == null){
             return null;
         }
-        
+
         Dictionary<String, Object> props = new Hashtable<String, Object>();
         for(CompositeData compositeData : (Collection<CompositeData>)data.values()){
             PropertyData  property = PropertyData.from(compositeData);
             props.put(property.getKey(), property.getValue());
         }
-        
+
         return props;
     }
     /**

Modified: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/UserData.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/UserData.java?rev=1348069&r1=1348068&r2=1348069&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/UserData.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/UserData.java Fri Jun  8 13:45:38 2012
@@ -16,12 +16,14 @@
  */
 package org.apache.aries.jmx.codec;
 
+import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.management.openmbean.CompositeData;
 import javax.management.openmbean.CompositeDataSupport;
 import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.TabularData;
 
 import org.osgi.jmx.service.useradmin.UserAdminMBean;
 import org.osgi.service.useradmin.User;
@@ -38,28 +40,29 @@ import org.osgi.service.useradmin.User;
 public class UserData extends RoleData {
 
     /**
-     * Constructs new UserData.
-     * 
-     * @param name user name.
-     * @param type role type.
-     */
-    public UserData(String name, int type){
-        super(name, type);
-    }
-    
-    /**
      * Constructs new UserData from {@link User} object.
-     * 
+     *
      * @param user {@link User} instance.
      */
     public UserData(User user){
-        this(user.getName(), user.getType());
+        super(user.getName(), user.getType(), user.getProperties());
     }
-    
+
+    /**
+     * Constructs new UserData.
+     *
+     * @param name user name.
+     * @param type role type.
+     * @param properties user properties.
+     */
+    public UserData(String name, int type, Dictionary properties) {
+        super(name, type, properties);
+    }
+
     /**
      * Translates UserData to CompositeData represented by
      * compositeType {@link UserAdminMBean#USER_TYPE}.
-     * 
+     *
      * @return translated UserData to compositeData.
      */
     public CompositeData toCompositeData() {
@@ -67,6 +70,7 @@ public class UserData extends RoleData {
             Map<String, Object> items = new HashMap<String, Object>();
             items.put(UserAdminMBean.NAME, name);
             items.put(UserAdminMBean.TYPE, type);
+            items.put(UserAdminMBean.PROPERTIES, getPropertiesTable());
             return new CompositeDataSupport(UserAdminMBean.USER_TYPE, items);
         } catch (OpenDataException e) {
             throw new IllegalStateException("Can't create CompositeData" + e);
@@ -75,7 +79,7 @@ public class UserData extends RoleData {
 
     /**
      * Static factory method to create UserData from CompositeData object.
-     * 
+     *
      * @param data {@link CompositeData} instance.
      * @return UserData instance.
      */
@@ -85,6 +89,8 @@ public class UserData extends RoleData {
         }
         String name = (String) data.get(UserAdminMBean.NAME);
         int type = (Integer)data.get(UserAdminMBean.TYPE);
-        return new UserData(name, type);
+        Dictionary<String, Object> props = propertiesFrom((TabularData) data.get(UserAdminMBean.PROPERTIES));
+
+        return new UserData(name, type, props);
     }
 }



Mime
View raw message