File: javamodel.jsp

package info (click to toggle)
gridengine 8.1.9%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 56,880 kB
  • sloc: ansic: 432,689; java: 87,068; cpp: 31,958; sh: 29,429; jsp: 7,757; perl: 6,336; xml: 5,828; makefile: 4,701; csh: 3,928; ruby: 2,221; tcl: 1,676; lisp: 669; yacc: 519; python: 503; lex: 361; javascript: 200
file content (495 lines) | stat: -rw-r--r-- 19,172 bytes parent folder | download | duplicates (9)
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
/*___INFO__MARK_BEGIN__*/
/*************************************************************************
 *
 *  The Contents of this file are made available subject to the terms of
 *  the Sun Industry Standards Source License Version 1.2
 *
 *  Sun Microsystems Inc., March, 2001
 *
 *
 *  Sun Industry Standards Source License Version 1.2
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.2 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *   Copyright: 2001 by Sun Microsystems, Inc.
 *
 *   All Rights Reserved.
 *
 ************************************************************************/
/*___INFO__MARK_END__*/
/**
 *  Generated from javamodel.jsp
 *  !!! DO NOT EDIT THIS FILE !!!
 */
<%
  final com.sun.grid.cull.CullDefinition cullDef = (com.sun.grid.cull.CullDefinition)params.get("cullDef");
  final com.sun.grid.cull.JavaHelper jh = (com.sun.grid.cull.JavaHelper)params.get("javaHelper");
  final com.sun.grid.cull.CullObject cullObj = (com.sun.grid.cull.CullObject)params.get("cullObj");
  com.sun.grid.cull.CullAttr   attr = null;
  final String classname = jh.getClassName(cullObj);
%>
package <%=jh.getPackageName()%>;

import com.sun.grid.jgdi.configuration.GEObject;
import java.util.List;
import java.util.Set;

/**
 *  Java representation of the cull object <%=cullObj.getName()%>
 *  defined in <%=jh.getSource(cullObj).getName()%>
 *
 *  <p><strong>Warning:</strong>  The  <%=classname%> class will 
 *  not be compatible with future Sun&trade; Grid Engine releases.</p>
 *
 */
public interface <%=classname%> extends <%

  if(cullObj.getParentObject() != null) {
%>  <%=jh.getClassName(cullObj.getParentObject())%> <%
  } else {%>
    GEObject <% 
    } 
