PIRL.Conductor.Maestro

## Class Remote_Theater

- java.lang.Object
- - PIRL.Conductor.Maestro.Theater
  - - PIRL.Conductor.Maestro.Remote_Theater

All Implemented Interfaces:
  EventListener, Management, Message_Delivered_Listener

    public class Remote_Theater
    extends Theater
    implements Management, Message_Delivered_Listener

A Remote_Theater implements the remote Conductor management side of a `Theater`.

A Remote_Theater is used by network distributed clients that will be using the `Management` interface of Conductors via a Stage_Manager proxy server.

See Also:
  `Message_Delivered_Listener`

### Field Summary

Fields
`static int` `DEFAULT_MESSAGE_RETRIES` The default number of protocol transmission retries before a Remote_Management_Exception will be thrown.
`static int` `DEFAULT_RESPONSE_TIMEOUT` The default amount of time (seconds) to wait for a response to a protocol message.
`static String` `ID` Class identification name with source code version and date.
`protected int` `NACK_Messages` Problem case message accounting.
`protected Message_Delivered_Listener` `Non_Protocol_Message_Listener` Object to which non-protocol Messages will be delivered.
`static String` `REMOTE_THEATER_NAME` The name to be used in describing objects of this class.
`protected int` `Undeliverable_Messages` Problem case message accounting.
`protected int` `Unknown_Messages` Problem case message accounting.

### Fields inherited from class PIRL.Conductor.Maestro.Theater

`ACTION_PARAMETER_NAME, ADD_LOG_WRITER_ACTION, ADD_LOG_WRITER_CODE, ADD_PROCESSING_LISTENER_ACTION, ADD_PROCESSING_LISTENER_CODE, ADDRESS_PARAMETER_NAME, CLASS_ID_PARAMETER_NAME, CONDUCTOR_CONNECT_ACTION, CONDUCTOR_CONNECT_CODE, CONDUCTOR_DISCONNECT_ACTION, CONDUCTOR_DISCONNECT_CODE, CONDUCTOR_STATE_ACTION, CONDUCTOR_STATE_CODE, CONFIGURATION_ACTION, CONFIGURATION_CODE, CONFIGURATION_PARAMETER_NAME, Default_Port, DEFAULT_RECEIVE_TIMEOUT, DONE_ACTION, DONE_CODE, ENABLE_LOG_WRITER_ACTION, ENABLE_LOG_WRITER_CODE, EXCEPTION_PARAMETER_NAME, EXPLANATION_PARAMETER_NAME, FORWARDING_MESSENGERS_PARAMETER_NAME, GET_POLL_INTERVAL_ACTION, GET_POLL_INTERVAL_CODE, GET_RESOLVER_DEFAULT_VALUE_ACTION, GET_RESOLVER_DEFAULT_VALUE_CODE, GET_STOP_ON_FAILURE_ACTION, GET_STOP_ON_FAILURE_CODE, IDENTIFY_ACTION, IDENTIFY_CODE, IDENTITY_ACTION, IDENTITY_CODE, KEY_PARAMETER_NAME, LOG_STYLE_PARAMETER_GROUP, LOG_WRITER_ACTION, LOG_WRITER_CODE, LOG_WRITTEN_PARAMETER_NAME, MEMORY_ALLOCATED_PARAMETER_NAME, MEMORY_AVAILABLE_PARAMETER_NAME, MEMORY_FREE_PARAMETER_NAME, MEMORY_STATUS_PARAMETER_NAME, MESSAGE_BYTES_RECEIVED_PARAMETER_NAME, MESSAGE_BYTES_SENT_PARAMETER_NAME, MESSAGES_RECEIVED_DROPPED_PARAMETER_NAME, MESSAGES_RECEIVED_PARAMETER_NAME, MESSAGES_SENT_DROPPED_PARAMETER_NAME, MESSAGES_SENT_PARAMETER_NAME, MESSENGER_STATUS_PARAMETER_NAME, MESSENGERS_REPORT_ACTION, MESSENGERS_REPORT_CODE, MINIMUM_PROTOCOL_CODE, MINIMUM_RECEIVE_TIMEOUT, NACK_ACTION, NACK_CODE, NAME_PARAMETER_NAME, NL, ORIGINAL_MESSAGE_PARAMETER_NAME, PORT_DELIMITER_CHAR, PROCEDURE_RECORD_PARAMETER_NAME, PROCEDURES_ACTION, PROCEDURES_CHANGED_PARAMETER_NAME, PROCEDURES_CODE, PROCESSING_CHANGES_ACTION, PROCESSING_CHANGES_CODE, PROCESSING_EXCEPTION_ACTION, PROCESSING_EXCEPTION_CODE, PROCESSING_STATE_ACTION, PROCESSING_STATE_CODE, QUIT_ACTION, QUIT_CODE, REMOVE_LOG_WRITER_ACTION, REMOVE_LOG_WRITER_CODE, REMOVE_PROCESSING_LISTENER_ACTION, REMOVE_PROCESSING_LISTENER_CODE, RESET_SEQUENTIAL_FAILURES_ACTION, RESET_SEQUENTIAL_FAILURES_CODE, ROUTE_TO_PARAMETER_NAME, SEQUENTIAL_FAILURES_ACTION, SEQUENTIAL_FAILURES_CODE, SET_POLL_INTERVAL_ACTION, SET_POLL_INTERVAL_CODE, SET_RESOLVER_DEFAULT_VALUE_ACTION, SET_RESOLVER_DEFAULT_VALUE_CODE, SET_STOP_ON_FAILURE_ACTION, SET_STOP_ON_FAILURE_CODE, SOURCE_RECORD_PARAMETER_NAME, SOURCES_ACTION, SOURCES_CODE, SOURCES_REFRESHED_PARAMETER_NAME, START_ACTION, START_CODE, START_CONDUCTOR_ACTION, START_CONDUCTOR_CODE, START_MESSENGER_REPORTING_ACTION, START_MESSENGER_REPORTING_CODE, STATUS_REPORT_ACTION, STATUS_REPORT_CODE, STOP_ACTION, STOP_CODE, STOP_MESSENGER_REPORTING_ACTION, STOP_MESSENGER_REPORTING_CODE, TABLE_PARAMETER_NAME, THEATER_LOCATION_PARAMETER_NAME, THEATER_NAME, UNDELIVERABLE_ACTION, UNDELIVERABLE_CODE, VALUE_PARAMETER_NAME`

