|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.jzos.ZLogstream
public class ZLogstream
A JNI Wrapper for z/OS Logstreams, supporting IXGCONN (connect) and IXGWRITE (write) services.
Refer to "z/OS MVS Programming: Assembler Services Guide" - SA22-7605 for more information on defining and using z/OS Logstreams, aka "the z/OS System Logger".
Note:If a Java security manager is active, it is used to check permissions for writing to a resource path name generated from the logstream name. For a logstream named "XXX.YYY.ZZZ", a pathname of "/LOGSTREAM/XXX/YYY/XXX" is used.
ZLogstreamException
Field Summary | |
---|---|
static long |
DEFAULT_RETRY_SLEEP_MS
The time, in milliseconds to sleep between retries |
static int |
DEFAULT_WRITE_RETRY_COUNT
The count for retries certain write errors |
Constructor Summary | |
---|---|
ZLogstream(java.lang.String name)
Constructor that creates a ZLogstream instance wrapper and connects to the named z/OS Logstream. |
Method Summary | |
---|---|
void |
close()
Closes this ZLogstream by disconnecting from the z/OS Logstream. |
java.lang.String |
getName()
Answers the name of the logstream |
long |
getRetrySleepTimeMs()
|
byte[] |
getToken()
Answers the 16-byte logstream token |
int |
getWriteRetryCount()
|
void |
setRetrySleepTimeMs(long retryTimeMs)
|
void |
setWriteRetryCount(int writeRetryCount)
|
java.lang.String |
toString()
Answer a String representation of the receiver |
void |
write(byte[] bytes,
int offset,
int len,
boolean sync)
Writes bytes to the ZLogstream by disconnecting from the z/OS Logstream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_WRITE_RETRY_COUNT
public static final long DEFAULT_RETRY_SLEEP_MS
Constructor Detail |
---|
public ZLogstream(java.lang.String name) throws ZLogstreamException
This method calls the IXGCONN macro to create a connection to the named logstream.
name
- the name of the z/OS logstream to open, length <= 26 characters
ZLogstreamException
- if the logstream could not be connected
java.lang.SecurityException
- if a SecurityManager is active and the required
permission is not granted based on the policy
in effect. TheMethod Detail |
---|
public void close() throws ZLogstreamException
This method calls the IXGCONN macro to disconnect from the logstream. This method does nothing if the ZLogstream has already been closed.
ZLogstreamException
- if there was an error disconnecting.public void write(byte[] bytes, int offset, int len, boolean sync) throws ZLogstreamException
This method calls the IXGWRITE macro to write bytes to the logstream. If a RC=8/082D error occurs (Invalid Token), then try to reconnect to the logstream and retry. If a RC=8/0868 occurs (Stage Formatting not Finished), sleep a little (retryTimeMs) and retry for up to writeRetryCount times.
bytes
- the byte array containing the raw block to write via IXGWRITEoffset
- the offset in bytes to beginning of block to writelen
- the length of the block to writesync
- if true, use IXGWRITE MODE=SYNC, otherwise MODE=ASYNCNORESPONSE
ZLogstreamException
- if there was an error from IXGWRITE, or possibly IXGCONN on a reconnectsetWriteRetryCount(int)
,
setRetrySleepTimeMs(long)
public java.lang.String getName()
public byte[] getToken()
public int getWriteRetryCount()
public void setWriteRetryCount(int writeRetryCount)
writeRetryCount
- the default retry count for certain kinds of write errorspublic long getRetrySleepTimeMs()
public void setRetrySleepTimeMs(long retryTimeMs)
retryTimeMs
- the time to sleep in ms between retriespublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |