com.rocketsoftware.mvapi.connector
Class MVSPConnector

java.lang.Object
  extended by com.rocketsoftware.mvapi.connector.MVSPConnector
All Implemented Interfaces:
MVConnector

public class MVSPConnector
extends java.lang.Object
implements MVConnector

Implements the MVConnector interface.


Field Summary
 java.lang.String m_ESC_CR
           
 java.lang.String m_ESC_DLE
           
 java.lang.String m_ESC_LF
           
static long readms
           
static long timing_data_read_ms
           
static long timing_header_read_ms
           
static long timing_string_convert_ms
           
 
Constructor Summary
MVSPConnector()
          Constructs a MVSPConnector object.
 
Method Summary
 java.lang.String call(java.lang.String name, java.util.List<java.lang.String> arguments)
          Calls a subroutine.
 java.lang.String call(java.lang.String name, java.lang.String data)
          Calls a subroutine.
 void clearSelect()
          Clears an active select list.
 void closeConnection()
          Closes a connection.
 void closeRoot(int index)
          Closes the index on the server.
 int count(java.lang.String stringToSearch, char charToCount)
          Counts character occurances in a string.
 int dCount(java.lang.String dArray, char delim)
          Counts number of substrings delimited by delim character.
 java.lang.String delete(java.lang.String dArray, int attrNum)
          Deletes an attribute from a dynamic array.
 java.lang.String delete(java.lang.String dArray, int attrNum, int valNum)
          Deletes a value from a dynamic array.
 java.lang.String delete(java.lang.String dArray, int attrNum, int valNum, int subValNum)
          Deletes a sub value from a dynamic array.
 void disableAccount(java.lang.String name)
          Disables an account for MVSP usage.
 void enableAccount(java.lang.String name)
          Enables an account if not already enabled.
 void execute(java.lang.String command)
          Executes a command and populates the "capturing" and "returning" results.
 void execute(java.lang.String command, java.lang.String data)
          Executes a command and populates the "capturing" and "returning" results.
 java.lang.String extract(java.lang.String dArray, int attrNum)
          Extracts an attribute from dynamic array.
 java.lang.String extract(java.lang.String dArray, int attrNum, int valNum)
          Extracts a value from the dynamic array.
 java.lang.String extract(java.lang.String dArray, int attrNum, int valNum, int subValNum)
          Extracts a subvalue from the dynamic array.
 java.lang.String field(java.lang.String dArray, java.lang.String delim, int pos)
          Extracts a substring from the dynamic array.
 boolean fileCacheRelease(java.lang.String path)
          Releases the associated file cache entry for the specified opened file on the MVSP server.
 java.lang.String fileDelete(java.lang.String path, java.lang.String itemId)
          Deletes an item from the file.
 java.lang.String fileRead(java.lang.String path, java.lang.String itemId)
          Reads an item from the file.
 java.lang.String fileReadNext()
          Gets the next item ID from the current fileSELECT list.
 java.lang.String fileReadU(java.lang.String path, java.lang.String itemId)
          Reads an item from the file, setting an item lock.
 java.lang.String fileReadV(java.lang.String path, java.lang.String itemId, int attribute)
          Reads an item's attribute from the file.
 java.lang.String fileReadVU(java.lang.String path, java.lang.String itemId, int attribute)
          Reads an item's attribute from the file, setting an item lock.
 java.lang.String fileRelease(java.lang.String path, java.lang.String itemId)
          Releases an item lock set by a prior fileReadU.
 boolean fileSelect(java.lang.String path)
          Selects the file specified by path for a subsequent fileReadNext
 java.lang.String fileWrite(java.lang.String path, java.lang.String itemId, java.lang.String itemBody)
          Writes an item to the file, releasing the update lock set by a previous fileReadU of the same item.
 java.lang.String fileWriteU(java.lang.String path, java.lang.String itemId, java.lang.String itemBody)
          Writes an item to the file, keeping update lock set by a previous fileReadU of the same item.
 java.lang.String fileWriteV(java.lang.String path, java.lang.String itemId, java.lang.String attributeBody, int attribute)
          Writes a value to an item's attribute.
 java.lang.String fileWriteVU(java.lang.String path, java.lang.String itemId, java.lang.String attributeBody, int attribute)
          Writes a value to an item's attribute, keeping update lock set by a previous fileReadU/fileReadVU of the same item.
 java.lang.Object getBaseConnector()
          Returns implementing connector object.
 java.lang.String getConnectionProperties()
          Gets the connection properties.
 java.lang.String getCurrentAccount()
          Gets the current logged to account.
 java.lang.String getCurrentAccountPwd()
          Gets the current logged to account password.
 boolean getEol()
          Checks for end of list, i.e., will READNEXT fail.
 java.lang.String getExecuteCapturing()
          Returns the captured result of an execute statement (execute command capturing result).
 java.lang.String getExecuteReturning()
          Returns the returning result of an execute statement (execute command returning result).
 int getFileStatusCode()
          Returns the result code of most recent file operation.
 java.lang.String getFileStatusMessage()
          Returns error message from the most recent file operation error.
 java.lang.String getHostName()
          Gets the network host name of this connection.
 int getPort()
          Gets the network port number for this connection.
 java.lang.String getQueryOptions()
          Gets the query options.
 byte[] getResult()
          Returns buffer containing results of last read.
 java.lang.String getRuleModule()
          Gets the rulename you had set via setRuleName.
 java.lang.String getServerEnvironment()
          Returns the server enviornment setting (STD, EUR, etc.)
 java.lang.String getServerPlatform()
          Gets the server platform name.
 java.lang.String getServerPort()
          Gets the server port id used by this connection.
 java.lang.String getServerVersion()
          Gets the server version number.
 java.lang.String insert(java.lang.String dArray, int attrNum, int valNum, int subValNum, java.lang.String subValue)
          Inserts a sub value into a dynamic array.
 java.lang.String insert(java.lang.String dArray, int attrNum, int valNum, java.lang.String value)
          Inserts a value into a dynamic array.
 java.lang.String insert(java.lang.String dArray, int attrNum, java.lang.String attribute)
          Inserts an attribute into a dynamic array.
 boolean isAccountEnabled(java.lang.String name)
          Returns true if the requested account has been enabled for MVSP use.
 boolean isConnected()
          Checks current connection state.
 boolean isConnectionPoolingSupported()
          Checks if connections can be pooled.
 boolean isFileExistCmdSupported()
          Checks if the server supports the FILEEXISTS command.
 boolean isQueryKeywordsSupported()
          Checks if the server supports the queryKeywords parameter on the executeQuery method.
 java.lang.String key(int index, java.lang.String operator, java.lang.String key, java.lang.String itemId)
          Executes a key operation on the index.
 void logTo(java.lang.String account, java.lang.String password)
          Logs the connection to the requested account.
 java.lang.String mvCall(java.lang.String RuleParams)
          Executes the business rule set by setRuleName.
 java.lang.String MVSPClientVersion()
          Returns the MVSP client version.
 int next()
          Reads the next query row.
 boolean openConnection(java.lang.String hostName, int port, java.lang.String user, java.lang.String password)
          Opens a connection to an MV server.
 boolean openConnection(java.lang.String hostName, int port, java.lang.String user, java.lang.String password, boolean sslConnect, boolean LicEnterprise)
          Opens a connection to an MV server.
 boolean openConnection(java.lang.String hostName, int port, java.lang.String user, java.lang.String password, java.lang.String clientId)
          Opens a connection to an MV server.
 boolean openConnection(java.lang.String hostName, int port, java.lang.String user, java.lang.String password, java.lang.String clientId, boolean sslConnect, boolean LicEnterprise)
          Opens a connection to an MV server.
 boolean openConnection(java.lang.String hostName, int port, java.lang.String user, java.lang.String password, java.lang.String clientId, java.lang.String account)
          Opens a connection to an MV server.
 boolean openConnection(java.lang.String hostName, int port, java.lang.String user, java.lang.String password, java.lang.String clientId, java.lang.String account, boolean sslConnect, boolean LicEnterprise, java.lang.String clientConnectionOptions)
          Opens a connection to the server.
 boolean openConnection(java.lang.String hostName, int port, java.lang.String user, java.lang.String password, java.lang.String clientId, java.lang.String account, boolean sslConnect, MVConstants.LicenseType licenseType, java.lang.String clientConnectionOptions)
          Opens a connection to the server.
 java.lang.String openStream(java.lang.String name, java.lang.String data)
          Calls a subroutine that generates results in byte count : data format.
 MVResultSet query(java.lang.String query)
          Executes an AQL query.
 java.lang.String readFromServer(boolean all, boolean isConnecting)
          Read from server socket
 java.lang.String replace(java.lang.String dArray, int attrNum, int valNum, int subValNum, java.lang.String subValue)
          Replaces a sub value in a dynamic array.
 java.lang.String replace(java.lang.String dArray, int attrNum, int valNum, java.lang.String value)
          Replaces a value in a dynamic array.
 java.lang.String replace(java.lang.String dArray, int attrNum, java.lang.String attribute)
          Replaces an attribute in a dynamic array.
 java.lang.String root(java.lang.String fileName, java.lang.String indexName)
          Executes a root operation on the supplied fileName and indexName.
 void setQueryOptions(java.lang.String options)
          Sets the query options.
 void setRuleModule(java.lang.String rule)
          Sets the rule name for subsequent mvCall.
 void setSoTimeout(int milliseconds)
          Sets the socket timeout.
 java.lang.String swap(java.lang.String array, java.lang.String oldStr, java.lang.String newStr)
          Replaces every occurrence of oldStr with newStr in array.
 boolean transactionBegin()
          Begins a transaction in the database.
 boolean transactionCommit()
          Commits a transaction in the database.
 boolean transactionRollback()
          Rolls back a transaction in the database.
 boolean transactionStatus()
          Returns true if currently in a transaction.
 void write(byte[] bytes, int off, int len)
           
 void writeToServer(java.lang.String data)
          Writes data to the server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readms

