Use Maven for building yaz4j.
[yaz4j-moved-to-github.git] / src / main / java / org / yaz4j / Package.java
1 package org.yaz4j;
2
3 import org.yaz4j.jni.SWIGTYPE_p_ZOOM_package_p;
4 import org.yaz4j.jni.yaz4jlib;
5
6 public class Package
7 {
8         private SWIGTYPE_p_ZOOM_package_p pack = null ;
9         private ConnectionExtended connection = null ;  
10         private String type;
11
12         Package(SWIGTYPE_p_ZOOM_package_p pack, ConnectionExtended connection, String type)
13         {
14                 this.type = type;
15                 this.connection = connection;
16                 this.pack = pack;
17         }
18         
19         public void finalize()
20         {
21                 Dispose();
22         }
23         
24         public PackageOptionsCollection getPackageOptions()
25         {
26            return new PackageOptionsCollection(pack);
27         }
28         
29         public void Send()
30         { 
31                 yaz4jlib.ZOOM_package_send( pack, type );
32         }
33         
34         public void Dispose()
35         {
36                 if ( pack != null )
37                 {
38                         yaz4jlib.ZOOM_package_destroy( pack );
39                         connection = null;
40                         pack = null ;
41                 }
42         }
43 }