Source code: com/flexstor/ejb/bucket/persist/BucketPersist.java
1 /*
2 * BucketPersist.java
3 *
4 * Copyright $Date: 2003/08/11 02:22:44 $ FLEXSTOR.net Inc.
5 *
6 * This work is licensed for use and distribution under license terms found at
7 * http://www.flexstor.org/license.html
8 *
9 */
10
11 package com.flexstor.ejb.bucket.persist;
12
13 import java.rmi.RemoteException;
14 import java.util.Vector;
15
16 import com.flexstor.common.data.ejb.bucket.BucketData;
17 import com.flexstor.common.exceptions.ejb.EjbException;
18 import com.flexstor.common.exceptions.ejb.NotFoundException;
19 import com.flexstor.common.keys.ejb.BucketKey;
20 import com.flexstor.ejb.EjbObject;
21
22 /**
23 * This is the client interface for obtaining a
24 * bucket Data Object.
25 *
26 * @author Daniel J. Nickel
27 * @version $Id: BucketPersist.java,v 1.2 2003/08/11 02:22:44 aleric Exp $
28 * @since FlexDB 3.0
29 * @see com.flexstor.ejb.dataobject.BucketData
30 *
31 */
32
33 public interface BucketPersist
34 extends EjbObject
35 {
36 /* MKS Identifier */
37 public final static String IDENTIFIER="$Id: BucketPersist.java,v 1.2 2003/08/11 02:22:44 aleric Exp $";
38
39 /**
40 * This will get A Bucket Data object based upon
41 * an Identifier.
42 *
43 * @param id This is the id of a Bucket
44 * @exception java.rmi.RemoteException
45 * @since FlexDB 3.0
46 */
47 BucketData getDataObject( int id )
48 throws EjbException, RemoteException, NotFoundException;
49
50 /**
51 * This will get A list of BucketData objects
52 * based on Label. This will
53 * return a list of close matches. The string should
54 * be a partial pattern and then a query will be performed.
55 * <br><br>
56 * <pre>Example: queryDataObjects( "Label 1%" );</pre><br><br>
57 * Will return all names which begin with the pattern.
58 * <br><br>
59 * <pre>Example: queryDataObjects( "%Label%" );</pre><br><br>
60 * Will return all names which contains the pattern.
61 *
62 * @param label This is the label of a Bucket
63 * @exception java.rmi.RemoteException
64 * @since FlexDB 3.0
65 */
66 Vector queryDataObjects( String label )
67 throws EjbException, RemoteException, NotFoundException;
68
69 /**
70 * This will get the Data Object based upon key.
71 *
72 * @param key A reference to a Bucket row
73 * @exception java.rmi.RemoteException
74 * @since FlexDB 3.0
75 */
76 BucketData getDataObject(BucketKey key)
77 throws EjbException, RemoteException, NotFoundException;
78
79
80 /**
81 * This will update a bucket row. There MUST
82 * contain a Database key! If key is null in the
83 * dataobject then a RemoteException is thrown!
84 * <br><br>
85 * Also the id needs to be set to the valid id or
86 * id will become null.
87 *
88 * @param disDat com.flexstor.ejb.dataobject.BucketData
89 * @exception java.rmi.RemoteException
90 * @since FlexDB 3.0
91 */
92
93 void update(BucketData fieldDat)
94 throws EjbException, RemoteException;
95
96 /**
97 * Insert a new bucket column in the bucket table. This will
98 * insert a new field and return a Bucket key.
99 *
100 * @param fieldDat BucketData Object
101 *
102 * @return com.flexstor.ejb.key.BucketKey
103 *
104 * @exception com.flexstor.ejb.exceptions.ServerException
105 * @exception java.rmi.RemoteException
106 */
107
108 public BucketKey insert( BucketData fieldDat )
109 throws EjbException, RemoteException;
110
111 /**
112 * Remove a Bucket From database Based upon key. Throws
113 * exception if error removing row.
114 *
115 * @param key BucketKey Object
116 * @exception com.flexstor.ejb.exceptions.EjbException
117 * @exception java.rmi.RemoteException
118 */
119 public void remove( BucketKey key )
120 throws EjbException, RemoteException;
121 }