|
Class ZCacheBean.ZCacheClient
Object
|
+----ZCacheBean.ZCacheClient
- public class ZCacheClient
- extends Object
- implements Serializable

context
-
curPrvKeyFileName
-
password
-
username
-
zsec
-

ZCacheBean.ZCacheClient()
-

delRecord(String[])
- This method deletes a specific record in a table.
equals(Object)
-
getContext()
- Gets the context name for this client.
getData(String[])
- This method retrieves a specific record, or block of records from a table.
getData(String[],
boolean)
-
getData(String,
String[], boolean)
-
getData(String,
String[])
-
getErrMsg(String)
- In the case where a request return null, this method can be used to return the error message associated with
the null request.
getFile(String)
- To get a file, pass in the filename, including the relative path.
getFirst()
- Gets the first record of the current data context.
getFirst(int)
- Gets the first record of the current data context.
getFirst(String)
- Gets the first record of the current data context.
getFirst(String,
int)
- Gets the first record of the current data context.
getIPAddress()
- Gets the IP address currently assigned to access the target ZCache server.
getLast()
- This method returns the last record in the table.
getLast(String)
- This method returns the last record in the table.
getLast(String,
int)
- This method gets a record data set, starting from the last record location in the table, minus the number or
records requested, to the last requested position-1.
getNext()
- This method gets the record data from the next location that immediately follows the previous request.
getNext(String)
- This method gets the record data from the next location that immediately follows the previous request.
getNext(int)
- This method gets the record data from the next location that immediately follows the previous request.
getNext(String,
int)
- This method gets the record data from the next location that immediately follows the previous request.
getOutputPath()
- Gets the currently defined file transfer output path.
getPassword()
- Gets the user's password.
getPort()
- Gets the port currently assigned to access the target ZCache server.
getPrev()
- This method gets the record data from the location that immediately precedes the previous request's position.
getPrev(String)
- This method gets the record data from the location that immediately precedes the previous request's position.
getPrev(int)
- This method gets a record data set, starting from the last location that was read, minus the number or records
requested, to the last requested position-1.
getPrev(String,
int)
- This method gets a record data set, starting from the last location that was read, minus the number or records
requested, to the last requested position-1.
getSecureMode()
- Sets secure mode state
getSecurityString()
- Gets the currently defined security token.
getUserIdentity()
- Gets the currently designated user identity string.
getUsername()
- Gets the user name used for authentication.
putRecord(String,
String[])
- This method inserts a new record into a table.
putUpdate(String,
String[])
- This api writes an update to the referenced table.
setContext(String)
- Sets the context name for this client.
setIPAddress(String)
- Sets the IP address of the target ZCache server.
setNewSearchContext(String,
String[])
- Relative movements through a data set require a current position in order to function.
setOutputPath(String)
- This sets the path that is needed for file transfer operations.
setPassword(String)
- Sets the user's password.
setPort(int)
- Sets the port of the ZCache server that the client is using.
setSecureMode(boolean)
- Sets secure mode state
setSecurityString(String)
- Sets the security token that is used to gain entry to the ZCache target server.
setUserIdentity(String)
- Sets the user identity to be attached to accesses, for error tracking by the server administrator.
setUsername(String)
- Sets the user name for authentication.
toString()
-

context
public java.lang.String context
curPrvKeyFileName
public java.lang.String curPrvKeyFileName
password
public java.lang.String password
username
public java.lang.String username
zsec
protected ZCacheBean.ZPTSecurity zsec

ZCacheClient
public ZCacheClient()

