|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.maplesoft.client.MapleStatement
Creates an object that can execute a Maple Statement at the MapleNet server.
In order to interact with the MapleNet server a MapleStatement object is created,
and both Host (i.e. hostname and port) and User (i.e. username and password)
information is supplied.
The execute method will pass
Maple commands to the server and return a response.
The connection exists only during the execute method and is then closed.
Note: Each request passed to execute() must be self-contained and complete as each
request is independent. No state information in Maple is maintained between call.
| Constructor Summary | |
MapleStatement()
Create a default MapleStatement and set up a default connection (localhost) and an empty user. |
|
MapleStatement(HostInfo hostinfo,
UserInfo userinfo)
Creates a MapleStatement for a given HostInfo and UserInfo. |
|
MapleStatement(java.lang.String sHost,
int iPort,
java.lang.String sUser,
java.lang.String sPassword)
Create a MapleStatement for a specific host, port, user and password. |
|
| Method Summary | |
java.lang.Object[] |
doMaple(java.lang.String[] saRequest)
Sends maple commands to the server and returns an object, text or plot, associated with each command. |
java.lang.String |
execute(java.lang.String sRequest)
Pass the command contained in the string to the Maple Server. |
java.lang.String[] |
execute(java.lang.String[] saRequest)
Pass the sequence of commands contained in the string array to the Maple Server. |
HostInfo |
getHost()
Returns the HostInfo object for this MapleStatement |
void |
getLock()
Obtain a session lock from the MapleNet server. |
java.lang.String |
getResponse()
Returns the Server response to the last execute() invocation. |
java.lang.String[] |
getResponseArray()
Returns the Server response to the last execute() invocation. |
UserInfo |
getUser()
Return the UserInfo object that is associated with this MapleStatement |
java.lang.String |
getXMLString()
Returns the complete XML form of the response from the server |
java.lang.String[] |
getXMLStringArray()
Returns the complete XML form of the response from the server |
void |
releaseLock()
Release the session lock held by this MapleStatement object. |
void |
setHost(HostInfo newHostinfo)
Sets new host connection information for this MapleStatement |
void |
setHost(java.lang.String sHost,
int iPort)
Change the host information for this statement. |
void |
setUser(java.lang.String user,
java.lang.String pswd)
Change the user information for this MapleStatement. |
void |
setUser(UserInfo newUserinfo)
Change the user information for this MapleStatement |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MapleStatement()
setHost and setUser to
establish connection information prior to executing any
requests from the server.
public MapleStatement(HostInfo hostinfo,
UserInfo userinfo)
HostInfo,
UserInfo
public MapleStatement(java.lang.String sHost,
int iPort,
java.lang.String sUser,
java.lang.String sPassword)
sHost - name of server (eg: abc.com)iPort - port to connect to on serversUser - user as registered on serversPassword - password for user| Method Detail |
public void setHost(java.lang.String sHost,
int iPort)
sHost - Name of host machine eq abc.comiPort - Port number to connect onpublic void setHost(HostInfo newHostinfo)
newHostinfo - A HostInfo objectpublic HostInfo getHost()
HostInfo objectsetHost( HostInfo )
public void setUser(java.lang.String user,
java.lang.String pswd)
sUser - username to use when connecting to serversPassword - password for userpublic void setUser(UserInfo newUserinfo)
newUserinfo - a UserInfo objectpublic UserInfo getUser()
UserInfo objectsetUser( UserInfo ),
setUser( String, String )
public void getLock()
throws MapleException,
MapleStatementException
releaseLock( )
public void releaseLock()
throws MapleException,
MapleStatementException
getLock( )
public java.lang.String execute(java.lang.String sRequest)
throws MapleException,
MapleStatementException
Note: Valid Host and User information needs to be set before
calling this method, either through the constructor
MapleStatement or through the
setHost and setUser methods.
sRequest - - a Maple command using Maple syntax.getResponse method.MapleException - if it cannot connect to server, if the user is invalid
or if the host is unknown.MapleStatementException - if it cannot the request cannot be processed
by the server
public java.lang.String[] execute(java.lang.String[] saRequest)
throws MapleException,
MapleStatementException
Note: Valid Host and User information needs to be set before
calling this method, either through the constructor
MapleStatement or through the
setHost and setUser methods.
saRequest - - a string array of Maple commands, using Maple syntax.getResponseArray method.MapleException - if it cannot connect to server, if the user is invalid
or if the host is unknown.MapleStatementException - if it cannot the request cannot be processed
by the server
public java.lang.Object[] doMaple(java.lang.String[] saRequest)
throws MapleException,
MapleStatementException
saRequest - - an array of Maple commandsMapleException - MapleStatementException - public java.lang.String getResponse()
execute() method returned.public java.lang.String[] getResponseArray()
execute() method returned.public java.lang.String getXMLString()
public java.lang.String[] getXMLStringArray()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||