// Mandatory slots have already been checked
AID agentID = dsc.getName();
AgentDescriptor ad = platformAgents.acquire(agentID);
if (ad != null) {
AMSAgentDescription oldDsc = ad.getDescription();
if (oldDsc != null) {
ad.setDescription(dsc);
String newState = dsc.getState();
String newOwnership = dsc.getOwnership();
if (newOwnership == null) {
newOwnership = oldDsc.getOwnership();
}
platformAgents.release(agentID);
if (ad.isNative()) {
// This is an agent living in the platform --> if necessary
// force changes in agent state and ownership
if (AMSAgentDescription.SUSPENDED.equals(newState) && !AMSAgentDescription.SUSPENDED.equals(oldDsc.getState())) {
suspend(agentID);
}
if (AMSAgentDescription.ACTIVE.equals(newState) && !AMSAgentDescription.ACTIVE.equals(oldDsc.getState())) {
activate(agentID);
}
if (newOwnership != null && newOwnership != oldDsc.getOwnership()) {
/*byte[] password = Agent.extractPassword(newOwnership);
String username = Agent.extractUsername(newOwnership);
take(agentID, username, password);*/
}
}