Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

service-api/ from 2009-01-10

  • Loading branch information...
commit 7147f2e237374111bd4f7303046d7464165f958b 1 parent 0562f3b
@timf timf authored
Showing with 5,080 additions and 0 deletions.
  1. +7 −0 service-api/java/source/.ant-targets-build.xml
  2. +14 −0 service-api/java/source/build.properties
  3. +164 −0 service-api/java/source/build.xml
  4. +32 −0 service-api/java/source/doc/style.css
  5. BIN  service-api/java/source/lib-compile/commons-logging.jar
  6. BIN  service-api/java/source/lib-compile/log4j-1.2.15.jar
  7. +7 −0 service-api/java/source/lib-compile/notes.txt
  8. BIN  service-api/java/source/lib/cglib-nodep-2.1_3.jar
  9. BIN  service-api/java/source/lib/spring.jar
  10. +33 −0 service-api/java/source/src/org/nimbustools/api/NimbusModule.java
  11. +31 −0 service-api/java/source/src/org/nimbustools/api/_repr/_Advertised.java
  12. +34 −0 service-api/java/source/src/org/nimbustools/api/_repr/_Caller.java
  13. +46 −0 service-api/java/source/src/org/nimbustools/api/_repr/_CreateRequest.java
  14. +27 −0 service-api/java/source/src/org/nimbustools/api/_repr/_CreateResult.java
  15. +25 −0 service-api/java/source/src/org/nimbustools/api/_repr/_CustomizationRequest.java
  16. +27 −0 service-api/java/source/src/org/nimbustools/api/_repr/_ShutdownTasks.java
  17. +25 −0 service-api/java/source/src/org/nimbustools/api/_repr/_Usage.java
  18. +30 −0 service-api/java/source/src/org/nimbustools/api/_repr/ctx/_Context.java
  19. +11 −0 service-api/java/source/src/org/nimbustools/api/_repr/ctx/package.html
  20. +10 −0 service-api/java/source/src/org/nimbustools/api/_repr/package.html
  21. +27 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/_Kernel.java
  22. +33 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/_NIC.java
  23. +25 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/_RequiredVMM.java
  24. +28 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/_ResourceAllocation.java
  25. +28 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/_Schedule.java
  26. +25 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/_State.java
  27. +40 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/_VM.java
  28. +34 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/_VMFile.java
  29. +11 −0 service-api/java/source/src/org/nimbustools/api/_repr/vm/package.html
  30. +153 −0 service-api/java/source/src/org/nimbustools/api/brain/BreathOfLife.java
  31. +45 −0 service-api/java/source/src/org/nimbustools/api/brain/Logging.java
  32. +69 −0 service-api/java/source/src/org/nimbustools/api/brain/Main.java
  33. +36 −0 service-api/java/source/src/org/nimbustools/api/brain/ModuleLocator.java
  34. +34 −0 service-api/java/source/src/org/nimbustools/api/brain/NimbusLog.java
  35. +16 −0 service-api/java/source/src/org/nimbustools/api/brain/package.html
  36. +33 −0 service-api/java/source/src/org/nimbustools/api/defaults/brain/DefaultModuleLocator.java
  37. +13 −0 service-api/java/source/src/org/nimbustools/api/defaults/brain/package.html
  38. +72 −0 service-api/java/source/src/org/nimbustools/api/defaults/defaults.xml
  39. +7 −0 service-api/java/source/src/org/nimbustools/api/defaults/log4j.properties
  40. +101 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr.xml
  41. +142 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultAdvertised.java
  42. +74 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultCaller.java
  43. +210 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultCreateRequest.java
  44. +80 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultCreateResult.java
  45. +54 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultCustomizationRequest.java
  46. +75 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultReprFactory.java
  47. +57 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultShutdownTasks.java
  48. +55 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultUsage.java
  49. +56 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/ctx/DefaultContext.java
  50. +12 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/ctx/package.html
  51. +13 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/package.html
  52. +69 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/DefaultKernel.java
  53. +147 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/DefaultNIC.java
  54. +70 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/DefaultRequiredVMM.java
  55. +97 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/DefaultResourceAllocation.java
  56. +94 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/DefaultSchedule.java
  57. +96 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/DefaultState.java
  58. +164 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/DefaultVM.java
  59. +119 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/DefaultVMFile.java
  60. +13 −0 service-api/java/source/src/org/nimbustools/api/defaults/repr/vm/package.html
  61. +226 −0 service-api/java/source/src/org/nimbustools/api/defaults/services/rm/DefaultBasicLegality.java
  62. +272 −0 service-api/java/source/src/org/nimbustools/api/defaults/services/rm/DefaultManager.java
  63. +11 −0 service-api/java/source/src/org/nimbustools/api/defaults/services/rm/package.html
  64. +20 −0 service-api/java/source/src/org/nimbustools/api/package.html
  65. +34 −0 service-api/java/source/src/org/nimbustools/api/repr/Advertised.java
  66. +41 −0 service-api/java/source/src/org/nimbustools/api/repr/Caller.java
  67. +40 −0 service-api/java/source/src/org/nimbustools/api/repr/CannotTranslateException.java
  68. +53 −0 service-api/java/source/src/org/nimbustools/api/repr/CreateRequest.java
  69. +26 −0 service-api/java/source/src/org/nimbustools/api/repr/CreateResult.java
  70. +23 −0 service-api/java/source/src/org/nimbustools/api/repr/CustomizationRequest.java
  71. +66 −0 service-api/java/source/src/org/nimbustools/api/repr/ReprFactory.java
  72. +25 −0 service-api/java/source/src/org/nimbustools/api/repr/ShutdownTasks.java
  73. +23 −0 service-api/java/source/src/org/nimbustools/api/repr/Usage.java
  74. +28 −0 service-api/java/source/src/org/nimbustools/api/repr/ctx/Context.java
  75. +11 −0 service-api/java/source/src/org/nimbustools/api/repr/ctx/package.html
  76. +8 −0 service-api/java/source/src/org/nimbustools/api/repr/package.html
  77. +25 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/Kernel.java
  78. +35 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/NIC.java
  79. +23 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/RequiredVMM.java
  80. +37 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/ResourceAllocation.java
  81. +26 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/Schedule.java
  82. +34 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/State.java
  83. +34 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/VM.java
  84. +35 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/VMFile.java
  85. +11 −0 service-api/java/source/src/org/nimbustools/api/repr/vm/package.html
  86. +25 −0 service-api/java/source/src/org/nimbustools/api/services/ctx/ContextBroker.java
  87. +40 −0 service-api/java/source/src/org/nimbustools/api/services/ctx/ContextBrokerException.java
  88. +8 −0 service-api/java/source/src/org/nimbustools/api/services/ctx/package.html
  89. +31 −0 service-api/java/source/src/org/nimbustools/api/services/metadata/MetadataServer.java
  90. +66 −0 service-api/java/source/src/org/nimbustools/api/services/metadata/MetadataServerException.java
  91. +37 −0 service-api/java/source/src/org/nimbustools/api/services/metadata/MetadataServerUnauthorizedException.java
  92. +8 −0 service-api/java/source/src/org/nimbustools/api/services/package.html
  93. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/AuthorizationException.java
  94. +43 −0 service-api/java/source/src/org/nimbustools/api/services/rm/BasicLegality.java
  95. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/CoSchedulingException.java
  96. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/CreationException.java
  97. +29 −0 service-api/java/source/src/org/nimbustools/api/services/rm/DestructionCallback.java
  98. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/DoesNotExistException.java
  99. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/ManageException.java
  100. +174 −0 service-api/java/source/src/org/nimbustools/api/services/rm/Manager.java
  101. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/MetadataException.java
  102. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/OperationDisabledException.java
  103. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/ResourceRequestDeniedException.java
  104. +40 −0 service-api/java/source/src/org/nimbustools/api/services/rm/SchedulingException.java
  105. +31 −0 service-api/java/source/src/org/nimbustools/api/services/rm/StateChangeCallback.java
  106. +11 −0 service-api/java/source/src/org/nimbustools/api/services/rm/package.html
