Class ShutdownOrderComparator

java.lang.Object
com.atlassian.bamboo.agent.elastic.server.ShutdownOrderComparator
All Implemented Interfaces:
Comparator<RemoteElasticInstance>

public class ShutdownOrderComparator extends Object implements Comparator<RemoteElasticInstance>
A compartator that will sort agents on the order which they should shutdown. Order is
  1. No agent found for RemoteElasticInstance
  2. BuildAgent.isRequestedToBeStopped() is true
  3. BuildAgent.isEnabled() is false (disabled agents)
  4. BuildAgent.getAgentStatus() 's index