### Constructor Summary

Constructors
Constructor and Description
`Remote_Theater()`
`Remote_Theater(String host, int port, Message identity, String connection_address)`
`Remote_Theater(String host, Message identity, String connection_address)`

### Method Summary

Methods
`Management` `Add_Log_Writer(Writer writer)` Register a Writer to receive processing log stream output.
`Management` `Add_Processing_Listener(Processing_Listener listener)` Register a processing state change listener.
`boolean` `Close()` Close this Theater.
`Message` `Conductor_Identity()` Get the identity of the Conductor with which this Remote_Theater is associated.
`Configuration` `Configuration()` Get the Conductor Configuration.
`boolean` `Connected_to_Stage_Manager()` Test if the Conductor is connected to a Stage_Manager.
`Management` `Enable_Log_Writer(Writer writer, boolean enable)` Enable or disable output to a `registered log stream Writer`.
`Message` `Identity()` Get the Conductor `identity`.
`Message` `Listener_Identity()` Get the identity description of this Conductor Management interface implementation.
`void` `Message_Delivered(Message_Delivered_Event event)` Take delivery of a Message.
`int` `Message_Retries()` Get the maximum number of protocol message retries before a Remote_Management_Exception will be thrown.
`Remote_Theater` `Message_Retries(int retries)` Set the number of protocol message retries before a Remote_Management_Exception will be thrown.
`int` `NACK_Messages()` Get the number of NACK (negative acknowledge) messages that have occurred.
`Message_Delivered_Listener` `Non_Protocol_Message_Listener()` Get the listener for non-protocol messages.
`Remote_Theater` `Non_Protocol_Message_Listener(Message_Delivered_Listener listener)` Set the listenter for non-protocol messages.
`void` `Open(String host, int port, Message identity, String connection_address)` Open this Theater.
`void` `Open(String host, Message identity, String connection_address)` Open this Theater.
`int` `Poll_Interval()` Get the interval at which the Conductor will poll for unprocessed source records.
`Management` `Poll_Interval(int seconds)` Set the interval at which the Conductor will poll for unprocessed source records.
`Vector<Vector<String>>` `Procedures()` Get the procedures table.
`Exception` `Processing_Exception()` Get the most recent Exception from the Conductor.
`int` `Processing_State()` Get the current Conductor processing state.
`void` `Quit()` Immediately stop Conductor processing and exit.
`boolean` `Remove_Log_Writer(Writer writer)` Unregister a log Writer.
`boolean` `Remove_Processing_Listener(Processing_Listener listener)` Unregister a processing state change listener.
`Management` `Reset_Sequential_Failures()` Reset the count of sequential source processing failures that the Conductor has accumulated.
`String` `Resolver_Default_Value()` Get the Conductor default Reference_Resolver value.
`Management` `Resolver_Default_Value(String value)` Set the Conductor default Reference_Resolver value.
`int` `Response_Timeout()` Get the amount of time to wait for a response to a protocol message.
`Remote_Theater` `Response_Timeout(int seconds)` Set the amount of time to wait for a response to a protocol message.
`protected Message` `Send_and_Wait(Message message)` Send a Message and wait for a response.
`int` `Sequential_Failures()` Get the count of sequential source processing failures that the Conductor has accumulated.
`Vector<Vector<String>>` `Sources()` Get the current cache of source records.
`void` `Start()` Start Conductor source record processing.
`Processing_Changes` `State()` Get the current Conductor processing state variables.
`int` `Stop_on_Failure()` Get the number of Conductor sequential source processing failures at which to stop processing.
`Management` `Stop_on_Failure(int failure_count)` Set the number of Conductor sequential source processing failures at which to stop processing.
`void` `Stop()` Request that Conductor stop source record processing.
`String` `toString()` Get the description of this Theater.
`int` `Undeliverable_Messages()` Get the number of undeliverable messages that have occurred.
`int` `Unknown_Messages()` Get the number of unknown messages that have occurred.
`protected Message` `Wait_for_Response()` Wait for a response Message.

