Index: oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java (date 1395747665000) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java (revision ) @@ -20,32 +20,63 @@ package org.apache.jackrabbit.oak.api.jmx; import javax.annotation.Nonnull; +import javax.management.openmbean.CompositeData; /** - * This interface exposes repository management operations - * and the status of such operations. This interface only - * provides high level functionality for starting certain - * management operations and monitoring their outcomes. - * Parametrisation and configuration of the operations is - * beyond the scope of this interface and must be achieved - * by other means. For example through a dedicated MBean of - * the specific service providing the respective functionality. - * Furthermore not all operations might be available in all - * deployments or at all times. However the status should give - * a clear indication for this case. + * This interface exposes repository management operations and the status + * of such operations. This interface only provides high level functionality + * for starting certain management operations and monitoring their outcomes. + * Parametrisation and configuration of the operations is beyond the scope + * of this interface and must be achieved by other means. For example + * through a dedicated MBean of the specific service providing the + * respective functionality. Furthermore not all operations might be + * available in all deployments or at all times. However the status should + * give a clear indication for this case. *

- * The status of an operation is an opaque string describing - * in a human readable form what the operation currently does, - * which might depend on the particular implementation performing - * the operation. However the status status must always - * indicate whether an operation is ongoing, not started or - * terminated. In the latter case it must indicate whether - * it terminated successfully or whether it failed. Furthermore the - * status must indicate when an operation is not available. - * In all cases the status may provide additional - * information like e.g. how far an ongoing operation progressed, - * what time it took to complete a terminated operation, or information - * about what caused a terminated operation to fail. + * The status of an operation is represented by a {@code CompositeData} + * instance consisting at least of the items {@code code}, {@code id}, + * and {@code message}. Implementations are free to add further items. + *

+ * The {@code code} item is an integer encoding the current status of + * the respective operation. Valid values and its semantics are: + *

+ *

+ * In all cases the {@code message} may provide additional information + * that might be useful in the context of the operation. + *

+ * The {@code id} is an identifier for the invocation of an operation. + * It is reported as a part of the status for clients to relate the + * status to invocation. */ public interface RepositoryManagementMBean { String TYPE = "RepositoryManagement"; @@ -56,16 +87,16 @@ * @return the status of the operation right after it was initiated */ @Nonnull - String startBackup(); + CompositeData startBackup(); /** * Backup status * * @return the status of the ongoing operation or if none the terminal - * status of the last operation or {@code null} if none. + * status of the last operation or Status not available if none. */ @Nonnull - String getBackupStatus(); + CompositeData getBackupStatus(); /** * Initiate a restore operation. @@ -73,16 +104,16 @@ * @return the status of the operation right after it was initiated */ @Nonnull - String startRestore(); + CompositeData startRestore(); /** * Restore status * * @return the status of the ongoing operation or if none the terminal - * status of the last operation or {@code null} if none. + * status of the last operation or Status not available if none. */ @Nonnull - String getRestoreStatus(); + CompositeData getRestoreStatus(); /** * Initiate a data store garbage collection operation @@ -90,16 +121,16 @@ * @return the status of the operation right after it was initiated */ @Nonnull - String startDataStoreGC(); + CompositeData startDataStoreGC(); /** * Data store garbage collection status * * @return the status of the ongoing operation or if none the terminal - * status of the last operation or {@code null} if none. + * status of the last operation or Status not available if none. */ @Nonnull - String getDataStoreGCStatus(); + CompositeData getDataStoreGCStatus(); /** * Initiate a revision garbage collection operation @@ -107,16 +138,16 @@ * @return the status of the operation right after it was initiated */ @Nonnull - String startRevisionGC(); + CompositeData startRevisionGC(); /** * Revision garbage collection status * * @return the status of the ongoing operation or if none the terminal - * status of the last operation or {@code null} if none. + * status of the last operation or Status not available if none. */ @Nonnull - String getRevisionGCStatus(); + CompositeData getRevisionGCStatus(); /** * Creates a new checkpoint of the latest root of the tree. The checkpoint