VLJ Iteration II, v. 1.0.0.193

gov.va.med.foundations.rpc
Class RpcRequest

java.lang.Object
  |
  +--VistaLinkRequestVOImpl
        |
        +--gov.va.med.foundations.rpc.RpcRequest

public class RpcRequest
extends VistaLinkRequestVOImpl

Represents a RPC request to an M VistA server.

This is the principal class of VLJ used by developers to create and setup requests to the host M server.
J2SE Example

 

 // create the callback handler
 CallbackHandlerSwing cbhSwing = new CallbackHandlerSwing(myFrame);
 
 // create the LoginContext  
 loginContext = new LoginContext("Production", cbhSwing);
 
 // login to server
 loginContext.login(); 
 
 //Gets the principal that contains the VistaLinkConnection
 VistaKernelPrincipalImpl myPrincipal = VistaKernelPrincipalImpl.
 			getKernelPrincipal(loginContext.getSubject());
 
 //Get the VistaLinkConnection
 VistaLinkConnection myConnection = myPrincipal.getAuthenticatedConnection();
 
  //request  and response objects 
 RpcRequest vReq = null; 
 RpcResponse vResp = null;
 
 //The Rpc Context
 String rpcContext = "XOBV VISTALINK TESTER";
 
 //The Rpc to call
 String rpcName = "XOBV TEST PING";
 
 
  //Construct    the request object 
 vReq = RpcRequestFactory.getRpcRequest(rpcContext, rpcName);
 
 
 //Execute the Rpc and get the respnse
 vResp = myConnection.executeRPC(vReq);
 
 //Work with the response ...
 
 
 

Version:
1.0.0.193
Author:
Application Modernization - Foundations Team
See Also:
Serialized Form

Method Summary
 void clearParams()
          Method clearParams.
 gov.va.med.foundations.rpc.RpcRequestParams getParams()
          Method getParams.
 java.lang.String getRequestString()
          
Gets the request string that will be used to make the request
from M.
 int getRpcClientTimeOut()
          Method getRpcClientTimeOut.
 java.lang.String getRpcContext()
          Method getRpcContext.
 java.lang.String getRpcName()
          Method getRpcName.
 boolean isUseProprietaryMessageFormat()
          Deprecated. For internal testing only!
 boolean isXmlResponse()
          Deprecated. This method will be removed after the REMOTE PROCEDURE (#8894) file adds an XML return type.
 void setParams(java.util.List list)
          Method setParams.
 void setRpcClientTimeOut(int value)
          Method setRpcClientTimeOut.
 void setRpcContext(java.lang.String value)
          Method setRpcContext.
 void setRpcName(java.lang.String value)
          Method setRpcName.
 void setUseProprietaryMessageFormat(boolean useSink)
          Method setUseProprietaryMessageFormat.
 void setXmlResponse(boolean value)
          Deprecated. This method will be removed after the REMOTE PROCEDURE (#8894) file adds an XML return type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParams

public gov.va.med.foundations.rpc.RpcRequestParams getParams()
Method getParams.
Gets the reference to the RpcRequestParams object
associated with this request.
This object contains the parameters sent with the call to the RPC
during the getResponse() call. Use this object to set these
parameters before calling getResponse().

Returns:
RpcRequestParams

setParams

public void setParams(java.util.List list)
Method setParams.
Sets all the paramters for a RPC call at once using a List.

Parameters:
list -

clearParams

public void clearParams()
Method clearParams.
Clears the params associated with this instance of RpcRequest


getRpcName

public java.lang.String getRpcName()
Method getRpcName.
Gets the name of the RPC.

Returns:
String

setRpcName

public void setRpcName(java.lang.String value)
Method setRpcName.
Sets the name of the RPC to be called on the M server. The name must be a
valid RPC name as it appears in the REMOTE PROCEDURE (#8994)
file in M VistA.

Parameters:
value -

getRpcContext

public java.lang.String getRpcContext()
Method getRpcContext.
Gets the name of the RPC Context.

Returns:
String

setRpcContext

public void setRpcContext(java.lang.String value)
                   throws FoundationsException
Method setRpcContext.
Sets the name of the RPC Context to be used. The name must be
a valid B- type OPTION name as it appears in the OPTION (#19)
file in M VistA.

Parameters:
value -
Throws:
FoundationsException

getRpcClientTimeOut

public int getRpcClientTimeOut()
Method getRpcClientTimeOut.
Gets the current client time out value. (Value is returned in
the number of seconds).

Returns:
int

setRpcClientTimeOut

public void setRpcClientTimeOut(int value)
Method setRpcClientTimeOut.
Sets the client time out value. (Value is expected in seconds.)

Parameters:
value -

getRequestString

public java.lang.String getRequestString()
                                  throws FoundationsException

Gets the request string that will be used to make the request
from M. This method will return the propietary message format
if useProprietaryMessageFormat is true, otherwise it will
return a XML string.

FoundationsException
See Also:
gov.va.med.foundations.adapter.record.VistaLinkRequestVO#getRequestString()

isXmlResponse

public boolean isXmlResponse()
Deprecated. This method will be removed after the REMOTE PROCEDURE (#8894) file adds an XML return type.

Method isXmlResponse.
Indicates whether the returned value from the RPC call is expected in XML format or not.

Returns:
boolean

setXmlResponse

public void setXmlResponse(boolean value)
Deprecated. This method will be removed after the REMOTE PROCEDURE (#8894) file adds an XML return type.

Method setXmlResponse.
Sets the indicator that the returned value from the RPC call is expected in XML format or not.

Parameters:
value - Whether XML is the expected type of result to be returned.

isUseProprietaryMessageFormat

public boolean isUseProprietaryMessageFormat()
Deprecated. For internal testing only!

Method isUseProprietaryMessageFormat.
Indicates whether the RPC request should be sent to the M server in a proprietary format (true) or in XML format (false).

Returns:
boolean

setUseProprietaryMessageFormat

public void setUseProprietaryMessageFormat(boolean useSink)
Method setUseProprietaryMessageFormat.
Set the Indicator that the RPC request should be sent to the M server in a proprietary format (true) or in XML format (false).
Sets the useProprietaryMessageFormat.

Parameters:
useSink -

VLJ Iteration II, v. 1.0.0.193

VistaLink Iteration II, v. 1.0.0.193