|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.net.connect.ConnectClient
public class ConnectClient
This is the base class for TelnetConnectClient and TunneledConnectClient.
Field Summary | |
---|---|
protected boolean |
abort
|
protected com.sas.net.sharenet.Wqefcb |
clientFcb
|
protected boolean |
connected
|
static java.lang.Integer |
LINE_TYPE_BYLINE
Line type code for by LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_ERROR
Line type code for error LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_FOOTNOTE
Line type code for footnote LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_HILIGHTED
Line type code for highlighted LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_MESSAGE
Line type code for message LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_NORMAL
Line type code for normal LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_NOTE
Line type code for note LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_SOURCE
Line type code for program source code LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_TITLE
Line type code for title LOG and LIST lines. |
static java.lang.Integer |
LINE_TYPE_WARNING
Line type code for warning LOG and LIST lines. |
Constructor Summary | |
---|---|
ConnectClient()
Constructs a SAS/CONNECT driver for Java ConnectClient object. |
|
ConnectClient(java.util.Properties info)
Constructs a SAS/CONNECT driver for Java ConnectClient object. |
Method Summary | |
---|---|
protected void |
addEditLine(java.lang.String editline)
Add edit lines to the editLines buffer. |
void |
addExtension(java.lang.String name,
java.lang.ClassLoader cl)
Adds an extension to the Connect protocol; for future extensions only. |
protected void |
addRecords(com.sas.net.connect.ConnectRecord record,
boolean must)
This method adds a record to the buffer and sends the buffer if necessary. |
protected void |
checkDownloadRecno(int recno)
Check final number of records. |
protected boolean |
checkOptions(int optionFlag)
Check options. |
void |
clearEditLines()
Clears the edit lines. |
void |
clearListLines()
Clears output lines in the LIST file. |
void |
clearLogLines()
Clears the LOG lines in the internal LOG line buffer. |
protected void |
connect(java.net.Socket socket,
com.sas.net.crypto.CipherInterface cipher)
Connects to the remote SAS session. |
void |
connect(java.lang.String host,
int port)
Connects to the remote SAS session. |
protected void |
createDownload(java.lang.String name,
int lrecl,
boolean text)
Create download file object. |
void |
disconnect()
Disconnects and shuts down the remote SAS session. |
protected boolean |
drain()
Drain all messages from the the server. |
protected void |
finalize()
The finalize method is called automatically when this class is garbage collected. |
protected boolean |
flush()
Transmit the current buffer. |
byte[] |
getDownloadData(java.lang.String name)
Gets the contents of a downloaded file. |
java.lang.String |
getDriverName()
Gets the name and version number of the SAS/CONNECT driver for Java component. |
java.lang.String |
getEditLines()
Gets edit lines. |
int |
getListLineCount()
Get the number of lines in the internal LIST line buffer. |
java.lang.String |
getListLines()
Gets the lines that SAS generated in the LIST file from the internal LIST line buffer as a single String. |
int |
getListLines(java.lang.String[] lines,
java.lang.Integer[] types)
Gets the lines that SAS generated in the LIST file from the internal LIST line buffer as an array of String with line types associated. |
int |
getLogLineCount()
Get the number of lines in the internal LOG line buffer. |
java.lang.String |
getLogLines()
Gets the lines that SAS generated in the LOG file from the internal LOG line buffer as a single String. |
int |
getLogLines(java.lang.String[] lines,
java.lang.Integer[] types)
Gets the lines that SAS generated in the LOG file from the internal LOG line buffer as an array of String with line types associated. |
int |
getMajorSasVersion()
Gets the major release number of the remote SAS server. |
int |
getMinorSasVersion()
Gets the minor release number of the remote SAS server. |
protected int |
getMver()
Gets the remote SAS session version number. |
protected int |
getOptions()
Get options. |
protected boolean |
getRecords()
Receive a message from the server. |
java.sql.Connection |
getSharenet()
Starts the Single User Server. |
java.lang.String |
getTextTransportFormat()
Returns the name of the character encoding used to convert SAS programs to byte arrays before submitting them and to convert received byte arrays representing log and list lines to strings. |
boolean |
isConnected()
Gets the value of the connected property. |
protected void |
mergeOptions(int masterOptions)
Merge options. |
void |
rcancel()
Cancels the statements that were sent to the remote SAS session. |
void |
rsubmit(java.lang.String lines)
Submits SAS statements to the remote SAS session. |
protected void |
send(com.sas.net.sharenet.Wqefcb fcb)
Send a message to the server. |
void |
setLogException(boolean logException)
Sets the logException property. |
protected void |
setMver(int masterVersion)
Save the version number of the remote SAS session. |
protected void |
setTextTransportFormat(java.lang.String s)
|
Field Detail |
---|
public static final java.lang.Integer LINE_TYPE_NORMAL
public static final java.lang.Integer LINE_TYPE_HILIGHTED
public static final java.lang.Integer LINE_TYPE_SOURCE
public static final java.lang.Integer LINE_TYPE_TITLE
public static final java.lang.Integer LINE_TYPE_BYLINE
public static final java.lang.Integer LINE_TYPE_FOOTNOTE
public static final java.lang.Integer LINE_TYPE_ERROR
public static final java.lang.Integer LINE_TYPE_WARNING
public static final java.lang.Integer LINE_TYPE_NOTE
public static final java.lang.Integer LINE_TYPE_MESSAGE
protected com.sas.net.sharenet.Wqefcb clientFcb
protected boolean connected
protected boolean abort
Constructor Detail |
---|
public ConnectClient()
public ConnectClient(java.util.Properties info)
info
- java.util.Properties object which contains:
true
and false
. The default is
false
.
session
and none
.
session
means that all messages exchanged in a session will be
examined and compressed if the compression would yield a smaller message. This
is the default behavior. none
means that no messages will be
compressed. This behavior is useful in SAS/CONNECT sessions in which the time used
to compress and decompress data does not justify the amount of space saved by
compression. This may be the case when the data exchanged are primarily binary.
java.lang.String
objects and the byte
arrays
that are transmitted to and received from the server. If no value is
specified for this property, the default character conversion will
be used. When connecting to a SAS/CONNECT server of version 8.1 or later, this
information is determined automatically so the textTransportFormat
property
is ignored.
Method Detail |
---|
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- if an exception occurs during garbage collectionpublic boolean isConnected()
false
. It
is set to true
when connect()
is called,
and it is set back to false
when
disconnect()
is called.
public java.lang.String getDriverName()
public int getMajorSasVersion() throws ConnectException
ConnectException
- if there is no
live connection to a SAS server.public int getMinorSasVersion() throws ConnectException
ConnectException
- if there is no
live connection to a SAS server.public void setLogException(boolean logException)
logException.
- If True, the ConnectClient will throw a ConnectLogException
when it detects a message in the SAS log indicating an error.public void connect(java.lang.String host, int port) throws ConnectException
host
- Host name or address of the machine on which the remote SAS session is running.port
- TCP/IP port number on which the SAS session is listening.
ConnectException
- if any exceptions are detected.protected void connect(java.net.Socket socket, com.sas.net.crypto.CipherInterface cipher) throws ConnectException
socket
- TCP socket to use for communications.
ConnectException
- if any exceptions are detected.public java.sql.Connection getSharenet() throws ConnectException
ConnectException
- if the Single User Server could not be started, or
detected an error.public void rsubmit(java.lang.String lines) throws ConnectException, ConnectLogException
lines
- The SAS statements that you want to submit.
ConnectException
- if an error is detected.
ConnectLogException
public void rcancel()
public void disconnect() throws ConnectException
ConnectException
- if an error is detected.public java.lang.String getLogLines()
\n
".
public int getLogLines(java.lang.String[] lines, java.lang.Integer[] types)
String
with line types associated. This
method copies
N lines from its buffer of LOG lines into lines
and copies the associated line type for each line into
types. N is the smallest of
lines.length
, types.length
, and
the size of the buffer of LOG lines. The size of the internal LOG
line buffer can be determined in advance by calling
getLogLineCount()
. Each line type is
one of the LINE_TYPE_* fields on this class.
public int getLogLineCount()
public void clearLogLines()
public java.lang.String getListLines()
\n
".
public int getListLines(java.lang.String[] lines, java.lang.Integer[] types)
String
with line types associated. This
method copies
N lines from its buffer of LIST lines into lines
and copies the associated line type for each line into
types. N is the smallest of
lines.length
, types.length
, and
the size of the buffer of LIST lines. The size of the internal LIST
line buffer can be determined in advance by calling
getListLineCount()
. Each line type is
one of the LINE_TYPE_* fields on this class.
public int getListLineCount()
public void clearListLines()
public java.lang.String getEditLines()
public void clearEditLines()
public byte[] getDownloadData(java.lang.String name) throws ConnectException
name
- The name of the downloaded file.
ConnectException
- if an error is detected.public void addExtension(java.lang.String name, java.lang.ClassLoader cl) throws ConnectException
name
- The class name of the extension.cl
- The class loader to load the extension. If null, the class
loader that loaded this class will be used.
ConnectException
- if the named extension cannot be
instantiated or does not support the required interface.public java.lang.String getTextTransportFormat()
null
is returned,
then the default character encoding should be
used.
protected boolean getRecords() throws ConnectException
ConnectException
- if an error is detectedprotected void addRecords(com.sas.net.connect.ConnectRecord record, boolean must) throws ConnectException
record
- record to be sent to the remote SAS sessionmust
- boolean true if message must be sent immediately
ConnectException
- if error is detectedprotected boolean drain() throws ConnectException
ConnectException
- if an error is detected.protected boolean flush() throws ConnectException
ConnectException
- if an error is detected.protected void send(com.sas.net.sharenet.Wqefcb fcb) throws ConnectException
fcb
- function control block that contains the message
ConnectException
- if an error is detectedprotected void addEditLine(java.lang.String editline)
editLine
- String to be added to editLines buffer.protected void createDownload(java.lang.String name, int lrecl, boolean text) throws ConnectException
name
- String used to refer to the downloaded filelrecl
- int number of records for downloaded filetext
- True if file is a text file, False if binary
ConnectException
- if an error is detectedprotected void checkDownloadRecno(int recno) throws ConnectException
recno
- number of records in downloaded file.
ConnectException
- if an error is detectedprotected void setMver(int masterVersion)
masterVersion
- int version number of remote SAS session.protected int getMver()
protected void setTextTransportFormat(java.lang.String s)
protected void mergeOptions(int masterOptions)
masterOptions
- int options set in remote SAS session.protected boolean checkOptions(int optionFlag)
optionFlag
- ands the option flags with this objects options settings.
protected int getOptions()
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |