private void updateHostState(Operation operation,State hostState,AgentState agentState){
  if (hostState.agentState != agentState) {
    State patchState=new State();
    patchState.agentState=agentState;
    ServiceUtils.logInfo(this,"Agent state for host " + hostState.hostAddress + " changed from "+ hostState.agentState+ " "+ "-> "+ agentState);
    TaskUtils.sendSelfPatch(this,patchState);
  }
  if (operation != null) {
    operation.complete();
  }
}

private void updateHostState ( Operation operation , State hostState , AgentState agentState ) { if ( hostState . agentState != agentState ) { State patchState = new State ( ) ; patchState . agentState = agentState ; ServiceUtils . logInfo ( this , "Agent state for host " + hostState . hostAddress + " changed from " + hostState . agentState + " " + "-> " + agentState ) ; TaskUtils . sendSelfPatch ( this , patchState ) ; } if ( operation != null ) { operation . complete ( ) ; } }
patch the host service document with the agent state if it has changed .