public static long readms

timing_header_read_ms

public static long timing_header_read_ms

timing_data_read_ms

public static long timing_data_read_ms

timing_string_convert_ms

public static long timing_string_convert_ms

m_ESC_LF

public java.lang.String m_ESC_LF

m_ESC_CR

public java.lang.String m_ESC_CR

m_ESC_DLE

public java.lang.String m_ESC_DLE
Constructor Detail

MVSPConnector

public MVSPConnector()
Constructs a MVSPConnector object.

Method Detail

openConnection

public boolean openConnection(java.lang.String hostName,
                              int port,
                              java.lang.String user,
                              java.lang.String password)
                       throws MVException
Description copied from interface: MVConnector
Opens a connection to an MV server.

Specified by:
openConnection in interface MVConnector
Parameters:
hostName - server hostname
port - server port
user - user name
password - user password
Returns:
true if successful
Throws:
MVException

openConnection

public boolean openConnection(java.lang.String hostName,
                              int port,
                              java.lang.String user,
                              java.lang.String password,
                              java.lang.String clientId,
                              java.lang.String account)
                       throws MVException
Description copied from interface: MVConnector
Opens a connection to an MV server.

Specified by:
openConnection in interface MVConnector
Parameters:
hostName - server hostname
port - server port
user - user name
password - user password
clientId - clientId identifies client to server for any special handling.
account - account name to logon to on initial connection. (For U2 platform)
Returns:
true if successful
Throws:
MVException