### Methods inherited from class PIRL.Conductor.Maestro.Theater

`Action_Code, Default_Port, Default_Port, Default_Receive_Timeout, Default_Receive_Timeout, Employer, Full_Location, Host, Listen_for_Messages, Location, Location, Messenger, NACK, Name, Open, Open, Opened, Port, Processing_Changes, Processing_Changes, Receive_Message, Receive_Timeout, Receive_Timeout, Record, Send_Message, Stage_Manager_Identity, Table`

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

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

### Field Detail

#### ID

    public static final String ID

Class identification name with source code version and date.

See Also:
  Constant Field Values

#### REMOTE_THEATER_NAME

    public static final String REMOTE_THEATER_NAME

The name to be used in describing objects of this class.

See Also:
  Constant Field Values

#### DEFAULT_RESPONSE_TIMEOUT

    public static final int DEFAULT_RESPONSE_TIMEOUT

The default amount of time (seconds) to wait for a response to a protocol message.

See Also:
  Constant Field Values

#### DEFAULT_MESSAGE_RETRIES

    public static final int DEFAULT_MESSAGE_RETRIES

The default number of protocol transmission retries before a Remote_Management_Exception will be thrown.

See Also:
  Constant Field Values

#### Non_Protocol_Message_Listener

    protected Message_Delivered_Listener Non_Protocol_Message_Listener

Object to which non-protocol Messages will be delivered.

#### Undeliverable_Messages

    protected int Undeliverable_Messages

Problem case message accounting.

#### NACK_Messages

    protected int NACK_Messages

Problem case message accounting.

#### Unknown_Messages

    protected int Unknown_Messages

Problem case message accounting.

### Constructor Detail

#### Remote_Theater

    public Remote_Theater(String host,
                  int port,
                  Message identity,
                  String connection_address)
                   throws IOException

Throws:
  `IOException`

#### Remote_Theater

    public Remote_Theater(String host,
                  Message identity,
                  String connection_address)
                   throws IOException

Throws:
  `IOException`

#### Remote_Theater

    public Remote_Theater()

### Method Detail

#### Response_Timeout

    public int Response_Timeout()

Get the amount of time to wait for a response to a protocol message.

Returns:
  The maximum amount of time (seconds) to wait for a response to a protocol message.

#### Response_Timeout

    public Remote_Theater Response_Timeout(int seconds)

Set the amount of time to wait for a response to a protocol message.

Parameters:
  `seconds` - The maximum amount of time (seconds) to wait for a response to a protocol message. If less than or equal to zero the `DEFAULT_RESPONSE_TIMEOUT` will be used.
Returns:
  This Remote_Theater object.

#### Conductor_Identity

    public Message Conductor_Identity()

