Java wrapper for the OMQ::FsRemoteSend class in Qorus.
More...
Java wrapper for the OMQ::FsRemoteSend class in Qorus.
◆ FsRemoteSend() [1/2]
com.qoretechnologies.qorus.FsRemoteSend.FsRemoteSend |
( |
String |
remote, |
|
|
String |
path, |
|
|
HashMap< String, Object > |
options |
|
) |
| throws Throwable |
|
inline |
constructor taking a DbRemote object for the remote server
- Parameters
-
remote | a string giving the name of the remote connection for the remote server |
path | a string with full or relative path of the target file (inluding file name) |
options | optional Streaming API Constructor Options as follows:
"timeout" : an HTTP socket timeout value in milliseconds; used locally and in the remote for socket I/O and queue operations; default value: 5m
"loglevel" : a default log level option for logging; see Log Levels for valid value
"block" : data block size (default 16384, minimum 4096); the number of bytes sent in each DataStream protocol chunk
"queue_block_size" : the number of blocks to queue for sending before the main data thread will block (default: 2)
"queue_timeout" : the number of milliseconds to wait for queue data before throwing a QUEUE-TIMEOUT exception
"no_remote_timeout" : if True the "timeout" option will not be sent to the remote
|
- Note
- to calculate the total data queued for the socket I/O thread, multiply block by queue_block_size (default 16384 * 2 = 32768 bytes)
- the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object
◆ FsRemoteSend() [2/2]
com.qoretechnologies.qorus.FsRemoteSend.FsRemoteSend |
( |
DbRemote |
remote, |
|
|
String |
path |
|
) |
| throws Throwable |
|
inline |
constructor taking a DbRemote object for the remote server
- Parameters
-
remote | a string giving the name of the remote connection for the remote server |
path | a string with full or relative path of the target file (inluding file name) |
- Note
- the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object
◆ append() [1/2]
void com.qoretechnologies.qorus.FsRemoteSend.append |
( |
String |
data | ) |
throws Throwable |
|
inline |
Append data to the ready queue.
- Example:
try {
fs.append(str);
}
fs.commit();
} catch (Throwable e) {
fs.cancel();
} finally {
fs.release();
}
- Parameters
-
Data are queued for sending when the buffered byte count reaches the block
size.
- Note
- make sure to call either commit() (to flush all data to the server) or cancel() (to cancel the I/O operation) before continuing (see the example above)
- exceptions thrown in the socket I/O thread will be rethrown when this method is called so that errors can be handled in the main data thread
◆ append() [2/2]
void com.qoretechnologies.qorus.FsRemoteSend.append |
( |
byte [] |
data | ) |
throws Throwable |
|
inline |
Append data to the ready queue.
- Example:
try {
fs.append(str);
}
fs.commit();
} catch (Throwable e) {
fs.cancel();
} finally {
fs.release();
}
- Parameters
-
Data are queued for sending when the buffered byte count reaches the block
size.
- Note
- make sure to call either commit() (to flush all data to the server) or cancel() (to cancel the I/O operation) before continuing (see the example above)
- exceptions thrown in the socket I/O thread will be rethrown when this method is called so that errors can be handled in the main data thread
◆ cancel()
void com.qoretechnologies.qorus.FsRemoteSend.cancel |
( |
| ) |
throws Throwable |
|
inline |
this method purges any queued I/O and stops the socket thread and returns when the socket I/O thread has terminated
- Example:
try {
fs.append(str);
}
fs.commit();
} catch (Throwable e) {
fs.cancel();
} finally {
fs.release();
}
- Note
- either this method or commit() should be called to ensure that all data has been sent
◆ commit()
void com.qoretechnologies.qorus.FsRemoteSend.commit |
( |
| ) |
throws Throwable |
|
inline |
this method flushes all buffered I/O to the remote server and returns when all data have been sent to the server and the socket I/O thread has terminated
- Example:
try {
fs.append(str);
}
fs.commit();
} catch (Throwable e) {
fs.cancel();
} finally {
fs.release();
}
Log messages are created with performance information (bytes send, time of transfer, bytes / second, etc).
- Note
- either this method, flush() or cancel() should be called to ensure that all data has been sent
- exceptions thrown in the socket I/O thread will be rethrown when this method is called so that errors can be handled in the main data thread
- equivalent to flush()
- See also
- flush()
◆ del()
void com.qoretechnologies.qorus.FsRemoteSend.del |
( |
| ) |
throws Throwable |
|
inline |
executes an implicit commit() and deletes the file given in path
in the constructor()
- Example:
try {
fs.append(str);
}
fs.commit();
fs.del();
} catch (Throwable e) {
fs.cancel();
} finally {
fs.release();
}
- Note
- do not call this method before all data have been sent (ie call only after calling commit() first as in the example above)
◆ rename()
void com.qoretechnologies.qorus.FsRemoteSend.rename |
( |
String |
target, |
|
|
boolean |
man |
|
) |
| throws Throwable |
|
inline |
executes an implicit commit() and renames/moves the file given in path
in the constructor()
- Example:
try {
fs.append(str);
}
fs.commit();
fs.rename(final_name);
} catch (Throwable e) {
fs.cancel();
} finally {
fs.release();
}
- Parameters
-
target | a new path with filename. Relative to user connection if the user connection constructor is used. |
man | rename the file manually by copying the file's data and then deleting the source file, this is sometimes necessary on some OSes when renaming files across filesystem boundaries |
- Warning
- The original file after the rename does not exist anymore if
man
is set to True. Any additional append() call will result in an exception.
- Note
- do not call this method before all data have been sent (ie call only after calling commit() first as in the example above)
The documentation for this class was generated from the following file:
- /builds/qorus/qorus/java/com/qoretechnologies/qorus/FsRemoteSend.java