openConnection

public boolean openConnection(java.lang.String hostName,
                              int port,
                              java.lang.String user,
                              java.lang.String password,
                              java.lang.String clientId)
                       throws MVException
Description copied from interface: MVConnector
Opens a connection to an MV server.

Specified by:
openConnection in interface MVConnector
Parameters:
hostName - server hostname
port - server port
user - user name
password - user password
clientId - clientId identifies client to server for any special handling.
Returns:
true if successful
Throws:
MVException

openConnection

public boolean openConnection(java.lang.String hostName,
                              int port,
                              java.lang.String user,
                              java.lang.String password,
                              boolean sslConnect,
                              boolean LicEnterprise)
                       throws MVException
Description copied from interface: MVConnector
Opens a connection to an MV server.

Specified by:
openConnection in interface MVConnector
Parameters:
hostName - server hostname
port - server port
user - user name
password - user password
sslConnect - use SSL connection
LicEnterprise - use Enterprise licensing
Returns:
true if successful
Throws:
MVException

openConnection

public boolean openConnection(java.lang.String hostName,
                              int port,
                              java.lang.String user,
                              java.lang.String password,
                              java.lang.String clientId,
                              boolean sslConnect,
                              boolean LicEnterprise)
                       throws MVException
Description copied from interface: MVConnector
Opens a connection to an MV server.

Specified by:
openConnection in interface MVConnector
Parameters:
hostName - server hostname
port - server port
user - user name
password - user password
clientId - clientId identifies client to server for any special handling.
sslConnect - use SSL connection
LicEnterprise - use Enterprise licensing
Returns:
true if successful
Throws:
MVException

openConnection

public boolean openConnection(java.lang.String hostName,
                              int port,
                              java.lang.String user,
                              java.lang.String password,
                              java.lang.String clientId,
                              java.lang.String account,
                              boolean sslConnect,
                              boolean LicEnterprise,
                              java.lang.String clientConnectionOptions)
                       throws MVException
Opens a connection to the server.

Specified by:
openConnection in interface MVConnector
Parameters:
hostName - network host name
port - network port number
user - user name
password - user password
clientId - clientId identifies client to server for any special handling.
account - account name to logon to on initial connection. (For U2 platform)
sslConnect - use SSL connection
LicEnterprise - use Enterprise licensing
Returns:
true if connection succeeded
Throws:
MVException - raised if any errors occur

openConnection

public boolean openConnection(java.lang.String hostName,
                              int port,
                              java.lang.String user,
                              java.lang.String password,
                              java.lang.String clientId,
                              java.lang.String account,
                              boolean sslConnect,
                              MVConstants.LicenseType licenseType,
                              java.lang.String clientConnectionOptions)
                       throws MVException
Opens a connection to the server.

