Class InternalPayloadSpace

java.lang.Object
net.messagevortex.router.operation.InternalPayloadSpace

public class InternalPayloadSpace extends Object

Represents a payload space of an identity in memory for processing.

  • Constructor Details

    • InternalPayloadSpace

      public InternalPayloadSpace(InternalPayloadSpaceStore payloadSpace, IdentityBlock identity)

      Creates an internal payload space and adds it to the central directory.

      Parameters:
      payloadSpace - the payload space to be added
      identity - the identity the payload space is assigned to
  • Method Details

    • getIdentity

      public IdentityBlock getIdentity()
    • getPayload

      public PayloadChunk getPayload(int id)

      Gets the payload of a workspace id.

      Parameters:
      id - the payload id to be fetched
      Returns:
      the requested chunk or null if not found
    • setPayload

      public PayloadChunk setPayload(PayloadChunk p)

      Sets a payload chunk.

      Parameters:
      p - the payload chunk to be set
      Returns:
      the previously set payload
    • setCalculatedPayload

      public void setCalculatedPayload(int id, PayloadChunk p)

      Sets an ephemeral payload.

      Parameters:
      id - the id of the payload
      p - the payload
    • addOperation

      public boolean addOperation(Operation op)

      Add an operation to the payload space.

      Parameters:
      op - the operation to be added
      Returns:
      true if successful
    • removeOperation

      public boolean removeOperation(Operation op)

      Remove an operation from the workspace.

      Parameters:
      op - the operation to be removed
      Returns:
      true if successful
    • compact

      protected boolean compact()