/*___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()%> * *
Warning: The <%=classname%> class will * not be compatible with future Sun™ Grid Engine releases.
* */ 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<%=mapAttr.getKeyName()%>
at index
.
* @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 <%=mapAttr.getKeyName()%>
* @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 SetGet the default value of the attribute <%=attrName%>. * (<%=mapAttr.getDefaultKey()%>)
* @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<%=mapAttr.getKeyName()%>
* (<%=mapAttr.getDefaultKey()%>).
*/
public int getDefault<%=gsname%>Count();
/**
* Get an unmodifiable list of <%=attrName%> attributes for
* <%=mapAttr.getKeyName()%>
.
*
* @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
* @return unmodifiable list of <%=attrName%> attributes
*/
public List<%=mapAttr.getValueName()%>
attribute to <%=mapAttr.getKeyName()%>
.
*
* @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
* @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%> attribute
*/
public void add<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, <%=valueClassName%> <%=mapAttr.getValueName()%>);
/**
* Initialize <%=mapAttr.getValueName()%>
attribute for a <%=mapAttr.getKeyName()%>
* with an empty list.
*
* @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
*/
public void addEmpty<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>);
/**
* Set <%=mapAttr.getValueName()%>
attribute for <%=mapAttr.getKeyName()%>
.
*
* @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 <%=mapAttr.getValueName()%>
attribute for <%=mapAttr.getKeyName()%>
.
*
* @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
* @param index the index of the <%=mapAttr.getValueName()%> attribute
* @return the remove <%=mapAttr.getValueName()%> attribute of null
* if the attribute has not been found
*/
public Object remove<%=gsname%>At(<%=keyClassName%> <%=mapAttr.getKeyName()%>, int index);
/**
* Remove <%=mapAttr.getValueName()%>
attribute for <%=mapAttr.getKeyName()%>
.
*
* @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
* @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%>) attribute
* @return true
if the attribute has been removed
*/
public boolean remove<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, <%=valueClassName%> <%=mapAttr.getValueName()%>);
/**
* Remove all <%=mapAttr.getValueName()%>
attributes for <%=mapAttr.getKeyName()%>
.
*
* @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
*/
public void removeAll<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>);
// default methods
/**
* Add <%=mapAttr.getValueName()%>
attribute to
* the default <%=mapAttr.getKeyName()%>
(<%=mapAttr.getDefaultKey()%>).
*
* @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%> attribute
*/
public void addDefault<%=gsname%>(<%=valueClassName%> <%=mapAttr.getValueName()%>);
/**
* Set <%=mapAttr.getValueName()%>
attribute for the default
* <%=mapAttr.getKeyName()%>
(<%=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 <%=mapAttr.getValueName()%>
attribute for the
* default <%=mapAttr.getKeyName()%>
(<%=mapAttr.getDefaultKey()%>).
*
* @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
* @param index the index of the <%=mapAttr.getValueName()%> attribute
* @return the remove <%=mapAttr.getValueName()%> attribute of null
* if the attribute has not been found
*/
public Object removeDefault<%=gsname%>At(<%=keyClassName%> <%=mapAttr.getKeyName()%>, int index);
/**
* Remove <%=mapAttr.getValueName()%>
attribute from the
* default <%=mapAttr.getKeyName()%>
(<%=mapAttr.getDefaultKey()%>).
*
* @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%>) attribute
* @return true
if the attribute has been removed
*/
public boolean removeDefault<%=gsname%>(<%=keyClassName%> <%=mapAttr.getKeyName()%>, <%=valueClassName%> <%=mapAttr.getValueName()%>);
/**
* Remove all <%=mapAttr.getValueName()%>) attributes from
* the default <%=mapAttr.getKeyName()%>
(<%=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";
}
%>
/**
* Get the default value of the attribute <%=attrName%>.
* @return the default value of the attribute <%=attrName%> * @throws java.lang.IllegalStateException if the default value is not set */ public <%=valueClassName%> getDefault<%=gsname%>(); /** *Get the <%=attrName%> attribute for <%=mapAttr.getKeyName()%>
.
<%=mapAttr.getKeyName()%>
or the
* default value of <%=attrName%>
*/
public <%=valueClassName%> get<%=gsname%>(String <%=mapAttr.getKeyName()%>);
/**
* Get the set of <%=mapAttr.getKeyName()%>
s which have the attribute <%=attrName%> set.
* @return set of <%=mapAttr.getKeyName()%>
s
*/
public Set<%=mapAttr.getKeyName()%>
is set
* @param <%=mapAttr.getKeyName()%> the <%=mapAttr.getKeyName()%>
* @return true
if the <%=attrName%> attribute is set
*/
public boolean isSet<%=gsname%>(String <%=mapAttr.getKeyName()%>);
<%
if (!attr.isReadOnly()) {
%>
/**
* Put the attribute <%=attrName%> for <%=mapAttr.getKeyName()%>
.
<%=mapAttr.getValueName()%>
attribute for the default
* <%=mapAttr.getKeyName()%>
(<%=mapAttr.getDefaultKey()%>).
*
* @param <%=mapAttr.getValueName()%> the <%=mapAttr.getValueName()%> attribute
*/
public void setDefault<%=gsname%>(<%=valueClassName%> <%=mapAttr.getValueName()%>);
<%
}
%>
/**
* remove the attribute <%=attrName%> for <%=mapAttr.getKeyName()%>
.
<%=mapAttr.getKeyName()%>
or null
* if the attribute was not defined for <%=mapAttr.getKeyName()%>
.
*/
public <%=fullValueClassName%> remove<%=gsname%>(String <%=mapAttr.getKeyName()%>);
/**
* Remove the attribute <%=attrName%> for all <%=mapAttr.getKeyName()%>s.
*/ 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 ornull
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 true
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 true
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 String
the dump string
*/
public String dump();
}