Get the identity of the Conductor with which this Remote_Theater is associated.

N.B.: The availability of a Conductor identity does not imply that this Remote_Theater is `opened` for that Conductor.

Returns:
  A `Conductor identity Message`. This will be an empty Message if no identity has yet been obtained. It will be null if the identity has become corrupted.

#### Message_Retries

    public int Message_Retries()

Get the maximum number of protocol message retries before a Remote_Management_Exception will be thrown.

Returns:
  The maximum number of protocol message retries.

#### Message_Retries

    public Remote_Theater Message_Retries(int retries)

Set the number of protocol message retries before a Remote_Management_Exception will be thrown.

Parameters:
  `retries` - The maximum number of protocol message retries. If zero the `DEFAULT_MESSAGE_RETRIES` will be used. If negative retries will continue until successful (this could result in an indefintate protocol hang).
Returns:
  This Remote_Theater object.

#### Undeliverable_Messages

    public int Undeliverable_Messages()

Get the number of undeliverable messages that have occurred.

An underliverable Message contains the `Theater.UNDELIVERABLE_ACTION` value for the `Theater.ACTION_PARAMETER_NAME`.

Returns:
  The number of undeliverable messages that have occurred.

#### NACK_Messages

    public int NACK_Messages()

Get the number of NACK (negative acknowledge) messages that have occurred.

A NACK Message contains the `Theater.NACK_ACTION` value for the `Theater.ACTION_PARAMETER_NAME`.

Returns:
  The number of NACK messages that have occurred.

#### Unknown_Messages

    public int Unknown_Messages()

Get the number of unknown messages that have occurred.

An unknown message has no `Theater.ACTION_PARAMETER_NAME`, this parameter has no value, or the value is not known as a protocol action. A `listener` may be set to receive non-protocol messages.

Returns:
  The number of undeliverable messages that have occurred.
See Also:
  `Non_Protocol_Message_Listener(Message_Delivered_Listener)`

#### Non_Protocol_Message_Listener

    public Message_Delivered_Listener Non_Protocol_Message_Listener()

Get the listener for non-protocol messages.

Returns:
  A Message_Delivered_Listener to which non-protocol messages will be delivered. This may be null.
See Also:
  `Non_Protocol_Message_Listener(Message_Delivered_Listener)`

#### Non_Protocol_Message_Listener

    public Remote_Theater Non_Protocol_Message_Listener(Message_Delivered_Listener listener)

Set the listenter for non-protocol messages.

A non-protocol message does not participate in the implementation of the remote Conductor Management interface. This includes Messages with the `Theater.DONE_ACTION`, `Theater.UNDELIVERABLE_ACTION`, `Theater.NACK_ACTION` or `Theater.MESSENGERS_REPORT_ACTION` value for the `Theater.ACTION_PARAMETER_NAME`, or any message that does not have a recognized protocol action.

Parameters:
  `listener` - A Message_Delivered_Listener to which non-protocol messages will be delivered.
Returns:
  This Remote_Theater object.
See Also:
  `Non_Protocol_Message_Listener()`

#### toString

    public String toString()

Description copied from class: `Theater`
Get the description of this Theater.

The first line of the description is the class `Theater.ID`. The second line of the description provides the Theater location, if it is known, and whether or not the Theater is open. If the Theater has a `Messenger` its description is included on the following lines.

Overrides:
  `toString` in class `Theater`
Returns:
  The Theater description String.

#### Open

    public void Open(String host,
            int port,
            Message identity,
            String connection_address)
              throws IOException

Open this Theater.

The current communication channel is `closed`. A new `connection` with the Stage_Manager is established using the identity provided.

Then a `Theater.CONDUCTOR_CONNECT_ACTION` Message is sent to the Stage_Manager with the connection ID. The response is checked for an `Theater.EXPLANATION_PARAMETER_NAME` indicating that the request could not be satisfied (unknown Messenger ID). If the response is good then the `route-to list` of the Conductor Identity Message is set to the value provided by its `Theater.ROUTE_TO_PARAMETER_NAME` parameter.

Parameters:
  `host` - The name or IP address of the host system where a Stage_Manager is running. If null, "localhost" will be used.
  `port` - The port number to use to establish the communication connection. If less than or equal to zero the `default port` will be used.
  `identity` - The Message used to provide the Stage_Manager with the required identity information.
  `connection_address` - The Messenger `address` used by the Stage_Manager to identify the Messenger used to establish a connection with the Local_Theater object bound to a Conductor.
