3 import org.yaz4j.exception.ZoomException;
4 import org.yaz4j.jni.SWIGTYPE_p_ZOOM_package_p;
5 import org.yaz4j.jni.yaz4jlib;
8 * Allows to perform an extended-service operation.
10 * Once created, a package is configured by means of options, then the package
11 * is send and the result is inspected (again, by means of options).
13 * @see org.yaz4j.ConnectionExtended#getPackage(java.lang.String)
17 public class Package {
19 private ConnectionExtended conn;
20 private SWIGTYPE_p_ZOOM_package_p pack;
21 private final String type;
23 Package(SWIGTYPE_p_ZOOM_package_p pack, ConnectionExtended conn, String type) {
25 throw new NullPointerException("type cannot be null");
31 public void finalize() {
36 * Write option for a specified key
37 * @param key option name
38 * @param value option value
39 * @return package (self) for chainability
41 public Package option(String key, String value) {
43 throw new NullPointerException("option name cannot be null");
44 yaz4jlib.ZOOM_package_option_set(pack, key, value);
49 * Read option for a specified key.
50 * @param key option name
51 * @return option value
53 public String option(String key) {
55 throw new NullPointerException("option name cannot be null");
56 return yaz4jlib.ZOOM_package_option_get(pack, key);
63 yaz4jlib.ZOOM_package_send(pack, type);
68 yaz4jlib.ZOOM_package_destroy(pack);