* @return The new server status of the DS
*/
public ServerStatus processNewStatus(ChangeStatusMsg csMsg)
{
// Get the status the DS just entered
ServerStatus reqStatus = csMsg.getNewStatus();
// Translate new status to a state machine event
StatusMachineEvent event = StatusMachineEvent.statusToEvent(reqStatus);
if (event == StatusMachineEvent.INVALID_EVENT)
{
Message msg = ERR_RS_INVALID_NEW_STATUS.get(reqStatus.toString(),
getServiceId().toString(), Integer.toString(serverId));
logError(msg);
return ServerStatus.INVALID_STATUS;
}
// Check state machine allows this new status
ServerStatus newStatus = StatusMachine.computeNewStatus(status, event);
if (newStatus == ServerStatus.INVALID_STATUS)
{
Message msg = ERR_RS_CANNOT_CHANGE_STATUS.get(getServiceId().toString(),
Integer.toString(serverId), status.toString(), event.toString());
logError(msg);