4D S.A. Copyright 2001

j4d.open
Class opConnection

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--j4d.open.opConnection
All Implemented Interfaces:
opConstants, java.lang.Runnable

public class opConnection
extends java.lang.Thread
implements opConstants

The class opConnection provides methods for basic connectivity operations.


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface j4d.open.opConstants
ACCESS_PRIVILEGE_VIOLATION, ALLOW_4D_CLIENT_ONLY_IS_CHECKED, ALPHANUMERIC, ALPHANUMERIC_ARRAY, ALPHANUMERIC2, AND, API_NOT_COMPATIBLE_WITH_SERVER, BACKUP_IN_PROGRESS, BAD_SEARCH_TABLE_DEFINITION, BAD_SORT_TABLE_DEFINITION, BLOB, BLOB_ARRAY, BLOBSTA, BOOLEAN, BOOLEAN_ARRAY, CHARSET_PROBLEM, CONNECTION_DO_ERR, CONNECTION_LL1_ERR, CONNECTION_LL2_ERR, CONNECTION_LL3_ERR, CONNECTION_LL4_ERR, CONTAIN, DATA_FIELD_PROBLEM, DATE, DATE_ARRAY, DISCONNECTION_ERR, DOES_NOT_CONTAIN, DUPLICATE_KEY_INDEX, EQUAL, EXCEPT, FIELD_IS_NOT_INDEXED, FIELD_IS_NOT_RELATED_TO, FIELD_NUMBER_IS_OUT_OF_RANGE, GREATER_THAN, GREATER_THAN_OR_EQUAL, INDEX_PAGE_OUT_OF_RANGE, INTEGER, INTEGER_ARRAY, INVALID_FIELD_TABLE_DEFINITION, INVALID_FIELD_TYPE, INVALID_INDEX_PAGE, INVALID_PASSWORD, INVALID_RECORD_ADDRESS, INVALID_RECORD_NUMBER, INVALID_RECORD_STRUCTURE, INVALID_SELECTED_RECORD_NUMBER, INVALID_STRUCTURE, INVALID_TYPE_REQUESTED, LESS_THAN, LESS_THAN_OR_EQUAL, LIMIT_OF_DEMO, LONGINTEGER, LONGINTEGER_ARRAY, MAXIMUM_NUMBER_OF_RECORDS_REACHED, NO_ARRAY_BLOB, NO_CURRENT_RECORD, NO_MORE_SPACE_AVAILABLE_TO_SAVE_RECORD, NONE, NOT_EQUAL, OLD_SERVER_ERR, OR, OTHER_RECORD_ARE_RELATED, PICTURE, PICTURE_ARRAY, PREPARE_LOGIN_ERR, PROCESS_COULD_NOT_BE_STARTED, REAL, REAL_ARRAY, RECORD_ALLREADY_DELETED, RECORD_COULD_NOT_BE_LOADED, RECORD_LOCKED_DURING_AUTOMATIC_DELETION, RECORD_NOT_IN_SELECTION, RECORD_OUT_OF_RANGE, RECURSIVE_INTEGRITY, SELECTION_DOES_NOT_EXIST, SLEEPING_PROCESS_ERR, STACK_IS_FULL, START_PROCESS_ERR, STOP_PROCESS_ERR, STRUCTURE_IS_LOCKED, SUBTABLE, TABLE_NUMBER_IS_OUT_OF_RANGE, TEXT, TEXT_ARRAY, TEXTSTA, TIME, TIME_ARRAY, TIME_OUT_EXPIRED, TIMEOUT, TRANSACTION_CANCELLED_DUPLICATE_KEY, TRANSACTION_INDEX_PAGE_COULD_NOT_BE_LOADED, TRIC_RESSOURCES_ARE_NOT_THE_SAME, UNABLE_TO_CLEAR_SELECTION, UNABLE_TO_OPEN_SOCKET_ERR, UNKNOWN_USER, UNSPECIFIED_CURRENT_RECORD, UNSPECIFIED_FIELD, UNSPECIFIED_FIELD_NAME, UNSPECIFIED_LOP, UNSPECIFIED_PROCESS_NAME, UNSPECIFIED_RECORD, UNSPECIFIED_RECORD_IN_SELECTION, UNSPECIFIED_SELECTION_NAME, UNSPECIFIED_SEMAPHORE_NAME, UNSPECIFIED_SET_NAME, UNSPECIFIED_SOP, UNSPECIFIED_TABLE, UNSPECIFIED_TABLE_NAME, UNSPECIFIED_TARGET_TABLE, VINTERPROCESS, VPROCESS
 
Method Summary
 void CloseConnection()
          The method CloseConnection close the current connection.
 int getCharSetId()
          The method getCharSetId return the CharSet ID.
 double getSleepValue()
          This method return the Sleeping Value of the opConnection object.
 boolean IsClosed()
          The method IsClosed test whether the connection is closed or not.
 void run()
           
 void setSleepValue(double val)
          This method is used to tune the Sleeping Value of the opConnection object, which runs in its own thread.
 opProcess startProcess(java.lang.String station, java.lang.String user, java.lang.String password, java.lang.String description)
          The method startProcess create a process on the current connection.
 void stopProcess(opProcess process)
          The method stopProcess close the process passed as parameter.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

CloseConnection

public void CloseConnection()
                     throws opException
The method CloseConnection close the current connection. If there is no current connection, CloseConnection has no effect.
See Also:
4D Open for Java examplet

startProcess

public opProcess startProcess(java.lang.String station,
                              java.lang.String user,
                              java.lang.String password,
                              java.lang.String description)
                       throws opException
The method startProcess create a process on the current connection.
Note: you can create simultaneously up to 6 processes for one connection.
Parameters:
station - Name of the machine.
user - Name of the user.
password - Password of the user.
description - Description of the connection.
Returns:
a newer process.
See Also:
4D Open for Java examplet

stopProcess

public void stopProcess(opProcess process)
                 throws opException
The method stopProcess close the process passed as parameter.
Parameters:
process - Process to close.
See Also:
4D Open for Java examplet

run

public void run()
Overrides:
run in class java.lang.Thread

getSleepValue

public double getSleepValue()
This method return the Sleeping Value of the opConnection object. The value is comprised between 0.0 and 1.0.
Returns:
double The value of sleeping.

setSleepValue

public void setSleepValue(double val)
This method is used to tune the Sleeping Value of the opConnection object, which runs in its own thread. It expects a double value comprised between 0.0 and 1.0. Set it up to a small value to choose a minimal sleeping value, which means that the thread will check often the buffer status to see if some new data has been received. Set it up to a larger value, and opConnection will check less often the buffer but will use less CPU.
Tip : when you expect to receive a large chunk of data, set it up to 0.0 just before making the Java Open call. Set it back to 1.0 just right after.
Parameters:
double - a value between 0.0 and 1.1.

getCharSetId

public int getCharSetId()
The method getCharSetId return the CharSet ID.
Returns:
int the CharSet ID.

IsClosed

public boolean IsClosed()
The method IsClosed test whether the connection is closed or not.
Returns:
boolean True if closed and False if not.

4D S.A. Copyright 2001

4D S.A.