Location where = (Location)params[1];
String newName = (String)params[2];
MainContainer impl = myContainer.getMain();
if(impl != null) {
ContainerID cid = impl.getContainerID(agentID);
AgentMobilitySlice targetSlice = (AgentMobilitySlice)getSlice(cid.getName());
try {
targetSlice.copyAgent(agentID, where, newName);
}
catch(IMTPException imtpe) {
// Try to get a newer slice and repeat...
targetSlice = (AgentMobilitySlice)getFreshSlice(cid.getName());
targetSlice.copyAgent(agentID, where, newName);
}
}
else {
// Do nothing for now, but could also route the command to the main slice, thus enabling e.g. AMS replication