%> { 
<%
    // Iterate over all attributes and create the corresponding member variable 
    // and getter and setter methods
    for (int i = 0; i < cullObj.getAttrCount(); i++) {
        attr = cullObj.getAttr(i);
        String attrType = jh.getFullClassName(attr.getType());
        String attrName = jh.getAttrName(attr);
        String gsname =  Character.toUpperCase(attrName.charAt(0)) + attrName.substring(1);
%>
    // Attribute <%=attrName%> ------------------------------------------------
<%
    if (attr instanceof com.sun.grid.cull.CullMapListAttr) {
    /* ------------------------------------------------------------------------
     * ---------------------- MapList Attribute -----------------------------------
     * ------------------------------------------------------------------------
     */ 
        if (attrName.endsWith("List")) {
            attrName = attrName.substring(0, attrName.length() - 4);
            gsname = Character.toUpperCase(attrName.charAt(0)) + attrName.substring(1);
        }
        com.sun.grid.cull.CullMapAttr mapAttr = (com.sun.grid.cull.CullMapAttr)attr;
        com.sun.grid.cull.CullObject subobj = cullDef.getCullObject(mapAttr.getType());
        com.sun.grid.cull.CullAttr keyAttr = mapAttr.getKeyAttr();
        com.sun.grid.cull.CullAttr valueAttr = mapAttr.getValueAttr();
        String keyClassName = jh.getClassName(keyAttr.getType());
        String valueClassName = jh.getClassName(valueAttr.getType());
        String fullValueClassName = jh.getClassName(valueAttr.getType());
        String defaultKey = mapAttr.getDefaultKey();
        if (defaultKey == null) {
            defaultKey = "default";
        }
%>      

    /**
     *  Get the value of <code><%=mapAttr.getKeyName()%></code> at <code>index</code>.
     *  @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
     *  @param index the index
     */
    public <%=valueClassName%> get<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, int index);
   
    /**
     *  Get the number of values for <code><%=mapAttr.getKeyName()%></code>
     *  @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
     */
    public int get<%=gsname%>Count(<%=keyClassName%> <%=mapAttr.getKeyName()%>);
   
    /**
     *   Get a unmodifiable set of stored <%=attrName%> attribute keys.
     *   @return unmodifiable set of stored <%=attrName%> attribute keys
     */
    public Set<String> get<%=gsname%>Keys();
   
    /**
     *  <p>Get the default value of the attribute <%=attrName%>.
     *  (<%=mapAttr.getDefaultKey()%>)</p>
     *  @return the default value of the attribute <%=attrName%>
     *  @throws  java.lang.IllegalStateException if the default value is not set
     */
    public <%=valueClassName%> getDefault<%=gsname%>(int index);
   
    /**
     *  Get the number of values for  the default <code><%=mapAttr.getKeyName()%></code>
     *  (<%=mapAttr.getDefaultKey()%>).
     */
    public int getDefault<%=gsname%>Count();
   
   
   
    /**
     *  Get an unmodifiable list of <%=attrName%> attributes for 
     *  <code><%=mapAttr.getKeyName()%></code>.
     *
     *  @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
     *  @return unmodifiable list of <%=attrName%> attributes
     */
    public List<String> get<%=gsname%>List(<%=keyClassName%> <%=mapAttr.getKeyName()%>);
   
<%                                                                            
    if (!attr.isReadOnly()) {
%>
    /**
     *  Add <code><%=mapAttr.getValueName()%></code> attribute to <code><%=mapAttr.getKeyName()%></code>.
     *
     *  @param <%=mapAttr.getKeyName()%>  the <%=mapAttr.getKeyName()%>
     *  @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%> attribute
     */
    public void add<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, <%=valueClassName%> <%=mapAttr.getValueName()%>);

    /**
     *  Initialize <code><%=mapAttr.getValueName()%></code> attribute for a <code><%=mapAttr.getKeyName()%></code> 
     *  with an empty list.
     *
     *  @param <%=mapAttr.getKeyName()%>  the <%=mapAttr.getKeyName()%>
     */
    public void addEmpty<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>);
   
   
    /**
     *  Set <code><%=mapAttr.getValueName()%></code> attribute for <code><%=mapAttr.getKeyName()%></code>.
     *
     *  @param <%=mapAttr.getKeyName()%>  the <%=mapAttr.getKeyName()%>
     *  @param index  index of the <%=mapAttr.getValueName()%> attribute
     *  @param <%=mapAttr.getValueName()%>  the <%=mapAttr.getValueName()%> attribute
     */
    public void set<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, int index, <%=valueClassName%> <%=mapAttr.getValueName()%>);
   
    /**
     *  Remove <code><%=mapAttr.getValueName()%></code> attribute for <code><%=mapAttr.getKeyName()%></code>.
     *
     *  @param <%=mapAttr.getKeyName()%>  the <%=mapAttr.getKeyName()%>
     *  @param index the index of the <%=mapAttr.getValueName()%> attribute
     *  @return the remove <%=mapAttr.getValueName()%> attribute of <code>null</code>
     *          if the attribute has not been found
     */
    public Object remove<%=gsname%>At(<%=keyClassName%> <%=mapAttr.getKeyName()%>, int index);
   
    /**
     *  Remove <code><%=mapAttr.getValueName()%></code> attribute for <code><%=mapAttr.getKeyName()%></code>.
     *
     *  @param <%=mapAttr.getKeyName()%>  the <%=mapAttr.getKeyName()%>
     *  @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%>) attribute
     *  @return <code>true</code> if the attribute has been removed
     */
    public boolean remove<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, <%=valueClassName%> <%=mapAttr.getValueName()%>);
   
    /**
     *  Remove all <code><%=mapAttr.getValueName()%></code> attributes for <code><%=mapAttr.getKeyName()%></code>.
     *
     *  @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
     */   
    public void removeAll<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>);
   
    // default methods
   
    /**
     *  Add <code><%=mapAttr.getValueName()%></code> attribute to 
     *  the default <code><%=mapAttr.getKeyName()%></code>  (<%=mapAttr.getDefaultKey()%>).
     *
     *  @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%> attribute
     */
    public void addDefault<%=gsname%>(<%=valueClassName%> <%=mapAttr.getValueName()%>);
   
    /**
     *  Set <code><%=mapAttr.getValueName()%></code> attribute for the default
     *  <code><%=mapAttr.getKeyName()%></code> (<%=mapAttr.getDefaultKey()%>).
     *
     *  @param index  index of the <%=mapAttr.getValueName()%> attribute
     *  @param <%=mapAttr.getValueName()%>  the <%=mapAttr.getValueName()%> attribute
     */
    public void setDefault<%=gsname%>(int index, <%=valueClassName%> <%=mapAttr.getValueName()%>);
   
    /**
     *  Remove <code><%=mapAttr.getValueName()%></code> attribute for the
     *  default <code><%=mapAttr.getKeyName()%></code> (<%=mapAttr.getDefaultKey()%>).
     *
     *  @param <%=mapAttr.getKeyName()%>  the <%=mapAttr.getKeyName()%>
     *  @param index the index of the <%=mapAttr.getValueName()%> attribute
     *  @return the remove <%=mapAttr.getValueName()%> attribute of <code>null</code>
     *          if the attribute has not been found
     */
    public Object removeDefault<%=gsname%>At(<%=keyClassName%> <%=mapAttr.getKeyName()%>, int index);
   
    /**
     *  Remove <code><%=mapAttr.getValueName()%></code> attribute from the
     *  default <code><%=mapAttr.getKeyName()%></code> (<%=mapAttr.getDefaultKey()%>).
     *
     *  @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%>) attribute
     *  @return <code>true</code> if the attribute has been removed
     */
    public boolean removeDefault<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, <%=valueClassName%> <%=mapAttr.getValueName()%>);

    /**
     *  Remove all <%=mapAttr.getValueName()%>) attributes from 
     *  the default <code><%=mapAttr.getKeyName()%></code> (<%=mapAttr.getDefaultKey()%>).
     */
    public void removeAllDefault<%=gsname%>();
   
    /**
     *  Remove all <%=mapAttr.getValueName()%>) attributes.
     */
    public void removeAll<%=gsname%>();
   
   
