org.symcomp.scscp
Class ProcedureCall

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

public class ProcedureCall
extends java.lang.Object

A class to encapsulate an SCSCP Procedure Call, used by both servers and clients.


Nested Class Summary
static class ProcedureCall.OPTION_RETURN
           
 
Field Summary
protected  OpenMathBase[] arguments
           
protected  CookieStore cookies
           
protected  java.util.Map<java.lang.String,OpenMathBase[]> options
           
protected  org.symcomp.openmath.OMSymbol serviceName
           
 
Constructor Summary
ProcedureCall(CookieStore cookies, OpenMathBase msgin)
          Constructor, intended to be used by servers.
ProcedureCall(java.lang.String callID, org.symcomp.openmath.OMSymbol serviceName, OpenMathBase[] arguments)
          Constructor, intended to be used by clients.
ProcedureCall(java.lang.String callID, OpenMathBase argument)
          Constructor, intended to be used by clients.
 
Method Summary
 void ensureReturnOption(ProcedureCall.OPTION_RETURN deflt)
           
 OpenMathBase getArgument(int i)
          Get an argument of the procedure call
 OpenMathBase[] getCallID()
           
 java.lang.String getCallIDStr()
           
 CookieStore getCookieStore()
           
 org.symcomp.openmath.OMObject getOMObject()
          Convert to OpenMath Object
 OpenMathBase[] getOption(org.symcomp.openmath.OMSymbol k)
           
 OpenMathBase getPayload()
          Get the payload of the procedure call
 ProcedureCall.OPTION_RETURN getReturn()
           
 org.symcomp.openmath.OMSymbol getServiceName()
           
 boolean hasReturn(ProcedureCall.OPTION_RETURN which)
           
 void removeOption(org.symcomp.openmath.OMSymbol k)
           
 void setCookieStore(CookieStore s)
           
 void setOption(org.symcomp.openmath.OMSymbol k, OpenMathBase v)
           
 void setReturn(ProcedureCall.OPTION_RETURN which)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cookies

protected CookieStore cookies

options

protected java.util.Map<java.lang.String,OpenMathBase[]> options

serviceName

protected org.symcomp.openmath.OMSymbol serviceName

arguments

protected OpenMathBase[] arguments
Constructor Detail

ProcedureCall

public ProcedureCall(java.lang.String callID,
                     org.symcomp.openmath.OMSymbol serviceName,
                     OpenMathBase[] arguments)
Constructor, intended to be used by clients.

Parameters:
callID - a String with the callID
serviceName - an OMSymbol carrying the name of the service to be queried
arguments - a list of OpenMath encoded arguments.

ProcedureCall

public ProcedureCall(java.lang.String callID,
                     OpenMathBase argument)
              throws OpenMathException
Constructor, intended to be used by clients.

Parameters:
callID - a String with the callID
argument - an OpenMath encoded object representing the call. This argument may either be an OMObject whose first argument is an OMApply a, or an OMApply a. The head symbol of a will be the serviceName of the resulting procedure call, and the arguments of a will be the arguments of the call.
Throws:
OpenMathException

ProcedureCall

public ProcedureCall(CookieStore cookies,
                     OpenMathBase msgin)
              throws OpenMathException
Constructor, intended to be used by servers.

Parameters:
cookies - the cookie store that is being passed around by the SCSCP server
msgin - an OpenMath encoded message containing the procedure call.
Throws:
OpenMathException
Method Detail

setOption

public void setOption(org.symcomp.openmath.OMSymbol k,
                      OpenMathBase v)

getOption

public OpenMathBase[] getOption(org.symcomp.openmath.OMSymbol k)

removeOption

public void removeOption(org.symcomp.openmath.OMSymbol k)

getCallID

public OpenMathBase[] getCallID()

getCallIDStr

public java.lang.String getCallIDStr()

getServiceName

public org.symcomp.openmath.OMSymbol getServiceName()

getCookieStore

public CookieStore getCookieStore()

setCookieStore

public void setCookieStore(CookieStore s)

setReturn

public void setReturn(ProcedureCall.OPTION_RETURN which)

hasReturn

public boolean hasReturn(ProcedureCall.OPTION_RETURN which)

getReturn

public ProcedureCall.OPTION_RETURN getReturn()

ensureReturnOption

public void ensureReturnOption(ProcedureCall.OPTION_RETURN deflt)

getArgument

public OpenMathBase getArgument(int i)
Get an argument of the procedure call

Parameters:
i - the index of the argument, 0 <=i < n
Returns:
the argument as OpenMathBase object

getOMObject

public org.symcomp.openmath.OMObject getOMObject()
Convert to OpenMath Object

Returns:
the procedure call as OMObject

getPayload

public OpenMathBase getPayload()
Get the payload of the procedure call

Returns:
the call as OMApply a, so that the head of a is the serviceName and the arguments of a are the arguments of the procedure call.


Copyright © 2010. All Rights Reserved.