-
Notifications
You must be signed in to change notification settings - Fork 33
/
ObjAdminEvent.java
287 lines (257 loc) · 7.43 KB
/
ObjAdminEvent.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
/*
* Copyright (c) 2000, 2017 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.messaging.jmq.admin.apps.console.event;
import java.util.Properties;
import java.util.Vector;
import com.sun.messaging.jmq.admin.event.AdminEvent;
import com.sun.messaging.jmq.admin.objstore.ObjStore;
import com.sun.messaging.jmq.admin.objstore.ObjStoreManager;
import com.sun.messaging.jmq.admin.objstore.ObjStoreAttrs;
/**
* Event class indicating some action related to Administered Object Management is needed.
* <P>
* The fields of this event include the various pieces of information needed for object management tasks.
*/
public class ObjAdminEvent extends AdminEvent {
private static final long serialVersionUID = 5437958055298936323L;
/*
* ObjAdminEvent event types
*/
public static final int ADD_OBJSTORE = 1;
public static final int UPDATE_OBJSTORE = 2;
public static final int DELETE_OBJSTORE = 3;
public static final int ADD_DESTINATION = 4;
public static final int UPDATE_DESTINATION = 5;
public static final int ADD_CONN_FACTORY = 6;
public static final int UPDATE_CONN_FACTORY = 7;
public static final int UPDATE_CREDENTIALS = 8;
/*
* Types of admin objects that can be created/updated.
*/
public static final int QUEUE = 1;
public static final int TOPIC = 2;
public static final int QCF = 3;
public static final int TCF = 4;
public static final int XAQCF = 5;
public static final int XATCF = 6;
public static final int CF = 7;
public static final int XACF = 8;
private transient ObjStore os = null;
private ObjStoreAttrs osa = null;
private transient ObjStoreManager osMgr = null;
private String lookupName = null;
private int destType;
private int factoryType;
private String id = null;
private boolean readOnly = false;
private Properties objProps;
private boolean okAction = true;
private boolean connect = true;
private Vector missingInfo;
/**
* Creates an instance of ObjAdminEvent
*
* @param source the object where the event originated
* @param type the event type
*/
public ObjAdminEvent(Object source, int type) {
super(source, type);
}
/*
* Set object store attributes. This may be needed for object store creation for example.
*
* @param osa Object Store Attributes to set on this event object.
*/
public void setObjStoreAttrs(ObjStoreAttrs osa) {
this.osa = osa;
}
/*
* Return object store attributes.
*
* @return Object Store Attributes.
*/
public ObjStoreAttrs getObjStoreAttrs() {
return (this.osa);
}
/*
* Set object store.
*
* @param os Object Store to set on this event object.
*/
public void setObjStore(ObjStore os) {
this.os = os;
}
/*
* Returns the object store.
*
* @return The Object Store.
*/
public ObjStore getObjStore() {
return (this.os);
}
/*
* Set new object store id (for an update).
*
* @param id id Object Store to set on this event object.
*/
public void setObjStoreID(String id) {
this.id = id;
}
/*
* Get new object store id (for an update).
*
* @return The Obj Store ID
*/
public String getObjStoreID() {
return this.id;
}
public void setReadOnly(boolean readOnly) {
this.readOnly = readOnly;
}
public boolean isReadOnly() {
return this.readOnly;
}
/*
* Set dest destination type.
*
* @param type Type of destination
*/
public void setDestinationType(int destType) {
this.destType = destType;
}
/*
* Returns the destination type
*
* @return The Destination Type
*/
public int getDestinationType() {
return (this.destType);
}
/*
* Set connectio factory type.
*
* @param type Type of destination
*/
public void setFactoryType(int factoryType) {
this.factoryType = factoryType;
}
/*
* Returns the factory type
*
* @return The Factory Type
*/
public int getFactoryType() {
return (this.factoryType);
}
/*
* Set lookup name.
*
* @param lookupName The Lookup Name
*/
public void setLookupName(String lookupName) {
this.lookupName = lookupName;
}
/*
* Returns the lookup name.
*
* @return The Lookup Name
*/
public String getLookupName() {
return (this.lookupName);
}
/*
* Set object store manager.
*
* @param osMgr Object Store Manager to set on this event object.
*/
public void setObjStoreManager(ObjStoreManager osMgr) {
this.osMgr = osMgr;
}
/*
* Returns the object store manager.
*
* @return The Object Store Manager.
*/
public ObjStoreManager getObjStoreManager() {
return (osMgr);
}
/*
* Set object properties.
*
* @param objProps Properties to set on the Administered Object.
*/
public void setObjProperties(Properties objProps) {
this.objProps = objProps;
}
/*
* Returns the object properties;
*
* @return The Object Properties;
*/
public Properties getObjProperties() {
return (objProps);
}
/*
* Set missing authorization info
*
* @param missingInfo Vector of security properties that are missing.
*/
public void setMissingAuthInfo(Vector missingInfo) {
this.missingInfo = missingInfo;
}
/*
* Returns the Vector
*
* @return The Vector of Properties;
*/
public Vector getMissingAuthInfo() {
return (missingInfo);
}
/*
* Set whether this event is trigerred by an 'OK' action. This information is used to determine whether the originating
* dialog (if one was involved) needs to be hidden.
*
* @param b True if this is an 'OK' action, false otherwise.
*/
public void setOKAction(boolean b) {
this.okAction = b;
}
/*
* Returns whether this event is trigerred by an 'OK' action.
*
* @return True if this is an 'OK' action, false otherwise.
*/
public boolean isOKAction() {
return (okAction);
}
/*
* Set whether to attempt to connect to the object store when adding/updating it.
*
* @param connect True if try to connect, false otherwise.
*/
public void setConnectAttempt(boolean connect) {
this.connect = connect;
}
/*
* Returns whether or not to attempt to connect to the object store when adding/updating it.
*
* @return True if attempt to connect, false otherwise.
*/
public boolean isConnectAttempt() {
return (connect);
}
}