delRecord
public final synchronized java.lang.String[] delRecord(String[] request)
- This method deletes a specific record in a table.
T:TABLE_NAME
I:INDEX_VAL
-
- Parameters:
- String[] - request
equals
public boolean equals(Object a)
-
- Overrides:
- equals in class Object
getContext
public final synchronized java.lang.String getContext()
- Gets the context name for this client.
-
- Returns:
- String
getData
public final synchronized java.lang.String[] getData(String[] request)
- This method retrieves a specific record, or block of records from a table.
T:TABLE_NAME
V:VIEW_NAME
I:INDEX_VAL:766 // There can be multiple indexes
// : is used for specific value requests
// ; is used for partial match requests
// the value used by the index follows immediately after the : or ;
F:FIELDNAME // Field names of data to be retuned are defined like this
N:10000 // number of records to return
O:0 // offset into this block of data
-
- Parameters:
- threadName - threadName is a name that identifies the thread that is using the ZCacheClient bean. This is to
simplify multi-threaded use of a single bean instance.
- String[] - request
- Returns:
- String[]
getData
public final synchronized java.lang.String[] getData(String[] request,
boolean local)
getData
public final synchronized java.lang.String[] getData(String threadName,
String[] request,
boolean local)
getData
public final synchronized java.lang.String[] getData(String threadName,
String[] request)
getErrMsg
public final synchronized java.lang.String getErrMsg(String threadName)
- In the case where a request return null, this method can be used to return the error message associated with
the null request.
-
- Parameters:
- threadName - String - Can be null
- Returns:
- String - An error message associated with the failed request.
getFile
public final synchronized int getFile(String filename)
- To get a file, pass in the filename, including the relative path. ( i.e. test/hosts.txt ) The file is retrieved
from ZappDataServer and placed in the output directory. The output directory is defined by String outputPath
-
- Parameters:
- String - filename
getFirst
public final synchronized java.lang.String[] getFirst()
- Gets the first record of the current data context. The default threadName is assigned as "null".
-
- Returns:
- String[] - Returns a single record.
getFirst
public final synchronized java.lang.String[] getFirst(int num)
- Gets the first record of the current data context.
-
- Parameters:
- num - int - The number of records you wish to return.
- Returns:
- String[] - An array of records results
getFirst
public final synchronized java.lang.String[] getFirst(String threadName)
- Gets the first record of the current data context.
-
- Parameters:
- threadName - threadName is a name that identifies the thread that is using the ZCacheClient bean. This is to
simplify multi-threaded use of a single bean instance.
- Returns:
- String[] - Returns a single string.
getFirst
public final synchronized java.lang.String[] getFirst(String threadName,
int num)
- Gets the first record of the current data context.
-
- Parameters:
- threadName - threadName is a name that identifies the thread that is using the ZCacheClient bean. This is to
simplify multi-threaded use of a single bean instance.
- num - int - Specifies the number of records you want to retrieve, starting with the first record.
- Returns:
- String[] - Returns a single string.
getIPAddress
public java.lang.String getIPAddress()
- Gets the IP address currently assigned to access the target ZCache server.
-
- Returns:
- String - A string description of the IP Address in dotted notation form.
getLast
public final synchronized java.lang.String[] getLast()
- This method returns the last record in the table.
-
- Returns:
- String[] - A single record data.
getLast
public final synchronized java.lang.String[] getLast(String threadName)
- This method returns the last record in the table.
-
- Parameters:
- threadName - threadName is a name that identifies the thread that is using the ZCacheClient bean. This is to
simplify multi-threaded use of a single bean instance.
- Returns:
- String[] - A single record data.
getLast
public final synchronized java.lang.String[] getLast(String threadName,
int num)
- This method gets a record data set, starting from the last record location in the table, minus the number or
records requested, to the last requested position-1. As an example, you can use this method to request the last
10 recordsint the table.
-
- Parameters:
- threadName - threadName is a name that identifies the thread that is using the ZCacheClient bean. This is to
simplify multi-threaded use of a single bean instance.
- num - int - The number of records to retrieve.
- Returns:
- String[] - An array of record data.
getNext
public final synchronized java.lang.String[] getNext()
- This method gets the record data from the next location that immediately follows the previous request.
-
- Returns:
- String[] - A single record.
getNext
public final synchronized java.lang.String[] getNext(String threadName)
- This method gets the record data from the next location that immediately follows the previous request.
-
- Parameters:
- threadName - threadName is a name that identifies the thread that is using the ZCacheClient bean. This is to
simplify multi-threaded use of a single bean instance.
- Returns:
- String[] - A single record data.
getNext
public final synchronized java.lang.String[] getNext(int num)
- This method gets the record data from the next location that immediately follows the previous request.
-
- Parameters:
- num - int - The number of records you wish to return.
- Returns:
- String[] - A single record data.
getNext
public final synchronized java.lang.String[] getNext(String threadName,
int num)
- This method gets the record data from the next location that immediately follows the previous request.
-
- Parameters:
- threadName - threadName is a name that identifies the thread that is using the ZCacheClient bean. This is to
simplify multi-threaded use of a single bean instance.
- num - int - The number of records you wish to return.
- Returns:
- String[] - A single record data.
getOutputPath
public java.lang.String getOutputPath()
- Gets the currently defined file transfer output path.
-
- Returns:
- String
getPassword
public final synchronized java.lang.String getPassword()
- Gets the user's password.
-
- Returns:
- String
getPort
public int getPort()
- Gets the port currently assigned to access the target ZCache server.
-
- Returns:
- int
getPrev
public final synchronized java.lang.String[] getPrev()
- This method gets the record data from the location that immediately precedes the previous request's position.
-
- Returns:
- String[] - A single record data.
getPrev
public final synchronized java.lang.String[] getPrev(String threadName)
- This method gets the record data from the location that immediately precedes the previous request's position.
-
- Parameters:
- threadName - threadName is a name that identifies the thread that is using the ZCacheClient bean. This is to
simplify multi-threaded use of a single bean instance.
- Returns:
- String[] - A single record data.
getPrev
public final synchronized java.lang.String[] getPrev(int num)
- This method gets a record data set, starting from the last location that was read, minus the number or records
requested, to the last requested position-1. As an example, you can use this method to request 10 records prior
to the last accessed record.
-
- Parameters:
- num - int - The number of records to retrieve.
- Returns:
- String[] - An array of record data.
getPrev
public final synchronized java.lang.String[] getPrev(String threadName,
int num)
- This method gets a record data set, starting from the last location that was read, minus the number or records
requested, to the last requested position-1. As an example, you can use this method to request 10 records prior
to the last accessed record.
-
- Parameters:
- String - threadName threadName is a name that identifies the thread that is using the ZCacheClient bean. This
is to simplify multi-threaded use of a single bean instance.
- int - num
- Returns:
- String[] - An array of record data.
getSecureMode
public boolean getSecureMode()
- Sets secure mode state
-
- Returns:
- boolean
getSecurityString
public java.lang.String getSecurityString()
- Gets the currently defined security token.
-
- Returns:
- String
getUserIdentity
public java.lang.String getUserIdentity()
- Gets the currently designated user identity string.
-
- Returns:
- String
getUsername
public final synchronized java.lang.String getUsername()
- Gets the user name used for authentication.
-
- Returns:
- String
putRecord
public final synchronized java.lang.String[] putRecord(String threadName,
String[] request)
- This method inserts a new record into a table.
T:TABLE_NAME // The table alias
F:NAME:George Strait // The fields are specified with the desired values
F:ADDRESS:1401 Milky Way Blvd // Note that the assigned values follow right after the :
F:CITY:Des Moines
F:STATE:IA
F:ZIP:46344
-
- Parameters:
- String - threadName
- String[] - request
putUpdate
public final synchronized java.lang.String[] putUpdate(String threadName,
String[] request)
- This api writes an update to the referenced table. The request is in the form of a string array. Each array
element is a line of the request as documented.
T:ALIAS_NAME // The database alias.
I:ID:133 // The index to use for the update
F:NAME_FLD:NAME // The field to be modified, and the new value after the colon
-
- Parameters:
- String - threadName
- String[] - request
setContext
public final synchronized void setContext(String str)
- Sets the context name for this client.
-
- Parameters:
- String - contextName
setIPAddress
public synchronized void setIPAddress(String ipstr)
- Sets the IP address of the target ZCache server.
-
- Parameters:
- ipstr - IP is a string in the dotted notation form "00.00.00.00"
setNewSearchContext
public final synchronized int setNewSearchContext(String threadName,
String[] request)
-
Relative movements through a data set require a current position in order to
function. The position information needed is returned by each valid request.
In single threaded applications, there is no need to pass in the thread name, and so
each method is available without the thread name as a passed parameter.
However, in multi-threaded search operations, position information is specific to each
thread in a multiple threaded application. For this reason, each relative position
method requires that the thread name be passed in as a part of the request, since
different threads might be accessing a different portion (and position) of the same data set.
Another important problem this bean addresses is that of Zapp being restarted, which would
invalidate currently held position information. In order to reestablish correct positioning,
an array that describes the base search criteria is part of a PositionInfo object that is
maintained by the bean, so that on a failed access a new context can automatically be
reestablished. This greatly simplifies behaviour for users of the bean.
setNewSearchContext (or any other specific getData() request) establishes a PositionInfo
state for the first record, and will fill in the PositionInfo object which establishes
a fresh context. Once this data is returned, you can navigate relative to your current
position using (getNext, getPrev, etc.) positioning methods.
If you design an application that uses relative positioning it is important to remember that
you are moving by records, and any filtering of results become your responsibility. This is easily
accomplished using Java's internal methods. (i.e. String.startsWith()) You can use a partial
search to get you started, which will give you the necessary positional information the bean needs
and then just 'getNext' until you are out of range.
-
- Parameters:
- threadName - String threadName, which can be set to null
- request - String[] which consists of the search information, but which is not used to actually perform a search,
but instead provides context information needed by ZCache. Usually this is not used, instead a getData() request
will establish context. However, in the case where you want to do a getFirst(), this API will provide context without
doing an extraneous search.
- Returns:
- String[] which will be empty.
setOutputPath
public synchronized void setOutputPath(String sopstr)
- This sets the path that is needed for file transfer operations. The default is the current working directory
of the application.
-
- Parameters:
- sopstr - String
setPassword
public final synchronized void setPassword(String str)
- Sets the user's password.
-
- Parameters:
- String - pwd
setPort
public synchronized void setPort(int portnum)
- Sets the port of the ZCache server that the client is using.
-
- Parameters:
- int - portnum
setSecureMode
public synchronized void setSecureMode(boolean state)
- Sets secure mode state
-
- Parameters:
- boolean - state
setSecurityString
public synchronized void setSecurityString(String str)
- Sets the security token that is used to gain entry to the ZCache target server. This token can be as long as
you like (but must not contain a '\n'). You should use only printable characters enterable from the keyboard. The
key is case sensitive. The default value is: NoNe
-
- Parameters:
- str - String
setUserIdentity
public synchronized void setUserIdentity(String costr)
- Sets the user identity to be attached to accesses, for error tracking by the server administrator. This identity
can be modified by the application to provide in depth debug information. Properly used, this feature can help
identify current process information critical to error identification.
-
- Parameters:
- costr - String
setUsername
public final synchronized void setUsername(String str)
- Sets the user name for authentication.
-
- Parameters:
- String - name
|