Specified by:
openConnection in interface MVConnector
Parameters:
hostName - server hostname
port - server port
user - user name
password - user password
clientId - clientId identifies client to server for any special handling
account - account name to logon to on initial connection. (For U2 platform)
sslConnect - use SSL connection
licenseType - license type (User, Enterprise, or Connection Pool licensing)
clientConnectionOptions - client connection options string
Returns:
true if connection succeeded
Throws:
MVException - raised if any errors occur

clearSelect

public void clearSelect()
                 throws MVException
Description copied from interface: MVConnector
Clears an active select list.

Specified by:
clearSelect in interface MVConnector
Throws:
MVException - if errors occur

closeConnection

public void closeConnection()
                     throws MVException
Description copied from interface: MVConnector
Closes a connection.

Specified by:
closeConnection in interface MVConnector
Throws:
MVException

logTo

public void logTo(java.lang.String account,
                  java.lang.String password)
           throws MVException
Logs the connection to the requested account.

Specified by:
logTo in interface MVConnector
Parameters:
account - account name
password - account password
Throws:
MVException - if the logto command failed

getCurrentAccount

public java.lang.String getCurrentAccount()
Gets the current logged to account.

Specified by:
getCurrentAccount in interface MVConnector
Returns:
string of current logged to account

getCurrentAccountPwd

public java.lang.String getCurrentAccountPwd()
Gets the current logged to account password.

Specified by:
getCurrentAccountPwd in interface MVConnector
Returns:
string of current logged to account password

enableAccount

public void enableAccount(java.lang.String name)
                   throws MVException
Enables an account if not already enabled.

Specified by:
enableAccount in interface MVConnector
Parameters:
name - account name to enable
Throws:
MVException - raised if an error occurs

disableAccount

public void disableAccount(java.lang.String name)
                    throws MVException
Disables an account for MVSP usage.

Specified by:
disableAccount in interface MVConnector
Parameters:
name - account name
Throws:
MVException - raised if an error occurs

isAccountEnabled

public boolean isAccountEnabled(java.lang.String name)
                         throws MVException
Returns true if the requested account has been enabled for MVSP use.

Specified by:
isAccountEnabled in interface MVConnector
Parameters:
name - account name
Returns:
true if account has been enabled.
Throws:
MVException - raised if an error occurs

execute

public void execute(java.lang.String command)
             throws MVException
Executes a command and populates the "capturing" and "returning" results.

Specified by:
execute in interface MVConnector
Parameters:
command - command to execute
Throws:
MVException - raised if errors encountered

execute

public void execute(java.lang.String command,
                    java.lang.String data)
             throws MVException
Executes a command and populates the "capturing" and "returning" results.

Specified by:
execute in interface MVConnector
Parameters:
command - command to execute
data - data to stack to the command
Throws:
MVException - if execute errors occur

query

public MVResultSet query(java.lang.String query)
                  throws MVException
Executes an AQL query.

Specified by:
query in interface MVConnector
Parameters:
query - AQL query string
Returns:
MVResultSet the result set generated from the AQL query
Throws:
MVException - raised if errors encountered

isConnected

public boolean isConnected()
Checks current connection state.

Specified by:
isConnected in interface MVConnector
Returns:
true if connection has been opened to the server

getExecuteCapturing

public java.lang.String getExecuteCapturing()
Returns the captured result of an execute statement (execute command capturing result).

Specified by:
getExecuteCapturing in interface MVConnector
Returns:
string containing the execute 'caputuring' data

getExecuteReturning

public java.lang.String getExecuteReturning()
Returns the returning result of an execute statement (execute command returning result).

Specified by:
getExecuteReturning in interface MVConnector
Returns:
string containing the execute 'returning' data

call

public java.lang.String call(java.lang.String name,
                             java.util.List<java.lang.String> arguments)
                      throws MVException
Calls a subroutine.

The subroutine must be defined to take two arguments:

subname(indata, outdata)

The indata argument will receive the data parameter from this call method. The subroutine must return it's result in the outdata argument. The outdata argument will then be returned as the result from this method.

Specified by:
call in interface MVConnector
Parameters:
name - name of subroutine, may include fullpath if supported

for example: (read.item or dev,bp, read.item)

arguments - list of arguments
Returns:
returned results
Throws:
MVException - if a subroutine call error occurs

call

public java.lang.String call(java.lang.String name,
                             java.lang.String data)
                      throws MVException
Calls a subroutine.

The subroutine must be defined to take two arguments:

subname(indata, outdata)

The indata argument will receive the data parameter from this call method. The subroutine must return it's result in the outdata argument. The outdata argument will then be returned as the result from this method.

Specified by:
call in interface MVConnector
Parameters:
name - name of subroutine, may include fullpath if supported

for example: (read.item or dev,bp, read.item)