Throws:
  `IOException` - If a connection could not be established to the Stage_Manager. This will be a Theater_Protocol_Exception if there were any problems in the content of the Messages used to establish the connection.
  `IllegalArgumentException` - If the identity or connection_address is null.
See Also:
  `Theater.Open(String, int, Message)`

#### Open

    public void Open(String host,
            Message identity,
            String connection_address)
              throws IOException

Open this Theater.

The `default port` will be used.

Parameters:
  `host` - The name or IP address of the host system where a Stage_Manager is running. If null, "localhost" will be used.
  `identity` - The Message used to provide the Stage_Manager with the required identity information.
  `connection_address` - The Messenger `address` used by the Stage_Manager to identify the Messenger used to establish a connection with the Local_Theater object bound to a Conductor.
Throws:
  `IOException` - If a connection could not be established to the Stage_Manager. This will be a Theater_Protocol_Exception if there were any problems in the content of the Messages used to establish the connection.
  `IllegalArgumentException` - If the identity or connection_address is null.
See Also:
  `Open(String, int, Message, String)`

#### Close

    public boolean Close()

Close this Theater.

If currently `opened` a `Theater.CONDUCTOR_DISCONNECT_ACTION` Message is `sent` with the `Theater.ADDRESS_PARAMETER_NAME` set from the same parameter of the `Conductor identity`. Then the communication channel is `closed`.

Overrides:
  `Close` in class `Theater`
Returns:
  true if this Remote_Theater was opened when this method was invoked; false if it was already closed.

#### Listener_Identity

    public Message Listener_Identity()

Get the identity description of this Conductor Management interface implementation.

Specified by:
  `Listener_Identity` in interface `Message_Delivered_Listener`
Returns:
  A Message describing this Remote_Theater object.

#### Message_Delivered

    public void Message_Delivered(Message_Delivered_Event event)

Take delivery of a Message.

The Action parameter value of the event's Message is used to determine an `action code` that selects a handler method if the Action is known. The delivered Message is handled before returning. Most Messages will just be posted as a Response which will wake up any thread that is `waiting for a response`. Typically this happens as a result of a `send-and_wait message`.

Messages that are asynchronously conveying `Conductor processing events` or `Conductor log reports` are handled immediately.

Non-protocol messages are delivered to the `non-protocol listener`, if there is one.

Specified by:
  `Message_Delivered` in interface `Message_Delivered_Listener`
Parameters:
  `event` - The Message_Delivered_Event containing the Message to be delivered and a reference to the delivering Messenger.

#### Send_and_Wait

    protected Message Send_and_Wait(Message message)

Send a Message and wait for a response.

The previous response is cleared, the Message is sent and then the current thread is blocked `waiting for a response`. When the response arrives it is returned.

Parameters:
  `message` - The Message to be sent.
Returns:
  The response Message. This will be null if the connection to the Stage_Manager was lost or the response did not arrive before the `response timeout` expired. Check if the Stage_Manager is `opened` to determine the exact cause of a null response.
Throws:
  `Remote_Management_Exception` - If Message could not be sent because it contains invalid PVL.

#### Wait_for_Response

    protected Message Wait_for_Response()

Wait for a response Message.

If a non-null response is currently posted that will be immediately returned without any waiting. N.B.: The previously posted response must be cleared when it is no longer relevant or it will be incorrectly returned as the new response; `Send_and_Wait(Message)`, for example, clears the response before sending a message that is expected to result in a new response.

After confirming that there is no response available a thread is started that will sleep until the `response timeout` expires or it is woken when a response arrives. The current thread joins the waiting thread which prevents the method from returning until a response arrives or the timeout occurs.

Returns:
  The response Message. This will be null if a response timeout occurred before a response arrived.
Throws:
  `IllegalThreadStateException` - If a waiting thread is active.

#### Identity

    public Message Identity()

Description copied from interface: `Management`
Get the Conductor `identity`.

Specified by:
  `Identity` in interface `Management`
Returns:
  A Message containing the Conductor identification parameters.
See Also:
  `Conductor.Identity()`

#### Start

    public void Start()

Description copied from interface: `Management`
Start Conductor source record processing.

If the Conductor is in a negative `processing state` (`waiting` or `halted`) it will enter the `running` state, reconfigure itself from its Configuration source, and source record processing will commence. If the Conductor is in the `run-to-wait` state it will clear this to the running state; for any other positive state (running or `polling`) there will be no change.

