You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2011/02/27 18:58:23 UTC
svn commit: r1075096 [2/13] - in /aries/tags/jmx-0.1-incubating: ./ jmx-api/
jmx-api/src/ jmx-api/src/main/ jmx-api/src/main/appended-resources/
jmx-api/src/main/appended-resources/META-INF/ jmx-api/src/main/java/
jmx-api/src/main/java/org/ jmx-api/src...
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/FrameworkMBean.java Sun Feb 27 17:58:16 2011
@@ -0,0 +1,488 @@
+/*
+ * Copyright (c) OSGi Alliance (2009, 2010). 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * The FrameworkMbean provides mechanisms to exert control over the framework.
+ * For many operations, it provides a batch mechanism to avoid excessive message
+ * passing when interacting remotely.
+ *
+ * @version $Revision: 929326 $
+ * @ThreadSafe
+ */
+public interface FrameworkMBean {
+ /**
+ * The fully qualified object name of this mbean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":type=framework,version=1.5";
+
+ /**
+ * The SUCCESS, used in {@link #SUCCESS_ITEM}.
+ */
+ String SUCCESS = "Success";
+
+ /**
+ * The item that indicates if this operation was successful. The key is
+ * {@link #SUCCESS} and the type is {@link SimpleType#BOOLEAN}. It is used
+ * in {@link #BATCH_ACTION_RESULT_TYPE} and
+ * {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item SUCCESS_ITEM = new Item(
+ SUCCESS,
+ "Whether the operation was successful",
+ SimpleType.BOOLEAN);
+
+ /**
+ * The key ERROR, used in {@link #ERROR_ITEM}.
+ */
+ String ERROR = "Error";
+
+ /**
+ * The item containing the error message of the batch operation. The key is
+ * {@link #ERROR} and the type is {@link SimpleType#STRING}. It is used in
+ * {@link #BATCH_ACTION_RESULT_TYPE} and {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item ERROR_ITEM = new Item(
+ ERROR,
+ "The error message if unsuccessful",
+ SimpleType.STRING);
+
+ /**
+ * The key COMPLETED, used in {@link #COMPLETED_ITEM}.
+ */
+ String COMPLETED = "Completed";
+
+ /**
+ * The item containing the list of bundles completing the batch operation.
+ * The key is {@link #COMPLETED} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}. It is used in
+ * {@link #BATCH_ACTION_RESULT_TYPE} and {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item COMPLETED_ITEM = new Item(
+ COMPLETED,
+ "The bundle ids of the successfully completed installs",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The key for BUNDLE_IN_ERROR. This key is used with two different items:
+ * {@link #BUNDLE_IN_ERROR_ID_ITEM} and
+ * {@link #BUNDLE_IN_ERROR_LOCATION_ITEM} that each have a different type
+ * for this key. It is used in {@link #BATCH_ACTION_RESULT_TYPE} and
+ * {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ String BUNDLE_IN_ERROR = "BundleInError";
+
+ /**
+ * The item containing the bundle which caused the error during the batch
+ * operation. This item describes the bundle in error as an id. The key is
+ * {@link #BUNDLE_IN_ERROR} and the type is {@link SimpleType#LONG}. It is
+ * used in {@link #BATCH_ACTION_RESULT_TYPE}.
+ *
+ * @see #BUNDLE_IN_ERROR_LOCATION_ITEM BUNDLE_IN_ERROR_LOCATION_ITEM for the
+ * item that has a location for the bundle in error.
+ */
+ Item BUNDLE_IN_ERROR_ID_ITEM = new Item(
+ BUNDLE_IN_ERROR,
+ "The id of the bundle causing the error",
+ SimpleType.LONG);
+
+ /**
+ * The key REMAINING, used in {@link #REMAINING_ID_ITEM} and
+ * {@link #REMAINING_LOCATION_ITEM}.
+ */
+ String REMAINING = "Remaining";
+
+ /**
+ * The item containing the list of remaining bundles unprocessed by the
+ * failing batch operation. The key is {@link #REMAINING} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}. It is used in
+ * {@link #BATCH_ACTION_RESULT_TYPE} and {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item REMAINING_ID_ITEM = new Item(
+ REMAINING,
+ "The ids of the remaining bundles",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The Composite Type for a batch action result.
+ * {@link #refreshBundle(long)} and {@link #refreshBundles(long[])}.
+ * Notice that a batch action result returns uses an id for the
+ * {@link #BUNDLE_IN_ERROR} while the {@link #BATCH_INSTALL_RESULT_TYPE}
+ * uses a location.
+ *
+ * This Composite Type consists of the following items:
+ * <ul>
+ * <li>{@link #BUNDLE_IN_ERROR_ID_ITEM}</li>
+ * <li>{@link #COMPLETED_ITEM}</li>
+ * <li>{@link #ERROR_ITEM}</li>
+ * <li>{@link #REMAINING_ID_ITEM}</li>
+ * <li>{@link #SUCCESS_ITEM}</li>
+ * </ul>
+ */
+ CompositeType BATCH_ACTION_RESULT_TYPE = Item
+ .compositeType(
+ "BUNDLE_ACTION_RESULT",
+ "This type encapsulates a bundle batch install action result",
+ BUNDLE_IN_ERROR_ID_ITEM,
+ COMPLETED_ITEM,
+ ERROR_ITEM,
+ REMAINING_ID_ITEM,
+ SUCCESS_ITEM //
+ );
+
+ /**
+ * The item containing the bundle which caused the error during the batch
+ * operation. This item describes the bundle in error as a location. The key
+ * is {@link #BUNDLE_IN_ERROR} and the type is {@link SimpleType#STRING}. It
+ * is used in {@link #BATCH_INSTALL_RESULT_TYPE}.
+ *
+ * @see #BUNDLE_IN_ERROR_ID_ITEM BUNDLE_IN_ERROR_ID_ITEM for the item that
+ * has the id for the bundle in error.
+ */
+ Item BUNDLE_IN_ERROR_LOCATION_ITEM = new Item(
+ BUNDLE_IN_ERROR,
+ "The location of the bundle causing the error",
+ SimpleType.STRING);
+
+ /**
+ * The item containing the list of remaining bundles unprocessed by the
+ * failing batch operation. The key is {@link #REMAINING} and the type is
+ * {@link JmxConstants#STRING_ARRAY_TYPE}. It is used in
+ * {@link #BATCH_ACTION_RESULT_TYPE} and {@link #BATCH_INSTALL_RESULT_TYPE}.
+ */
+ Item REMAINING_LOCATION_ITEM = new Item(
+ REMAINING,
+ "The locations of the remaining bundles",
+ JmxConstants.STRING_ARRAY_TYPE);
+
+ /**
+ * The Composite Type which represents the result of a batch install
+ * operation. It is used in {@link #installBundles(String[])} and
+ * {@link #installBundlesFromURL(String[], String[])}.
+ *
+ * This Composite Type consists of the following items:
+ * <ul>
+ * <li>{@link #BUNDLE_IN_ERROR_LOCATION_ITEM}</li>
+ * <li>{@link #COMPLETED_ITEM}</li>
+ * <li>{@link #ERROR_ITEM}</li>
+ * <li>{@link #REMAINING_LOCATION_ITEM P }</li>
+ * <li>{@link #SUCCESS_ITEM}</li>
+ * </ul>
+ */
+ CompositeType BATCH_INSTALL_RESULT_TYPE = Item
+ .compositeType(
+ "BATCH_INSTALL_RESULT",
+ "This type encapsulates a bundle batch install action result",
+ BUNDLE_IN_ERROR_LOCATION_ITEM,
+ COMPLETED_ITEM,
+ ERROR_ITEM,
+ REMAINING_LOCATION_ITEM,
+ SUCCESS_ITEM //
+ );
+
+ /**
+ * Retrieve the framework start level
+ *
+ * @return the framework start level
+ * @throws IOException if the operation failed
+ */
+ int getFrameworkStartLevel() throws IOException;
+
+ /**
+ * Answer the initial start level assigned to a bundle when it is first
+ * started
+ *
+ * @return the start level
+ * @throws IOException if the operation failed
+ */
+ int getInitialBundleStartLevel() throws IOException;
+
+ /**
+ * Install the bundle indicated by the bundleLocations
+ *
+ * @param location the location of the bundle to install
+ * @return the bundle id the installed bundle
+ * @throws IOException if the operation does not succeed
+ */
+ long installBundle(String location) throws IOException;
+
+ /**
+ * Install the bundle indicated by the bundleLocations
+ *
+ * @param location the location to assign to the bundle
+ * @param url the URL which will supply the bytes for the bundle
+ * @return the bundle id the installed bundle
+ * @throws IOException if the operation does not succeed
+ */
+ long installBundleFromURL(String location, String url) throws IOException;
+
+ /**
+ * Batch install the bundles indicated by the list of bundleLocationUrls
+ *
+ * @see #BATCH_INSTALL_RESULT_TYPE BATCH_INSTALL_RESULT_TYPE for the precise
+ * specification of the CompositeData type representing the returned
+ * result.
+ *
+ * @param locations the array of locations of the bundles to install
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData installBundles(String[] locations) throws IOException;
+
+ /**
+ * Batch install the bundles indicated by the list of bundleLocationUrls
+ *
+ * @see #BATCH_INSTALL_RESULT_TYPE BATCH_INSTALL_RESULT_TYPE
+ * BatchBundleResult for the precise specification of the CompositeData
+ * type representing the returned result.
+ *
+ * @param locations the array of locations to assign to the installed
+ * bundles
+ * @param urls the array of urls which supply the bundle bytes
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData installBundlesFromURL(String[] locations, String[] urls)
+ throws IOException;
+
+ /**
+ * Force the update, replacement or removal of the packages identified by
+ * the specified bundle.
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation failed
+ */
+ void refreshBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Force the update, replacement or removal of the packages identified by
+ * the list of bundles.
+ *
+ * @param bundleIdentifiers The identifiers of the bundles to refresh, or
+ * <code>null</code> for all bundles with packages pending removal.
+ * @throws IOException if the operation failed
+ */
+ void refreshBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Resolve the bundle indicated by the unique symbolic name and version
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @return <code>true</code> if the bundle was resolved, false otherwise
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ boolean resolveBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Batch resolve the bundles indicated by the list of bundle identifiers
+ *
+ * @param bundleIdentifiers The identifiers of the bundles to resolve, or
+ * <code>null</code> to resolve all unresolved bundles.
+ * @return <code>true</code> if the bundles were resolved, false otherwise
+ * @throws IOException if the operation does not succeed
+ */
+ boolean resolveBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Restart the framework by updating the system bundle
+ *
+ * @throws IOException if the operation failed
+ */
+ void restartFramework() throws IOException;
+
+ /**
+ * Set the start level for the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @param newlevel the new start level for the bundle
+ * @throws IOException if the operation failed
+ */
+ void setBundleStartLevel(long bundleIdentifier, int newlevel)
+ throws IOException;
+
+ /**
+ * Set the start levels for the list of bundles.
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE BATCH_ACTION_RESULT_TYPE for the precise
+ * specification of the CompositeData type representing the returned
+ * result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @param newlevels the array of new start level for the bundles
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation failed
+ */
+ CompositeData setBundleStartLevels(long[] bundleIdentifiers, int[] newlevels)
+ throws IOException;
+
+ /**
+ * Set the start level for the framework
+ *
+ * @param newlevel the new start level
+ * @throws IOException if the operation failed
+ */
+ void setFrameworkStartLevel(int newlevel) throws IOException;
+
+ /**
+ * Set the initial start level assigned to a bundle when it is first started
+ *
+ * @param newlevel the new start level
+ * @throws IOException if the operation failed
+ */
+ void setInitialBundleStartLevel(int newlevel) throws IOException;
+
+ /**
+ * Shutdown the framework by stopping the system bundle
+ *
+ * @throws IOException if the operation failed
+ */
+ void shutdownFramework() throws IOException;
+
+ /**
+ * Start the bundle indicated by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void startBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Batch start the bundles indicated by the list of bundle identifier
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE BATCH_ACTION_RESULT_TYPE for the precise
+ * specification of the CompositeData type representing the returned
+ * result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData startBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Stop the bundle indicated by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void stopBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Batch stop the bundles indicated by the list of bundle identifier
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE BATCH_ACTION_RESULT_TYPE for the precise
+ * specification of the CompositeData type representing the returned
+ * result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData stopBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Uninstall the bundle indicated by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void uninstallBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Batch uninstall the bundles indicated by the list of bundle identifiers
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE BATCH_ACTION_RESULT_TYPE for the precise
+ * specification of the CompositeData type representing the returned
+ * result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData uninstallBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Update the bundle indicated by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void updateBundle(long bundleIdentifier) throws IOException;
+
+ /**
+ * Update the bundle identified by the bundle identifier
+ *
+ * @param bundleIdentifier the bundle identifier
+ * @param url the URL to use to update the bundle
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ void updateBundleFromURL(long bundleIdentifier, String url) throws IOException;
+
+ /**
+ * Batch update the bundles indicated by the list of bundle identifier.
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE BATCH_ACTION_RESULT_TYPE for the precise
+ * specification of the CompositeData type representing the returned
+ * result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ */
+ CompositeData updateBundles(long[] bundleIdentifiers) throws IOException;
+
+ /**
+ * Update the bundle uniquely identified by the bundle symbolic name and
+ * version using the contents of the supplied urls.
+ *
+ * @see #BATCH_ACTION_RESULT_TYPE BATCH_ACTION_RESULT_TYPE for the precise
+ * specification of the CompositeData type representing the returned
+ * result.
+ *
+ * @param bundleIdentifiers the array of bundle identifiers
+ * @param urls the array of URLs to use to update the bundles
+ * @return the resulting state from executing the operation
+ * @throws IOException if the operation does not succeed
+ * @throws IllegalArgumentException if the bundle indicated does not exist
+ */
+ CompositeData updateBundlesFromURL(long[] bundleIdentifiers, String[] urls)
+ throws IOException;
+
+ /**
+ * Update the framework by updating the system bundle.
+ *
+ * @throws IOException if the operation failed
+ */
+ void updateFramework() throws IOException;
+
+ }
\ No newline at end of file
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/PackageStateMBean.java Sun Feb 27 17:58:16 2011
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) OSGi Alliance (2009, 2010). 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularType;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean provides information about the package state of the framework.
+ *
+ * @version $Revision: 919575 $
+ * @ThreadSafe
+ */
+public interface PackageStateMBean {
+ /**
+ * The fully qualified object name of this MBean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":type=packageState,version=1.5";
+
+ /**
+ * The key EXPORTING_BUNDLE, used in {@link #EXPORTING_BUNDLES_ITEM}.
+ */
+ String EXPORTING_BUNDLES = "ExportingBundles";
+
+ /**
+ * The item containing the bundle identifier in {@link #PACKAGE_TYPE}. The
+ * key is {@link #EXPORTING_BUNDLES} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}.
+ */
+ Item EXPORTING_BUNDLES_ITEM = new Item(
+ EXPORTING_BUNDLES,
+ "The bundles the package belongs to",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The key IMPORTING_BUNDLES, used in {@link #IMPORTING_BUNDLES_ITEM}.
+ */
+ String IMPORTING_BUNDLES = "ImportingBundles";
+
+ /**
+ * The item containing the bundle identifier in {@link #PACKAGE_TYPE}. The
+ * key is {@link #IMPORTING_BUNDLES} and the type is {@link JmxConstants#LONG_ARRAY_TYPE}.
+ */
+ Item IMPORTING_BUNDLES_ITEM = new Item(
+ IMPORTING_BUNDLES,
+ "The importing bundles of the package",
+ JmxConstants.LONG_ARRAY_TYPE);
+
+
+ /**
+ * The key NAME, used in {@link #NAME_ITEM}.
+ */
+ String NAME = "Name";
+
+ /**
+ * The item containing the name of the package in {@link #PACKAGE_TYPE}.
+ * The key is {@link #NAME} and the type is {@link SimpleType#LONG}.
+ */
+ Item NAME_ITEM = new Item(NAME,
+ "The package name",
+ SimpleType.STRING);
+
+ /**
+ * The name of the item containing the pending removal status of the package
+ * in the CompositeData. Used
+ */
+ String REMOVAL_PENDING = "RemovalPending";
+ /**
+ * The item representing the removal pending status of a package. The key is
+ * {@link #REMOVAL_PENDING} and the type is {@link SimpleType#BOOLEAN}.
+ */
+ Item REMOVAL_PENDING_ITEM = new Item(
+ REMOVAL_PENDING,
+ "Whether the package is pending removal",
+ SimpleType.BOOLEAN);
+
+ /**
+ * The name of the item containing the package version in the CompositeData.
+ * Used in {@link #VERSION_ITEM}.
+ */
+ String VERSION = "Version";
+
+ /**
+ * The item containing the version of the package in {@link #PACKAGE_TYPE}.
+ * The key is {@link #VERSION} and the type is {@link SimpleType#STRING}.
+ */
+ Item VERSION_ITEM = new Item(
+ VERSION,
+ "The identifier of the bundle the service belongs to",
+ SimpleType.STRING);
+
+ /**
+ * The Composite Type for a CompositeData representing a package. This type
+ * consists of:
+ * <ul>
+ * <li>{@link #EXPORTING_BUNDLES_ITEM}</li>
+ * <li>{@link #IMPORTING_BUNDLES_ITEM}</li>
+ * <li>{@link #NAME_ITEM}</li>
+ * <li>{@link #REMOVAL_PENDING_ITEM}</li>
+ * <li>{@link #VERSION_ITEM}</li>
+ * </ul>
+ * The key is defined as {@link #NAME} and {@link #EXPORTING_BUNDLES}
+ */
+ CompositeType PACKAGE_TYPE = Item
+ .compositeType(
+ "PACKAGE",
+ "This type encapsulates an OSGi package",
+ EXPORTING_BUNDLES_ITEM,
+ IMPORTING_BUNDLES_ITEM,
+ NAME_ITEM,
+ REMOVAL_PENDING_ITEM,
+ VERSION_ITEM);
+
+ /**
+ * The Tabular Type used in {@link #listPackages()}. They key is
+ * {@link #NAME}, {@link #VERSION}, and {@link #EXPORTING_BUNDLES}.
+ */
+ TabularType PACKAGES_TYPE = Item.tabularType("PACKAGES",
+ "A table of packages",
+ PACKAGE_TYPE, NAME,
+ VERSION, EXPORTING_BUNDLES);
+
+ /**
+ * Answer the identifier of the bundle exporting the package
+ *
+ * @param packageName - the package name
+ * @param version - the version of the package
+ * @return the bundle identifiers exporting such a package
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the package indicated does not exist
+ */
+ long[] getExportingBundles(String packageName, String version)
+ throws IOException;
+
+ /**
+ * Answer the list of identifiers of the bundles importing the package
+ *
+ * @param packageName The package name
+ * @param version The version of the package
+ * @param exportingBundle The exporting bundle for the given package
+ * @return the list of bundle identifiers
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the package indicated does not exist
+ *
+ */
+ long[] getImportingBundles(String packageName, String version,
+ long exportingBundle) throws IOException;
+
+ /**
+ * Answer the package state of the system in tabular form
+ *
+ * The Tabular Data is typed by {@link #PACKAGES_TYPE}, which has
+ * {@link #PACKAGE_TYPE} as its Composite Type.
+ *
+ * @return the tabular representation of the package state
+ * @throws IOException When fails
+ */
+ TabularData listPackages() throws IOException;
+
+ /**
+ * Answer if this package is exported by a bundle which has been updated or
+ * uninstalled
+ *
+ * @param packageName The package name
+ * @param version The version of the package
+ * @param exportingBundle The bundle exporting the package
+ * @return true if this package is being exported by a bundle that has been
+ * updated or uninstalled.
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the package indicated does not exist
+ */
+ boolean isRemovalPending(String packageName, String version, long exportingBundle)
+ throws IOException;
+
+}
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/ServiceStateMBean.java Sun Feb 27 17:58:16 2011
@@ -0,0 +1,242 @@
+/*
+ * Copyright (c) OSGi Alliance (2009, 2010). 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularType;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean represents the Service state of the framework. This MBean also
+ * emits events that clients can use to get notified of the changes in the
+ * service state of the framework.
+ *
+ * @version $Revision: 921523 $
+ * @ThreadSafe
+ */
+public interface ServiceStateMBean {
+ /**
+ * The fully qualified object name of this mbean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":type=serviceState,version=1.5";
+ /**
+ * The key BUNDLE_IDENTIFIER, used in {@link #BUNDLE_IDENTIFIER_ITEM}.
+ */
+ String BUNDLE_IDENTIFIER = "BundleIdentifier";
+ /**
+ * The item containing the bundle identifier in {@link #SERVICE_TYPE}. The
+ * key is {@link #BUNDLE_IDENTIFIER} and the type is {@link SimpleType#LONG}
+ * .
+ */
+ Item BUNDLE_IDENTIFIER_ITEM = new Item(BUNDLE_IDENTIFIER,
+ "The identifier of the bundle the service belongs to",
+ SimpleType.LONG);
+
+ /**
+ * The key OBJECT_CLASS, used {@link #OBJECT_CLASS_ITEM}.
+ */
+ String OBJECT_CLASS = "objectClass";
+
+ /**
+ * The item containing the interfaces of the service in
+ * {@link #SERVICE_TYPE}. The key is {@link #OBJECT_CLASS} and the type is
+ * {@link JmxConstants#STRING_ARRAY_TYPE}.
+ */
+ Item OBJECT_CLASS_ITEM = new Item(
+ OBJECT_CLASS,
+ "An string array containing the interfaces under which the service has been registered",
+ JmxConstants.STRING_ARRAY_TYPE);
+
+ /**
+ * The key IDENTIFIER, used {@link #IDENTIFIER_ITEM}.
+ */
+ String IDENTIFIER = "Identifier";
+
+ /**
+ * The item containing the service identifier in {@link #SERVICE_TYPE}. The
+ * key is {@link #IDENTIFIER} and the type is {@link SimpleType#LONG}.
+ */
+ Item IDENTIFIER_ITEM = new Item(IDENTIFIER,
+ "The identifier of the service", SimpleType.LONG);
+
+ /**
+ * The key USING_BUNDLES, used in {@link #USING_BUNDLES_ITEM}.
+ */
+ String USING_BUNDLES = "UsingBundles";
+
+ /**
+ * The item containing the bundles using the service in
+ * {@link #SERVICE_TYPE}. The key is {@link #USING_BUNDLES} and the type is
+ * {@link JmxConstants#LONG_ARRAY_TYPE}.
+ */
+ Item USING_BUNDLES_ITEM = new Item(USING_BUNDLES,
+ "The bundles using the service", JmxConstants.LONG_ARRAY_TYPE);
+
+ /**
+ * The Composite Type for a CompositeData representing a service. This type
+ * consists of:
+ * <ul>
+ * <li>{@link #BUNDLE_IDENTIFIER}</li>
+ * <li>{@link #IDENTIFIER}</li>
+ * <li>{@link #OBJECT_CLASS}</li>
+ * <li>{@link #USING_BUNDLES}</li>
+ * </ul>
+ */
+ CompositeType SERVICE_TYPE = Item.compositeType("SERVICE",
+ "This type encapsulates an OSGi service", BUNDLE_IDENTIFIER_ITEM,
+ IDENTIFIER_ITEM, OBJECT_CLASS_ITEM,
+ USING_BUNDLES_ITEM);
+
+ /**
+ * The Tabular Type for a Service table. The rows consists of
+ * {@link #SERVICE_TYPE} Composite Data and the index is {@link #IDENTIFIER}
+ * .
+ */
+ TabularType SERVICES_TYPE = Item.tabularType("SERVICES",
+ "The table of all services", SERVICE_TYPE, IDENTIFIER);
+
+ /**
+ * The key BUNDLE_LOCATION, used in {@link #SERVICE_EVENT_TYPE}.
+ */
+ String BUNDLE_LOCATION = "BundleLocation";
+ /**
+ * The item containing the bundle location in {@link #EVENT_ITEM}. The key
+ * is {@link #BUNDLE_LOCATION} and the the type is {@link SimpleType#STRING}
+ * .
+ */
+ Item BUNDLE_LOCATION_ITEM = new Item(BUNDLE_LOCATION,
+ "The location of the bundle", SimpleType.STRING);
+ /**
+ * The key BUNDLE_SYMBOLIC_NAME, used in {@link #SERVICE_EVENT_TYPE}.
+ */
+ String BUNDLE_SYMBOLIC_NAME = "BundleSymbolicName";
+
+ /**
+ * The item containing the symbolic name in {@link #EVENT}. The key is
+ * {@link #BUNDLE_SYMBOLIC_NAME} and the the type is
+ * {@link SimpleType#STRING}.
+ */
+ Item BUNDLE_SYMBOLIC_NAME_ITEM = new Item(BUNDLE_SYMBOLIC_NAME,
+ "The symbolic name of the bundle", SimpleType.STRING);
+
+ /**
+ * The key EVENT, used in {@link #EVENT_ITEM}.
+ */
+ String EVENT = "ServiceEvent";
+
+ /**
+ * The item containing the event type. The key is {@link #EVENT} and the
+ * type is {@link SimpleType#INTEGER}
+ */
+ Item EVENT_ITEM = new Item(
+ EVENT,
+ "The eventType of the event: {REGISTERED=1, MODIFIED=2 UNREGISTERING=3}",
+ SimpleType.INTEGER);
+
+ /**
+ * The Composite Type that represents a service event. This composite
+ * consists of:
+ * <ul>
+ * <li>{@link #IDENTIFIER}</li>
+ * <li>{@link #OBJECT_CLASS}</li>
+ * <li>{@link #BUNDLE_LOCATION}</li>
+ * <li>{@link #BUNDLE_SYMBOLIC_NAME}</li>
+ * <li>{@link #EVENT}</li>
+ * </ul>
+ */
+ CompositeType SERVICE_EVENT_TYPE = Item.compositeType("SERVICE_EVENT",
+ "This type encapsulates OSGi service events", IDENTIFIER_ITEM,
+ OBJECT_CLASS_ITEM, BUNDLE_IDENTIFIER_ITEM, BUNDLE_LOCATION_ITEM,
+ BUNDLE_SYMBOLIC_NAME_ITEM, EVENT_ITEM);
+
+ /**
+ * Answer the list of interfaces that this service implements
+ *
+ * @param serviceId
+ * the identifier of the service
+ * @return the list of interfaces
+ * @throws IOException
+ * if the operation fails
+ * @throws IllegalArgumentException
+ * if the service indicated does not exist
+ */
+ public String[] getObjectClass(long serviceId) throws IOException;
+
+ /**
+ * Answer the bundle identifier of the bundle which registered the service
+ *
+ * @param serviceId
+ * the identifier of the service
+ * @return the identifier for the bundle
+ * @throws IOException
+ * if the operation fails
+ * @throws IllegalArgumentException
+ * if the service indicated does not exist
+ */
+ long getBundleIdentifier(long serviceId) throws IOException;
+
+ /**
+ * Answer the map of properties associated with this service
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param serviceId
+ * the identifier of the service
+ * @return the table of properties. These include the standard mandatory
+ * service.id and objectClass properties as defined in the
+ * <code>org.osgi.framework.Constants</code> interface
+ * @throws IOException
+ * if the operation fails
+ * @throws IllegalArgumentException
+ * if the service indicated does not exist
+ */
+ TabularData getProperties(long serviceId) throws IOException;
+
+ /**
+ * Answer the service state of the system in tabular form.
+ *
+ * @see #SERVICES_TYPE for the details of the TabularType
+ *
+ * @return the tabular representation of the service state
+ * @throws IOException
+ * If the operation fails
+ * @throws IllegalArgumentException
+ * if the service indicated does not exist
+ */
+ TabularData listServices() throws IOException;
+
+ /**
+ * Answer the list of identifiers of the bundles that use the service
+ *
+ * @param serviceId
+ * the identifier of the service
+ * @return the list of bundle identifiers
+ * @throws IOException
+ * if the operation fails
+ * @throws IllegalArgumentException
+ * if the service indicated does not exist
+ */
+ long[] getUsingBundles(long serviceId) throws IOException;
+
+}
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/package.html
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/package.html?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/package.html (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/package.html Sun Feb 27 17:58:16 2011
@@ -0,0 +1,29 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Rev$ -->
+<BODY>
+<p>OSGi JMX Framework Package Version 1.5.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.framework; version="[1.5,2.0)"
+</pre>
+</BODY>
+
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/packageinfo
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/packageinfo?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/packageinfo (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/framework/packageinfo Sun Feb 27 17:58:16 2011
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.5
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/package.html
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/package.html?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/package.html (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/package.html Sun Feb 27 17:58:16 2011
@@ -0,0 +1,29 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Rev$ -->
+<BODY>
+<p>OSGi JMX Package Version 1.0.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx; version="[1.0,2.0)"
+</pre>
+</BODY>
+
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/packageinfo
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/packageinfo?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/packageinfo (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/packageinfo Sun Feb 27 17:58:16 2011
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.0
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/ConfigurationAdminMBean.java Sun Feb 27 17:58:16 2011
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) OSGi Alliance (2009, 2010). 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.jmx.service.cm;
+
+import java.io.IOException;
+
+import javax.management.openmbean.TabularData;
+
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean provides the management interface to the OSGi Configuration
+ * Administration Service.
+ *
+ * @version $Revision: 922888 $
+ * @ThreadSafe
+ */
+public interface ConfigurationAdminMBean {
+ /**
+ * The object name for this mbean.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_COMPENDIUM+":service=cm,version=1.3";
+
+ /**
+ * Create a new configuration instance for the supplied persistent id of the
+ * factory, answering the PID of the created configuration
+ *
+ * @param factoryPid the persistent id of the factory
+ * @return the PID of the created configuration
+ * @throws IOException if the operation failed
+ */
+ String createFactoryConfiguration(String factoryPid) throws IOException;
+
+ /**
+ * Create a factory configuration for the supplied persistent id of the
+ * factory and the bundle location bound to bind the created configuration
+ * to, answering the PID of the created configuration
+ *
+ * @param factoryPid the persistent id of the factory
+ * @param location the bundle location
+ * @return the pid of the created configuation
+ * @throws IOException if the operation failed
+ */
+ String createFactoryConfigurationForLocation(String factoryPid, String location)
+ throws IOException;
+
+ /**
+ * Delete the configuration
+ *
+ * @param pid the persistent identifier of the configuration
+ * @throws IOException if the operation fails
+ */
+ void delete(String pid) throws IOException;
+
+ /**
+ * Delete the configuration
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @throws IOException if the operation fails
+ */
+ void deleteForLocation(String pid, String location) throws IOException;
+
+ /**
+ * Delete the configurations matching the filter specification.
+ *
+ * @param filter the string representation of the
+ * <code>org.osgi.framework.Filter</code>
+ * @throws IOException if the operation failed
+ * @throws IllegalArgumentException if the filter is invalid
+ */
+ void deleteConfigurations(String filter) throws IOException;
+
+ /**
+ * Answer the bundle location the configuration is bound to
+ *
+ * @param pid the persistent identifier of the configuration
+ * @return the bundle location
+ * @throws IOException if the operation fails
+ */
+ String getBundleLocation(String pid) throws IOException;
+
+ /**
+ * Answer the factory PID if the configuration is a factory configuration,
+ * null otherwise.
+ *
+ * @param pid the persistent identifier of the configuration
+ * @return the factory PID
+ * @throws IOException if the operation fails
+ */
+ String getFactoryPid(String pid) throws IOException;
+
+ /**
+ * Answer the factory PID if the configuration is a factory configuration,
+ * null otherwise.
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @return the factory PID
+ * @throws IOException if the operation fails
+ */
+ String getFactoryPidForLocation(String pid, String location) throws IOException;
+
+ /**
+ * Answer the contents of the configuration <p/>
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param pid the persistent identifier of the configuration
+ * @return the table of contents
+ * @throws IOException if the operation fails
+ */
+
+ TabularData getProperties(String pid) throws IOException;
+
+ /**
+ * Answer the contents of the configuration <p/>
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @return the table of contents
+ * @throws IOException if the operation fails
+ */
+ TabularData getPropertiesForLocation(String pid, String location) throws IOException;
+
+ /**
+ * Answer the list of PID/Location pairs of the configurations managed by
+ * this service
+ *
+ * @param filter the string representation of the
+ * <code>org.osgi.framework.Filter</code>
+ * @return the list of configuration PID/Location pairs
+ * @throws IOException if the operation failed
+ * @throws IllegalArgumentException if the filter is invalid
+ */
+ String[][] getConfigurations(String filter) throws IOException;
+
+ /**
+ * Set the bundle location the configuration is bound to
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @throws IOException if the operation fails
+ */
+ void setBundleLocation(String pid, String location) throws IOException;
+
+ /**
+ * Update the configuration with the supplied properties For each property
+ * entry, the following row is supplied <p/>
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param properties the table of properties
+ * @throws IOException if the operation fails
+ */
+ void update(String pid, TabularData properties) throws IOException;
+
+ /**
+ * Update the configuration with the supplied properties For each property
+ * entry, the following row is supplied <p/>
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for the details of the TabularType
+ *
+ * @param pid the persistent identifier of the configuration
+ * @param location the bundle location
+ * @param properties the table of properties
+ * @throws IOException if the operation fails
+ */
+ void updateForLocation(String pid, String location, TabularData properties)
+ throws IOException;
+}
\ No newline at end of file
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/package.html
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/package.html?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/package.html (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/package.html Sun Feb 27 17:58:16 2011
@@ -0,0 +1,29 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Rev$ -->
+<BODY>
+<p>OSGi JMX CM Package Version 1.3.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.service.cm; version="[1.3,2.0)"
+</pre>
+</BODY>
+
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/packageinfo
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/packageinfo?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/packageinfo (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/cm/packageinfo Sun Feb 27 17:58:16 2011
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.3
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/PermissionAdminMBean.java Sun Feb 27 17:58:16 2011
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.jmx.service.permissionadmin;
+
+import java.io.IOException;
+
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean represents the OSGi Permission Manager Service
+ *
+ * @version $Rev: 896239 $
+ */
+public interface PermissionAdminMBean {
+ /**
+ * Permission Admin MBean object name.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_CORE
+ + ":service=permissionadmin,version=1.2";
+
+ /**
+ * Answer the bundle locations that have permissions assigned to them
+ *
+ * @return the bundle locations
+ * @throws IOException if the operation fails
+ */
+ String[] listLocations() throws IOException;
+
+ /**
+ * Answer the list of encoded permissions of the bundle specified by the
+ * bundle location
+ *
+ * @param location location identifying the bundle
+ * @return the array of String encoded permissions
+ * @throws IOException if the operation fails
+ */
+ String[] getPermissions(String location) throws IOException;
+
+ /**
+ * Set the default permissions assigned to bundle locations that have no
+ * assigned permissions
+ *
+ * @param encodedPermissions the string encoded permissions
+ * @throws IOException if the operation fails
+ */
+ void setDefaultPermissions(String[] encodedPermissions) throws IOException;
+
+ /**
+ * Answer the list of encoded permissions representing the default
+ * permissions assigned to bundle locations that have no assigned
+ * permissions
+ *
+ * @return the array of String encoded permissions
+ * @throws IOException if the operation fails
+ */
+ String[] listDefaultPermissions() throws IOException;
+
+ /**
+ * Set the permissions on the bundle specified by the bundle location
+ *
+ * @param location the location of the bundle
+ * @param encodedPermissions the string encoded permissions to set
+ * @throws IOException if the operation fails
+ */
+ void setPermissions(String location, String[] encodedPermissions)
+ throws IOException;
+}
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/package.html
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/package.html?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/package.html (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/package.html Sun Feb 27 17:58:16 2011
@@ -0,0 +1,29 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Rev$ -->
+<BODY>
+<p>OSGi JMX Permission Admin Package Admin Package Version 1.2.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.service.permission; version="[1.2,2.0)"
+</pre>
+</BODY>
+
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/packageinfo
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/packageinfo?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/packageinfo (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/permissionadmin/packageinfo Sun Feb 27 17:58:16 2011
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.2
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/ProvisioningServiceMBean.java Sun Feb 27 17:58:16 2011
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) OSGi Alliance (2009, 2010). 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.jmx.service.provisioning;
+
+import java.io.IOException;
+
+import javax.management.openmbean.TabularData;
+
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean represents the management interface to the OSGi Initial
+ * Provisioning Service
+ *
+ * @version $Revision: 922888 $
+ * @ThreadSafe
+ */
+public interface ProvisioningServiceMBean {
+ /**
+ * Provisioning MBean object name.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_COMPENDIUM
+ + ":service=provisioning,version=1.2";
+
+ /**
+ * Processes the <code>ZipInputStream</code> contents of the provided
+ * zipURL and extracts information to add to the Provisioning Information
+ * dictionary, as well as, install/update and start bundles. This method
+ * causes the <code>PROVISIONING_UPDATE_COUNT</code> to be incremented.
+ *
+ * @param zipURL the String form of the URL that will be resolved into a
+ * <code>ZipInputStream</code> which will be used to add key/value
+ * pairs to the Provisioning Information dictionary and install and
+ * start bundles. If a <code>ZipEntry</code> does not have an
+ * <code>Extra</code> field that corresponds to one of the four
+ * defined MIME types (<code>MIME_STRING</code>,
+ * <code>MIME_BYTE_ARRAY</code>,<code>MIME_BUNDLE</code>, and
+ * <code>MIME_BUNDLE_URL</code>) in will be silently ignored.
+ * @throws IOException if an error occurs while processing the
+ * ZipInputStream of the URL. No additions will be made to the
+ * Provisioning Information dictionary and no bundles must be
+ * started or installed.
+ */
+ public void addInformationFromZip(String zipURL) throws IOException;
+
+ /**
+ * Adds the key/value pairs contained in <code>info</code> to the
+ * Provisioning Information dictionary. This method causes the
+ * <code>PROVISIONING_UPDATE_COUNT</code> to be incremented.
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for details of the Tabular Data
+ *
+ * @param info the set of Provisioning Information key/value pairs to add to
+ * the Provisioning Information dictionary. Any keys are values that
+ * are of an invalid type will be silently ignored.
+ * @throws IOException if the operation fails
+ */
+ public void addInformation(TabularData info) throws IOException;
+
+ /**
+ * Returns a table representing the Provisioning Information Dictionary.
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for details of the Tabular Data
+ *
+ * @throws IOException if the operation fails
+ * @return The table representing the manager dictionary.
+ */
+ public TabularData listInformation() throws IOException;
+
+ /**
+ * Replaces the Provisioning Information dictionary with the entries of the
+ * supplied table. This method causes the
+ * <code>PROVISIONING_UPDATE_COUNT</code> to be incremented.
+ *
+ * @see JmxConstants#PROPERTIES_TYPE for details of the Tabular Data
+ *
+ * @param info the new set of Provisioning Information key/value pairs. Any
+ * keys are values that are of an invalid type will be silently
+ * ignored.
+ * @throws IOException if the operation fails
+ */
+ public void setInformation(TabularData info) throws IOException;
+
+}
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/package.html
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/package.html?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/package.html (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/package.html Sun Feb 27 17:58:16 2011
@@ -0,0 +1,29 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Rev$ -->
+<BODY>
+<p>OSGi JMX Initial Provisioning Package Version 1.2.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.service.provisioning; version="[1.2,2.0)"
+</pre>
+</BODY>
+
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/packageinfo
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/packageinfo?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/packageinfo (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/provisioning/packageinfo Sun Feb 27 17:58:16 2011
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.2
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java Sun Feb 27 17:58:16 2011
@@ -0,0 +1,527 @@
+/*
+ * Copyright (c) OSGi Alliance (2009, 2010). 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.jmx.service.useradmin;
+
+import java.io.IOException;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean provides the management interface to the OSGi User Manager Service
+ *
+ * @version $Revision: 920467 $
+ * @ThreadSafe
+ */
+public interface UserAdminMBean {
+ /**
+ * User Admin MBean object name.
+ */
+ String OBJECTNAME = JmxConstants.OSGI_COMPENDIUM
+ + ":service=useradmin,version=1.1";
+
+ /**
+ * The key NAME, used in {@link #NAME_ITEM}.
+ */
+ String NAME = "Name";
+
+ /**
+ * 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);
+
+ /**
+ * The key ROLES, used in {@link #ROLES_ITEM}.
+ */
+ String ROLES = "Roles";
+
+ /**
+ * 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);
+
+ /**
+ * 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);
+ /**
+ * The Role TYPE key, used in {@link #TYPE_ITEM}.
+ */
+ String TYPE = "Type";
+
+ /**
+ * The item containing the type of the roles encapsulated by this
+ * 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);
+
+ /**
+ * The PROPERTIES key, used in {@link #PROPERTIES_ITEM}.
+ */
+ String PROPERTIES = "Properties";
+
+ /**
+ * 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);
+ /**
+ * The Composite Type for a Role. It contains the following items:
+ * <ul>
+ * <li>{@link #NAME}</li>
+ * <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);
+
+ /**
+ * The CREDENTIALS key, used in {@link #CREDENTIALS_ITEM}.
+ */
+ String CREDENTIALS = "Credentials";
+
+ /**
+ * The item containing the credentials of a user. The key is
+ * {@link #CREDENTIALS} and the type is {@link 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");
+
+ /**
+ * The MEMBERS key, used in {@link #MEMBERS_ITEM}.
+ */
+ String MEMBERS = "Members";
+
+ /**
+ * The item containing the members of a group. The key is {@link #MEMBERS}
+ * 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);
+
+ /**
+ * The REQUIRED_MEMBERS key, used in {@link #REQUIRED_MEMBERS_ITEM}.
+ */
+ String REQUIRED_MEMBERS = "RequiredMembers";
+
+ /**
+ * 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} .
+ */
+ 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>
+ */
+ 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
+ */
+ 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;
+
+ /**
+ * 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
+ *
+ */
+ 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 rolename The role name
+ * @throws IOException if the operation fails
+ */
+ 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
+ */
+ 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
+ */
+ 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
+ */
+ void createUser(String name) throws IOException;
+
+ /**
+ * 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
+ */
+ 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
+ * @throws IllegalArgumentException if the user name is not a User
+ */
+ CompositeData getAuthorization(String user) throws IOException;
+
+ /**
+ * 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}
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the user name is not a User
+ */
+ TabularData getCredentials(String username) throws IOException;
+
+ /**
+ * 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
+ * @throws IllegalArgumentException if the group name is not a Group
+ */
+ CompositeData getGroup(String groupname) throws IOException;
+
+ /**
+ * Answer the list of group names
+ *
+ * @return The list of group names
+ * @throws IOException if the operation fails
+ */
+ String[] listGroups() throws IOException;
+
+ /**
+ * Answer the list of group names
+ *
+ * @param filter The filter to apply
+ * @return The list of group names
+ * @throws IOException if the operation fails
+ */
+ String[] getGroups(String filter) throws IOException;
+
+ /**
+ * 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
+ * @throws IllegalArgumentException if the username is not a User
+ */
+ String[] getImpliedRoles(String username) throws IOException;
+
+ /**
+ * 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
+ */
+ 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
+ */
+ 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
+ */
+ 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
+ */
+ 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
+ */
+ String[] listRoles() throws IOException;
+
+ /**
+ * 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.
+ *
+ * @return The list the role names
+ * @throws IOException if the operation fails
+ */
+ String[] getRoles(String filter) throws IOException;
+
+ /**
+ * 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
+ */
+ 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
+ * @throws IOException if the operation fails
+ */
+ String getUserWithProperty(String key, String value) throws IOException;
+
+ /**
+ * Answer the list of user names in the User Admin database
+ *
+ * @return The list of user names
+ * @throws IOException if the operation fails
+ */
+ String[] listUsers() throws IOException;
+
+ /**
+ * 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
+ */
+ String[] getUsers(String filter) throws IOException;
+
+ /**
+ * 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
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the username is not a User
+ */
+ void removeCredential(String key, String username) throws IOException;
+
+ /**
+ * Remove a role from the group
+ *
+ * @param groupname The group name
+ * @param rolename
+ * @return true if the role was removed from the group
+ * @throws IOException if the operation fails
+ * @throws IllegalArgumentException if the groupname is not a Group
+ */
+ boolean removeMember(String groupname, String rolename) throws IOException;
+
+ /**
+ * Remove a property from a role
+ *
+ * @param key
+ * @param rolename
+ * @throws IOException if the operation fails
+ */
+ 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
+ */
+ 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
+ */
+ 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
+ */
+ boolean removeUser(String name) throws IOException;
+
+}
\ No newline at end of file
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/package.html
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/package.html?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/package.html (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/package.html Sun Feb 27 17:58:16 2011
@@ -0,0 +1,29 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Rev$ -->
+<BODY>
+<p>OSGi JMX User Admin Package Version 1.1.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.jmx.service.useradmin; version="[1.1,2.0)"
+</pre>
+</BODY>
+
Added: aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/packageinfo
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/packageinfo?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/packageinfo (added)
+++ aries/tags/jmx-0.1-incubating/jmx-api/src/main/java/org/osgi/jmx/service/useradmin/packageinfo Sun Feb 27 17:58:16 2011
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.1
Added: aries/tags/jmx-0.1-incubating/jmx-blueprint-api/pom.xml
URL: http://svn.apache.org/viewvc/aries/tags/jmx-0.1-incubating/jmx-blueprint-api/pom.xml?rev=1075096&view=auto
==============================================================================
--- aries/tags/jmx-0.1-incubating/jmx-blueprint-api/pom.xml (added)
+++ aries/tags/jmx-0.1-incubating/jmx-blueprint-api/pom.xml Sun Feb 27 17:58:16 2011
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.aries.jmx</groupId>
+ <artifactId>jmx</artifactId>
+ <version>0.1-incubating</version>
+ </parent>
+
+ <artifactId>org.apache.aries.jmx.blueprint.api</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Aries JMX Blueprint API</name>
+ <description>
+ This bundle contains the JMX Blueprint API
+ </description>
+
+ <properties>
+ <aries.osgi.export.pkg>
+ org.apache.aries.jmx.blueprint
+ </aries.osgi.export.pkg>
+ </properties>
+
+</project>