Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/flexstor/ejb/server/persist/ServerPersist.java


1   /*
2    * ServerPersist.java
3    *
4    * Copyright $Date: 2003/08/11 02:22:47 $ 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.server.persist;
12  
13  import java.rmi.RemoteException;
14  import java.util.Hashtable;
15  import java.util.Vector;
16  
17  import com.flexstor.common.data.ejb.server.ServerData;
18  import com.flexstor.common.exceptions.ejb.DuplicateRecordException;
19  import com.flexstor.common.exceptions.ejb.EjbException;
20  import com.flexstor.common.exceptions.ejb.NotFoundException;
21  import com.flexstor.common.keys.ejb.ServerCollectionKey;
22  import com.flexstor.common.keys.ejb.ServerKey;
23  import com.flexstor.ejb.EjbObject;
24  
25  /**
26   *
27   * <P>
28   * ServerPersist <BR>
29   * <BLOCKQUOTE>
30   *    Inserts, updates, remove and queries information from the SERVER table. <BR>
31   * </BLOCKQUOTE>
32   * </P>
33   *
34   * <P>
35   * Uses cache: yes
36   *
37   * State Management Type: Stateless
38   * </P>
39   *
40   * Configurable properties in flexdm.properties: <BR>
41   * <BLOCKQUOTE>
42   * <P>
43   *    NONE <BR>
44   * </P>
45   * </BLOCKQUOTE>
46   *
47   */
48  public interface ServerPersist 
49      extends EjbObject 
50  {
51    // MKS macro expander
52    public final static String IDENTIFIER = "$Id: ServerPersist.java,v 1.4 2003/08/11 02:22:47 aleric Exp $";    
53  
54  
55     /**
56      * Retrieve a Server data object
57      * Transaction Attribute: Not Supported
58      *
59      * @param aKey a server object reference
60      * @return  - a Server data object
61      *
62      * @exception EjbException - an error occured obtaining a server
63      * @exception RemoteException - Some problem occured with the EJB server
64      */
65     public ServerData getServer(ServerKey aKey)
66        throws EjbException, RemoteException;
67  
68     /**
69      * Retrieve a Server data object
70      * Transaction Attribute: Not Supported
71      *
72      * @param aServerName The name of a server
73      * @return - a ServerData object
74      *
75      * @exception NotFoundException - Server not found in the database
76      * @exception EjbException - an error occured obtaining an server
77      * @exception RemoteException - Some problem occured with the EJB server
78      */
79     public ServerData getServer(String aServerName)
80        throws EjbException, RemoteException, NotFoundException;
81  
82     /**
83      * Retrieve a list of all servers registered in the system
84      * Transaction Attribute: Not Supported
85      *
86      * @return - an ServerData collection with the server name (String) as its key
87      *
88      * @exception EjbException - An error occured with the database query
89      * @exception RemoteException - Some problem occured with the EJB server
90      *
91      * @see com.flexstor.common.data.ejb.user.ServerData
92      */
93     public Hashtable getServerList()
94        throws EjbException, RemoteException;
95  
96     /**
97      * Retrieve a collection of Server data objects
98      * Transaction Attribute: Not Supported
99      *
100     * @param aKey a server collection object reference
101     * @return - an ServerData collection with the ServerData server name(String) as its key
102     *
103     * @exception EjbException - an error occured obtaining an list of servers
104     * @exception RemoteException - Some problem occured with the EJB server
105     */
106    public Hashtable getServers(ServerCollectionKey aKey)
107       throws EjbException, RemoteException;
108 
109    /**
110     * Retrieve a collection of ServerData from a collection of ServerCollectionKeys
111     * Transaction Attribute: Not Supported
112     *
113     * @param aServerKeyCollection list of object references to a collection of server objects
114     * @return - ServerData collection
115     *
116     * @exception EjbException - an error occured obtaining an email address
117     * @exception RemoteException - Some problem occured with the EJB server
118     *
119     * @see com.flexstor.common.keys.ejb.ServerCollectionKey
120     * @see com.flexstor.common.data.ejb.user.ServerData
121     */
122    public Hashtable getServers(Vector aServerKeyCollection)
123       throws EjbException, RemoteException;
124 
125    /**
126     * Insert a new server into the server database.
127     * Transaction Attribute: Required
128     *
129     * @param aServer the Server data object to be inserted
130     * @return - a reference to the new object
131     *
132     * @exception DuplicateRecordException - a row already exists within the database with the given key
133     * @exception EjbException - an error occured inserting an email address
134     * @exception RemoteException - Some problem occured with the EJB server
135     */
136    public ServerKey insert(ServerData aServer)
137       throws DuplicateRecordException, EjbException, RemoteException;
138 
139    /**
140     * Remove a server from the server database.
141     * Transaction Attribute: Required
142     *
143     * @param aServerKey a reference to the Server object to be removed
144     *
145     * @exception EjbException - an error occured deleting an server
146     * @exception RemoteException - Some problem occured with the EJB server
147     */
148    public void remove(ServerKey aServerKey)
149       throws EjbException, RemoteException;
150 
151    /**
152     * Save the current state of the object to the database.
153     * Transaction Attribute: Required
154     *
155     * @param aDataObject a Server data object
156     *
157     * @exception EjbException - an error occured updating server information
158     * @exception RemoteException - Some problem occured with the EJB server
159     */
160    public void update(ServerData aDataObject)
161       throws EjbException, RemoteException;
162       
163    /**
164     * Load all servers into the EJB Server's cache directory
165     * 
166     * @exception EjbException - An error occured loading the info
167     * @exception RemoteException - Some problem occured with the EJB Server
168     */
169    public void loadServersToCache()
170       throws EjbException, RemoteException;
171 }