Specified by:
  `Start` in interface `Management`
See Also:
  `Conductor.Start()`

#### Stop

    public void Stop()

Description copied from interface: `Management`
Request that Conductor stop source record processing.

If the Conductor is in a positive `processing state` it will enter the `run-to-wait` state, in which it will enter the `waiting` state when the current source record completes processing. If the Conductor is in the `polling` state it will immediately stop polling for new source records. There will be no effect for any negative state.

Specified by:
  `Stop` in interface `Management`
See Also:
  `Conductor.Stop()`

#### Quit

    public void Quit()

Description copied from interface: `Management`
Immediately stop Conductor processing and exit.

Any open log file is closed. The database server is disconnected. An `exiting` processing event is sent to all `processing listeners`. The application exits with a `success status`.

N.B.: If source processing is `running` it is aborted.

Specified by:
  `Quit` in interface `Management`
See Also:
  `Conductor.Quit()`

#### Processing_State

    public int Processing_State()

Description copied from interface: `Management`
Get the current Conductor processing state.

The possible processing state values are:

`Conductor.RUNNING`
  Source records are being processing.
`Conductor.POLLING`
  No unprocessed source records are currently available for processing; the Conductor is `polling` for source records to process.
`Conductor.RUN_TO_WAIT`
  When processing of the current source record completes Conductor will go into the waiting state.
`Conductor.WAITING`
  The Conductor is waiting to be told to being processing.
`Conductor.HALTED`
  A problem condition caused the Conductor to halt processing. The problem may be the result of the maximum number of `sequential failures` of source record processing having occured, a database access failure, or some other `system error`.

The WAITING and HALTED state codes are negative; all others are positive.

Specified by:
  `Processing_State` in interface `Management`
Returns:
  A Conductor processing state code.

#### Configuration

    public Configuration Configuration()

Description copied from interface: `Management`
Get the Conductor Configuration.

The Configuration that is returned is a copy of the current state of the Conductor Configuration, which is dynamically changed during processing. All parameters named "PASSWORD" (case insensitive) will have their values reset to `Processing_Changes.MASKED_PASSWORD`.

Specified by:
  `Configuration` in interface `Management`
Returns:
  A copy of the Conductor Configuration.
See Also:
  `Conductor.Preconfigure(Configuration)`, `Conductor.Postconfigure(Configuration)`

#### Poll_Interval

    public Management Poll_Interval(int seconds)

Description copied from interface: `Management`
Set the interval at which the Conductor will poll for unprocessed source records.

When the Conductor is in the polling `state` it will periodically check the database sources table for source records that are marked as unprocessed. Unprocessed source records are used to refresh the Conductor cache of source records to be processed. When all source records in the cache have been processed, the Conductor will enter the polling state if the poll interval is positive; it will enter the waiting state if the poll interval is not positive (as if the `stop request` had been issued), or will exit if it is not `connected to a Stage_Manager` at the time.

Specified by:
  `Poll_Interval` in interface `Management`
Parameters:
  `seconds` - The interval, in seconds, at which the Conductor will poll for unprocessed source records. If less than zero, zero will be set, but the value will be reset to the Conductor Configuration `Conductor.POLL_INTERVAL_PARAMETER` value or the `Conductor.DEFAULT_POLL_INTERVAL` value if the Configuration does contain the parameter, the next time the Conductor is `started` after having stopped processing for any reason.
Returns:
  This Management object.
See Also:
  `Conductor.Poll_Interval(int)`

#### Poll_Interval

    public int Poll_Interval()

Description copied from interface: `Management`
Get the interval at which the Conductor will poll for unprocessed source records.

This value may also be obtained from the `Configuration` `Conductor.POLL_INTERVAL_PARAMETER`.

Specified by:
  `Poll_Interval` in interface `Management`
Returns:
  The interval, in seconds, at which the Conductor will poll for unprocessed source records. If zero, polling has been disabled.
See Also:
  `Management.Poll_Interval(int)`

#### Resolver_Default_Value

    public Management Resolver_Default_Value(String value)

Description copied from interface: `Management`
Set the Conductor default Reference_Resolver value.