<%
    }
%>
    
<%
    } else if (attr instanceof com.sun.grid.cull.CullMapAttr) {
    /* ------------------------------------------------------------------------
     * ---------------------- Map Attribute -----------------------------------
     * ------------------------------------------------------------------------
     */ 
        if (attrName.endsWith("List")) {
            attrName = attrName.substring(0, attrName.length() - 4);
            gsname = Character.toUpperCase(attrName.charAt(0)) + attrName.substring(1);
        }
        com.sun.grid.cull.CullMapAttr mapAttr = (com.sun.grid.cull.CullMapAttr)attr;
        com.sun.grid.cull.CullObject subobj = cullDef.getCullObject(mapAttr.getType());
        com.sun.grid.cull.CullAttr keyAttr = mapAttr.getKeyAttr();
        com.sun.grid.cull.CullAttr valueAttr = mapAttr.getValueAttr();
        String keyClassName = jh.getClassName(keyAttr.getType());
%>
        // keyClassName for <%=keyAttr.getType()%> = <%=keyClassName%>
<%
        String valueClassName = jh.getClassName(valueAttr.getType());
        String fullValueClassName = jh.getFullClassNameOrWrapper(valueAttr.getType());
        String defaultKey = mapAttr.getDefaultKey();
        if (defaultKey == null) {
            defaultKey = "default";
        }
%>     
   
    /**
     *  <p>Get the default value of the attribute <%=attrName%>.</p>
     *  @return the default value of the attribute <%=attrName%>
     *  @throws  java.lang.IllegalStateException if the default value is not set
     */
    public <%=valueClassName%> getDefault<%=gsname%>();

    /**
     *  <p>Get the <%=attrName%> attribute for <code><%=mapAttr.getKeyName()%></code>.</p>
     *  @param   <%=mapAttr.getKeyName()%>   the <%=mapAttr.getKeyName()%>
     *  @return  the <%=attrName%> attribute for <code><%=mapAttr.getKeyName()%></code> or the
     *           default value of  <%=attrName%>
     */
    public <%=valueClassName%> get<%=gsname%>(String <%=mapAttr.getKeyName()%>);
   
    /**
     *  Get the set of <code><%=mapAttr.getKeyName()%></code>s which have the attribute <%=attrName%> set.
     *  @return set of <code><%=mapAttr.getKeyName()%></code>s
     */
    public Set<String> get<%=gsname%>Keys();
   
    /**
     *  Get the number of <%=mapAttr.getKeyName()%>s which have the attribute <%=attrName%> set.
     *  @return the number of <%=mapAttr.getKeyName()%>s which have the attribute <%=attrName%> set.
     */
    public int get<%=gsname%>Count();
   
    /**
     *  Determine if any <%=attrName%> attribute is for <code><%=mapAttr.getKeyName()%></code> is set
     *  @param  <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
     *  @return <code>true</code> if the <%=attrName%> attribute is set
     */
    public boolean isSet<%=gsname%>(String <%=mapAttr.getKeyName()%>);
   
   
<%
    if (!attr.isReadOnly()) {
%>          
    /**
     *  <p>Put the attribute <%=attrName%> for <code><%=mapAttr.getKeyName()%></code>.</p>
     *
     *  @param <%=mapAttr.getKeyName()%>   the <%=mapAttr.getKeyName()%>
     *  @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%>
     */
    public void put<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, <%=valueClassName%> <%=mapAttr.getValueName()%>);
   
<%   
   if (mapAttr.getDefaultKey() != null) {
%>   
    /**
     *  Set <code><%=mapAttr.getValueName()%></code> attribute for the default
     *  <code><%=mapAttr.getKeyName()%></code> (<%=mapAttr.getDefaultKey()%>).
     *
     *  @param <%=mapAttr.getValueName()%>  the <%=mapAttr.getValueName()%> attribute
     */
    public void setDefault<%=gsname%>(<%=valueClassName%> <%=mapAttr.getValueName()%>);

<%
    }
%>

    /**
     *  <p>remove the attribute <%=attrName%> for <code><%=mapAttr.getKeyName()%></code>.</p>
     *
     *  @param <%=mapAttr.getKeyName()%>  The <%=mapAttr.getKeyName()%>
     *  @return the value of the attribute for <code><%=mapAttr.getKeyName()%></code> or <code>null</code>
     *          if the attribute was not defined for <code><%=mapAttr.getKeyName()%></code>.
     */
    public <%=fullValueClassName%> remove<%=gsname%>(String <%=mapAttr.getKeyName()%>);
   
    /**
     *  <p>Remove the attribute <%=attrName%> for all <%=mapAttr.getKeyName()%>s.</p>
     */
    public void removeAll<%=gsname%>();
<%
    }
