org.osgi.jmx.codec
Class BundleBatchActionResult

java.lang.Object
  extended by org.osgi.jmx.codec.BundleBatchActionResult

public class BundleBatchActionResult
extends java.lang.Object

Author:
Hal Hildebrand Date: Nov 23, 2008 Time: 7:35:35 PM

This class represents the CODEC for the resulting composite data from the batch operations on the bundles in the FrameworkMBean. It serves as both the documentation of the type structure and as the codification of the mechanism to convert to/from the CompositeData.

The structure of the composite data is:

Success Boolean
Error String
Completed Array of long
BundleInError long
Remaining Array of long

Field Summary
static javax.management.openmbean.CompositeType RESULT
          The CompositeType which represents the result of batch operations on the FrameworkMBean
 
Constructor Summary
BundleBatchActionResult()
          Construct a result signifying the successful completion of the batch operation.
BundleBatchActionResult(javax.management.openmbean.CompositeData compositeData)
          Construct a result representing the contents of the supplied CompositeData returned from a batch operation.
BundleBatchActionResult(java.lang.String errorMessage, long[] completed, long bundleInError, long[] remaining)
          Construct a result indictating the failure of a batch operation.
 
Method Summary
 javax.management.openmbean.CompositeData asCompositeData()
          Answer the receiver encoded as CompositeData
 long getBundleInError()
          Answer the bundle identifier which indicates the bundle that produced an error during the batch operation.
 long[] getCompleted()
          If the operation failed, answer the list of bundle identifiers that successfully completed the batch operation.
 java.lang.String getErrorMessage()
          Answer the error message indicating the error that occurred during the batch operation or null, if the operation was a success.
 long[] getRemaining()
          If the operation was unsuccessful, answer the list of bundle identifiers of the bundles that were not processed during the batch operation.
 boolean isSuccess()
          Answer true if the batch operation was successful, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESULT

public static final javax.management.openmbean.CompositeType RESULT
The CompositeType which represents the result of batch operations on the FrameworkMBean

Constructor Detail

BundleBatchActionResult

public BundleBatchActionResult()
Construct a result signifying the successful completion of the batch operation.


BundleBatchActionResult

public BundleBatchActionResult(javax.management.openmbean.CompositeData compositeData)
Construct a result representing the contents of the supplied CompositeData returned from a batch operation.

Parameters:
compositeData - - the CompositeData representing the result of a batch operation.

BundleBatchActionResult

public BundleBatchActionResult(java.lang.String errorMessage,
                               long[] completed,
                               long bundleInError,
                               long[] remaining)
Construct a result indictating the failure of a batch operation.

Parameters:
errorMessage - - the message indicating the error
completed - - the list of bundle identifiers indicating bundles that have successfully completed the batch operation
bundleInError - - the identifier of the bundle which produced the error
remaining - - the list of bundle identifiers which remain unprocessed
Method Detail

asCompositeData

public javax.management.openmbean.CompositeData asCompositeData()
Answer the receiver encoded as CompositeData

Returns:
the CompositeData encoding of the receiver.

getBundleInError

public long getBundleInError()
Answer the bundle identifier which indicates the bundle that produced an error during the batch operation.

Returns:
the bundle identifier of the bundle in error, or -1L if no error occurred

getCompleted

public long[] getCompleted()
If the operation failed, answer the list of bundle identifiers that successfully completed the batch operation. If the operation was successful, then the list is null;

Returns:
the list of bundle identifiers or null if the operation was successful

getErrorMessage

public java.lang.String getErrorMessage()
Answer the error message indicating the error that occurred during the batch operation or null, if the operation was a success.

Returns:
the String error message

getRemaining

public long[] getRemaining()
If the operation was unsuccessful, answer the list of bundle identifiers of the bundles that were not processed during the batch operation. If the operation was a success, then answer null

Returns:
the remaining bundle identifiers or null if the operation was a success

isSuccess

public boolean isSuccess()
Answer true if the batch operation was successful, false otherwise.

Returns:
the success of the batch operation


Copyright © 2009. All Rights Reserved.