BEAST
eu.baltrad.beast.admin.JsonCommandParserImpl Class Reference

The implementation of all commands that we currently can parse. More...

Inheritance diagram for eu.baltrad.beast.admin.JsonCommandParserImpl:
eu.baltrad.beast.admin.JsonCommandParser

Public Member Functions

Command parse (InputStream inputStream)
 Parses an input stream into a command object.
 
Command parse (String s)
 Parses a JSON request if supported.
 
Command parse (JsonNode node)
 Processes a JsonNode according to administrator command conventions.
 
Command parseCommand (String command, JsonNode arguments)
 Takes care of and maps the command to the appropriate method.
 
Command parseHelpCommand (String operation, JsonNode arguments)
 Provides the help command to get information about available commands.
 
Command parseAdaptorCommand (String operation, JsonNode node)
 Manages an adaptor, either ADD, UPDATE or REMOVE.
 
Command parseAnomalyDetectorCommand (String operation, JsonNode node)
 Manages an anomaly detector.
 
Command parseRouteCommand (String operation, JsonNode node)
 Manages an anomaly detector.
 
Command parseSettingCommand (String operation, JsonNode arguments)
 Parses a setting command.
 
Command parseScheduleCommand (String operation, JsonNode node)
 Parses a schedule command.
 
Command parseUserCommand (String operation, JsonNode arguments)
 Parses a user manipulation command.
 
void setRouteCommandHelper (RouteCommandHelper helper)
 The route command helper.
 
RouteCommandHelper getRouteCommandHelper ()
 
String getHelp ()
 
String getHelp (String method)
 Generates help text about a method.
 
String getMethodHelp (String method) throws Exception
 Returns help about the specified method.
 
String createFullCommand (String method, Object object) throws Exception
 Creates a full command object for usage in the help text.
 
String createSimpleCommand (String method, Object[] objs) throws Exception
 Creates a json representation when the arguments are just fields and not complete objects.
 

Detailed Description

The implementation of all commands that we currently can parse.

Author
anders

Member Function Documentation

◆ createFullCommand()

String eu.baltrad.beast.admin.JsonCommandParserImpl.createFullCommand ( String method,
Object object ) throws Exception
inline

Creates a full command object for usage in the help text.

Parameters
methodthe method
objectthe object that should be jsonified
Returns
the json representation of the object
Exceptions
Exceptionwhen an error occurs

◆ createSimpleCommand()

String eu.baltrad.beast.admin.JsonCommandParserImpl.createSimpleCommand ( String method,
Object[] objs ) throws Exception
inline

Creates a json representation when the arguments are just fields and not complete objects.

Parameters
methodthe method
objsan array of of N*2 items where N = name of field, N+1 = field value
Returns
the json representation of the object
Exceptions
Exceptionwhen an error occurs

◆ getHelp() [1/2]

String eu.baltrad.beast.admin.JsonCommandParserImpl.getHelp ( )
inline
Returns
the help for the command parsing

Implements eu.baltrad.beast.admin.JsonCommandParser.

◆ getHelp() [2/2]

String eu.baltrad.beast.admin.JsonCommandParserImpl.getHelp ( String method)
inline

Generates help text about a method.

If method == null it will be the same as calling getHelp().

Parameters
method- the method for which help text should be produced
Returns
the help text

Implements eu.baltrad.beast.admin.JsonCommandParser.

◆ getMethodHelp()

String eu.baltrad.beast.admin.JsonCommandParserImpl.getMethodHelp ( String method) throws Exception
inline

Returns help about the specified method.

Parameters
method- the method for which help should be generated
Returns
the help text

◆ getRouteCommandHelper()

RouteCommandHelper eu.baltrad.beast.admin.JsonCommandParserImpl.getRouteCommandHelper ( )
inline
Returns
the route command helper

◆ parse() [1/3]

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parse ( InputStream inputStream)
inline

Parses an input stream into a command object.

Returns
the parsed command or null
Exceptions
{

link AdministratorException} when a problem occurs.

Implements eu.baltrad.beast.admin.JsonCommandParser.

◆ parse() [2/3]

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parse ( JsonNode node)
inline

Processes a JsonNode according to administrator command conventions.

Parameters
nodethe json node
Returns
the associated command
Exceptions
{

link AdministratorException} when a problem occurs.

◆ parse() [3/3]

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parse ( String s)
inline

Parses a JSON request if supported.

Exceptions
aRuntimeException if not handled

Implements eu.baltrad.beast.admin.JsonCommandParser.

◆ parseAdaptorCommand()

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parseAdaptorCommand ( String operation,
JsonNode node )
inline

Manages an adaptor, either ADD, UPDATE or REMOVE.

Parameters
operationthe operation
nodethe json node containing an adaptor definition
Exceptions
{

link AdministratorException} when a problem occurs.

◆ parseAnomalyDetectorCommand()

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parseAnomalyDetectorCommand ( String operation,
JsonNode node )
inline

Manages an anomaly detector.

Parameters
operationthe operation
nodethe anomaly detector
Returns
the command
Exceptions
{

link AdministratorException} when a problem occurs.

◆ parseCommand()

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parseCommand ( String command,
JsonNode arguments )
inline

Takes care of and maps the command to the appropriate method.

Parameters
commandthe command
argumentsthe arguments as a json node if any
Returns
the command

◆ parseHelpCommand()

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parseHelpCommand ( String operation,
JsonNode arguments )
inline

Provides the help command to get information about available commands.

Parameters
operationthe operation
argumentsthe arguments
Returns
the command

◆ parseRouteCommand()

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parseRouteCommand ( String operation,
JsonNode node )
inline

Manages an anomaly detector.

Parameters
operationthe operation
nodethe anomaly detector
Returns
the command
Exceptions
{

link AdministratorException} when a problem occurs.

◆ parseScheduleCommand()

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parseScheduleCommand ( String operation,
JsonNode node )
inline

Parses a schedule command.

Parameters
operationthe operation
nodethe node
Returns
the parsed scheduled command
Exceptions
{

link AdministratorException} when a problem occurs.

◆ parseSettingCommand()

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parseSettingCommand ( String operation,
JsonNode arguments )
inline

Parses a setting command.

Parameters
operationthe operation
nodethe arguments
Returns
the parsed user command
Exceptions
{

link AdministratorException} when a problem occurs.

◆ parseUserCommand()

Command eu.baltrad.beast.admin.JsonCommandParserImpl.parseUserCommand ( String operation,
JsonNode arguments )
inline

Parses a user manipulation command.

Parameters
operationthe operation
nodethe arguments
Returns
the parsed user command
Exceptions
{

link AdministratorException} when a problem occurs.

◆ setRouteCommandHelper()

void eu.baltrad.beast.admin.JsonCommandParserImpl.setRouteCommandHelper ( RouteCommandHelper helper)
inline

The route command helper.

Parameters
helper

The documentation for this class was generated from the following file: