StateServer: StateServer

Description Usage Arguments Format Details Author(s) See Also

Description

StateServer This class is responsible for serializing and deserializing object states. Invoked by the StateManager class, this class is comprised of two methods, saveState and restoreState. The saveState method takes as its parameters, a state identifier and the object to be saved, then serializes and saves the object to the States directory. The restoreState method takes a state identifier as its parameter and reads the object, designated by the state identifier from file and returns it to the StateManager object.

Usage

1

Arguments

key

Character string indicating a unique request from the StateManager class.

object

A serializable object to be serialized and saved.

stateId

Character string which uniquely identifies an object and its state at a specific point in time.

Format

An object of class R6ClassGenerator of length 24.

Details

The StateServer class is a participant of the State family of classes.

State Family of Classes Overview: The State family of classes is responsible for object persistence and data recovery in the NLPStudio package and is comprised of the following participants.

State Class Family Participants:

StateServer Methods: The following methods are defined for this class:

new(key)

Method that instantiates an object of the StateServer class. The method is invoked by the StateManager class with a unique key. This key is validated against future requests to confirm that the requests is originating from the StateManager class.

saveState(key, stateId, object)

Method for serializing and storing the object to disk.

restoreState(key, stateId)

Method for deserializing and returning the object from disk at state designated by the stateId parameter.

Author(s)

John James, jjames@datasciencesalon.org

See Also

Other State Classes: StateManager, State


j2scode/nlpStudio documentation built on May 9, 2019, 12:54 p.m.