View
7 service-api/java/source/.ant-targets-build.xml
@@ -0,0 +1,7 @@
+checkjdk
+clean
+compile
+dist
+init
+jar
+javadoc
View
14 service-api/java/source/build.properties
@@ -0,0 +1,14 @@
+nimbus.service.api.print-noun=Nimbus Services Bridge (RM API)
+nimbus.service.api.build.dir=build
+nimbus.service.api.build.dest=build/classes
+nimbus.service.api.src.dir=src
+nimbus.service.api.docs.dir=doc
+nimbus.service.api.javadocs.dir=doc/javadoc
+nimbus.service.api.lib.dir=lib
+nimbus.service.api.lib-compile.dir=lib-compile
+nimbus.service.api.dist.dir=dist
+nimbus.service.api.jar.name=nimbus-service-api.jar
+nimbus.service.api.javadoc.css=doc/style.css
+
+# you can override this in ~/nimbus.build.properties
+nimbus.java.compilerarg=-nowarn
View
164 service-api/java/source/build.xml
@@ -0,0 +1,164 @@
+<?xml version="1.0"?>
+
+<project default="dist" basedir="." name="Nimbus Service APIs">
+
+ <description>Nimbus Service APIs</description>
+
+ <!-- load user nimbus.build.properties file, if it exists -->
+ <property file="${user.home}/nimbus.build.properties"/>
+
+ <!-- load defaults from colocated build.properties file -->
+ <property file="build.properties"/>
+
+
+ <!-- *******************************************************************
+ CHECK MINIMUM JDK
+ ******************************************************************* -->
+
+ <target name="checkjdk">
+ <available property="jdk1.4+" classname="java.lang.CharSequence"/>
+ <fail message="Aborting: determined you are not building with >= JDK 1.4"
+ unless="jdk1.4+" />
+ </target>
+
+
+ <!-- *******************************************************************
+ INITIALIZE
+ ******************************************************************* -->
+
+ <target name="init" depends="checkjdk">
+ <mkdir dir="${nimbus.service.api.build.dir}"/>
+ <mkdir dir="${nimbus.service.api.build.dest}"/>
+ <mkdir dir="${nimbus.service.api.dist.dir}"/>
+ </target>
+
+
+ <!-- *******************************************************************
+ COMPILATION
+ ******************************************************************* -->
+
+ <path id="nimbus.service.api.classpath">
+ <fileset dir="${nimbus.service.api.lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="${nimbus.service.api.lib-compile.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="compile" depends="init">
+
+ <javac srcdir="${nimbus.service.api.src.dir}"
+ destdir="${nimbus.service.api.build.dest}"
+ debug="on"
+ classpathref="nimbus.service.api.classpath">
+
+ <include name="**/*.java"/>
+ <compilerarg value="${nimbus.java.compilerarg}" />
+
+ </javac>
+
+ <copy todir="${nimbus.service.api.build.dest}" >
+
+ <fileset dir="${nimbus.service.api.src.dir}"
+ includes="**/*.properties" />
+
+ <fileset dir="${nimbus.service.api.src.dir}"
+ includes="**/*.xml" />
+
+ <fileset dir="${nimbus.service.api.src.dir}"
+ includes="**/*.txt" />
+ </copy>
+
+ </target>
+
+
+ <!-- *******************************************************************
+ CREATE ARCHIVE FILE
+ ******************************************************************* -->
+
+ <target name="jar" depends="compile">
+ <jar destfile="${nimbus.service.api.dist.dir}/${nimbus.service.api.jar.name}"
+ basedir="${nimbus.service.api.build.dest}"/>
+ </target>
+
+
+ <!-- *******************************************************************
+ CLEAN
+ ******************************************************************* -->
+
+ <target name="clean">
+ <delete dir="${nimbus.service.api.build.dir}"/>
+ <delete dir="${nimbus.service.api.dist.dir}"/>
+ <delete dir="${nimbus.service.api.javadocs.dir}"/>
+ <echo message="Cleaned: ${basedir}" />
+ </target>
+
+
+ <!-- *******************************************************************
+ CREATE DISTRIBUTION
+ ******************************************************************* -->
+
+ <target name="dist">
+ <echo message="**** Module: ${basedir}" />
+ <echo>Building: ${nimbus.service.api.print-noun}</echo>
+ <antcall target="jar" />
+ <echo>Built: ${nimbus.service.api.print-noun}
+ </echo>
+ </target>
+
+
+ <!-- *******************************************************************
+ CREATE DOCUMENTATION
+ ******************************************************************* -->
+
+ <target name="javadoc">
+
+ <delete dir="${nimbus.service.api.javadocs.dir}"/>
+ <mkdir dir="${nimbus.service.api.javadocs.dir}"/>
+
+ <javadoc destdir="${nimbus.service.api.javadocs.dir}"
+ linksource="true"
+ author="false"
+ version="false"
+ use="true"
+ stylesheetfile="${nimbus.service.api.javadoc.css}"
+ windowtitle="Nimbus Services Bridge (RM API)">
+
+ <packageset dir="src" defaultexcludes="yes">
+ <include name="org/nimbustools/**"/>
+ </packageset>
+
+ <doctitle><![CDATA[<h1>Nimbus Services Bridge (RM API) - <i>TP2.2</i></h1>]]></doctitle>
+
+ <bottom>
+ <![CDATA[<i>Release: TP2.2</i> - For more information, see
+ <a href="http://www.nimbustools.org"
+ target="_blank">http://www.nimbustools.org</a>]]></bottom>
+
+ <group title="Action Interfaces">
+ <package name="org.nimbustools.api.services.*" />
+ <package name="org.nimbustools.api" />
+ <package name="org.nimbustools.api.services" />
+ </group>
+
+ <group title="Representation Interfaces">
+ <package name="org.nimbustools.api.repr" />
+ <package name="org.nimbustools.api.repr.*" />
+ </group>
+
+ <group title="Instantiation / IoC">
+ <package name="org.nimbustools.api.brain" />
+ </group>
+
+ <group title="Read/Write Representation Interfaces">
+ <package name="org.nimbustools.api._repr" />
+ <package name="org.nimbustools.api._repr.*" />
+ </group>
+
+ <group title="Default Implementations">
+ <package name="org.nimbustools.api.defaults.*" />
+ </group>
+ </javadoc>
+ </target>
+</project>
View
32 service-api/java/source/doc/style.css
@@ -0,0 +1,32 @@
+/* Javadoc style sheet */
+
+/* Define colors, fonts and other style attributes here to override the defaults */
+
+/* Page background color */
+body {
+ background-color: #FFFFFF;
+ color:#000000;
+}
+
+/* Headings */
+h1 { font-size: 145% }
+
+/* Table colors */
+.TableHeadingColor { background: #FFFFCC; color:#000000 }
+.TableSubHeadingColor { background: #FFFFCC; color:#000000 }
+.TableRowColor { background: #FFFFFF; color:#000000 } /* White */
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
+
+/* Navigation bar fonts and colors */
+.NavBarCell1 { background-color:#ffffff; color:#000000} /* Light mauve */
+.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */
+.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}
+.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}
+
+.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
+.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
+
View
BIN  service-api/java/source/lib-compile/commons-logging.jar
Binary file not shown
View
BIN  service-api/java/source/lib-compile/log4j-1.2.15.jar
Binary file not shown
View
7 service-api/java/source/lib-compile/notes.txt
@@ -0,0 +1,7 @@
+The package will run without these libraries on the classpath but they are
+needed for compiling (and for running the Main demo).
+
+Class comment from org.nimbustools.api.brain.Logging:
+
+ Hides logging dependencies, squelches the (very few) debug statements if
+ commons logging is not in the classpath.
View
BIN  service-api/java/source/lib/cglib-nodep-2.1_3.jar
Binary file not shown
View
BIN  service-api/java/source/lib/spring.jar
Binary file not shown
View
33 service-api/java/source/src/org/nimbustools/api/NimbusModule.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api;
+
+public interface NimbusModule {
+
+ // -------------------------------------------------------------------------
+ // AUXILIARY
+ // -------------------------------------------------------------------------
+
+ /**
+ * This may or may not be called around instantiation time to log
+ * advisory information.
+ *
+ * @return anything you want, or null
+ */
+ public String report();
+
+}
View
31 service-api/java/source/src/org/nimbustools/api/_repr/_Advertised.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.Advertised;
+
+public interface _Advertised extends Advertised {
+
+ public void setDefaultRunningTimeSeconds(int defaultRunningTime);
+ public void setMaximumRunningTimeSeconds(int maximumRunningTime);
+ public void setCpuArchitectureName(String cpuArchitectureName);
+ public void setVmmVersions(String[] vmmVersions);
+ public void setVmm(String vmm);
+ public void setNetworkNames(String[] networkNames);
+ public void setMaxGroupSize(int maxGroupSize);
+ public void setChargeGranularity(int chargeGranularity);
+}
View
34 service-api/java/source/src/org/nimbustools/api/_repr/_Caller.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.Caller;
+
+import javax.security.auth.Subject;
+
+public interface _Caller extends Caller {
+
+ /**
+ * @param identity if null, then assumed to be superuser
+ */
+ public void setIdentity(String identity);
+
+ /**
+ * @param subject from JAAS etc (presumably), may be null
+ */
+ public void setSubject(Subject subject);
+}
View
46 service-api/java/source/src/org/nimbustools/api/_repr/_CreateRequest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.ctx.Context;
+import org.nimbustools.api.repr.vm.Kernel;
+import org.nimbustools.api.repr.vm.NIC;
+import org.nimbustools.api.repr.vm.RequiredVMM;
+import org.nimbustools.api.repr.vm.ResourceAllocation;
+import org.nimbustools.api.repr.vm.Schedule;
+import org.nimbustools.api.repr.vm.VMFile;
+import org.nimbustools.api.repr.CreateRequest;
+import org.nimbustools.api.repr.CustomizationRequest;
+
+public interface _CreateRequest extends CreateRequest {
+
+ public void setName(String name);
+ public void setVMFiles(VMFile[] vmFiles);
+ public void setRequestedNics(NIC[] requested);
+ public void setRequestedSchedule(Schedule requested);
+ public void setCoScheduleID(String id);
+ public void setCoScheduleDone(boolean done);
+ public void setCoScheduleMember(boolean member);
+ public void setRequestedRA(ResourceAllocation requested);
+ public void setRequiredVMM(RequiredVMM requiredVMM);
+ public void setRequestedKernel(Kernel kernel);
+ public void setCustomizationRequests(CustomizationRequest[] requests);
+ public void setShutdownType(String type);
+ public void setInitialStateRequest(String state);
+ public void setContext(Context context);
+ public void setMdUserData(String mdUserData);
+}
View
27 service-api/java/source/src/org/nimbustools/api/_repr/_CreateResult.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.vm.VM;
+import org.nimbustools.api.repr.CreateResult;
+
+public interface _CreateResult extends CreateResult {
+
+ public void setVMs(VM[] vms);
+ public void setGroupID(String id);
+ public void setCoscheduledID(String id);
+}
View
25 service-api/java/source/src/org/nimbustools/api/_repr/_CustomizationRequest.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.CustomizationRequest;
+
+public interface _CustomizationRequest extends CustomizationRequest {
+
+ public void setPathOnVM(String pathOnVM);
+ public void setContent(String content);
+}
View
27 service-api/java/source/src/org/nimbustools/api/_repr/_ShutdownTasks.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.ShutdownTasks;
+
+import java.net.URI;
+
+public interface _ShutdownTasks extends ShutdownTasks {
+
+ public void setBaseFileUnpropagationTarget(URI target);
+ public void setAppendID(boolean appendID);
+}
View
25 service-api/java/source/src/org/nimbustools/api/_repr/_Usage.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr;
+
+import org.nimbustools.api.repr.Usage;
+
+public interface _Usage extends Usage {
+
+ public void setElapsedMinutes(long elapsedMinutes);
+ public void setReservedMinutes(long reservedMinutes);
+}
View
30 service-api/java/source/src/org/nimbustools/api/_repr/ctx/_Context.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.ctx;
+
+import org.nimbustools.api.repr.ctx.Context;
+
+/**
+ * This is currently just what the Manager needs to consume.
+ *
+ * Virtualization of ContextBroker itself is coming in subsequent release.
+ */
+public interface _Context extends Context {
+
+ public void setBootstrapText(String bootstrapText);
+ public void setBootstrapPath(String bootstrapPath);
+}
View
11 service-api/java/source/src/org/nimbustools/api/_repr/ctx/package.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<body>
+
+<p>
+ Extensions of the {@link org.nimbustools.api.repr.ctx} interfaces that
+ add setter methods.
+</p>
+
+</body>
+</html>
View
10 service-api/java/source/src/org/nimbustools/api/_repr/package.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<body>
+<p>
+ Extensions of the {@link org.nimbustools.api.repr} interfaces that
+ add setter methods.
+</p>
+
+</body>
+</html>
View
27 service-api/java/source/src/org/nimbustools/api/_repr/vm/_Kernel.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.vm;
+
+import org.nimbustools.api.repr.vm.Kernel;
+
+import java.net.URI;
+
+public interface _Kernel extends Kernel {
+
+ public void setKernel(URI kernel);
+ public void setParameters(String parameters);
+}
View
33 service-api/java/source/src/org/nimbustools/api/_repr/vm/_NIC.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.vm;
+
+import org.nimbustools.api.repr.vm.NIC;
+
+public interface _NIC extends NIC {
+
+ public void setName(String name);
+ public void setAcquisitionMethod(String method);
+ public void setNetworkName(String networkName);
+ public void setMAC(String MAC);
+ public void setHostname(String hostname);
+ public void setIpAddress(String ipAddress);
+ public void setNetmask(String netmask);
+ public void setGateway(String gateway);
+ public void setBroadcast(String broadcast);
+ public void setNetwork(String network);
+}
View
25 service-api/java/source/src/org/nimbustools/api/_repr/vm/_RequiredVMM.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.vm;
+
+import org.nimbustools.api.repr.vm.RequiredVMM;
+
+public interface _RequiredVMM extends RequiredVMM {
+
+ public void setType(String type);
+ public void setVersions(String[] versions);
+}
View
28 service-api/java/source/src/org/nimbustools/api/_repr/vm/_ResourceAllocation.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.vm;
+
+import org.nimbustools.api.repr.vm.ResourceAllocation;
+
+public interface _ResourceAllocation extends ResourceAllocation {
+
+ public void setArchitecture(String architecture);
+ public void setIndCpuSpeed(int indCpuSpeed);
+ public void setCpuPercentage(int cpuPercentage);
+ public void setMemory(int memory);
+ public void setNodeNumber(int nodeNumber);
+}
View
28 service-api/java/source/src/org/nimbustools/api/_repr/vm/_Schedule.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.vm;
+
+import org.nimbustools.api.repr.vm.Schedule;
+
+import java.util.Calendar;
+
+public interface _Schedule extends Schedule {
+
+ public void setStartTime(Calendar startTime);
+ public void setDurationSeconds(int durationSeconds);
+ public void setDestructionTime(Calendar destructionTime);
+}
View
25 service-api/java/source/src/org/nimbustools/api/_repr/vm/_State.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.vm;
+
+import org.nimbustools.api.repr.vm.State;
+
+public interface _State extends State {
+
+ public void setState(String state);
+ public void setProblem(Throwable e);
+}
View
40 service-api/java/source/src/org/nimbustools/api/_repr/vm/_VM.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.vm;
+
+import org.nimbustools.api.repr.vm.VM;
+import org.nimbustools.api.repr.vm.NIC;
+import org.nimbustools.api.repr.vm.ResourceAllocation;
+import org.nimbustools.api.repr.vm.Schedule;
+import org.nimbustools.api.repr.vm.State;
+import org.nimbustools.api.repr.vm.VMFile;
+import org.nimbustools.api.repr.Caller;
+
+public interface _VM extends VM {
+
+ public void setID(String id);
+ public void setGroupID(String id);
+ public void setCoschedID(String id);
+ public void setNics(NIC[] nics);
+ public void setVMFiles(VMFile[] vmFiles);
+ public void setResourceAllocation(ResourceAllocation ra);
+ public void setSchedule(Schedule schedule);
+ public void setState(State state);
+ public void setCreator(Caller creator);
+ public void setLaunchIndex(int launchIndex);
+ public void setMdUserData(String mdUserData);
+}
View
34 service-api/java/source/src/org/nimbustools/api/_repr/vm/_VMFile.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api._repr.vm;
+
+import org.nimbustools.api.repr.vm.VMFile;
+
+import java.net.URI;
+
+public interface _VMFile extends VMFile {
+
+ public void setRootFile(boolean rootFile);
+ public void setURI(URI uri);
+ public void setMountAs(String mountAs);
+ public void setDiskPerms(String perms);
+
+ public void setUnpropURI(URI uri);
+
+ public void setBlankSpaceName(String name);
+ public void setBlankSpaceSize(int space);
+}
View
11 service-api/java/source/src/org/nimbustools/api/_repr/vm/package.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<body>
+
+<p>
+ Extensions of the {@link org.nimbustools.api.repr.vm} interfaces that
+ add setter methods.
+</p>
+
+</body>
+</html>
View
153 service-api/java/source/src/org/nimbustools/api/brain/BreathOfLife.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.brain;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+/**
+ * <p><img src="http://workspace.globus.org/img/sh.png" /> Use to instantiate
+ * an application context (via Spring IoC).</p>
+ *
+ * <p>This is the only concrete class in the exposed API (besides exceptions),
+ * every implementation can be configured at runtime. Default implementations
+ * live in the {@link org.nimbustools.api.defaults} package.</p>
+ *
+ * <p>The implementations in the {@link org.nimbustools.api.defaults.services}
+ * package do nothing besides logging. The workspace project supplies
+ * implementations of these separately. When distributed together in an
+ * installable form, the word "default" might take on a different meaning.
+ * Defaults here mean the defaults for this when it is in standalone mode.</p>
+ *
+ * <p>The 'real' implementations are probably also internally modularized via
+ * an inversion of control container (can piggyback through this one), but this
+ * API system proper stands alone as a bridge between the messaging layers and
+ * implementations of VM manager and other services -- allowing everything to
+ * be decoupled and independently implemented.</p>
+ *
+ * <p>In any messaging implementation (hosted by an application container), you
+ * will be able to find a call to
+ * {@link BreathOfLife#breathe(String xmlCtxPath)}
+ * and all further coupling is via ModuleLocator and the representative object
+ * interfaces (the {@link org.nimbustools.api.repr} package).</p>
+ *
+ * <p>In any services implementation, you will NOT be able to find a dependency
+ * on anything beyond ("above") this API.</p>
+ *
+ * <p>The point of this is to bridge between remote messaging syntax (and even
+ * <b>semantics</b>) and a consistent service implementation (which can also
+ * be replaced/altered at will).</p>
+ *
+ * <p><b>See developer documentation</b>.</p>
+ *
+ * @see ModuleLocator
+ * @see org.nimbustools.api.services.rm.Manager
+ * @see org.nimbustools.api.services.ctx.ContextBroker
+ * @see org.nimbustools.api.repr.ReprFactory
+ */
+public class BreathOfLife {
+
+ // -------------------------------------------------------------------------
+ // STATIC VARIABLES
+ // -------------------------------------------------------------------------
+
+ private static final String DEFAULT_CONFIG =
+ "org/nimbustools/api/defaults/defaults.xml";
+
+ private static final String ID_MODULE_LOCATOR =
+ "nimbus-brain.ModuleLocator";
+
+
+ // -------------------------------------------------------------------------
+ // IMPL
+ // -------------------------------------------------------------------------
+
+ /**
+ * Begin with embedded defaults.xml file
+ * This will do nothing practical for you unless you're developing/debugging
+ * @return locator
+ * @see ModuleLocator
+ */
+ public ModuleLocator breathe() {
+ return this.breathe(null);
+ }
+
+ /**
+ * Begin with a given Spring configuration file.
+ *
+ * @param xmlCtxPath path to XML context/configuration file
+ * @return locator
+ * @see FileSystemXmlApplicationContext
+ * @see ModuleLocator
+ */
+ public ModuleLocator breathe(String xmlCtxPath) {
+
+ String name = "Nimbus master configuration";
+ if (xmlCtxPath == null) {
+ name = name + " - internal default @ " + DEFAULT_CONFIG;
+ } else {
+ name = name + " @ " + xmlCtxPath;
+ }
+
+ Logging.debug("Initializing " + name);
+
+ final ApplicationContext ctx;
+ if (xmlCtxPath == null) {
+ ctx = new ClassPathXmlApplicationContext(DEFAULT_CONFIG);
+ } else {
+ ctx = new FileSystemXmlApplicationContext(xmlCtxPath);
+ }
+
+ final ModuleLocator locator =
+ (ModuleLocator) ctx.getBean(ID_MODULE_LOCATOR);
+
+ Logging.debug("Initialized " + name);
+
+ /*
+ final String appCTX = "APPCXT: '" + ctx.getDisplayName() + "'";
+ final Manager manager = locator.getManager();
+ this.reportLog("Manager", appCTX, manager.report());
+ final ReprFactory repr = locator.getReprFactory();
+ this.reportLog("ReprFactory", appCTX, repr.report());
+ */
+
+ return locator;
+ }
+
+ protected void reportLog(String name, String appCTX, String report) {
+
+ if (report == null) {
+ return;
+ }
+
+ final StringBuffer buf = new StringBuffer(1024);
+ buf.append(appCTX).append("\n");
+
+ final String header =
+ "-----------------==== " + name + " ====--------------------";
+ buf.append(header).append("\n");
+
+ buf.append(report).append("\n");
+
+ for (int i = 0; i < header.length(); i++) {
+ buf.append("-");
+ }
+
+ Logging.debug(buf.toString());
+ }
+}
View
45 service-api/java/source/src/org/nimbustools/api/brain/Logging.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.brain;
+
+/**
+ * Hides logging dependencies, squelches the (very few) debug statements if
+ * commons logging is not in the classpath.
+ */
+public class Logging {
+
+ private static NimbusLog logger;
+ private static boolean triedAndFailed;
+
+ public synchronized static void debug(String debug) {
+
+ if (triedAndFailed) {
+ return;
+ }
+
+ if (logger == null) {
+ try {
+ logger = new NimbusLog();
+ } catch (Throwable t) {
+ triedAndFailed = true;
+ return;
+ }
+ }
+
+ logger.debug(debug);
+ }
+}
View
69 service-api/java/source/src/org/nimbustools/api/brain/Main.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.brain;
+
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.log4j.helpers.Loader;
+
+import java.net.URL;
+
+/**
+ * Something you can run standalone from IDE/console to run the API without
+ * any messaging layer at all.
+ */
+public class Main {
+
+ // -------------------------------------------------------------------------
+ // STATIC VARIABLES
+ // -------------------------------------------------------------------------
+
+ private static final String LOG4J_KEY = "log4j.configuration";
+ private static final String DEFAULT_LOG4J =
+ "org/nimbustools/api/defaults/log4j.properties";
+
+
+ // -------------------------------------------------------------------------
+ // STANDALONE
+ // -------------------------------------------------------------------------
+
+ public static void main(String[] args) {
+ logImpl();
+ new BreathOfLife().breathe(null);
+ }
+
+
+ // -------------------------------------------------------------------------
+ // LOGGING
+ // -------------------------------------------------------------------------
+
+ // TODO: looking at internal log system based on SLF4J (and maybe logback),
+ // esp. for MDC support (Mapped Diagnostic Context)
+ private static void logImpl() {
+ final String config = System.getProperty(LOG4J_KEY);
+ if (config == null) {
+ final URL loadURL = Loader.getResource(DEFAULT_LOG4J);
+ if (loadURL != null) {
+ PropertyConfigurator.configure(loadURL);
+ } else {
+ System.err.println("could not locate '" + DEFAULT_LOG4J + "'");
+ }
+ } else {
+ // do nothing.
+ Logging.debug("logging was configured via -D" + LOG4J_KEY);
+ }
+ }
+}
View
36 service-api/java/source/src/org/nimbustools/api/brain/ModuleLocator.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.brain;
+
+import org.nimbustools.api.repr.ReprFactory;
+import org.nimbustools.api.services.metadata.MetadataServer;
+import org.nimbustools.api.services.rm.Manager;
+
+/**
+ * For use from above to find key modules, where "above" means the remote
+ * messaging system (or some test/console framework). Those cannot be served
+ * by our dependency injection (they can be IoC of course, but it would be a
+ * different application context unless you took time to integrate directly).
+ *
+ * @see BreathOfLife
+ */
+public interface ModuleLocator {
+ public Manager getManager();
+ public ReprFactory getReprFactory();
+ public MetadataServer getMetadataServer();
+ //public ContextBroker getContextBroker();
+}
View
34 service-api/java/source/src/org/nimbustools/api/brain/NimbusLog.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.brain;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Hides logging dependencies
+ */
+public class NimbusLog {
+
+ private static final Log logger =
+ LogFactory.getLog(NimbusLog.class.getName());
+
+ void debug(String debug) {
+ logger.debug(debug);
+ }
+
+}
View
16 service-api/java/source/src/org/nimbustools/api/brain/package.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<body>
+
+<p>
+ <img src="http://workspace.globus.org/img/sh.png" alt="[Start here] " />
+ Used by the messaging-layer/hosting-container to instantiate and access the
+ underlying implementation.
+</p>
+
+<p>
+ Using Spring, see {@link org.nimbustools.api.brain.BreathOfLife}
+</p>
+
+</body>
+</html>
View
33 service-api/java/source/src/org/nimbustools/api/defaults/brain/DefaultModuleLocator.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.brain;
+
+import org.nimbustools.api.brain.ModuleLocator;
+import org.nimbustools.api.repr.ReprFactory;
+import org.nimbustools.api.services.rm.Manager;
+import org.nimbustools.api.services.metadata.MetadataServer;
+
+/**
+ * The implementation of this is authored on the fly by Spring IoC's cglib
+ * feature.
+ */
+public abstract class DefaultModuleLocator implements ModuleLocator {
+ public abstract Manager getManager();
+ public abstract ReprFactory getReprFactory();
+ public abstract MetadataServer getMetadataServer();
+ //public abstract ContextBroker getContextBroker();
+}
View
13 service-api/java/source/src/org/nimbustools/api/defaults/brain/package.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<body>
+
+<p>
+ All default implementations for {@link org.nimbustools.api.brain};
+ all classes here are instantiated when using the embedded IoC
+ configuration (it's unlikely brain impls are overridden in the deployed
+ configuration, but possible).
+</p>
+
+</body>
+</html>
View
72 service-api/java/source/src/org/nimbustools/api/defaults/defaults.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Default Spring configuration for Nimbus.
+
+ This contains an implementation configuration that:
+
+ a) Doesn't actually accomplish anything
+
+ b) Performs no I/O except logging
+
+ c) Is helpful for learning about the overall architecture
+
+ d) Is helpful for developing/testing/debugging (in some cases)
+
+ This can also be used as a template for adding in various real
+ implementations, although a working config from a deployment might
+ serve you better for that.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <!--
+ rm.Manager implementation
+ -->
+
+ <bean id="nimbus-rm.manager"
+ class="org.nimbustools.api.defaults.services.rm.DefaultManager">
+
+ <constructor-arg ref="nimbus-repr.ReprFactory"/>
+ <constructor-arg ref="nimbus-rm.BasicLegality"/>
+
+ </bean>
+
+
+ <!--
+ rm.BasicLegality implementation
+ -->
+
+ <bean id="nimbus-rm.BasicLegality"
+ class="org.nimbustools.api.defaults.services.rm.DefaultBasicLegality" />
+
+
+ <!--
+ brain.ModuleLocator implementation
+
+ For use from above to find key modules, where "above" in almost all
+ cases means a container (the remote messaging layer). Those cannot be
+ served by dependency injection (or if they happened to be, would be a
+ different application context unless you took time to integrate
+ directly).
+ -->
+
+ <bean id="nimbus-brain.ModuleLocator"
+ class="org.nimbustools.api.defaults.brain.DefaultModuleLocator">
+
+ <lookup-method name="getManager" bean="nimbus-rm.manager"/>
+ <lookup-method name="getReprFactory" bean="nimbus-repr.ReprFactory"/>
+
+ </bean>
+
+
+ <!--
+ representation classes are broken out
+ -->
+
+ <import resource="repr.xml"/>
+
+</beans>
View
7 service-api/java/source/src/org/nimbustools/api/defaults/log4j.properties
@@ -0,0 +1,7 @@
+log4j.rootCategory=ERROR, A1
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} [%t,%M:%L] %m%n
+log4j.category.org.globus=INFO
+log4j.category.org.nimbustools=DEBUG
+log4j.category.org.globus.workspace=DEBUG
View
101 service-api/java/source/src/org/nimbustools/api/defaults/repr.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ WARNING: It is unlikely you would need to edit anything here, most of these
+ objects are POJOs/beans.
+
+ New implementations of these representation objects are possible
+ using these mappings but it's recommended that you familiarize
+ yourself at the code level with how the default impls are used.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <bean id="nimbus-repr.ReprFactory"
+ class="org.nimbustools.api.defaults.repr.DefaultReprFactory">
+
+ <!-- repr package, writable: -->
+
+ <lookup-method name="_newAdvertised" bean="nimbus-repr.Advertised"/>
+ <lookup-method name="_newCaller" bean="nimbus-repr.Caller"/>
+ <lookup-method name="_newCreateRequest" bean="nimbus-repr.CreateRequest"/>
+ <lookup-method name="_newCreateResult" bean="nimbus-repr.CreateResult"/>
+ <lookup-method name="_newCustomizationRequest" bean="nimbus-repr.CustomizationRequest"/>
+ <lookup-method name="_newShutdownTasks" bean="nimbus-repr.ShutdownTasks"/>
+ <lookup-method name="_newUsage" bean="nimbus-repr.Usage"/>
+
+ <!-- vm package, writable: -->
+
+ <lookup-method name="_newKernel" bean="nimbus-repr.vm.Kernel"/>
+ <lookup-method name="_newNIC" bean="nimbus-repr.vm.NIC"/>
+ <lookup-method name="_newRequiredVMM" bean="nimbus-repr.vm.RequiredVMM"/>
+ <lookup-method name="_newResourceAllocation" bean="nimbus-repr.vm.ResourceAllocation"/>
+ <lookup-method name="_newSchedule" bean="nimbus-repr.vm.Schedule"/>
+ <lookup-method name="_newState" bean="nimbus-repr.vm.State"/>
+ <lookup-method name="_newVM" bean="nimbus-repr.vm.VM"/>
+ <lookup-method name="_newVMFile" bean="nimbus-repr.vm.VMFile"/>
+
+ <!-- ctx package, writable: -->
+
+ <lookup-method name="_newContext" bean="nimbus-repr.ctx.Context"/>
+
+ </bean>
+
+ <!-- repr package beans: -->
+
+ <bean id="nimbus-repr.Advertised" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultAdvertised" />
+
+ <bean id="nimbus-repr.Caller" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultCaller" />
+
+ <bean id="nimbus-repr.CreateRequest" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultCreateRequest" />
+
+ <bean id="nimbus-repr.CreateResult" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultCreateResult" />
+
+ <bean id="nimbus-repr.CustomizationRequest" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultCustomizationRequest" />
+
+ <bean id="nimbus-repr.ShutdownTasks" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultShutdownTasks" />
+
+ <bean id="nimbus-repr.Usage" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.DefaultUsage" />
+
+ <!-- vm package beans: -->
+
+ <bean id="nimbus-repr.vm.Kernel" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.vm.DefaultKernel" />
+
+ <bean id="nimbus-repr.vm.NIC" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.vm.DefaultNIC" />
+
+ <bean id="nimbus-repr.vm.RequiredVMM" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.vm.DefaultRequiredVMM" />
+
+ <bean id="nimbus-repr.vm.ResourceAllocation" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.vm.DefaultResourceAllocation" />
+
+ <bean id="nimbus-repr.vm.Schedule" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.vm.DefaultSchedule" />
+
+ <bean id="nimbus-repr.vm.State" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.vm.DefaultState" />
+
+ <bean id="nimbus-repr.vm.VM" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.vm.DefaultVM" />
+
+ <bean id="nimbus-repr.vm.VMFile" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.vm.DefaultVMFile" />
+
+ <!-- ctx package bean: -->
+
+ <bean id="nimbus-repr.ctx.Context" scope="prototype"
+ class="org.nimbustools.api.defaults.repr.ctx.DefaultContext" />
+
+</beans>
View
142 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultAdvertised.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.repr;
+
+import org.nimbustools.api._repr._Advertised;
+
+import java.util.Arrays;
+
+public class DefaultAdvertised implements _Advertised {
+
+ // -------------------------------------------------------------------------
+ // INSTANCE VARIABLES
+ // -------------------------------------------------------------------------
+
+ private int defaultRunningTimeSeconds;
+ private int maximumRunningTimeSeconds;
+ private int maximumAfterRunningTimeSeconds;
+ private String cpuArchitectureName;
+ private String[] vmmVersions;
+ private String vmm;
+ private String[] networkNames;
+ private int maxGroupSize;
+ private int chargeGranularity;
+
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api.repr.Advertised
+ // -------------------------------------------------------------------------
+
+ public int getDefaultRunningTimeSeconds() {
+ return this.defaultRunningTimeSeconds;
+ }
+
+ public int getMaximumRunningTimeSeconds() {
+ return this.maximumRunningTimeSeconds;
+ }
+
+ public int getMaximumAfterRunningTimeSeconds() {
+ return this.maximumAfterRunningTimeSeconds;
+ }
+
+ public String getCpuArchitectureName() {
+ return this.cpuArchitectureName;
+ }
+
+ public String[] getVmmVersions() {
+ return this.vmmVersions;
+ }
+
+ public String getVmm() {
+ return this.vmm;
+ }
+
+ public String[] getNetworkNames() {
+ return this.networkNames;
+ }
+
+ public int getMaxGroupSize() {
+ return this.maxGroupSize;
+ }
+
+ public int getChargeGranularity() {
+ return this.chargeGranularity;
+ }
+
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api._repr.__Advertised
+ // -------------------------------------------------------------------------
+
+ public void setDefaultRunningTimeSeconds(int defaultRunningTime) {
+ this.defaultRunningTimeSeconds = defaultRunningTime;
+ }
+
+ public void setMaximumRunningTimeSeconds(int maximumRunningTime) {
+ this.maximumRunningTimeSeconds = maximumRunningTime;
+ }
+
+ public void setMaximumAfterRunningTimeSeconds(int maximumAfterRunningTime) {
+ this.maximumAfterRunningTimeSeconds = maximumAfterRunningTime;
+ }
+
+ public void setCpuArchitectureName(String cpuArchitectureName) {
+ this.cpuArchitectureName = cpuArchitectureName;
+ }
+
+ public void setVmmVersions(String[] vmmVersions) {
+ this.vmmVersions = vmmVersions;
+ }
+
+ public void setVmm(String vmm) {
+ this.vmm = vmm;
+ }
+
+ public void setNetworkNames(String[] networkNames) {
+ this.networkNames = networkNames;
+ }
+
+ public void setMaxGroupSize(int maxGroupSize) {
+ this.maxGroupSize = maxGroupSize;
+ }
+
+ public void setChargeGranularity(int chargeGranularity) {
+ this.chargeGranularity = chargeGranularity;
+ }
+
+ // -------------------------------------------------------------------------
+ // DEBUG STRING
+ // -------------------------------------------------------------------------
+
+
+ public String toString() {
+ return "DefaultAdvertised{" +
+ "defaultRunningTimeSeconds=" + defaultRunningTimeSeconds +
+ ", maximumRunningTimeSeconds=" + maximumRunningTimeSeconds +
+ ", maximumAfterRunningTimeSeconds=" +
+ maximumAfterRunningTimeSeconds +
+ ", cpuArchitectureName='" + cpuArchitectureName + '\'' +
+ ", vmmVersions=" +
+ (vmmVersions == null ? null : Arrays.asList(vmmVersions)) +
+ ", vmm='" + vmm + '\'' +
+ ", networkNames=" +
+ (networkNames == null ? null : Arrays.asList(networkNames)) +
+ ", maxGroupSize=" + maxGroupSize +
+ ", chargeGranularity=" + chargeGranularity +
+ '}';
+ }
+}
View
74 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultCaller.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.repr;
+
+import org.nimbustools.api._repr._Caller;
+import javax.security.auth.Subject;
+
+public class DefaultCaller implements _Caller {
+
+ // -------------------------------------------------------------------------
+ // INSTANCE VARIABLES
+ // -------------------------------------------------------------------------
+
+ private String identity;
+ private boolean superuser;
+ private Subject subject;
+
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api.repr.Caller
+ // -------------------------------------------------------------------------
+
+ public String getIdentity() {
+ return this.identity;
+ }
+
+ public boolean isSuperUser() {
+ return this.superuser;
+ }
+
+ public Subject getSubject() {
+ return this.subject;
+ }
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api._repr._Caller
+ // -------------------------------------------------------------------------
+
+ public void setIdentity(String identity) {
+ this.identity = identity;
+ // this object is not strictly a "bean"
+ this.superuser = (identity == null);
+ }
+
+ public void setSubject(Subject subject) {
+ this.subject = subject;
+ }
+
+ // -------------------------------------------------------------------------
+ // DEBUG STRING
+ // -------------------------------------------------------------------------
+
+ public String toString() {
+ return "DefaultCaller{" +
+ "identity='" + identity + '\'' +
+ ", superuser=" + superuser +
+ ", subject=" + subject +
+ '}';
+ }
+}
View
210 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultCreateRequest.java
@@ -0,0 +1,210 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.repr;
+
+import org.nimbustools.api._repr._CreateRequest;
+import org.nimbustools.api.repr.CustomizationRequest;
+import org.nimbustools.api.repr.ctx.Context;
+import org.nimbustools.api.repr.vm.Kernel;
+import org.nimbustools.api.repr.vm.NIC;
+import org.nimbustools.api.repr.vm.RequiredVMM;
+import org.nimbustools.api.repr.vm.ResourceAllocation;
+import org.nimbustools.api.repr.vm.Schedule;
+import org.nimbustools.api.repr.vm.VMFile;
+
+import java.util.Arrays;
+
+public class DefaultCreateRequest implements _CreateRequest {
+
+ // -------------------------------------------------------------------------
+ // INSTANCE VARIABLES
+ // -------------------------------------------------------------------------
+
+ private String name;
+ private VMFile[] vmFiles;
+ private NIC[] nics;
+ private Schedule schedule;
+ private String coscheduleID;
+ private boolean coscheduleDone;
+ private boolean coscheduleMember;
+ private ResourceAllocation ra;
+ private RequiredVMM requiredVMM;
+ private Kernel kernel;
+ private CustomizationRequest[] custRequests;
+ private String shutdownType;
+ private String initialStateRequest;
+ private Context context;
+ private String mdUserData;
+
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api.repr.CreateRequest
+ // -------------------------------------------------------------------------
+
+ public String getName() {
+ return this.name;
+ }
+
+ public VMFile[] getVMFiles() {
+ return this.vmFiles;
+ }
+
+ public NIC[] getRequestedNics() {
+ return this.nics;
+ }
+
+ public Schedule getRequestedSchedule() {
+ return this.schedule;
+ }
+
+ public String getCoScheduleID() {
+ return this.coscheduleID;
+ }
+
+ public boolean isCoScheduleDone() {
+ return this.coscheduleDone;
+ }
+
+ public boolean isCoScheduleMember() {
+ return this.coscheduleMember;
+ }
+
+ public ResourceAllocation getRequestedRA() {
+ return this.ra;
+ }
+
+ public RequiredVMM getRequiredVMM() {
+ return this.requiredVMM;
+ }
+
+ public Kernel getRequestedKernel() {
+ return this.kernel;
+ }
+
+ public CustomizationRequest[] getCustomizationRequests() {
+ return this.custRequests;
+ }
+
+ public String getShutdownType() {
+ return this.shutdownType;
+ }
+
+ public String getInitialStateRequest() {
+ return this.initialStateRequest;
+ }
+
+ public Context getContext() {
+ return this.context;
+ }
+
+ public String getMdUserData() {
+ return this.mdUserData;
+ }
+
+ public void setMdUserData(String mdUserData) {
+ this.mdUserData = mdUserData;
+ }
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api._repr._CreateRequest
+ // -------------------------------------------------------------------------
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setVMFiles(VMFile[] vmFiles) {
+ this.vmFiles = vmFiles;
+ }
+
+ public void setRequestedNics(NIC[] nics) {
+ this.nics = nics;
+ }
+
+ public void setRequestedSchedule(Schedule schedule) {
+ this.schedule = schedule;
+ }
+
+ public void setCoScheduleID(String id) {
+ this.coscheduleID = id;
+ }
+
+ public void setCoScheduleDone(boolean done) {
+ this.coscheduleDone = done;
+ }
+
+ public void setCoScheduleMember(boolean member) {
+ this.coscheduleMember = member;
+ }
+
+ public void setRequestedRA(ResourceAllocation requestedRA) {
+ this.ra = requestedRA;
+ }
+
+ public void setRequiredVMM(RequiredVMM requiredVMM) {
+ this.requiredVMM = requiredVMM;
+ }
+
+ public void setRequestedKernel(Kernel kernel) {
+ this.kernel = kernel;
+ }
+
+ public void setCustomizationRequests(CustomizationRequest[] requests) {
+ this.custRequests = requests;
+ }
+
+ public void setShutdownType(String type) {
+ this.shutdownType = type;
+ }
+
+ public void setInitialStateRequest(String state) {
+ this.initialStateRequest = state;
+ }
+
+ public void setContext(Context context) {
+ this.context = context;
+ }
+
+
+ // -------------------------------------------------------------------------
+ // DEBUG STRING
+ // -------------------------------------------------------------------------
+
+ public String toString() {
+ final boolean userDataPresent = this.mdUserData != null;
+ final String prefix = "\n\n{{{ ";
+ return "\nDefaultCreateRequest" +
+ prefix + "name='" + this.name + '\'' +
+ prefix + "vmFiles=" +
+ (this.vmFiles == null ? null : Arrays.asList(this.vmFiles)) +
+ prefix + "nics=" +
+ (this.nics == null ? null : Arrays.asList(this.nics)) +
+ prefix + "schedule=" + this.schedule +
+ prefix + "coscheduleID='" + this.coscheduleID + "'" +
+ prefix + "coscheduleDone=" + this.coscheduleDone +
+ prefix + "coscheduleMember=" + this.coscheduleMember +
+ prefix + "ra=" + this.ra +
+ prefix + "requiredVMM=" + this.requiredVMM +
+ prefix + "kernel=" + this.kernel +
+ prefix + "custRequests=" +
+ (this.custRequests == null ? null : Arrays.asList(this.custRequests)) +
+ prefix + "shutdownType='" + this.shutdownType + "'" +
+ prefix + "userDataPresent? " + userDataPresent +
+ prefix + "initialStateRequest='" + this.initialStateRequest + "'" +
+ prefix + "context=" + this.context + "\n";
+ }
+}
View
80 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultCreateResult.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.repr;
+
+import org.nimbustools.api._repr._CreateResult;
+import org.nimbustools.api.repr.vm.VM;
+
+import java.util.Arrays;
+
+public class DefaultCreateResult implements _CreateResult {
+
+ // -------------------------------------------------------------------------
+ // INSTANCE VARIABLES
+ // -------------------------------------------------------------------------
+
+ private VM[] vms;
+ private String groupID;
+ private String coscheduleID;
+
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api.repr.CreateResult
+ // -------------------------------------------------------------------------
+
+ public VM[] getVMs() {
+ return this.vms;
+ }
+
+ public String getGroupID() {
+ return this.groupID;
+ }
+
+ public String getCoscheduledID() {
+ return this.coscheduleID;
+ }
+
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api._repr._CreateResult
+ // -------------------------------------------------------------------------
+
+ public void setVMs(VM[] vms) {
+ this.vms = vms;
+ }
+
+ public void setGroupID(String id) {
+ this.groupID = id;
+ }
+
+ public void setCoscheduledID(String id) {
+ this.coscheduleID = id;
+ }
+
+
+ // -------------------------------------------------------------------------
+ // DEBUG STRING
+ // -------------------------------------------------------------------------
+
+ public String toString() {
+ return "DefaultCreateResult{" +
+ "vms=" + (vms == null ? null : Arrays.asList(vms)) +
+ ", groupID='" + groupID + '\'' +
+ ", coscheduleID='" + coscheduleID + '\'' +
+ '}';
+ }
+}
View
54 ...ce-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultCustomizationRequest.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.repr;
+
+import org.nimbustools.api._repr._CustomizationRequest;
+
+public class DefaultCustomizationRequest implements _CustomizationRequest {
+
+ private String pathOnVM;
+ private String content;
+
+ public String getPathOnVM() {
+ return this.pathOnVM;
+ }
+
+ public void setPathOnVM(String pathOnVM) {
+ this.pathOnVM = pathOnVM;
+ }
+
+ public String getContent() {
+ return this.content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String toString() {
+ final String x;
+ if (this.content != null) {
+ x = "[content-is-present]";
+ } else {
+ x = "[content-is-not-present]";
+ }
+ return "DefaultCustomizationRequest{" +
+ "pathOnVM='" + this.pathOnVM + '\'' +
+ ", content=" + x +
+ '}';
+ }
+}
View
75 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultReprFactory.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.repr;
+
+import org.nimbustools.api._repr._Advertised;
+import org.nimbustools.api._repr._Caller;
+import org.nimbustools.api._repr._CreateRequest;
+import org.nimbustools.api._repr._CreateResult;
+import org.nimbustools.api._repr._CustomizationRequest;
+import org.nimbustools.api._repr._ShutdownTasks;
+import org.nimbustools.api._repr._Usage;
+import org.nimbustools.api._repr.ctx._Context;
+import org.nimbustools.api._repr.vm._Kernel;
+import org.nimbustools.api._repr.vm._NIC;
+import org.nimbustools.api._repr.vm._RequiredVMM;
+import org.nimbustools.api._repr.vm._ResourceAllocation;
+import org.nimbustools.api._repr.vm._Schedule;
+import org.nimbustools.api._repr.vm._State;
+import org.nimbustools.api._repr.vm._VM;
+import org.nimbustools.api._repr.vm._VMFile;
+import org.nimbustools.api.repr.ReprFactory;
+
+/**
+ * The implementation of this is authored on the fly by Spring IoC's cglib
+ * feature.
+ */
+public abstract class DefaultReprFactory implements ReprFactory {
+
+ public String report() {
+ return "Default representation object factory " +
+ "(class implementation is auto-generated)";
+ }
+
+
+ // -------------------------------------------------------------------------
+ // WRITABLE
+ // -------------------------------------------------------------------------
+
+ // repr package
+ public abstract _Advertised _newAdvertised();
+ public abstract _Caller _newCaller();
+ public abstract _CreateRequest _newCreateRequest();
+ public abstract _CreateResult _newCreateResult();
+ public abstract _CustomizationRequest _newCustomizationRequest();
+ public abstract _ShutdownTasks _newShutdownTasks();
+ public abstract _Usage _newUsage();
+
+ // vm package
+ public abstract _Kernel _newKernel();
+ public abstract _NIC _newNIC();
+ public abstract _RequiredVMM _newRequiredVMM();
+ public abstract _ResourceAllocation _newResourceAllocation();
+ public abstract _Schedule _newSchedule();
+ public abstract _State _newState();
+ public abstract _VM _newVM();
+ public abstract _VMFile _newVMFile();
+
+ // ctx package
+ public abstract _Context _newContext();
+
+}
View
57 service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultShutdownTasks.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 1999-2008 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.api.defaults.repr;
+
+import org.nimbustools.api._repr._ShutdownTasks;
+
+import java.net.URI;
+
+public class DefaultShutdownTasks implements _ShutdownTasks {
+
+ // -------------------------------------------------------------------------
+ // INSTANCE VARIABLES
+ // -------------------------------------------------------------------------
+
+ private URI baseFileUnpropagationTarget;
+ private boolean appendID;
+
+
+ // -------------------------------------------------------------------------
+ // implements org.nimbustools.api.repr.ShutdownTasks
+ // -------------------------------------------------------------------------
+
+ public URI getBaseFileUnpropagationTarget() {
+ return this.baseFileUnpropagationTarget;
+ }
+
+ public boolean isAppendID() {
+ return this.appendID;
+ }
+