Normally when the Conductor Reference_Resolver is unable to resolve a reference it will throw an `exception` and enter the halted `processing state`, or exit if it is not `connected to a Stage_Manager` at the time. If, however, the `Reference_Resolver default value` is set to a non-null String that value will be used for the unresolved_reference instead of throwing an exception.

Specified by:
  `Resolver_Default_Value` in interface `Management`
Parameters:
  `value` - The default Reference_Resolver String value. If this starts with `Conductor.UNRESOLVED_REFERENCE_THROWS` (case insensitive) null will be used.
Returns:
  This Management object.
See Also:
  `Conductor.Resolver_Default_Value(String)`, `Reference_Resolver`

#### Resolver_Default_Value

    public String Resolver_Default_Value()

Description copied from interface: `Management`
Get the Conductor default Reference_Resolver value.

This value may also be obtained from the `Configuration` `Conductor.UNRESOLVED_REFERENCE_PARAMETER`. Note, however, that the value will be `Conductor.UNRESOLVED_REFERENCE_THROWS` when the actual value is null.

Specified by:
  `Resolver_Default_Value` in interface `Management`
Returns:
  The default Reference_Resolver String value.
See Also:
  `Management.Resolver_Default_Value(String)`

#### Stop_on_Failure

    public Management Stop_on_Failure(int failure_count)

Description copied from interface: `Management`
Set the number of Conductor sequential source processing failures at which to stop processing.

The Conductor keeps a `count of sequential source processing failures`. When this count reaches the stop-on-failure limit the Conductor will enter the halted `processing state` or exit if it is not `connected to a Stage_Manager` at the time.

N.B.: Reaching the stop-on-failure limit does not cause the sequential failures count to be `reset`.

Specified by:
  `Stop_on_Failure` in interface `Management`
Parameters:
  `failure_count` - The number of Conductor sequential source processing failures at which to stop processing. If zero sequential processing failures will never cause processing to stop. If negative the current value will not be changed, but the value will be reset to the Conductor Configuration `Conductor.STOP_ON_FAILURE_PARAMETER` value or the `Conductor.DEFAULT_STOP_ON_FAILURE` value if the Configuration does contain the parameter, the next time the Conductor is `started` after having stopped processing for any reason.
Returns:
  This Management object.
See Also:
  `Management.Sequential_Failures()`, `Conductor.Stop_on_Failure(int)`

#### Stop_on_Failure

    public int Stop_on_Failure()

Description copied from interface: `Management`
Get the number of Conductor sequential source processing failures at which to stop processing.

This value may also be obtained from the `Configuration` `Conductor.STOP_ON_FAILURE_PARAMETER`

Specified by:
  `Stop_on_Failure` in interface `Management`
Returns:
  The number of Conductor sequential source processing failures at which to stop processing. If zero sequential processing failures will never cause processing to stop.
See Also:
  `Management.Stop_on_Failure(int)`

#### Sequential_Failures

    public int Sequential_Failures()

Description copied from interface: `Management`
Get the count of sequential source processing failures that the Conductor has accumulated.

Other source processing success and failure counts may be obtained from the `Configuration`:

`Conductor.SOURCE_SUCCESS_COUNT`
  The total number of source records that have successfully completed all processing since the Conductor first began processing.
`Conductor.SOURCE_FAILURE_COUNT`
  The number of source records that have resulted in a failed procedure condition during processing.
`Conductor.TOTAL_FAILURE_COUNT`
  The total number of source records that failed to be processed for any reason since the Conductor first began processing.

Specified by:
  `Sequential_Failures` in interface `Management`
Returns:
  The count of sequential source processing failures that the Conductor has accumulated.
See Also:
  `Management.Stop_on_Failure(int)`, `Management.Reset_Sequential_Failures()`

#### Reset_Sequential_Failures

    public Management Reset_Sequential_Failures()

Description copied from interface: `Management`
Reset the count of sequential source processing failures that the Conductor has accumulated.

If the Conductor is in the halted `processing state` it is reset to the waiting state.

Specified by:
  `Reset_Sequential_Failures` in interface `Management`
Returns:
  This Management object.
See Also:
  `Management.Stop_on_Failure(int)`, `Conductor.Reset_Sequential_Failures()`

#### Processing_Exception

    public Exception Processing_Exception()

Get the most recent Exception from the Conductor.

<b.N.B.: A generic Exception will be returned since the specific type was not conveyed through the messaging protocol (an enhancement could provide this...).

Specified by:
  `Processing_Exception` in interface `Management`
