if (eventType.isCloudPartitionEvent() || (null == agentName)) {
throw new IllegalArgumentException("Invalid agent partition event or no agent specified for event type: "
+ eventType);
}
Agent agent = agentManager.getAgentByName(agentName);
if (null == agent) {
throw new IllegalArgumentException("Can not perform partition event, agent not found with name: "
+ agentName);
}
PartitionEvent partitionEvent = new PartitionEvent(subject.getName(), eventType, eventDetail,
PartitionEvent.ExecutionStatus.IMMEDIATE);
partitionEventManager.createPartitionEvent(subject, partitionEvent);
return failoverListManager.getForSingleAgent(partitionEvent, agent.getName());
}