org.symcomp.scscp
Class Computation

java.lang.Object
  extended by org.symcomp.scscp.Computation

public class Computation
extends java.lang.Object

A Computation is a container that holds the request, the state and some meta-data of a computation.

It is internally used in SCSCPClient. There is no need to manually deal with these objects.


Field Summary
protected  CookieStore cookies
           
protected  java.util.Date finishedAt
           
protected  java.lang.Integer lock
           
protected  ProcedureCall procedureCall
           
protected  ProcedureDone procedureDone
           
protected  java.util.Date receivedAt
           
protected  OpenMathBase request
           
protected  OpenMathBase.ENCODINGS requestEncoding
           
protected  OpenMathBase result
           
protected  java.util.Date startedAt
           
protected  java.lang.Integer state
           
protected  CASClient system
           
protected  java.lang.String token
           
 
Constructor Summary
Computation()
           
Computation(CASClient system, java.lang.String token, OpenMathBase command)
           
 
Method Summary
 void computing()
           
 void error(OpenMathBase result)
           
 void error(java.lang.String result)
           
 void finished(OpenMathBase result)
           
 void finished(java.lang.String result)
           
 java.util.Date getFinishedAt()
           
 ProcedureCall getProcedureCall()
          Get the computation as (OpenMath encoded) procedure call
 ProcedureDone getProcedureDone()
          Get the result as (OpenMath encoded) ProcedureDone
 java.util.Date getReceivedAt()
           
 OpenMathBase getRequest()
           
 OpenMathBase.ENCODINGS getRequestEncoding()
           
 OpenMathBase getResult()
           
 void getReturn()
          Request the return type of the Procedure call
 java.util.Date getStartedAt()
           
 java.lang.Integer getState()
           
 CASClient getSystem()
           
 java.lang.String getToken()
           
 void hasReturn(ProcedureCall.OPTION_RETURN which)
          Check whether the Procedure call has a particular return type
 boolean isReady()
           
 void receivedMessage(OpenMathBase b0)
          Calls setProcedureCall(ProcedureCall p) or setProcedureDone(ProcedureDone p), depending on the type of message b is.
 void receivedMessage(OpenMathBase b0, OpenMathBase.ENCODINGS enc)
          Calls setProcedureCall(ProcedureCall p) or setProcedureDone(ProcedureDone p), depending on the type of message b is.
 void receivedMessage(java.lang.String m)
          Calls setProcedureCall(ProcedureCall p) or setProcedureDone(ProcedureDone p), depending on the type of message b is.
 void setCookieStore(CookieStore c)
           
 void setFinishedAt(java.util.Date finishedAt)
           
 void setProcedureCall(ProcedureCall p)
           
 void setProcedureDone(ProcedureDone p)
           
 void setReceivedAt(java.util.Date receivedAt)
           
 void setRequest(OpenMathBase request)
           
 void setResult(OpenMathBase result)
           
 void setResult(java.lang.String result)
           
 void setReturn(ProcedureCall.OPTION_RETURN which)
          Set the return type of the Procedure call: cookie, option or nothing
 void setStartedAt(java.util.Date startedAt)
           
 void setState(java.lang.Integer state)
           
 void setSystem(CASClient s)
           
 void setToken(java.lang.String token)
           
 void waitForResult()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

procedureCall

protected ProcedureCall procedureCall

procedureDone

protected ProcedureDone procedureDone

result

protected OpenMathBase result

request

protected OpenMathBase request

cookies

protected CookieStore cookies

token

protected java.lang.String token

receivedAt

protected java.util.Date receivedAt

startedAt

protected java.util.Date startedAt

finishedAt

protected java.util.Date finishedAt

requestEncoding

protected OpenMathBase.ENCODINGS requestEncoding

state

protected java.lang.Integer state

system

protected CASClient system

lock

protected final java.lang.Integer lock
Constructor Detail

Computation

public Computation()

Computation

public Computation(CASClient system,
                   java.lang.String token,
                   OpenMathBase command)
Method Detail

setCookieStore

public void setCookieStore(CookieStore c)

setSystem

public void setSystem(CASClient s)

computing

public void computing()

finished

public void finished(OpenMathBase result)

finished

public void finished(java.lang.String result)

error

public void error(OpenMathBase result)

error

public void error(java.lang.String result)

waitForResult

public void waitForResult()

isReady

public boolean isReady()

getToken

public java.lang.String getToken()

setToken

public void setToken(java.lang.String token)

getReceivedAt

public java.util.Date getReceivedAt()

setReceivedAt

public void setReceivedAt(java.util.Date receivedAt)

getStartedAt

public java.util.Date getStartedAt()

setStartedAt

public void setStartedAt(java.util.Date startedAt)

getFinishedAt

public java.util.Date getFinishedAt()

setFinishedAt

public void setFinishedAt(java.util.Date finishedAt)

getState

public java.lang.Integer getState()

setState

public void setState(java.lang.Integer state)

getRequestEncoding

public OpenMathBase.ENCODINGS getRequestEncoding()

getSystem

public CASClient getSystem()

setReturn

public void setReturn(ProcedureCall.OPTION_RETURN which)
Set the return type of the Procedure call: cookie, option or nothing


getReturn

public void getReturn()
Request the return type of the Procedure call


hasReturn

public void hasReturn(ProcedureCall.OPTION_RETURN which)
Check whether the Procedure call has a particular return type


getProcedureCall

public ProcedureCall getProcedureCall()
Get the computation as (OpenMath encoded) procedure call

Returns:
the message

getProcedureDone

public ProcedureDone getProcedureDone()
                               throws OpenMathException
Get the result as (OpenMath encoded) ProcedureDone

Returns:
the result message
Throws:
OpenMathException - if something went wrong

getResult

public OpenMathBase getResult()

setResult

public void setResult(java.lang.String result)

setResult

public void setResult(OpenMathBase result)

getRequest

public OpenMathBase getRequest()

setRequest

public void setRequest(OpenMathBase request)

setProcedureCall

public void setProcedureCall(ProcedureCall p)

setProcedureDone

public void setProcedureDone(ProcedureDone p)

receivedMessage

public void receivedMessage(OpenMathBase b0,
                            OpenMathBase.ENCODINGS enc)
                     throws OpenMathException
Calls setProcedureCall(ProcedureCall p) or setProcedureDone(ProcedureDone p), depending on the type of message b is.

Parameters:
b0 - the message, enc the encoding the message was in (or null)
Throws:
OpenMathException - if the message has the wrong format

receivedMessage

public void receivedMessage(OpenMathBase b0)
                     throws OpenMathException
Calls setProcedureCall(ProcedureCall p) or setProcedureDone(ProcedureDone p), depending on the type of message b is.

Parameters:
b0 - the message
Throws:
OpenMathException - if the message has the wrong format

receivedMessage

public void receivedMessage(java.lang.String m)
                     throws OpenMathException
Calls setProcedureCall(ProcedureCall p) or setProcedureDone(ProcedureDone p), depending on the type of message b is.

Parameters:
b0 - the message as a string
Throws:
OpenMathException - if the message has the wrong format


Copyright © 2010. All Rights Reserved.