Skip to content
This repository
  • 1 commit
  • 9 files changed
  • 0 comments
  • 1 contributor
4  messaging/gt4.0/java/msgbridge/src/org/nimbustools/messaging/gt4_0/factory/FactoryResource.java
@@ -385,9 +385,9 @@ public void setRPs(Advertised advert) throws ResourceException {
385 385
         
386 386
         /* CPUArchitectureName */
387 387
 
388  
-        if (advert.getCpuArchitectureName() != null) {
  388
+        if (advert.getCpuArchitectureNames() != null) {
389 389
             prop = new SimpleResourceProperty(Constants_GT4_0.RP_FACTORY_CPUArch);
390  
-            prop.add(advert.getCpuArchitectureName());
  390
+            prop.add(advert.getCpuArchitectureNames());
391 391
             this.propSet.add(prop);
392 392
         }
393 393
 
2  service-api/java/source/src/org/nimbustools/api/_repr/_Advertised.java
@@ -22,7 +22,7 @@
22 22
 
23 23
     public void setDefaultRunningTimeSeconds(int defaultRunningTime);
24 24
     public void setMaximumRunningTimeSeconds(int maximumRunningTime);
25  
-    public void setCpuArchitectureName(String cpuArchitectureName);
  25
+    public void setCpuArchitectureNames(String[] cpuArchitectureNames);
26 26
     public void setVmmVersions(String[] vmmVersions);
27 27
     public void setVmm(String vmm);
28 28
     public void setNetworkNames(String[] networkNames);
13  service-api/java/source/src/org/nimbustools/api/defaults/repr/DefaultAdvertised.java
@@ -29,7 +29,7 @@
29 29
     private int defaultRunningTimeSeconds;
30 30
     private int maximumRunningTimeSeconds;
31 31
     private int maximumAfterRunningTimeSeconds;
32  
-    private String cpuArchitectureName;
  32
+    private String[] cpuArchitectureNames;
33 33
     private String[] vmmVersions;
34 34
     private String vmm;
35 35
     private String[] networkNames;
@@ -53,8 +53,8 @@ public int getMaximumAfterRunningTimeSeconds() {
53 53
         return this.maximumAfterRunningTimeSeconds;
54 54
     }
55 55
 
56  
-    public String getCpuArchitectureName() {
57  
-        return this.cpuArchitectureName;
  56
+    public String[] getCpuArchitectureNames() {
  57
+        return this.cpuArchitectureNames;
58 58
     }
59 59
 
60 60
     public String[] getVmmVersions() {
@@ -94,8 +94,8 @@ public void setMaximumAfterRunningTimeSeconds(int maximumAfterRunningTime) {
94 94
         this.maximumAfterRunningTimeSeconds = maximumAfterRunningTime;
95 95
     }
96 96
 
97  
-    public void setCpuArchitectureName(String cpuArchitectureName) {
98  
-        this.cpuArchitectureName = cpuArchitectureName;
  97
+    public void setCpuArchitectureNames(String[] cpuArchitectureNames) {
  98
+        this.cpuArchitectureNames = cpuArchitectureNames;
99 99
     }
100 100
 
101 101
     public void setVmmVersions(String[] vmmVersions) {
@@ -129,7 +129,8 @@ public String toString() {
129 129
                 ", maximumRunningTimeSeconds=" + maximumRunningTimeSeconds +
130 130
                 ", maximumAfterRunningTimeSeconds=" +
131 131
                 maximumAfterRunningTimeSeconds +
132  
-                ", cpuArchitectureName='" + cpuArchitectureName + '\'' +
  132
+                ", cpuArchitectureNames='" +
  133
+                (cpuArchitectureNames  == null ? null : Arrays.asList(cpuArchitectureNames)) +
133 134
                 ", vmmVersions=" +
134 135
                 (vmmVersions == null ? null : Arrays.asList(vmmVersions)) +
135 136
                 ", vmm='" + vmm + '\'' +
2  service-api/java/source/src/org/nimbustools/api/repr/Advertised.java
@@ -25,7 +25,7 @@
25 25
 
26 26
     public int getDefaultRunningTimeSeconds();
27 27
     public int getMaximumRunningTimeSeconds();
28  
-    public String getCpuArchitectureName();
  28
+    public String[] getCpuArchitectureNames();
29 29
     public String[] getVmmVersions();
30 30
     public String getVmm();
31 31
     public String[] getNetworkNames();
2  service/service/java/source/etc/workspace-service/other/main.xml
@@ -125,7 +125,7 @@
125 125
           init-method="validate">
126 126
 
127 127
         <!-- Property values coming via vmm.conf -->
128  
-        <property name="cpuArchitectureName"
  128
+        <property name="cpuArchitectureNames"
129 129
                   value="$VMM{cpu.arch}" />
130 130
         <property name="vmm"
131 131
                   value="$VMM{vmm.type}" />
4  service/service/java/source/src/org/globus/workspace/creation/defaults/DefaultCreation.java
@@ -229,8 +229,8 @@ public void setAccountingEventAdapter(AccountingEventAdapter accEvents) {
229 229
     public Advertised getAdvertised() {
230 230
 
231 231
         final _Advertised adv = this.repr._newAdvertised();
232  
-        adv.setCpuArchitectureName(
233  
-                this.globals.getCpuArchitectureName());
  232
+        adv.setCpuArchitectureNames(
  233
+                this.globals.getCpuArchitectureNames());
234 234
         adv.setDefaultRunningTimeSeconds(
235 235
                 this.globals.getDefaultRunningTimeSeconds());
236 236
         adv.setMaxGroupSize(
2  service/service/java/source/src/org/globus/workspace/service/binding/GlobalPolicies.java
@@ -24,7 +24,7 @@
24 24
 
25 25
     public int getTerminationOffsetSeconds();
26 26
 
27  
-    public String getCpuArchitectureName();
  27
+    public String[] getCpuArchitectureNames();
28 28
 
29 29
     public String[] getVmmVersions();
30 30
 
32  service/service/java/source/src/org/globus/workspace/service/binding/authorization/DefaultAuthorize.java
@@ -29,6 +29,8 @@
29 29
 import org.nimbustools.api.services.rm.ResourceRequestDeniedException;
30 30
 
31 31
 import javax.security.auth.Subject;
  32
+import java.util.List;
  33
+import java.util.Arrays;
32 34
 
33 35
 public class DefaultAuthorize implements Authorize {
34 36
 
@@ -264,8 +266,8 @@ protected static void authorizeDuration(VirtualMachine vm,
264 266
     protected void checkArchitecture(VirtualMachine vm)
265 267
             throws ResourceRequestDeniedException {
266 268
 
267  
-        final String fact = this.globals.getCpuArchitectureName();
268  
-        if (fact == null) {
  269
+        final String[] allowedCPUArchitectures = this.globals.getCpuArchitectureNames();
  270
+        if (allowedCPUArchitectures == null) {
269 271
             // if policy is null, means 'any'
270 272
             return; // *** EARLY RETURN ***
271 273
         }
@@ -276,16 +278,32 @@ protected void checkArchitecture(VirtualMachine vm)
276 278
                             "no CPU architecture description (no dep)");
277 279
         }
278 280
 
279  
-        final String arch = dep.getCPUArchitecture();
280  
-        if (arch == null) {
  281
+        final String requestedArch = dep.getCPUArchitecture();
  282
+        if (requestedArch == null) {
281 283
             throw new ResourceRequestDeniedException(
282 284
                             "no CPU architecture description (no dep.arch)");
283 285
         }
284 286
 
285  
-        if (!arch.equals(fact)) {
  287
+        List archList = Arrays.asList(allowedCPUArchitectures);
  288
+
  289
+        if (!archList.contains(requestedArch)) {
  290
+
  291
+            StringBuilder sb = new StringBuilder();
  292
+            boolean first = true;
  293
+            for (int i=0; i < allowedCPUArchitectures.length ; i++) {
  294
+                if (first) {
  295
+                    first = false;
  296
+                }
  297
+                else {
  298
+                    sb.append(", ");
  299
+                }
  300
+                sb.append(allowedCPUArchitectures[i]);
  301
+            }
  302
+            final String allArchitectures = sb.toString();
  303
+
286 304
             throw new ResourceRequestDeniedException(
287  
-                    "incorrect CPU architecture, only '" + fact +
288  
-                            "' supported, you request '" + arch + "'");
  305
+                    "incorrect CPU architecture, only '" + allArchitectures +
  306
+                            "' supported, you requested '" + requestedArch + "'");
289 307
         }
290 308
     }
291 309
 
10  service/service/java/source/src/org/globus/workspace/service/binding/defaults/DefaultGlobalPolicies.java
@@ -38,7 +38,7 @@
38 38
     private int defaultRunningTimeSeconds;
39 39
     private int maximumRunningTimeSeconds;
40 40
     private int terminationOffsetSeconds;
41  
-    private String cpuArchitectureName;
  41
+    private String[] cpuArchitectureNames;
42 42
     private String[] vmmVersions;
43 43
     private String vmm;
44 44
 
@@ -83,12 +83,12 @@ public void setTerminationOffsetSeconds(int terminationOffsetSeconds) {
83 83
         this.terminationOffsetSeconds = terminationOffsetSeconds;
84 84
     }
85 85
 
86  
-    public String getCpuArchitectureName() {
87  
-        return this.cpuArchitectureName;
  86
+    public String[] getCpuArchitectureNames() {
  87
+        return this.cpuArchitectureNames;
88 88
     }
89 89
 
90  
-    public void setCpuArchitectureName(String cpuArchitectureName) {
91  
-        this.cpuArchitectureName = cpuArchitectureName;
  90
+    public void setCpuArchitectureNames(String[] cpuArchitectureNames) {
  91
+        this.cpuArchitectureNames = cpuArchitectureNames;
92 92
     }
93 93
 
94 94
     public String[] getVmmVersions() {

No commit comments for this range

Something went wrong with that request. Please try again.