Class: Reply

Reply()

Represents a response to an Agent operation in KDC-JS. Extends Agent to provide information about the outcome of a request, including success status, an optional response payload, and an optional error message. Reply objects participate in the same serialization and class registration mechanisms as other Agents. The standard Reply class is automatically registered by ParametersBuilder for interoperability with KDC-Java.

Constructor

new Reply()

Creates a Reply with a successful default status and no payload or error message.

Extends

Classes

Reply

Members

KEY_DELIMITER :string

Delimiter used when constructing compound data keys. Matches the Java Agent.KEY_DELIMITER constant.
Type:
  • string
Overrides:

apiClassName :string|null

Logical API class name used to identify the receiving API.
Type:
  • string | null
Overrides:

creationTimeStamp :number

Agent creation time, expressed as milliseconds since the Unix epoch.
Type:
  • number
Overrides:

data :Object.<string, *>|null

Application-defined key/value data associated with this Agent.
Type:
  • Object.<string, *> | null
Overrides:

errorMessage :string|null

Optional error message describing a failed operation. Defaults to null.
Type:
  • string | null

latencyRecord :LatencyRecord|null

Latency measurements associated with this Agent.
Type:
Overrides:

payload :*

Optional response payload. Defaults to null.
Type:
  • *

sizeInBytes :number

Serialized Agent size in bytes. Initially zero until populated by the serialization process.
Type:
  • number
Overrides:

success :boolean

Indicates whether the requested operation succeeded. Defaults to true.
Type:
  • boolean

synchronous :boolean

Indicates whether the Agent uses synchronous request/reply processing.
Type:
  • boolean
Overrides:

uuid :string

Unique identifier assigned to this Agent.
Type:
  • string
Overrides:

visitorMethodName :string|null

Name of the visitor method to invoke on the receiving endpoint.
Type:
  • string | null
Overrides:

Methods

getData(key) → {*}

Retrieves an application-defined value associated with the specified key.
Parameters:
Name Type Description
key string Non-empty key identifying the data value.
Overrides:
Throws:
  • If key is not a non-empty string.
    Type
    TypeError
  • If the data map is empty or the key does not exist.
    Type
    Error
Returns:
Value associated with the specified key.
Type
*

hasData(key) → {boolean}

Determines whether the Agent contains a value associated with the specified key.
Parameters:
Name Type Description
key string Non-empty key to check.
Overrides:
Throws:
If key is not a non-empty string.
Type
TypeError
Returns:
True if the key exists; otherwise false.
Type
boolean

setData(key, value) → {Agent}

Associates an application-defined value with a key. If the data map does not exist, it is created. An existing value associated with the same key is replaced.
Parameters:
Name Type Description
key string Non-empty key identifying the data value.
value * Application-defined value to store.
Overrides:
Throws:
If key is not a non-empty string.
Type
TypeError
Returns:
This Agent for method chaining.
Type
Agent

setVisitorMethod(visitorMethodName, apiClassName) → {Agent}

Configures the visitor method and API class name used to dispatch this Agent. Both arguments must be non-empty strings.
Parameters:
Name Type Description
visitorMethodName string Name of the visitor method to invoke.
apiClassName string Logical name of the receiving API class.
Overrides:
Throws:
If either argument is not a non-empty string.
Type
TypeError
Returns:
This Agent for method chaining.
Type
Agent