com.uppaal.engine
Class KeyValueProtocol

java.lang.Object
  extended by com.uppaal.engine.KeyValueProtocol
All Implemented Interfaces:
Protocol

public class KeyValueProtocol
extends Object
implements Protocol


Nested Class Summary
protected static class KeyValueProtocol.Service
           
 
Constructor Summary
KeyValueProtocol(InputStream in, OutputStream out)
           
 
Method Summary
 void close()
          Disconnect from the server.
protected  String escape(String str)
           
 SystemState getInitial(UppaalSystem system)
          Returns the initial state for the system.
 String getOptionsInfo()
          Returns information about available options.
 ArrayList<Transition> getTransitions(UppaalSystem system, SystemState state)
          Returns the list of outgoing transitions for the state.
 String getVersion()
          Returns the version string of the server.
protected  String localiseString(String str)
           
protected  SystemEdge[] parseEdges(Properties data, UppaalSystem system, String edges)
           
protected  SystemLocation[] parseLocationVector(String property, UppaalSystem system)
           
protected  SystemState parseState(Properties data, UppaalSystem system, String locations, String variables, String zone)
           
protected  int[] parseVariableVector(String property, UppaalSystem system)
           
protected  Polyhedron parseZone(String property, UppaalSystem system)
           
 char query(UppaalSystem system, String query, QueryFeedback f)
          Verify a query on an instantiated UPPAAL model.
 char query(UppaalSystem system, SystemState state, String query, QueryFeedback f)
          Verify a query on an instantiated UPPAAL model with custom initial state.
protected  List<String> readLines()
           
protected  String recvBlock(KeyValueProtocol.Service serviceName, boolean allow_progress)
           
protected  List<String> recvLines(KeyValueProtocol.Service serviceName, boolean allow_progress)
           
protected  List<Properties> recvProperties(KeyValueProtocol.Service serviceName)
           
protected  List<Properties> recvProperties(KeyValueProtocol.Service serviceName, boolean allow_progress)
           
protected  String recvString(KeyValueProtocol.Service serviceName)
           
protected  void sendMessage(KeyValueProtocol.Service service)
           
protected  void sendMessage(KeyValueProtocol.Service service, String data)
           
protected  void sendMessage(KeyValueProtocol.Service service, SystemState state)
           
protected  void sendMessage(KeyValueProtocol.Service service, SystemState state, String query)
           
 void setOptions(String options)
          Sets server options used for verification.
protected  void setProgress(QueryFeedback f, Properties data)
           
protected  void setSystemInfo(QueryFeedback f, Properties data)
           
 UppaalSystem upload(Document document)
          Upload the document to the server.
 UppaalSystem upload(Document document, ArrayList<Problem> problems)
          Upload the document to the server.
 LscProcess uploadLsc(Document document, ArrayList<Problem> problems)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyValueProtocol

public KeyValueProtocol(InputStream in,
                        OutputStream out)
Method Detail

close

public void close()
           throws IOException
Description copied from interface: Protocol
Disconnect from the server.

Specified by:
close in interface Protocol
Throws:
IOException

getInitial

public SystemState getInitial(UppaalSystem system)
                       throws EngineException,
                              IOException
Description copied from interface: Protocol
Returns the initial state for the system. The stub must be connected and the system must be the last one uploaded to the server.

Specified by:
getInitial in interface Protocol
Throws:
EngineException
IOException

parseLocationVector

protected SystemLocation[] parseLocationVector(String property,
                                               UppaalSystem system)

parseVariableVector

protected int[] parseVariableVector(String property,
                                    UppaalSystem system)

parseZone

protected Polyhedron parseZone(String property,
                               UppaalSystem system)

getOptionsInfo

public String getOptionsInfo()
                      throws EngineException,
                             IOException
Description copied from interface: Protocol
Returns information about available options. The information is returned as an XML document. The stub must be connected.

Specified by:
getOptionsInfo in interface Protocol
Throws:
EngineException
IOException

getTransitions

public ArrayList<Transition> getTransitions(UppaalSystem system,
                                            SystemState state)
                                     throws EngineException,
                                            IOException
Description copied from interface: Protocol
Returns the list of outgoing transitions for the state. The stub must be connected, the state must belong to the system, and the system must be the last one uploaded to the server.

Specified by:
getTransitions in interface Protocol
Throws:
EngineException
IOException

parseState

protected SystemState parseState(Properties data,
                                 UppaalSystem system,
                                 String locations,
                                 String variables,
                                 String zone)

parseEdges

