4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface Class Reference

Interface for call of SEC API as external program (deamon) More...

Collaboration diagram for cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface:
Collaboration graph

Public Member Functions

synchronized boolean init ()
 
synchronized String makeRequest (String s) throws Exception
 
void close ()
 

Static Public Member Functions

static boolean isSecCommandEmpty ()
 

Static Public Attributes

static final String SEC_API_COMMAND = "/var/sec/SEC_API/sec_api.py"
 
static final String SEC_API_PATH = "/var/sec/SEC_API/"
 
static final String SEC_API_SETTING_NAME = "secCommand"
 
static final String SEC_API_PATH_SETTING_NAME = "secPath"
 

Package Attributes

OutputStream stdin = null
 
InputStream stderr = null
 
InputStream stdout = null
 
ProcessBuilder processBuilder
 
Process processVar
 
BufferedWriter brStdIn
 
BufferedReader brStdOut
 
BufferedReader brStdErrOut
 
boolean wasInitialized = false
 

Detailed Description

Interface for call of SEC API as external program (deamon)

Interface for call of SEC API as external program (deamon)

Note: If SEC API is started locally it will also provide interface on some port (8082 on default installation but if it is used, 8084 is recommended). So there is no need to start other instance if we need to provide SEC API network interface to others. SEC API can also provide services not only to local Annotation Server but also to other annotation servers which has acces to appropriate port.

Author
Marek Kopecky

Definition at line 43 of file SECAPIInterface.java.

Member Function Documentation

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.close ( )

Destroy process and close streams

Definition at line 237 of file SECAPIInterface.java.

synchronized boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.init ( )

Initialize process

Returns
true - process was created, false - process was not created

Definition at line 115 of file SECAPIInterface.java.

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.isSecCommandEmpty ( )
static

Returns if SEC API command is empty in database.

Returns
If SEC API command is empty in database, returns true, false otherwise.

Definition at line 164 of file SECAPIInterface.java.

Here is the caller graph for this function:

synchronized String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.makeRequest ( String  s) throws Exception

Send message to process and return response.

Parameters
sMessage
Returns
Response
Exceptions
Exception,whenproces was terminated

Definition at line 185 of file SECAPIInterface.java.

Member Data Documentation

BufferedReader cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.brStdErrOut
package

Buffered reader for stderr

Definition at line 103 of file SECAPIInterface.java.

BufferedWriter cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.brStdIn
package

Buffered writer for stdin

Definition at line 93 of file SECAPIInterface.java.

BufferedReader cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.brStdOut
package

Buffered reader for stdout

Definition at line 98 of file SECAPIInterface.java.

ProcessBuilder cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.processBuilder
package

Process builder information

Definition at line 83 of file SECAPIInterface.java.

Process cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.processVar
package

Process information

Definition at line 88 of file SECAPIInterface.java.

final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.SEC_API_COMMAND = "/var/sec/SEC_API/sec_api.py"
static

Default command for external program

Definition at line 48 of file SECAPIInterface.java.

final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.SEC_API_PATH = "/var/sec/SEC_API/"
static

Default path for external program

Definition at line 53 of file SECAPIInterface.java.

final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.SEC_API_PATH_SETTING_NAME = "secPath"
static

Name of setting of command for external program

Definition at line 63 of file SECAPIInterface.java.

final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.SEC_API_SETTING_NAME = "secCommand"
static

Name of setting of command for external program

Definition at line 58 of file SECAPIInterface.java.

InputStream cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.stderr = null
package

Standard error output of external program

Definition at line 73 of file SECAPIInterface.java.

OutputStream cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.stdin = null
package

Standard input of external program

Definition at line 68 of file SECAPIInterface.java.

InputStream cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.stdout = null
package

Standard output of external program

Definition at line 78 of file SECAPIInterface.java.

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SECAPIInterface.wasInitialized = false
package

true - proces was initialized, false proces was not initialized

Definition at line 108 of file SECAPIInterface.java.


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