Class OroServer
- All Implemented Interfaces:
IServiceProvider
OroServer
is the application entry point. It initializes and starts
the various services, connectors and background tasks, as set up in the
oro-server
configuration file.OroServer does mainly two things:
- It registers and connects a set of services (presumably related to robotic cognition) to a socket interface,
- It runs in the background several tasks related to robotic cognition.
Features
Most services are related to access and management of a cognitive storage
backend. The main storage backend is an ontology, as implemented in the
OpenRobotsOntology
class. This class exposes a set of RPC services
(and hence implement the IServiceProvider
interface).
However, other services can be registred (like stats()
that returns
statistics on the server itself).
Amongst the tasks that are run in background, we can list:
- The event manager (see
laas.openrobots.ontology.modules.events
) - The memory manager (see
MemoryManager
)
Getting access to the server
The communication with the server relies on standard TCP/IP sockets. The
ASCII protocole we use is documented here: SocketConnector
.
Configuration
OroServer
has a main
function which expect a configuration
file.
For the server, the following options are currently available:
- port = [port number over 4000]: the port on which the server should starts and listen.
OpenRobotsOntology(Properties)
for others
options, specific to the ontologies. Have a look at the config file itself
for more details.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean
static final String
The default configuration file (set to "etc/oro-server/oro.conf").static String
Defines the standard language used in particular for labels retrieval.
This field can be set up in the configuration file with thelanguage
option.
Expected values are ISO 2 characters language codes.static boolean
This set holds the types that should not be exposed to oro-server clients but are required by some RPC methods (for instance to retrieve the context when the query was received).static boolean
static final Date
static Properties
static VerboseLevel
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNewServiceProviders
(IServiceProvider provider) static String
Formats in a human-readable way the parameters of a method.static Properties
getConfiguration
(String configFileURI) Read a configuration file and return to corresponding "Properties" object.help()
static void
static int
void
void
reset()
void
void
serverInitialization
(Properties serverParameters) long
size()
stats()
Returns several statistics on the server.
-
Field Details
-
DEFAULT_CONF
The default configuration file (set to "etc/oro-server/oro.conf").- See Also:
-
DEFAULT_LANGUAGE
Defines the standard language used in particular for labels retrieval.
This field can be set up in the configuration file with thelanguage
option.
Expected values are ISO 2 characters language codes. -
HAS_A_TTY
public static boolean HAS_A_TTY -
VERBOSITY
-
DEMO_MODE
public static boolean DEMO_MODE -
ServerParameters
-
BLINGBLING
public static boolean BLINGBLING -
VERSION
- See Also:
-
SERVER_START_TIME
-
discardedTypeFromServiceArgs
This set holds the types that should not be exposed to oro-server clients but are required by some RPC methods (for instance to retrieve the context when the query was received). TODO: This is more like a workaround...
-
-
Constructor Details
-
OroServer
-
-
Method Details
-
addNewServiceProviders
-
pushRequest
-
runServer
-
serverInitialization
- Throws:
OntologyServerException
-
main
public static void main(String[] args) throws OntologyConnectorException, InterruptedException, OntologyServerException -
reset
@RPCMethod(category="administration", desc="Reload the base ontologies, discarding all inserted of removed statements, in every models") public void reset() throws OntologyServerException- Throws:
OntologyServerException
-
stats
@RPCMethod(category="administration", desc="returns some statistics on the server") public Map<String,String> stats()Returns several statistics on the server. Returned values:- the server version
- the hostname where the server runs
- server uptime
- the current amount of classes in the ontology
- the current amount of instances in the ontology
- the current amount of client connected to the server
- Returns:
- a map containing the statistics (pairs name/value)
-
size
public long size() -
help
@RPCMethod(desc="returns a human-friendly list of available methods with their signatures and short descriptions.") public String help() -
listMethods
-
listSimpleMethods
@RPCMethod(category="administration", desc="returns a raw list of available methods.") public Set<String> listSimpleMethods() -
makeHtmlDoc
@RPCMethod(category="administration", desc="returns a list of available methods in HTML format for inclusion in documentation.") public String makeHtmlDoc() -
formatParameters
Formats in a human-readable way the parameters of a method. This method skips all the parameters whose type belongs todiscardedTypeFromServiceArgs
- Parameters:
m
- The method- Returns:
- the in-parenthesis list of the method's parameters
-
nbExposedParameters
-
getConfiguration
Read a configuration file and return to corresponding "Properties" object. The configuration file contains the path to the ontology to be loaded and several options regarding the server configuration.- Parameters:
configFileURI
- The path and filename of the configuration file.- Returns:
- A Java.util.Properties instance containing the application configuration.
-