data - string data to pass in
Returns:
returned results
Throws:
MVException - if a subroutine call error occurs

openStream

public java.lang.String openStream(java.lang.String name,
                                   java.lang.String data)
                            throws MVException
Calls a subroutine that generates results in byte count : data format.

The subroutine must be defined to take two arguments:

subname(indata, outdata)

The indata argument will receive the data parameter from this call method. The subroutine must return it's result in the outdata argument. The outdata argument will then be returned as the result from this method.

Parameters:
name - name of subroutine, may include fullpath if supported

for example: (read.item or dev,bp, read.item)

data - string data to pass in
Returns:
returned results
Throws:
MVException - if a subroutine call error occurs

readFromServer

public java.lang.String readFromServer(boolean all,
                                       boolean isConnecting)
                                throws MVException
Description copied from interface: MVConnector
Read from server socket

Specified by:
readFromServer in interface MVConnector
Parameters:
all - read all available bytes. false means read only to end of current message
isConnecting - true if called during logon process
Returns:
data read from server
Throws:
MVException - raised if any errors encountered

next

public int next()
         throws MVException
Description copied from interface: MVConnector
Reads the next query row.

Specified by:
next in interface MVConnector
Throws:
MVException

getResult

public byte[] getResult()
Returns buffer containing results of last read.

Specified by:
getResult in interface MVConnector
Returns:
byte array containing read results.

write

