C - The base class for all commands sent and received by this
implementationE - The base class for all events sent and received by this
implementationT - The base class for all telemetry sent and received by this
implementationpublic class SALImplementation<C extends SALCommand,E extends SALEvent,T extends SALTelemetry> extends Object implements SAL<C,E,T>
<type> <imple-SAL class name> <SAL class name> [<argument list>]
| Modifier | Constructor and Description |
|---|---|
|
SALImplementation(BufferedReader salFile)
Create a GenericSAL object by reading a .sal file.
|
protected |
SALImplementation(Class c,
String resource)
Convenience method for reading configuration from a resource
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
SALReceivedCommand<C> |
getNextCommand(Duration timeout)
Fetch the next command, or timeout if specified duration is exceeded.
|
E |
getNextEvent(Duration timeout) |
T |
getTelemetry(Duration timeout) |
SALCommandResponse |
issueCommand(C command)
Issue a command,
|
void |
logEvent(E event)
Sends an event
|
void |
sendTelemetry(T telem) |
protected SALImplementation(Class c, String resource)
c - The class to use to access the resourceresource - The name of the resourcepublic SALImplementation(BufferedReader salFile) throws IOException
salFile - A reader from which the file will be read.IOException - If an IO or syntax error occurs.public SALReceivedCommand<C> getNextCommand(Duration timeout) throws SALException
SALgetNextCommand in interface SAL<C extends SALCommand,E extends SALEvent,T extends SALTelemetry>timeout - The maximum time to wait before timing outnull if the wait
times-out.SALException - If a communication or similar
error occurspublic SALCommandResponse issueCommand(C command) throws SALException
SALissueCommand in interface SAL<C extends SALCommand,E extends SALEvent,T extends SALTelemetry>command - The command to issue.SALException - If a communication or similar error occurspublic void logEvent(E event) throws SALException
SALlogEvent in interface SAL<C extends SALCommand,E extends SALEvent,T extends SALTelemetry>event - The event to sendSALException - If a communication or similar error occurspublic E getNextEvent(Duration timeout) throws SALException
getNextEvent in interface SAL<C extends SALCommand,E extends SALEvent,T extends SALTelemetry>SALExceptionpublic void sendTelemetry(T telem) throws SALException
sendTelemetry in interface SAL<C extends SALCommand,E extends SALEvent,T extends SALTelemetry>SALExceptionpublic T getTelemetry(Duration timeout) throws SALException
getTelemetry in interface SAL<C extends SALCommand,E extends SALEvent,T extends SALTelemetry>SALExceptionpublic void close()
throws SALException
close in interface AutoCloseableclose in interface SAL<C extends SALCommand,E extends SALEvent,T extends SALTelemetry>SALExceptionCopyright © 2018. All rights reserved.