public class Client extends java.lang.Object implements Executor
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BY_PASS_LOGIN
Static field for login bypass value
|
static java.lang.String |
BY_PASS_TRAFFIC
Static field for traffic bypass value
|
static java.lang.String |
VERSION
The current version of the soap client
|
Constructor and Description |
---|
Client(SoapTransport transport)
Create a new SOAP client
|
Client(java.lang.String host)
Create a new SOAP client
|
Modifier and Type | Method and Description |
---|---|
void |
addDiscoverTransport(java.lang.String transportUrl,
java.lang.String userId,
java.lang.String password)
Add an additional transport.
|
void |
addMoveToUrlTransport(java.util.List transportUrl,
java.lang.String userId,
java.lang.String password)
Add move to URL transport.
|
protected void |
addSessionHeader(org.w3c.dom.Document envelope)
Add the session header.
|
void |
addTransport(SoapTransport transport)
add an additional transport
|
java.lang.String |
checkInFile(java.lang.String fileName,
java.io.File file)
Checks in a file
|
java.lang.String |
checkInFile(java.lang.String fileName,
java.io.File file,
java.lang.String location)
Checks in a file
|
java.io.File |
checkOutFile(java.lang.String fileName)
gets and locks a file from the server.
|
java.io.File |
checkOutFile(java.lang.String fileName,
java.lang.String location)
Gets and locks a file from the server
|
org.w3c.dom.Document |
createEnvelope()
<?xml version="1.0" encoding="UTF-8"?<
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<
<soapenv:Header<
<SessionInfo soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns=""<
<SESSION_SIGNATURE xmlns=""<self_test</SESSION_SIGNATURE<
<SESSION_TZ xmlns=""<Australia/Sydney</SESSION_TZ<
</SessionInfo<
</soapenv:Header<
<soapenv:Body<
<execute xmlns=""<
<sql<DISCOVER SSO</sql<
</execute<
<messageID xmlns=""<1</messageID<
</soapenv:Body<
</soapenv:Envelope<
|
SoapTransport |
currentTransport()
Which transport are we using ?
|
org.w3c.dom.Document |
execute(java.lang.String sql)
Execute a SQL statement.
|
org.w3c.dom.Document |
farm(java.lang.String sql)
execute the commands on a
|
SoapResultSet |
fetch(java.lang.String sql)
fetch a SQL statement as a record set.
|
java.lang.String |
getCacheDiretcory()
The cache directory is used by the file fetch operations.
|
java.lang.String |
getHost()
The current host.
|
java.lang.String |
getLayer()
The database layer to connect to.
|
protected org.w3c.dom.Document |
getResult(org.w3c.dom.Document doc,
java.lang.String tag)
Convert a XML document into a record set.
|
java.lang.String |
getSessionID()
Returns session ID.
|
java.util.TimeZone |
getTimeZone()
The timezone of this executor
|
int |
getTransportCount()
The number of transports avaliable.
|
java.lang.String |
getUserName()
The login to connect with
|
protected void |
handleFault(java.lang.String code,
java.lang.String reason)
Handle a fault.
|
boolean |
isStateless()
Is the client currently stateless ?
|
boolean |
isUrlByPassEnabled()
Returns the flag if the URL by-pass is set or not.
|
void |
login()
Login using the defaults
|
void |
login(java.lang.String login,
java.lang.String password,
java.lang.String layer)
Login using the values passed.
|
void |
login(java.lang.String login,
java.lang.String password,
java.lang.String layer,
LoginContext loginContext)
Login using the defaults.
|
void |
logout()
Logout.
|
SoapTransport |
nextTransport()
Move to the next transport
|
java.io.File |
readFile(java.lang.String fileName)
gets a file from the server for READ access.
|
java.io.File |
readFile(java.lang.String fileName,
java.lang.String location)
Gets a file from the server for READ access, using the specified location
|
org.w3c.dom.Document |
sendEnvelope(org.w3c.dom.Document envelope,
java.lang.String relativePath)
send the envelope.
|
void |
setByPassDiscover(boolean flag)
by pass the discover phase
|
void |
setCacheDirectory(java.lang.String path)
Sets the cache directory to be used during fetch operations.
|
void |
setLayer(java.lang.String layer)
set the layer
|
void |
setTimeZone(java.util.TimeZone tz)
set the time zone
|
java.lang.String |
toString()
Return details of this client
|
void |
updateFile(java.lang.String fileKey,
java.io.File newVersion)
Updates a file with a new version
|
void |
updateFile(java.lang.String fileKey,
java.io.File newVersion,
java.lang.String location)
Updates a file with a new version
|
public static final java.lang.String VERSION
public static final java.lang.String BY_PASS_TRAFFIC
public static final java.lang.String BY_PASS_LOGIN
public Client(java.lang.String host)
host
- The URL or list of URLspublic Client(SoapTransport transport)
transport
- The internal transportpublic void setByPassDiscover(boolean flag)
flag
- true if we should not call DISCOVERpublic final void addTransport(SoapTransport transport)
transport
- The additional transportpublic SoapTransport currentTransport()
public SoapTransport nextTransport()
public int getTransportCount()
public java.lang.String getHost()
public java.lang.String getLayer()
public java.util.TimeZone getTimeZone()
getTimeZone
in interface Executor
public java.lang.String getUserName()
getUserName
in interface Executor
public void login() throws java.lang.Exception
java.lang.Exception
- Failed to login.public void login(java.lang.String login, java.lang.String password, java.lang.String layer, LoginContext loginContext) throws java.lang.Exception
login
- The user idpassword
- The password.layer
- The layer to login to.loginContext
- The context.java.lang.Exception
- Failed to login.public void login(java.lang.String login, java.lang.String password, java.lang.String layer) throws java.lang.Exception
login
- The user idpassword
- The password.layer
- The layer to login to.java.lang.Exception
- Failed to login.public void logout() throws java.lang.Exception
java.lang.Exception
- A serious problempublic boolean isStateless()
isStateless
in interface Executor
@CheckReturnValue @Nonnull public java.lang.String toString()
toString
in class java.lang.Object
public void updateFile(java.lang.String fileKey, java.io.File newVersion) throws java.lang.Exception
fileKey
- the global key of the filenewVersion
- the new version of the filejava.lang.Exception
- update failurepublic void updateFile(java.lang.String fileKey, java.io.File newVersion, java.lang.String location) throws java.lang.Exception
fileKey
- the global key of the filenewVersion
- the new version of the filelocation
- the location to updatejava.lang.Exception
- update failurepublic java.lang.String checkInFile(java.lang.String fileName, java.io.File file) throws java.lang.Exception
fileName
- the name of the filefile
- the file to check injava.lang.Exception
- check in failurepublic java.lang.String checkInFile(java.lang.String fileName, java.io.File file, java.lang.String location) throws java.lang.Exception
fileName
- the name of the filefile
- the file to check inlocation
- the location to create the file onjava.lang.Exception
- check in failurepublic java.io.File checkOutFile(java.lang.String fileName) throws java.lang.Exception
fileName
- The actual file to check out.java.lang.Exception
- A serious problempublic java.io.File checkOutFile(java.lang.String fileName, java.lang.String location) throws java.lang.Exception
fileName
- the name of the file to checkoutlocation
- the location to get the file fromjava.lang.Exception
- failure to get file or lockpublic java.io.File readFile(java.lang.String fileName) throws java.lang.Exception
fileName
- The actual file namejava.lang.Exception
- A serious problempublic java.io.File readFile(java.lang.String fileName, java.lang.String location) throws java.lang.Exception
fileName
- the name of the file to getlocation
- the location to get the file fromjava.lang.Exception
- a failure to get the filepublic SoapResultSet fetch(java.lang.String sql) throws java.lang.Exception
public org.w3c.dom.Document farm(java.lang.String sql) throws java.lang.Exception
sql
- the commandsjava.lang.Exception
- a serious problempublic org.w3c.dom.Document execute(java.lang.String sql) throws java.lang.Exception
public org.w3c.dom.Document createEnvelope() throws java.lang.Exception
java.lang.Exception
- a serious problem.protected final void addSessionHeader(org.w3c.dom.Document envelope) throws java.lang.Exception
envelope
- The envelope to add the session header to.java.lang.Exception
- A serious problemprotected org.w3c.dom.Document getResult(org.w3c.dom.Document doc, java.lang.String tag) throws java.lang.Exception
doc
- The XML documenttag
- The tag to fetchjava.lang.Exception
- A serious problemprotected void handleFault(java.lang.String code, java.lang.String reason) throws java.lang.Exception
code
- The codereason
- The reasonjava.lang.Exception
- A serious problempublic final org.w3c.dom.Document sendEnvelope(org.w3c.dom.Document envelope, java.lang.String relativePath) throws java.lang.Exception
envelope
- The enveloperelativePath
- The path to send it tojava.lang.Exception
- A serious problempublic java.lang.String getSessionID()
public java.lang.String getCacheDiretcory()
public void setCacheDirectory(java.lang.String path)
path
- the path of the cache directory, can be nullpublic final void addDiscoverTransport(java.lang.String transportUrl, java.lang.String userId, java.lang.String password)
transportUrl
- The additional transportuserId
- user idpassword
- passwordpublic final void addMoveToUrlTransport(java.util.List transportUrl, java.lang.String userId, java.lang.String password)
transportUrl
- URLuserId
- user idpassword
- passwordpublic void setLayer(java.lang.String layer)
layer
- the signaturepublic void setTimeZone(java.util.TimeZone tz)
tz
- the time zonepublic boolean isUrlByPassEnabled()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.