public class MethodInfo
extends java.lang.Object
MethodFactory
.createMethodCall
that can construct most method call
descriptions automatically. It will format this object correctly with the appropriate values,
based on the parameter values that are passed in. Care must be taken however, because the
passwords must already be saved for the server and service to be invoked.
If it is a utility Linker
service, for example, a password might not be saved directly,
where the parent password is required instead.
Manual construction is therefore also possible and may be safer, as you will automatically enter a value for each required field. Something like the following:
methodInfo = new MethodInfo(theService);
methodInfo.setName(methodName);
methodInfo.setServerURL(serverUrl);
methodInfo.setServiceURI(serviceUri);
methodInfo.setRtnType(rtnType);
methodInfo.setServerPassword(serverPassword);
methodInfo.setPassword(servicePassword);
methodInfo.addParam(param1);
methodInfo.addParam(param2);
reply = callObject.call(methodInfo);
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<ParamInfo> |
params
Parameters.
|
Constructor and Description |
---|
MethodInfo()
Creates a new instance of MethodInfo and sets the
clientUri to the server address
if one is running or null if one is not running. |
MethodInfo(Service thisService)
Creates a new instance of MethodInfo and sets the
clientUri to the local service path. |
Modifier and Type | Method and Description |
---|---|
void |
addParam(java.lang.Object theParam)
Add a method parameter.
|
protected void |
checkServerURL()
Check the server url format.
|
void |
clearParams()
Clear the list of method parameters.
|
java.lang.Object |
clone()
Return a clone of this MethodInfo object.
|
void |
copyValues(MethodInfo copyInfo)
Copy the values from the method info passed in to this object.
|
int |
getCallTimeout()
Get the maximum allowed amount of time for a synchronous call.
|
java.lang.String |
getCallType()
Get the value indicating the type of remote call.
|
org.licas_xml.abs.Element |
getClientURI()
Get the full uri path to the client service.
|
java.lang.String |
getCommunicationID()
Get the communication id.
|
boolean |
getIsRemote()
Get the value indicating if a remote service method call.
|
java.lang.String |
getName()
Get the method name.
|
int |
getPacketSize()
Get the packet size.
|
ParamInfo |
getParameter(java.lang.String paramName)
Get the parameter with the specified name, case ignored.
|
java.util.ArrayList<ParamInfo> |
getParams()
Get the method parameters.
|
java.util.ArrayList<java.lang.Object> |
getParamValues()
Convert the method parameters into a vector of parameter objects.
|
java.lang.String |
getPassword()
Get the service password.
|
org.licas_xml.abs.Element |
getRestOfServiceURI()
Get the full uri path for the rest of the service call.
|
java.lang.String |
getRtnType()
Get the return type, can also be for intermediary service calls..
|
java.lang.String |
getServerPassword()
Get the server password.
|
java.lang.String |
getServerURL()
Get the http address of the server.
|
java.lang.String |
getServiceRtnType()
Get the service return type, for the service method call only.
|
java.lang.Object |
getServiceURI()
Get the full current call uri path.
|
boolean |
isVoid()
Return true if the method does not return a value.
|
java.util.ArrayList<java.lang.String> |
objParameterTypes()
Get the method parameter types as an ordered a list.
|
void |
setCallTimeout(int theCallTimeout)
Set the maximum allowed amount of time for a synchronous call.
|
void |
setCallType(java.lang.String thisCallType)
Set the value indicating the type of remote call.
|
void |
setClientURI(org.licas_xml.abs.Element theClientUri)
Set the uri for the client service.
|
void |
setCommunicationID(java.lang.String theCommunicationID)
Set the communication id.
|
void |
setIfRemote()
Determine if a remote method call.
|
void |
setName(java.lang.String theName)
Set the method name.
|
void |
setPacketSize(int thePacketSize)
Set the packet size to the value passed in.
|
void |
setPassword(java.lang.String thePassword)
Set the service password.
|
void |
setRestOfServiceURI(org.licas_xml.abs.Element theServiceUri)
Set the uri for the rest of the service call path.
|
void |
setRtnType(java.lang.String theRtnType)
Set the return type, can also be for intermediary service calls.
|
void |
setServerPassword(java.lang.String theServerPassword)
Set the server password.
|
protected void |
setServerURL(org.licas_xml.abs.Element theServerUri)
Set the url for the server from the full uri address.
|
void |
setServiceObj(java.lang.Object theServiceObj)
Set a direct reference to a service object.
|
void |
setServiceRtnType(java.lang.String theRtnType)
Set the service return type, for the service method call only.
|
void |
setServiceURI(java.lang.Object theServiceUri)
Set the uri for the current call path.
|
java.lang.String |
toString()
Convert the method info to a String.
|
void |
updateServiceURIs()
Update the service uris to have the correct values.
|
protected java.util.ArrayList<ParamInfo> params
public MethodInfo() throws java.lang.Exception
clientUri
to the server address
if one is running or null
if one is not running.java.lang.Exception
- any error.public MethodInfo(Service thisService) throws java.lang.Exception
clientUri
to the local service path.thisService
- the service making the call.java.lang.Exception
- any error.public boolean isVoid()
public void setIfRemote()
public void updateServiceURIs()
public void setPacketSize(int thePacketSize)
thePacketSize
- the packet size, or maximum number of characters in a
message transaction.public int getPacketSize()
public void setCallTimeout(int theCallTimeout)
theCallTimeout
- the maximum allowed amount of time for a synchronous call.public int getCallTimeout()
public boolean getIsRemote()
public void setCallType(java.lang.String thisCallType)
thisCallType
- the type of remote call.public java.lang.String getCallType()
public void setName(java.lang.String theName)
theName
- the method name. Can also include service names.public java.lang.String getName()
public void setRtnType(java.lang.String theRtnType)
theRtnType
- the fully qualified class name of the return type.public java.lang.String getRtnType()
public void setServiceRtnType(java.lang.String theRtnType)
theRtnType
- the fully qualified class name of the return type.public java.lang.String getServiceRtnType()
public void setServerPassword(java.lang.String theServerPassword)
theServerPassword
- the password to allow access to the server to call.public java.lang.String getServerPassword()
public void setPassword(java.lang.String thePassword)
thePassword
- the password to allow access to the service to call.public java.lang.String getPassword()
public void setCommunicationID(java.lang.String theCommunicationID)
theCommunicationID
- a unique id to identify the communication.public java.lang.String getCommunicationID()
public void clearParams()
public void addParam(java.lang.Object theParam)
theParam
- the parameter to add. If it is not of type ParamInfo, then
it will be wrapped inside of a ParamInfo object.public ParamInfo getParameter(java.lang.String paramName)
paramName
- the name of the parameter.public java.util.ArrayList<ParamInfo> getParams()
public java.util.ArrayList<java.lang.Object> getParamValues()
public void setClientURI(org.licas_xml.abs.Element theClientUri)
theClientUri
- the full uri path to the client service.public org.licas_xml.abs.Element getClientURI()
protected void setServerURL(org.licas_xml.abs.Element theServerUri)
theServerUri
- the full uri path to the server to call.public java.lang.String getServerURL()
protected void checkServerURL()
public void setServiceURI(java.lang.Object theServiceUri) throws java.lang.Exception
theServiceUri
- the full uri path for the current call.java.lang.Exception
- any error.public void setServiceObj(java.lang.Object theServiceObj) throws java.lang.Exception
setServiceURI
as the service setting is now the object itself, but its use is for a direct reference.theServiceObj
- the service object to execute on.java.lang.Exception
- any error.public java.lang.Object getServiceURI()
public void setRestOfServiceURI(org.licas_xml.abs.Element theServiceUri)
theServiceUri
- the full uri path for the rest of the service call.public org.licas_xml.abs.Element getRestOfServiceURI()
public java.util.ArrayList<java.lang.String> objParameterTypes()
null
, it is replaced with Object.class
.public void copyValues(MethodInfo copyInfo)
copyInfo
- the info object to copy.public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object