Make Command be able to carry hypervisor or environment related info to help support dispatching same command towards multiple targets

This commit is contained in:
Kelven Yang 2011-02-16 16:41:55 -08:00
parent a89fffee9d
commit 77ac07430e
1 changed files with 14 additions and 0 deletions

View File

@ -17,6 +17,9 @@
*/
package com.cloud.agent.api;
import java.util.HashMap;
import java.util.Map;
/**
* Command is a command that is sent between the management agent and management
@ -29,6 +32,9 @@ package com.cloud.agent.api;
*/
public abstract class Command {
// allow command to carry over hypervisor or other environment related context info
protected Map<String, String> contextMap = new HashMap<String, String>();
protected Command() {
}
@ -42,4 +48,12 @@ public abstract class Command {
public boolean logTrace() {
return false;
}
public void setContextParam(String name, String value) {
contextMap.put(name, value);
}
public String getContextParam(String name) {
return contextMap.get(name);
}
}