Returns:
  An Exception with the Conductor Exception message. This will be null if no Exception is obtained from the Conductor.

#### Connected_to_Stage_Manager

    public boolean Connected_to_Stage_Manager()

Description copied from interface: `Management`
Test if the Conductor is connected to a Stage_Manager.

Specified by:
  `Connected_to_Stage_Manager` in interface `Management`
Returns:
  true if the Conductor is connected to a Stage_Manager via an open Local_Theater; false otherwise.
See Also:
  `Local_Theater`

#### Sources

    public Vector<Vector<String>> Sources()

Description copied from interface: `Management`
Get the current cache of source records.

The table is expected to be delivered with the record fields in `Conductor.SOURCES_FIELD_NAMES` order, and with the records sorted by increasing `Conductor.SEQUENCE_FIELD` order.

N.B.: Only the contents of the Conductor source records cache is delivered. The contents of the database sources table may be much, much larger.

Specified by:
  `Sources` in interface `Management`
Returns:
  A table Vector of record Vectors of field Strings. The first record contains the field names.

#### Procedures

    public Vector<Vector<String>> Procedures()

Description copied from interface: `Management`
Get the procedures table.

The table is expected to be delivered with the record fields in `Conductor.PROCEDURES_FIELD_NAMES` order, and with the records in processing order.

N.B.: The entire contents of the database procedures table is delivered.

Specified by:
  `Procedures` in interface `Management`
Returns:
  A table Vector of record Vectors of field Strings. The first record contains the field names.

#### State

    public Processing_Changes State()

Description copied from interface: `Management`
Get the current Conductor processing state variables.

All Processing_Changes values are set except the except the flag variables - `Processing_Changes.Sources_Refreshed(boolean)`, `Processing_Changes.Procedures_Changed(boolean)` and `Processing_Changes.Exiting(boolean)` - which will always be false.

Specified by:
  `State` in interface `Management`
Returns:
  Processing_Changes object.
See Also:
  `Processing_Changes`

#### Add_Processing_Listener

    public Management Add_Processing_Listener(Processing_Listener listener)

Description copied from interface: `Management`
Register a processing state change listener.

The Conductor sends its `processing event` notifications to all registered listeners.

Specified by:
  `Add_Processing_Listener` in interface `Management`
Parameters:
  `listener` - A Processing_Listener.
Returns:
  This Management object.
See Also:
  `Processing_Listener`

#### Remove_Processing_Listener

    public boolean Remove_Processing_Listener(Processing_Listener listener)

Description copied from interface: `Management`
Unregister a processing state change listener.

Specified by:
  `Remove_Processing_Listener` in interface `Management`
Parameters:
  `listener` - The Processing_Listener to be removed from the Management list of registered listeners.
Returns:
  true If the listener was registered and is now removed; false if it was not registered.
See Also:
  `Management.Add_Processing_Listener(Processing_Listener)`

#### Add_Log_Writer

    public Management Add_Log_Writer(Writer writer)

Description copied from interface: `Management`
Register a Writer to receive processing log stream output.

The Conductor writes its processing log reports, including the output from all pipeline procedures it runs, to all registered log Writers.

Specified by:
  `Add_Log_Writer` in interface `Management`
Parameters:
  `writer` - A Writer object.
Returns:
  This Management object.
See Also:
  `Management.Enable_Log_Writer(Writer, boolean)`, `Management.Remove_Log_Writer(Writer)`

#### Remove_Log_Writer

    public boolean Remove_Log_Writer(Writer writer)

Description copied from interface: `Management`
Unregister a log Writer.

Specified by:
  `Remove_Log_Writer` in interface `Management`
Parameters:
  `writer` - A Writer object.
Returns:
  true If the writer was registered and is now removed; false if it was not registered.
See Also:
  `Management.Add_Log_Writer(Writer)`

#### Enable_Log_Writer

    public Management Enable_Log_Writer(Writer writer,
                               boolean enable)

Description copied from interface: `Management`
Enable or disable output to a `registered log stream Writer`.

Specified by:
  `Enable_Log_Writer` in interface `Management`
Parameters:
  `writer` - A Writer that has been registered to receive Conductor log stream output. If the writer is not `registered` to receive the Conductor log stream nothing is done.
  `enable` - If false, Conductor log stream output to the Writer is suspended without having to unregister the Writer. If true, a Writer that has had its log stream output suspended will begin receiving it again.
Returns:
  This Management object.