KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > policyframework > PolicyConstants


1 package com.sslexplorer.policyframework;
2
3 import com.sslexplorer.properties.PropertyProfileResourceType;
4 import com.sslexplorer.security.AuthenticationSchemeResourceType;
5
6 /**
7  * Constants used throughout the policy framework.
8  *
9  * @author Brett Smith <a HREF="mailto:brett@3sp.com">&lt;brett@3sp.com&gt;</a>
10  */

11 public interface PolicyConstants {
12
13     /**
14      * A special policy with a Name of 'Everyone'. All users in the realm are
15      * part of this policy.
16      */

17     public final static String JavaDoc EVERYONE_POLICY_NAME = "Everyone";
18
19     /**
20      * The Id for the permission that allows users to create resources and
21      * assign policies to them.
22      */

23     public final static int PERM_CREATE_AND_ASSIGN_ID = 1;
24
25     /**
26      * The Id for the permission that allows users to edit resources and assign
27      * policies to them.
28      */

29     public final static int PERM_EDIT_AND_ASSIGN_ID = 2;
30
31     /**
32      * The Id for the permission that allows users to assign policies to
33      * resources.
34      */

35     public final static int PERM_ASSIGN_ID = 3;
36
37     /**
38      * Id for permission that allows an item to be edited.
39      */

40     public final static int PERM_EDIT_ID = 4;
41
42     /**
43      * Id for permission that allows an item to be created.
44      */

45     public final static int PERM_CREATE_ID = 5;
46
47     /**
48      * Id for permission that allows items or resources to be deleted.
49      */

50     public final static int PERM_DELETE_ID = 6;
51
52     /**
53      * Id for permission that allows resources to be copied.
54      */

55     public final static int PERM_COPY_ID = 7;
56
57     /**
58      * Id for permission that allows configuration of policies within policies.
59      */

60     public final static int PERM_NEST_ID = 8;
61
62     /**
63      * Id for generic permission that allows some item to be changed in some
64      * way.
65      */

66     public static final int PERM_CHANGE_ID = 9;
67
68     /**
69      * Id for generic permission thats some item or resource to be viewed
70      * (although not neccessarily edited)
71      */

72     public static final int PERM_VIEW_ID = 10;
73
74     /**
75      * Id for permission that allows some action to be performed.
76      */

77     public static final int PERM_PERFORM_ID = 11;
78
79     /**
80      * Id for permission that allows some entity to be updated.
81      */

82     public static final int PERM_UPDATE_ID = 12;
83
84     /**
85      * Id for permission that allows some entity to be installed
86      */

87     public static final int PERM_INSTALL_ID = 13;
88
89     /**
90      * Id for permission that allows some type of entity to be maintained.
91      *
92      */

93     public static final int PERM_MAINTAIN_ID = 14;
94
95     /**
96      * Id for permission that allows type of entity to be used.
97      */

98     public static final int PERM_USE_ID = 15;
99
100     /**
101      * Id for permission that allows some type of sub-system to be controlled
102      */

103     public static final int PERM_CONTROL_ID = 16;
104
105     /**
106      * Id for permission that allows some type of entity to be sent somewhere.
107      */

108     public static final int PERM_SEND_ID = 17;
109
110     /**
111      * Id for permission that allows the server to be shutdown.
112      */

113     public static final int PERM_SHUTDOWN_ID = 18;
114
115     /**
116      * Id for permission that allows the server to be restarted.
117      */

118     public static final int PERM_RESTART_ID = 19;
119
120     /**
121      * Id for permission that allows items or resources to be cleared.
122      */

123     public static final int PERM_CLEAR_ID = 20;
124
125     /**
126      * Permission that allows users to create resources and assign policies to
127      * them.
128      */

129     public final static Permission PERM_CREATE_EDIT_AND_ASSIGN = new Permission(PERM_CREATE_AND_ASSIGN_ID, "policyframework");
130
131     /**
132      * The permission that allows users to edit resources and assign policies to
133      * them.
134      */

135     public final static Permission PERM_EDIT_AND_ASSIGN = new Permission(PERM_EDIT_AND_ASSIGN_ID, "policyframework");
136
137     /**
138      * Permission that allows an item to be created.
139      */

140     public final static Permission PERM_CREATE = new Permission(PERM_CREATE_ID, "policyframework");
141
142     /**
143      * Permission that allows an item to be edited.
144      */

145     public final static Permission PERM_EDIT = new Permission(PERM_EDIT_ID, "policyframework");
146
147     /**
148      * Permission that allows configuration of policies within policies.
149      */

150     public final static Permission PERM_NEST = new Permission(PERM_NEST_ID, "policyframework");
151
152     /**
153      * Permission that allows items or resources to be deleted.
154      */

155     public final static Permission PERM_DELETE = new Permission(PERM_DELETE_ID, "policyframework");
156     /**
157      * Permission that allows resources to be copied.
158      */

159     public final static Permission PERM_COPY = new Permission(PERM_COPY_ID, "policyframework");
160
161     /**
162      * Generic permission that allows some item to be changed in some
163      * way.
164      */

165     public final static Permission PERM_CHANGE = new Permission(PERM_CHANGE_ID, "policyframework");
166
167     /**
168      * Generic permission thats some item or resource to be viewed
169      * (although not neccessarily edited)
170      */

171     public final static Permission PERM_VIEW = new Permission(PERM_VIEW_ID, "policyframework");
172     
173     /**
174      * Permission that allows some action to be performed.
175      */

176     public final static Permission PERM_PERFORM = new Permission(PERM_PERFORM_ID, "policyframework");
177     
178     /**
179      * Permission that allows some entity to be installed
180      */

181     public final static Permission PERM_INSTALL = new Permission(PERM_INSTALL_ID, "policyframework");
182     
183     /**
184      * Permission that allows some entity to be updated
185      */

186     public final static Permission PERM_UPDATE = new Permission(PERM_UPDATE_ID, "policyframework");
187     
188     /**
189      * Permission that allows some entity or group of entities to be maintained
190      */

191     public static final Permission PERM_MAINTAIN = new Permission(PERM_MAINTAIN_ID, "policyframework");
192     
193     /**
194      * Permission that allows some entity or group of entities to be used
195      */

196     public static final Permission PERM_USE = new Permission(PERM_USE_ID, "policyframework");
197     
198     /**
199      * Permission that allows some entity or group of entities to be controlled
200      */

201     public static final Permission PERM_CONTROL = new Permission(PERM_CONTROL_ID, "policyframework");
202
203     /**
204      * Permission that allows some entity or group of entities to be sent somewhere
205      */

206     public static final Permission PERM_SEND = new Permission(PERM_SEND_ID, "policyframework");
207     
208     /**
209      * Permission that allows the server to be shut down
210      */

211     public static final Permission PERM_SHUTDOWN = new Permission(PERM_SHUTDOWN_ID, "policyframework");
212     
213     /**
214      * Permission that allows the server to be restarted
215      */

216     public static final Permission PERM_RESTART = new Permission(PERM_RESTART_ID, "policyframework");
217     
218     /**
219      * permission that allows users to assign policies to resources.
220      */

221     public static final Permission PERM_ASSIGN = new Permission(PERM_ASSIGN_ID, "policyframework");
222
223     /**
224      * Permission that allows items or resources to be deleted.
225      */

226     public static final Permission PERM_CLEAR = new Permission(PERM_CLEAR_ID, "policyframework");
227
228     /*
229      * Permission classes
230      */

231     
232     /**
233      * Permission class for <i>Delegation Resource Permissions</i>
234      */

235     public final static String JavaDoc DELEGATION_CLASS = "delegation";
236     
237     /**
238      * Permission class for <i>System Resource Permissions</i>
239      */

240     public final static String JavaDoc SYSTEM_CLASS = "system";
241
242     /**
243      * Permission class for <i>Personal Resource Permissions</i>
244      */

245     public final static String JavaDoc PERSONAL_CLASS = "personal";
246
247     /*
248      * Global Resource Permission Id's
249      */

250
251     /**
252      * ID for the PROFILE_RESOURCE_TYPE
253      */

254     public final static int PROFILE_RESOURCE_TYPE_ID = 1;
255     
256     /**
257      * ID for the POLICY_RESOURCE_TYPE
258      */

259     public final static int POLICY_RESOURCE_TYPE_ID = 5;
260     
261     /**
262      * ID for the ACCESS_RIGHTS_RESOURCE
263      */

264     public final static int ACCESS_RIGHTS_RESOURCE_TYPE_ID = 6;
265
266     /**
267      * The ResourceType for Profiles
268      */

269     public static final ResourceType PROFILE_RESOURCE_TYPE = new PropertyProfileResourceType(PROFILE_RESOURCE_TYPE_ID,
270                     DELEGATION_CLASS);
271     
272     /**
273      * The ResourceType for Policies
274      */

275     public static final ResourceType POLICY_RESOURCE_TYPE = new PolicyResourceType();
276     
277     /**
278      * The ResourceType for Access Rights
279      */

280     public static final ResourceType ACCESS_RIGHTS_RESOURCE_TYPE = new AccessRightsResourceType();
281
282     // System Resource Permissions (delegatable)
283

284     
285     /**
286      * ID for the SERVICE_CONTROL_RESOURCE_TYPE
287      */

288     public final static int SERVICE_CONTROL_RESOURCE_TYPE_ID = 1000; //
289

290     /**
291      * ID for the SYSTEM_CONFIGURATION_RESOURCE_TYPE
292      */

293     public final static int SYSTEM_CONFIGURATION_RESOURCE_TYPE_ID = 1001; //
294

295     /**
296      * ID for the KEYSTORE_RESOURCE_TYPE
297      */

298     public final static int KEYSTORE_RESOURCE_TYPE_ID = 1002; //
299

300     /**
301      * ID for the AUTHENTICATION_SCHEMES_RESOURCE_TYPE
302      */

303     public final static int AUTHENTICATION_SCHEMES_RESOURCE_TYPE_ID = 1003;
304     
305     /**
306      * ID for the ACCOUNTS_AND_GROUPS_RESOURCE
307      */

308     public final static int ACCOUNTS_AND_GROUPS_RESOURCE_TYPE_ID = 1004;
309     
310     /**
311      * ID for the IP_RESTRICTIONS_RESOURCE_TYPE
312      */

313     public final static int IP_RESTRICTIONS_RESOURCE_TYPE_ID = 1006;
314     
315     /**
316      * ID for the EXTENSIONS_RESOURCE_TYPE
317      */

318     public final static int EXTENSIONS_RESOURCE_TYPE_ID = 1007; //
319

320     /**
321      * ID for the MESSAGE_QUEUE_RESOURCE_TYPE
322      */

323     public final static int MESSAGE_QUEUE_RESOURCE_TYPE_ID = 1008;
324     
325     /**
326      * ID for the STATUS_TYPE_RESOURCE_TYPE
327      */

328     public final static int STATUS_TYPE_RESOURCE_TYPE_ID = 1009;
329     
330     /**
331      * ID for the REPLACEMENTS_RESOURCE_TYPE
332      */

333     public final static int REPLACEMENTS_RESOURCE_TYPE_ID = 1010;
334     
335     /**
336      * ID for the USER_ATTRIBUTE_DEFINITIONS_RESOURCE_TYPE
337      */

338     public final static int ATTRIBUTE_DEFINITIONS_RESOURCE_TYPE_ID = 1011;
339     
340     /**
341      * ID for the REALM_RESOURCE_TYPE
342      */

343     public final static int REALM_RESOURCE_TYPE_ID = 1012;
344     
345     /**
346      * The ResourceType for Services
347      */

348     public final static ResourceType SERVICE_CONTROL_RESOURCE_TYPE = new DefaultResourceType(SERVICE_CONTROL_RESOURCE_TYPE_ID,
349                     "policyframework", SYSTEM_CLASS);
350     
351     /**
352      * The ResourceType for System configuration
353      */

354     public static final ResourceType SYSTEM_CONFIGURATION_RESOURCE_TYPE = new DefaultResourceType(
355                     SYSTEM_CONFIGURATION_RESOURCE_TYPE_ID, "policyframework", SYSTEM_CLASS);
356     
357     /**
358      * The ResourceType for keystore
359      */

360     public static final ResourceType KEYSTORE_RESOURCE_TYPE = new DefaultResourceType(KEYSTORE_RESOURCE_TYPE_ID, "policyframework",
361                     SYSTEM_CLASS);
362     
363     /**
364      * The ResourceType for authenticaton schemes
365      */

366     public static final ResourceType AUTHENTICATION_SCHEMES_RESOURCE_TYPE = new AuthenticationSchemeResourceType();
367     
368     /**
369      * The ResourceType for accounts and groups
370      */

371     public static final ResourceType ACCOUNTS_AND_GROUPS_RESOURCE_TYPE = new DefaultResourceType(ACCOUNTS_AND_GROUPS_RESOURCE_TYPE_ID, "policyframework",
372                     SYSTEM_CLASS);
373     
374     /**
375      * The ResourceType for IP restrictions
376      */

377     public static final ResourceType IP_RESTRICTIONS_RESOURCE_TYPE = new DefaultResourceType(IP_RESTRICTIONS_RESOURCE_TYPE_ID,
378                     "policyframework", SYSTEM_CLASS);
379     
380     /**
381      * The ResourceType for extensions
382      */

383     public static final ResourceType EXTENSIONS_RESOURCE_TYPE = new DefaultResourceType(EXTENSIONS_RESOURCE_TYPE_ID,
384                     "policyframework", SYSTEM_CLASS);
385     
386     /**
387      * The ResourceType for message queue
388      */

389     public static final ResourceType MESSAGE_QUEUE_RESOURCE_TYPE = new DefaultResourceType(MESSAGE_QUEUE_RESOURCE_TYPE_ID,
390                     "policyframework", SYSTEM_CLASS);
391     
392     /**
393      * The ResourceType for status
394      */

395     public static final ResourceType STATUS_TYPE_RESOURCE_TYPE = new DefaultResourceType(STATUS_TYPE_RESOURCE_TYPE_ID,
396                     "policyframework", SYSTEM_CLASS);
397     
398     /**
399      * The ResourceType for replacements
400      */

401     public static final ResourceType REPLACEMENTS_RESOURCE_TYPE = new DefaultResourceType(REPLACEMENTS_RESOURCE_TYPE_ID,
402                     "policyframework", SYSTEM_CLASS);
403     
404     /**
405      * The ResourceType for attribute definition
406      */

407     public static final ResourceType ATTRIBUTE_DEFINITIONS_RESOURCE_TYPE = new DefaultResourceType(ATTRIBUTE_DEFINITIONS_RESOURCE_TYPE_ID,
408                     "policyframework", SYSTEM_CLASS);
409     
410     /**
411      * The ResourceType for realms
412      */

413     public static final ResourceType REALMS_RESOURCE_TYPE = new DefaultResourceType(REALM_RESOURCE_TYPE_ID,
414                     "realms", SYSTEM_CLASS);
415
416     /**
417      * ID for the PERSONAL_PROFILE_RESOURCE_TYPE
418      */

419     public final static int PERSONAL_PROFILE_RESOURCE_TYPE_ID = 2001;
420
421     /**
422      * ID for the PASSWORD_RESOURCE_TYPE
423      */

424     public final static int PASSWORD_RESOURCE_TYPE_ID = 2002;
425
426     /**
427      * ID for the PERSONAL_DETAILS_RESOURCE_TYPE
428      */

429     public final static int PERSONAL_DETAILS_RESOURCE_TYPE_ID = 2003;
430
431     /**
432      * ID for the AGENT_RESOURCE_TYPE
433      */

434     public final static int AGENT_RESOURCE_TYPE_ID = 2004;
435
436     /**
437      * ID for the FAVORITES_RESOURCE_TYPE
438      */

439     public final static int FAVORITES_RESOURCE_TYPE_ID = 2005;
440
441     /**
442      * ID for the ATTRIBUTES_RESOURCE_TYPE
443      */

444     public final static int ATTRIBUTES_RESOURCE_TYPE_ID = 2006;
445
446     /**
447      * ID for the LANGUAGE_RESOURCE_TYPE
448      */

449     public final static int LANGUAGE_RESOURCE_TYPE_ID = 2007;
450
451     /**
452      * The ResourceType for personal profiles
453      */

454     public static final ResourceType PERSONAL_PROFILE_RESOURCE_TYPE = new PropertyProfileResourceType(
455                     PERSONAL_PROFILE_RESOURCE_TYPE_ID, PERSONAL_CLASS);
456
457     /**
458      * The ResourceType for passwords
459      */

460     public static final ResourceType PASSWORD_RESOURCE_TYPE = new DefaultResourceType(PASSWORD_RESOURCE_TYPE_ID, "policyframework",
461                     PERSONAL_CLASS);
462
463     /**
464      * The ResourceType for personal details
465      */

466     public static final ResourceType PERSONAL_DETAILS_RESOURCE_TYPE = new DefaultResourceType(PERSONAL_DETAILS_RESOURCE_TYPE_ID,
467                     "policyframework", PERSONAL_CLASS);
468
469     /**
470      * The ResourceType for agent
471      */

472     public static final ResourceType AGENT_RESOURCE_TYPE = new DefaultResourceType(AGENT_RESOURCE_TYPE_ID,
473                     "policyframework", PERSONAL_CLASS);
474
475     /**
476      * The ResourceType for favorites
477      */

478     public static final ResourceType FAVORITES_RESOURCE_TYPE = new DefaultResourceType(FAVORITES_RESOURCE_TYPE_ID,
479                     "policyframework", PERSONAL_CLASS);
480
481     /**
482      * The ResourceType for attributes
483      */

484     public static final ResourceType ATTRIBUTES_RESOURCE_TYPE = new DefaultResourceType(ATTRIBUTES_RESOURCE_TYPE_ID,
485                     "policyframework", PERSONAL_CLASS);
486
487     /**
488      * The ResourceType for languages
489      */

490     public static final ResourceType LANGUAGE_RESOURCE_TYPE = new DefaultResourceType(LANGUAGE_RESOURCE_TYPE_ID,
491                     "policyframework", PERSONAL_CLASS);
492 }
493
Popular Tags