Permalink
Browse files

added sshkeyName to AsyncRequest

  • Loading branch information...
pauloricardomg committed Aug 5, 2010
1 parent d37b3b5 commit a666110e21f089ca02387961bc93bfaf85dde824
@@ -25,7 +25,8 @@
private Context context;
private NIC[] requestedNics;
private String groupID;
-
+ private String sshKeyName;
+
private Throwable problem = null;
private LinkedHashSet<Integer> allocatedVMs = new LinkedHashSet<Integer>();
@@ -35,7 +36,7 @@
//Test-only
public AsyncRequest(String id, Double highestPrice, VirtualMachine[] bindings) {
- this(id, highestPrice, false, null, null, bindings, null, null, null);
+ this(id, highestPrice, false, null, null, bindings, null, null, null, null);
}
/**
@@ -52,8 +53,8 @@ public AsyncRequest(String id, Double highestPrice, VirtualMachine[] bindings) {
*/
public AsyncRequest(String id, Double spotPrice, boolean persistent,
Caller caller, String groupID, VirtualMachine[] bindings, Context context,
- NIC[] requestedNics, Calendar creationTime) {
- this(id, true, spotPrice, persistent, caller, groupID, bindings, context, requestedNics, creationTime);
+ NIC[] requestedNics, String sshKeyName, Calendar creationTime) {
+ this(id, true, spotPrice, persistent, caller, groupID, bindings, context, requestedNics, sshKeyName, creationTime);
}
/**
@@ -70,12 +71,12 @@ public AsyncRequest(String id, Double spotPrice, boolean persistent,
*/
public AsyncRequest(String id, Caller caller, String groupID, VirtualMachine[] bindings, Context context,
NIC[] requestedNics, Calendar creationTime) {
- this(id, false, -1.0, true, caller, groupID, bindings, context, requestedNics, creationTime);
+ this(id, false, -1.0, true, caller, groupID, bindings, context, requestedNics, null, creationTime);
}
public AsyncRequest(String id, boolean spotinstances, Double spotPrice, boolean persistent,
Caller caller, String groupID, VirtualMachine[] bindings, Context context,
- NIC[] requestedNics, Calendar creationTime) {
+ NIC[] requestedNics, String sshKeyName, Calendar creationTime) {
this.status = AsyncRequestStatus.OPEN;
this.id = id;
this.spot = spotinstances;
@@ -87,6 +88,7 @@ public AsyncRequest(String id, boolean spotinstances, Double spotPrice, boolean
this.groupID = groupID;
this.caller = caller;
this.creationTime = creationTime;
+ this.sshKeyName = sshKeyName;
}
public Double getMaxBid() {
@@ -180,6 +182,10 @@ public String getGroupID() {
return groupID;
}
+ public String getSshKeyName() {
+ return sshKeyName;
+ }
+
public boolean isAllocatedVM(Integer vmid){
return allocatedVMs.contains(vmid);
}
@@ -309,9 +309,13 @@ public AsyncRequest addAsyncRequest(AsyncCreateRequest req, Caller caller)
if(req instanceof SpotCreateRequest){
SpotCreateRequest spotReq = (SpotCreateRequest)req;
- siRequest = new AsyncRequest(siID, spotReq.getSpotPrice(), spotReq.isPersistent(), caller, groupID, bound, req.getContext(), req.getRequestedNics(), Calendar.getInstance());
+ siRequest = new AsyncRequest(siID, spotReq.getSpotPrice(), spotReq.isPersistent(),
+ caller, groupID, bound, req.getContext(), req.getRequestedNics(),
+ req.getSshKeyName(), Calendar.getInstance());
} else {
- siRequest = new AsyncRequest(siID, caller, groupID, bound, req.getContext(), req.getRequestedNics(), Calendar.getInstance());
+ siRequest = new AsyncRequest(siID, caller, groupID, bound,
+ req.getContext(), req.getRequestedNics(),
+ Calendar.getInstance());
}
asyncManager.addRequest(siRequest);

0 comments on commit a666110

Please sign in to comment.