public void write(byte[] bytes,
                  int off,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

writeToServer

public void writeToServer(java.lang.String data)
                   throws java.io.IOException
Description copied from interface: MVConnector
Writes data to the server.

Specified by:
writeToServer in interface MVConnector
Parameters:
data - to write
Throws:
java.io.IOException

getHostName

public java.lang.String getHostName()
Gets the network host name of this connection.

Specified by:
getHostName in interface MVConnector
Returns:
string host name

getPort

public int getPort()
Gets the network port number for this connection.

Specified by:
getPort in interface MVConnector
Returns:
int port number

root

public java.lang.String root(java.lang.String fileName,
                             java.lang.String indexName)
                      throws MVException
Description copied from interface: MVConnector
Executes a root operation on the supplied fileName and indexName.

Specified by:
root in interface MVConnector
Returns:
string result of the root operation: attribute 1: 0 attribute 2: index number; up to 100 indexes may be open at any one time. if attribute 1 is not 0 an error has occured. In this case attribute 2 will have the error code.
Throws:
MVException - if any errors occur

key

public java.lang.String key(int index,
                            java.lang.String operator,
                            java.lang.String key,
                            java.lang.String itemId)
                     throws MVException
Description copied from interface: MVConnector
Executes a key operation on the index.

Specified by:
key in interface MVConnector
Parameters:
index - index handle as returned from the root() method.
operator - index operation (e.g. C, N, P)
key - index key
itemId - index itemId
Returns:
string result of the key operation.
Throws:
MVException - if any errors occur

closeRoot

public void closeRoot(int index)
               throws MVException
Description copied from interface: MVConnector
Closes the index on the server.

Specified by:
closeRoot in interface MVConnector
Parameters:
index - index handle as returned from the root() method.
Throws:
MVException - if any errors occur

setSoTimeout

public void setSoTimeout(int milliseconds)
                  throws java.net.SocketException
Sets the socket timeout.

Specified by:
setSoTimeout in interface MVConnector
Parameters:
milliseconds - time to wait for a read operation to complete
Throws:
java.net.SocketException - raised if any socket errors occur

getServerVersion

public java.lang.String getServerVersion()
Gets the server version number.

Specified by:
getServerVersion in interface MVConnector
Returns:
string server number

getServerPlatform

public java.lang.String getServerPlatform()
Gets the server platform name.

Specified by:
getServerPlatform in interface MVConnector
Returns:
string server platform name

getServerPort

public java.lang.String getServerPort()
Gets the server port id used by this connection.

Specified by:
getServerPort in interface MVConnector
Returns:
server port id

getQueryOptions

public java.lang.String getQueryOptions()
Gets the query options.

Specified by:
getQueryOptions in interface MVConnector
Returns:
string query options

setQueryOptions

public void setQueryOptions(java.lang.String options)
Sets the query options.

Specified by:
setQueryOptions in interface MVConnector
Parameters:
options - query options

getConnectionProperties

public java.lang.String getConnectionProperties()
Gets the connection properties.

Specified by:
getConnectionProperties in interface MVConnector
Returns:
connection properties string

setRuleModule

public void setRuleModule(java.lang.String rule)
Description copied from interface: MVConnector
Sets the rule name for subsequent mvCall.

Specified by:
setRuleModule in interface MVConnector
Parameters:
rule - (cataloged subroutine) name

getRuleModule

public java.lang.String getRuleModule()
Description copied from interface: MVConnector
Gets the rulename you had set via setRuleName.

Specified by:
getRuleModule in interface MVConnector
Returns:
rule name

mvCall

public java.lang.String mvCall(java.lang.String RuleParams)
                        throws MVException
Description copied from interface: MVConnector
Executes the business rule set by setRuleName.

Specified by:
mvCall in interface MVConnector
Parameters:
RuleParams - x'fe' delimited list of parameters
Returns:
NetEvents array + char(24) + NetProperties array + char(254) + business rule output
Throws:
MVException - if a subroutine call error occurs

extract

public java.lang.String extract(java.lang.String dArray,
                                int attrNum)
Description copied from interface: MVConnector
Extracts an attribute from dynamic array.

Specified by:
extract in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - - Attribute number (1-relative)
Returns:
the attrNumth attribute

extract

public java.lang.String extract(java.lang.String dArray,
                                int attrNum,
                                int valNum)
Description copied from interface: MVConnector
Extracts a value from the dynamic array.

Specified by:
extract in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - - Attribute number (1-relative)
valNum - - Value number (1-relative)
Returns:
valNumth value of the attrNumth attribute

extract

public java.lang.String extract(java.lang.String dArray,
                                int attrNum,
                                int valNum,
                                int subValNum)
Description copied from interface: MVConnector
Extracts a subvalue from the dynamic array.

Specified by:
extract in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - - Attribute number (1-relative)
valNum - - Value number (1-relative)
subValNum - - subvalue number (1-relative)
Returns:
subValNumthe subvalue of the valNumth value of the attrNumth attribute

insert

public java.lang.String insert(java.lang.String dArray,
                               int attrNum,
                               int valNum,
                               int subValNum,
                               java.lang.String subValue)
Description copied from interface: MVConnector
Inserts a sub value into a dynamic array.

Specified by:
insert in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative Index of the attribute containing the value containing the sub value to insert
valNum - 1-relative Index of the value containing the sub value to insert
subValNum - 1-relative Index of the sub value to insert
Returns:
dynamic array with the specified sub value in the specified value in the specified attribute inserted.

insert

public java.lang.String insert(java.lang.String dArray,
                               int attrNum,
                               int valNum,
                               java.lang.String value)
Description copied from interface: MVConnector
Inserts a value into a dynamic array.

Specified by:
insert in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value containing the subvalue to insert
valNum - 1-relative index of the value containg the subvalue to insert
Returns:
dynamic array with the specified subvalue in the specified value in the specified attribute inserted.

insert

public java.lang.String insert(java.lang.String dArray,
                               int attrNum,
                               java.lang.String attribute)
Description copied from interface: MVConnector
Inserts an attribute into a dynamic array.

Specified by:
insert in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value containing the subvalue to insert
Returns:
dynamic array with the specified attribute in the specified value in the specified attribute inserted.

replace

public java.lang.String replace(java.lang.String dArray,
                                int attrNum,
                                int valNum,
                                int subValNum,
                                java.lang.String subValue)
Description copied from interface: MVConnector
Replaces a sub value in a dynamic array.

Specified by:
replace in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value containing the sub value to replace
valNum - 1-relative index of the value containing the sub value to replace
subValNum - 1-relative index of the sub value to replace
Returns:
dynamic array with the specified sub value in the specified value in the specified attribute replaced.

replace

public java.lang.String replace(java.lang.String dArray,
                                int attrNum,
                                int valNum,
                                java.lang.String value)
Description copied from interface: MVConnector
Replaces a value in a dynamic array.

Specified by:
replace in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value containing the subvalue to replace
valNum - 1-relative index of the value containg the subvalue to replace
Returns:
dynamic array with the specified subvalue in the specified value in the specified attribute replaced.

replace

public java.lang.String replace(java.lang.String dArray,
                                int attrNum,
                                java.lang.String attribute)
Description copied from interface: MVConnector
Replaces an attribute in a dynamic array.

Specified by:
replace in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value containing the subvalue to replace
Returns:
dynamic array with the specified attribute in the specified value in the specified attribute replaced.

field

public java.lang.String field(java.lang.String dArray,
                              java.lang.String delim,
                              int pos)
Description copied from interface: MVConnector
Extracts a substring from the dynamic array.

Specified by:
field in interface MVConnector
Parameters:
dArray - Dynamic array
delim - - delimiter to use
pos - - occurrance number
Returns:
subValNumthe subvalue of the valNumth value of the attrNumth attribute

delete

public java.lang.String delete(java.lang.String dArray,
                               int attrNum)
Description copied from interface: MVConnector
Deletes an attribute from a dynamic array.

Specified by:
delete in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative attribute number to delete
Returns:
dynamic array with the specified attribute deleted. e.g. delete("a^b^c",2) returns "a^c", where "^" is char(254).

delete

public java.lang.String delete(java.lang.String dArray,
                               int attrNum,
                               int valNum)
Description copied from interface: MVConnector
Deletes a value from a dynamic array.

Specified by:
delete in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative index of the attribute containing the value
valNum - 1-relative index of the value to delete
Returns:
dynamic array with the specified value in the specified attribute deleted. e.g. delete("a^b]1^c",2,1) returns "a^1^c", where "^" is char(254) and "]" is char(253).

delete

public java.lang.String delete(java.lang.String dArray,
                               int attrNum,
                               int valNum,
                               int subValNum)
Description copied from interface: MVConnector
Deletes a sub value from a dynamic array.

Specified by:
delete in interface MVConnector
Parameters:
dArray - Dynamic array
attrNum - 1-relative Index of the attribute containing the value containing the sub value to delete
valNum - 1-relative Index of the value containing the sub value to delete
subValNum - 1-relative Index of the sub value to delete
Returns:
dynamic array with the specified sub value in the specified value in the specified attribute deleted. e.g. delete("a^b]1\2\3^c",2,2,1) returns "a^b]2\3^c", where "^" is char(254), "]" is char(253), and "\" is char(252).

count

public int count(java.lang.String stringToSearch,
                 char charToCount)
Description copied from interface: MVConnector
Counts character occurances in a string.

Specified by:
count in interface MVConnector
Returns:
number of charToCount characters in stringToSearch

dCount

public int dCount(java.lang.String dArray,
                  char delim)
Description copied from interface: MVConnector
Counts number of substrings delimited by delim character.

Specified by:
dCount in interface MVConnector
Parameters:
dArray - dynamic array to search
delim - delimiter to count
Returns:
Number of delimiters plus one, unless dArray is null, in which case zero is returned

swap

public java.lang.String swap(java.lang.String array,
                             java.lang.String oldStr,
                             java.lang.String newStr)
Description copied from interface: MVConnector
Replaces every occurrence of oldStr with newStr in array.

Specified by:
swap in interface MVConnector
Parameters:
array - - a string containing zero or more occurrences of oldStr.
oldStr - - the string to search for in array.
newStr - - the string with which to replace every occurrence of oldStr in array.
Returns:
- a new string containing newStr where any oldStr used to be.

getFileStatusCode

public int getFileStatusCode()
Description copied from interface: MVConnector
Returns the result code of most recent file operation.

Specified by:
getFileStatusCode in interface MVConnector
Returns:
Result code of most recent file operation

getEol

public boolean getEol()
Description copied from interface: MVConnector
Checks for end of list, i.e., will READNEXT fail.

Specified by:
getEol in interface MVConnector
Returns:
true if end of list

getFileStatusMessage

public java.lang.String getFileStatusMessage()
Description copied from interface: MVConnector
Returns error message from the most recent file operation error. If getFileStatusCode returns non-zero, call this to get a textual error message.

Specified by:
getFileStatusMessage in interface MVConnector
Returns:
Error message text of the most recent file operation failure

fileRead

public java.lang.String fileRead(java.lang.String path,
                                 java.lang.String itemId)
Description copied from interface: MVConnector
Reads an item from the file.

Specified by:
fileRead in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
Item body

fileReadU

public java.lang.String fileReadU(java.lang.String path,
                                  java.lang.String itemId)
Description copied from interface: MVConnector
Reads an item from the file, setting an item lock.

Specified by:
fileReadU in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
Item body if lock successful, otherwise a null string, and getFileStatusCode returns -1.

fileCacheRelease

public boolean fileCacheRelease(java.lang.String path)
Description copied from interface: MVConnector
Releases the associated file cache entry for the specified opened file on the MVSP server.

Specified by:
fileCacheRelease in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
true if successful

fileReadV

public java.lang.String fileReadV(java.lang.String path,
                                  java.lang.String itemId,
                                  int attribute)
                           throws MVException
Description copied from interface: MVConnector
Reads an item's attribute from the file.

Specified by:
fileReadV in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
attribute - The attribute number to read
Returns:
attribute's value
Throws:
MVException - if any errors occur

fileReadVU

public java.lang.String fileReadVU(java.lang.String path,
                                   java.lang.String itemId,
                                   int attribute)
                            throws MVException
Description copied from interface: MVConnector
Reads an item's attribute from the file, setting an item lock.

Specified by:
fileReadVU in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
attribute - The attribute number to read
Returns:
attribute's value
Throws:
MVException - if any errors occur

fileDelete

public java.lang.String fileDelete(java.lang.String path,
                                   java.lang.String itemId)
Description copied from interface: MVConnector
Deletes an item from the file.

Specified by:
fileDelete in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
null string

fileRelease

public java.lang.String fileRelease(java.lang.String path,
                                    java.lang.String itemId)
Description copied from interface: MVConnector
Releases an item lock set by a prior fileReadU.

Specified by:
fileRelease in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
null string

fileWrite

public java.lang.String fileWrite(java.lang.String path,
                                  java.lang.String itemId,
                                  java.lang.String itemBody)
Description copied from interface: MVConnector
Writes an item to the file, releasing the update lock set by a previous fileReadU of the same item.

Specified by:
fileWrite in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
null string

fileWriteU

public java.lang.String fileWriteU(java.lang.String path,
                                   java.lang.String itemId,
                                   java.lang.String itemBody)
Description copied from interface: MVConnector
Writes an item to the file, keeping update lock set by a previous fileReadU of the same item.

Specified by:
fileWriteU in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
Returns:
null string

fileWriteV

public java.lang.String fileWriteV(java.lang.String path,
                                   java.lang.String itemId,
                                   java.lang.String attributeBody,
                                   int attribute)
                            throws MVException
Description copied from interface: MVConnector
Writes a value to an item's attribute.

Specified by:
fileWriteV in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
attributeBody - The value to write
attribute - The attribute number to read
Returns:
null string
Throws:
MVException - if any errors occur

fileWriteVU

public java.lang.String fileWriteVU(java.lang.String path,
                                    java.lang.String itemId,
                                    java.lang.String attributeBody,
                                    int attribute)
                             throws MVException
Description copied from interface: MVConnector
Writes a value to an item's attribute, keeping update lock set by a previous fileReadU/fileReadVU of the same item.

Specified by:
fileWriteVU in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
itemId - item id
attributeBody - The value to write
attribute - The attribute number to read
Returns:
null string
Throws:
MVException - if any errors occur

fileSelect

public boolean fileSelect(java.lang.String path)
Description copied from interface: MVConnector
Selects the file specified by path for a subsequent fileReadNext

Specified by:
fileSelect in interface MVConnector
Parameters:
path - [dict][accountName,]fileName[,sectionName]
Returns:
true if success, otherwise false, in which case you need to call getFileStatusMessage() to see what went wrong.

fileReadNext

public java.lang.String fileReadNext()
Description copied from interface: MVConnector
Gets the next item ID from the current fileSELECT list.

Specified by:
fileReadNext in interface MVConnector
Returns:
item ID or null string if end of list. Since null item-ids are permissible, call fileOpOK(), which will return 1 if End of List.

getServerEnvironment

public java.lang.String getServerEnvironment()
Description copied from interface: MVConnector
Returns the server enviornment setting (STD, EUR, etc.)

Specified by:
getServerEnvironment in interface MVConnector
Returns:
string containing server platform

isFileExistCmdSupported

public boolean isFileExistCmdSupported()
Description copied from interface: MVConnector
Checks if the server supports the FILEEXISTS command.

Specified by:
isFileExistCmdSupported in interface MVConnector
Returns:
true if command is supported

isQueryKeywordsSupported

public boolean isQueryKeywordsSupported()
Description copied from interface: MVConnector
Checks if the server supports the queryKeywords parameter on the executeQuery method.

Specified by:
isQueryKeywordsSupported in interface MVConnector
Returns:
true if command is supported

MVSPClientVersion

public java.lang.String MVSPClientVersion()
Description copied from interface: MVConnector
Returns the MVSP client version.

Specified by:
MVSPClientVersion in interface MVConnector
Returns:
MVSP client version

transactionBegin

public boolean transactionBegin()
                         throws MVException
Description copied from interface: MVConnector
Begins a transaction in the database.

Specified by:
transactionBegin in interface MVConnector
Returns:
true if successful
Throws:
MVException - raised if any errors encountered.

transactionCommit

public boolean transactionCommit()
                          throws MVException
Description copied from interface: MVConnector
Commits a transaction in the database.

Specified by:
transactionCommit in interface MVConnector
Returns:
true if successful
Throws:
MVException - raised if any errors encountered.

transactionRollback

public boolean transactionRollback()
                            throws MVException
Description copied from interface: MVConnector
Rolls back a transaction in the database.

Specified by:
transactionRollback in interface MVConnector
Returns:
true if successful
Throws:
MVException - raised if any errors encountered.

getBaseConnector

public java.lang.Object getBaseConnector()
Description copied from interface: MVConnector
Returns implementing connector object.

Specified by:
getBaseConnector in interface MVConnector
Returns:
object represents the base connector.

transactionStatus

public boolean transactionStatus()
Description copied from interface: MVConnector
Returns true if currently in a transaction.

Specified by:
transactionStatus in interface MVConnector
Returns:
true if in a transaction.

isConnectionPoolingSupported

public final boolean isConnectionPoolingSupported()
Description copied from interface: MVConnector
Checks if connections can be pooled.

Specified by:
isConnectionPoolingSupported in interface MVConnector
Returns:
return true if pooling supported