protected SystemEdge[] parseEdges(Properties data,
                                  UppaalSystem system,
                                  String edges)

getVersion

public String getVersion()
                  throws IOException,
                         EngineException
Description copied from interface: Protocol
Returns the version string of the server. The stub must be connected.

Specified by:
getVersion in interface Protocol
Throws:
IOException
EngineException

query

public char query(UppaalSystem system,
                  String query,
                  QueryFeedback f)
           throws EngineException,
                  IOException
Description copied from interface: Protocol
Verify a query on an instantiated UPPAAL model. Returns 'T' if property is satisfied, 'F' if it is not satisfied, 'M' if it is maybe satisfied, and 'E' if an error occurred. Progress feedback and traces are provided via the feedback object. The stub must be connected and the system must be the last one uploaded to the server.

Specified by:
query in interface Protocol
Throws:
EngineException
IOException

query

public char query(UppaalSystem system,
                  SystemState state,
                  String query,
                  QueryFeedback f)
           throws EngineException,
                  IOException
Description copied from interface: Protocol
Verify a query on an instantiated UPPAAL model with custom initial state. Returns 'T' if property is satisfied, 'F' if it is not satisfied, 'M' if it is maybe satisfied, and 'E' if an error occurred. Progress feedback and traces are provided via the feedback object. The stub must be connected and the system must be the last one uploaded to the server.

Specified by:
query in interface Protocol
Throws:
EngineException
IOException

setProgress

protected void setProgress(QueryFeedback f,
                           Properties data)

setSystemInfo

protected void setSystemInfo(QueryFeedback f,
                             Properties data)

setOptions

public void setOptions(String options)
                throws EngineException,
                       IOException
Description copied from interface: Protocol
Sets server options used for verification. The stub must be connected. TODO: Document format.

Specified by:
setOptions in interface Protocol
Throws:
EngineException
IOException

upload

public UppaalSystem upload(Document document,
                           ArrayList<Problem> problems)
                    throws EngineException,
                           IOException
Description copied from interface: Protocol
Upload the document to the server. If no errors occurred, the instantiated system is returned. Otherwise, null is returned and error reports are stored in the problems vector. Even if no errors occurred, warnings may have been added to the problems vector. The stub must be connected.

Specified by:
upload in interface Protocol
Throws:
EngineException
IOException

upload

public UppaalSystem upload(Document document)
                    throws EngineException,
                           IOException
Description copied from interface: Protocol
Upload the document to the server. If no errors occurred, the instantiated system is returned. Otherwise, null is returned. The stub must be connected.

Specified by:
upload in interface Protocol
Throws:
EngineException
IOException

sendMessage

protected void sendMessage(KeyValueProtocol.Service service)
                    throws IOException
Throws:
IOException

sendMessage

protected void sendMessage(KeyValueProtocol.Service service,
                           String data)
                    throws IOException
Throws:
IOException

sendMessage

protected void sendMessage(KeyValueProtocol.Service service,
                           SystemState state)
                    throws IOException
Throws:
IOException

sendMessage

protected void sendMessage(KeyValueProtocol.Service service,
                           SystemState state,
                           String query)
                    throws IOException
Throws:
IOException

localiseString

protected String localiseString(String str)

recvProperties

protected List<Properties> recvProperties(KeyValueProtocol.Service serviceName)
                                   throws IOException,
                                          EngineException
Throws:
IOException
EngineException

recvProperties

protected List<Properties> recvProperties(KeyValueProtocol.Service serviceName,
                                          boolean allow_progress)
                                   throws IOException,
                                          EngineException
Throws:
IOException
EngineException

recvString

protected String recvString(KeyValueProtocol.Service serviceName)
                     throws IOException,
                            EngineException
Throws:
IOException
EngineException

recvBlock

protected String recvBlock(KeyValueProtocol.Service serviceName,
                           boolean allow_progress)
                    throws IOException,
                           EngineException
Throws:
IOException
EngineException

recvLines

protected List<String> recvLines(KeyValueProtocol.Service serviceName,
                                 boolean allow_progress)
                          throws IOException,
                                 EngineException
Throws:
IOException
EngineException

readLines

protected List<String> readLines()
                          throws IOException
Throws:
IOException

escape

protected String escape(String str)

uploadLsc

public LscProcess uploadLsc(Document document,
                            ArrayList<Problem> problems)
                     throws EngineException,
                            IOException
Specified by:
uploadLsc in interface Protocol
Throws:
EngineException
IOException


Copyright © 2012 Uppsala University and Aalborg University. All Rights Reserved.