de.esprit.netsuite.netdata.agent

## Interface Sequenced

- All Known Implementing Classes:
    AbstractSequencedAgent, DBLoadAgent, LoadTextFileSequencedAgent, MessageBurstSequencedAgent, SequencedParamAgent

      public interface Sequenced

  This interface is implemented by agents that send their results in multiple chunks to the client.
  Author:
    Rainer Buesch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getChunkSize()` Returns the chunk size of this agent.
    `int` | `getMaxSequenceId()` Returns the maximum sequenceId.
    `int` | `getSequenceId()` Returns the sequence id of the agent
    `boolean` | `isLast()` Tells whether this is the very last agent of a sequence.
    `void` | `processLast()` This method is called on client side, when the client receives the last agent of a sequence.
    `void` | `sendLast()` Creates and sends the very last agent of a sequence.
    `void` | `sendNextSequence()` Creates and sends the next agent of a sequence with an incremented sequenceId
    `void` | `setChunkSize(int size)` Sets the chunk size, which typically is the amount of data transferred by this agent.
    `void` | `setMaxSequenceId(int maxId)`

- - ### Method Detail

    - #### getSequenceId

          int getSequenceId()

      Returns the sequence id of the agent

    - #### getMaxSequenceId

          int getMaxSequenceId()

      Returns the maximum sequenceId. A value of 0 indicates, that we do not know how many sequenced agents will still be received.

      Note that in the very last agent sent (isLast flag set) the server automatically sets the MaxSequenceId to the number of agents that have been sent.

    - #### setMaxSequenceId

          void setMaxSequenceId(int maxId)

    - #### setChunkSize

          void setChunkSize(int size)

      Sets the chunk size, which typically is the amount of data transferred by this agent.

    - #### getChunkSize

          int getChunkSize()

      Returns the chunk size of this agent.

    - #### isLast

          boolean isLast()

      Tells whether this is the very last agent of a sequence.
      See Also:
        `sendLast()`

    - #### sendNextSequence

          void sendNextSequence()

      Creates and sends the next agent of a sequence with an incremented sequenceId

    - #### sendLast

          void sendLast()

      Creates and sends the very last agent of a sequence. Note that this method must never be called by a user. It is automatically called by the server after all chunks of a sequenced agent have been sent. The very last agent is a kind of a marker agent, that indicates to the client that all chunks have been received already. As such it does never contain valid data and thus it's result is never postprocessed on client side.

    - #### processLast

          void processLast()

      This method is called on client side, when the client receives the last agent of a sequence.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.