%>

<%
    // end of Map Attribute
    } else if (attr instanceof com.sun.grid.cull.CullListAttr) {
    /* ------------------------------------------------------------------------
     * ---------------------- List Attribute ----------------------------------
     * ------------------------------------------------------------------------
     */
        if (attrName.endsWith("List")) {
            attrName  = attrName.substring(0, attrName.length() - 4);
            gsname = Character.toUpperCase(attrName.charAt(0)) + attrName.substring(1);
        }
%>

    /**
     *   Get a unmodifiable list of all <%=attrType%> attributes.
     *
     *   @return Unmodifiable list with all <%=attrType%> attributes
     */
    public List< <%=attrType%> >  get<%=gsname%>List();

    /**
     *  Get the number of <%=attrType%> attributes.
     *
     *  @return The number of <%=attrType%> attributes.
     */
    public int get<%=gsname%>Count();
 
    /**
     *  Get a <%=attrType%> attribute at an index.
     *  @param index  the index of the <%=attrType%> attribute which should be
     *                removed
     *  @return the <%=attrType%> attribute
     */
    public <%=attrType%> get<%=gsname%>(int index);
   
<%
    if (!attr.isReadOnly()) {
%>
    /**
     *   Add a <%=attrType%> attribute.
     *   @param a<%=attrName%>  the new <%=attrType%> attribute
     */
    public void add<%=gsname%>(<%=attrType%> a<%=attrName%>);
   
    /**
     *   Set a <%=attrType%> attribute.
     *   @param index   index of the <%=attrType%> attribute
     *   @param a<%=attrName%>  the new <%=attrType%> attribute
     */
    public void set<%=gsname%>(int index, <%=attrType%> a<%=attrName%>);

    /**
     *  Remove all <%=attrType%> attributes.
     */
    public void removeAll<%=gsname%>();
   
    /**
     *  Remote a <%=attrType%> attribute at an index.
     *  @param index  the index of the <%=attrType%> attribute which should be
     *                removed
     *  @return the removed <%=attrType%> attribute or <code>null</code> if
     *          no attribute at this index is stored
     */
    public <%=attrType%> remove<%=gsname%>(int index);

    /**
     *  Remote a specific <%=attrType%> attribute.
     *  @param a<%=attrName%>  the <%=attrType%> attribute which should be
     *                         removed
     *  @return <code>true</code> if the <%=attrType%> attribute has been removed
     */
    public boolean remove<%=gsname%>(<%=attrType%> a<%=attrName%>);
   
<%
    }
%>       
<%  // end of List Attribute
    } else {
    /* ------------------------------------------------------------------------
     * ---------------------- Simple Attribute ----------------------------------
     * ------------------------------------------------------------------------
     */
%>
<% 
        if (!attr.isReadOnly()) {
%>       
    /**
     *   Set the <%=attrName%> attribute.
     *
     *   @param a<%=gsname%>  the new value for the  <%=attrName%> attribute
     */
    public void set<%=gsname%>(<%=attrType%> a<%=gsname%>);
<%
        }
%>  
    /**
     *  Get the value of the <%=attrName%> attribute.
     *  @return the value of the <%=attrName%> attribute
     */
    public <%=attrType%> <%=attrType.endsWith("oolean")?"is":"get"%><%=gsname%>();
   

<%
    } // end of else normal attributes
   
    // Methods which are common to all attribute types
%> 
    /**
     *  Determine if any <%=attrName%> attribute is set
     *  @return <code>true</code> if the <%=attrName%> attribute is set
     */
    public boolean isSet<%=gsname%>();

<%
} // end of for of attribute
//SPECIAL CODE for COMPLEX ENTRY
    if (classname.equals("ComplexEntry")) {
%>
    public String typeToString(int type);
    public int typeToInt(String type);
    public String opToString(int op);
    public int opToInt(String type);
    public String reqToString(int op);
    public int reqToInt(String type);
<%
    } else if (classname.equals("AdvanceReservation")) {
%>
    public String getStateAsString();
<%
    }
%>

    /*
     * Dump the object
     * @return <code>String</code> the dump string
     */
     public String dump();
     

}