Source code: com/flexstor/ejb/machine/persist/MachinePersist.java
1 /*
2 * MachinePersist.java
3 *
4 * Copyright $Date: 2003/08/11 02:22:39 $ 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.machine.persist;
12
13 import java.rmi.RemoteException;
14 import java.util.Hashtable;
15
16 import com.flexstor.common.data.ejb.machine.MachineData;
17 import com.flexstor.common.exceptions.ejb.DuplicateRecordException;
18 import com.flexstor.common.exceptions.ejb.EjbException;
19 import com.flexstor.common.exceptions.ejb.NotFoundException;
20 import com.flexstor.common.keys.ejb.MachineKey;
21 import com.flexstor.ejb.EjbObject;
22
23 /**
24 *
25 * <P>
26 * MachinePersist <BR>
27 * <BLOCKQUOTE>
28 * MachinePersist has the ability to manipulate (add, change, delete) a Machine representation <BR>
29 * within a persistant data store. <BR>
30 * </BLOCKQUOTE>
31 * </P>
32 *
33 * <P>
34 * Uses cache: no
35 *
36 * State Management Type: Stateless
37 * </P>
38 *
39 * Configurable properties in flexdm.properties: <BR>
40 * <BLOCKQUOTE>
41 * <P>
42 * NONE <BR>
43 * </P>
44 * </BLOCKQUOTE>
45 *
46 */
47 public interface MachinePersist
48 extends EjbObject
49 {
50 // MKS macro expander
51 public final static String IDENTIFIER = "$Id: MachinePersist.java,v 1.3 2003/08/11 02:22:39 aleric Exp $";
52
53 /**
54 * This method retrieves machine data by machine name
55 * Transaction Attribute: Not Supported
56 *
57 * @param aMachineName A machine name (or host name)
58 * @return - an Machine data object
59 *
60 * @exception EjbException - A problem occured querying the database record
61 * @exception RemoteException - Some problem occured with the EJB server
62 */
63 public MachineData getMachine(String aMachineName)
64 throws EjbException, RemoteException;
65
66 /**
67 * This method add a machine setting to the maching specified by the name.
68 * Transaction Attribute: Required
69 *
70 * @param aMachineName A machine name (or host name)
71 * @param key Setting key
72 * @param value Setting value
73 *
74 * @exception EjbException - A problem occured querying the database record
75 * @exception RemoteException - Some problem occured with the EJB server
76 */
77 public void addMachineSetting(String aMachineName, String key, String value)
78 throws EjbException, RemoteException;
79
80 /**
81 * This method deletes a machine setting from the maching specified by the name.
82 * Transaction Attribute: Required
83 *
84 * @param aMachineName A machine name (or host name)
85 * @param key Setting key
86 *
87 * @exception EjbException - A problem occured querying the database record
88 * @exception NotFoundException - If key does not exist in the database
89 * @exception RemoteException - Some problem occured with the EJB server
90 */
91 public void deleteMachineSetting(String aMachineName, String key)
92 throws EjbException, RemoteException, NotFoundException;
93
94 /**
95 * This method modifes a machine setting for the maching specified by the name.
96 * Transaction Attribute: Required
97 *
98 * @param aMachineName A machine name (or host name)
99 * @param key Setting key
100 * @param newValue New Value for the setting
101 *
102 * @exception EjbException - A problem occured querying the database record
103 * @exception RemoteException - Some problem occured with the EJB server
104 */
105 public void modifyMachineSetting(String aMachineName, String key, String newValue)
106 throws EjbException, RemoteException;
107
108 /**
109 * Retrieve an list of all machines registered in the system
110 * Transaction Attribute: Not Supported
111 *
112 * @return - MachineData collection with the MachineData machine_name(String) as its key
113 *
114 * @exception EjbException - An error occured with the database query
115 * @exception RemoteException - Some problem occured with the EJB server
116 *
117 * @see com.flexstor.common.data.ejb.machine.MachineData
118 */
119 public Hashtable getMachineList()
120 throws EjbException, RemoteException;
121
122 /**
123 * Create a new instance of Machine in the database.
124 * Transaction Attribute: Required
125 *
126 * @param aDataLayer an Machine data object
127 * @return - a reference to the Machine object added
128 *
129 * @exception DuplicateRecordException - a row already exists within the database with the given key
130 * @exception EjbException - An error occured with the database insert
131 * @exception RemoteException - Some problem occured with the EJB server
132 */
133 public MachineKey insert(MachineData aDataLayer)
134 throws DuplicateRecordException, EjbException, RemoteException;
135
136 /**
137 * Remove the instance of Machine from the database.
138 * Transaction Attribute: Required
139 *
140 * @param aMachineKey - a reference to the Machine object to be removed
141 *
142 * @exception EjbException - An error occured with the database delete
143 * @exception RemoteException - Some problem occured with the EJB server
144 */
145 public void remove(MachineKey aMachineKey)
146 throws EjbException, RemoteException;
147
148 /**
149 * Save the current state of the object to the database.
150 * Transaction Attribute: Required
151 *
152 * @param aDataLayer an Machine data object
153 *
154 * @exception DuplicateRecordException - a row already exists within the database with the given key
155 * @exception EjbException - A problem occured updating the database record
156 * @exception RemoteException - Some problem occured with the EJB server
157 */
158 public void update(MachineData aDataLayer)
159 throws DuplicateRecordException, EjbException, RemoteException;
160 }