ClusterManagementResult (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.management.api, class: ClusterManagementResult

Package org.apache.geode.management.api

# Class ClusterManagementResult

java.lang.Object
org.apache.geode.management.api.ClusterManagementResult

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `ClusterManagementGetResult`, `ClusterManagementListOperationsResult`, `ClusterManagementListResult`, `ClusterManagementOperationResult`, `ClusterManagementRealizationResult`

@Experimental public class ClusterManagementResult extends Object implements Serializable
This base class provides the common attributes returned from all `ClusterManagementService` methods

Implementation Note: Serializable Interface

This class implements `Serializable` to support Apache Geode's DUnit distributed testing framework, which runs tests across multiple JVMs. When test methods return instances of this class from VM.invoke() calls, DUnit requires the objects to be serializable for cross-JVM communication via RMI.

Why This Was Added:

- DUnit Architecture: DUnit tests execute code in separate JVM processes (client VM, locator VM, server VM). When a test in one VM invokes a method in another VM and that method returns a result object, DUnit serializes the object to transmit it across the JVM boundary.
- Test Pattern Change: Prior to Jetty 12 migration, authentication tests expected exceptions (no return values). With Jetty 12 and Spring Security 6 integration, some tests now validate successful operations and return ClusterManagementResult objects, requiring serialization support.
- Serialization Verification: DUnit's MethodInvokerResult.checkSerializable() validates that all return values implement Serializable, throwing NotSerializableException if they don't.

Serialization Compatibility:

- All fields (statusCode, statusMessage, links) are either primitives, Strings, enums, or Serializable objects
- The `Links` class also implements Serializable for complete object graph support
- serialVersionUID is explicitly defined to maintain serialization compatibility across code changes

This change does not affect production usage - it only enables comprehensive testing in DUnit's multi-JVM environment.

See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `ClusterManagementResult.StatusCode`
  these status codes generally have a one-to-one mapping to the http status code returned by the REST controller

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClusterManagementResult()`
  for internal use only
  `ClusterManagementResult(ClusterManagementResult copyFrom)`
  for internal use only
  `ClusterManagementResult(ClusterManagementResult.StatusCode statusCode, String message)`
  for internal use only

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `ClusterManagementResult.StatusCode`
  `getStatusCode()`
  Returns the `ClusterManagementResult.StatusCode` for this request, such as ERROR or OK.
  `String`
  `getStatusMessage()`
  Returns an optional message to accompany `getStatusCode()`
  `int`
  `hashCode()`
  `boolean`
  `isSuccessful()`
  Returns true if `getStatusCode()` has a non-error value
  `void`
  `setLinks(Links links)`
  for internal use only
  `void`
  `setStatus(ClusterManagementResult.StatusCode statusCode, String message)`
  for internal use only
  `String`
  `toString()`
  Returns the status code and message

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

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

- ## Constructor Details

  - ### ClusterManagementResult

    public ClusterManagementResult()
    for internal use only

  - ### ClusterManagementResult

    public ClusterManagementResult(ClusterManagementResult.StatusCode statusCode, String message)
    for internal use only
    Parameters:
      `statusCode` - the `ClusterManagementResult.StatusCode` to set
      `message` - the status message to set

  - ### ClusterManagementResult

    public ClusterManagementResult(ClusterManagementResult copyFrom)
    for internal use only
    Parameters:
      `copyFrom` - the `ClusterManagementResult` to copy from

- ## Method Details

  - ### setStatus

    public void setStatus(ClusterManagementResult.StatusCode statusCode, String message)
    for internal use only
    Parameters:
      `statusCode` - the `ClusterManagementResult.StatusCode` to set
      `message` - the status message to set

  - ### getStatusMessage

    public String getStatusMessage()
    Returns an optional message to accompany `getStatusCode()`
    Returns:
      an optional message to accompany `getStatusCode()`

  - ### setLinks

    public void setLinks(Links links)
    for internal use only
    Parameters:
      `links` - the `Links` to set

  - ### isSuccessful

    public boolean isSuccessful()
    Returns true if `getStatusCode()` has a non-error value
    Returns:
      true if `getStatusCode()` has a non-error value

  - ### getStatusCode

    public ClusterManagementResult.StatusCode getStatusCode()
    Returns the `ClusterManagementResult.StatusCode` for this request, such as ERROR or OK.
    Returns:
      the `ClusterManagementResult.StatusCode` for this request

  - ### toString

    public String toString()
    Returns the status code and message
    Overrides:
      `toString` in class `Object`
    Returns:
      the status code and message as a String

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`