Package org.apache.sysds.runtime.controlprogram.federated

## Class FederatedResponse

- java.lang.Object
- - org.apache.sysds.runtime.controlprogram.federated.FederatedResponse

- All Implemented Interfaces:
    `Serializable`

      public class FederatedResponse
      extends Object
      implements Serializable

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `FederatedResponse.ResponseType` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FederatedResponse​(FederatedResponse.ResponseType status)` |
    `FederatedResponse​(FederatedResponse.ResponseType status, Object data)` |
    `FederatedResponse​(FederatedResponse.ResponseType status, Object[] data)` |
    `FederatedResponse​(FederatedResponse.ResponseType status, Object[] data, LineageItem linItem)` |
    `FederatedResponse​(FederatedResponse.ResponseType status, Object data, LineageItem linItem)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `long` | `estimateSerializationBufferSize()` |
    `Object[]` | `getData()` |
    `String` | `getErrorMessage()` |
    `LineageItem` | `getLineageItem()` |
    `boolean` | `isSuccessful()` |
    `void` | `setCheckedConstraints​(Map<PrivacyConstraint.PrivacyLevel,​LongAdder> checkedConstraints)` | Set checked privacy constraints in response if the provided map is not empty.
    `void` | `throwExceptionFromResponse()` | Checks the data object array for exceptions that occurred in the federated worker during handling of request.
    `void` | `updateCheckedConstraintsLog()` |

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FederatedResponse

          public FederatedResponse​(FederatedResponse.ResponseType status)

    - #### FederatedResponse

          public FederatedResponse​(FederatedResponse.ResponseType status,
                                   Object[] data)

    - #### FederatedResponse

          public FederatedResponse​(FederatedResponse.ResponseType status,
                                   Object[] data,
                                   LineageItem linItem)

    - #### FederatedResponse

          public FederatedResponse​(FederatedResponse.ResponseType status,
                                   Object data)

    - #### FederatedResponse

          public FederatedResponse​(FederatedResponse.ResponseType status,
                                   Object data,
                                   LineageItem linItem)

  - ### Method Detail

    - #### isSuccessful

          public boolean isSuccessful()

    - #### getErrorMessage

          public String getErrorMessage()

    - #### getData

          public Object[] getData()
                           throws Exception

      Throws:
        `Exception`

    - #### estimateSerializationBufferSize

          public long estimateSerializationBufferSize()

    - #### throwExceptionFromResponse

          public void throwExceptionFromResponse()
                                          throws Exception

      Checks the data object array for exceptions that occurred in the federated worker during handling of request.
      Throws:
        `Exception` - the exception retrieved from the data object array or DMLRuntimeException if no exception is provided by the federated worker.

    - #### setCheckedConstraints

          public void setCheckedConstraints​(Map<PrivacyConstraint.PrivacyLevel,​LongAdder> checkedConstraints)

      Set checked privacy constraints in response if the provided map is not empty. If the map is empty, it means that no privacy constraints were found.
      Parameters:
        `checkedConstraints` - map of checked constraints from the PrivacyMonitor

    - #### updateCheckedConstraintsLog

          public void updateCheckedConstraintsLog()

    - #### getLineageItem

          public LineageItem getLineageItem()