org.rhq.enterprise.server.cloud
Interface FailoverListManagerLocal

All Known Implementing Classes:
FailoverListManagerBean

public interface FailoverListManagerLocal

Author:
Joseph Marques, Jay Shaughnessy

Method Summary
 void deleteServerListDetailsForServer(int serverId)
          For a server being deleted it is necessary to remove server lists details referencing the server.
 void deleteServerListsForAgent(org.rhq.core.domain.resource.Agent agent)
          For an agent being deleted it is necessary to remove server lists for the agent.
 org.rhq.core.domain.cloud.composite.FailoverListComposite getExistingForSingleAgent(String agentName)
          Returns the existing server list for the specified agent, if it exists.
 org.rhq.core.domain.cloud.composite.FailoverListComposite getForSingleAgent(org.rhq.core.domain.cloud.PartitionEvent event, String agentName)
          Note that load is balanced as best as possible without a full refresh.
 Map<org.rhq.core.domain.resource.Agent,org.rhq.core.domain.cloud.composite.FailoverListComposite> refresh(org.rhq.core.domain.cloud.PartitionEvent event)
          Performs a full repartition, re-balancing the agent load on available servers and generating new server lists for every agent.
 Map<org.rhq.core.domain.resource.Agent,org.rhq.core.domain.cloud.composite.FailoverListComposite> refresh(org.rhq.core.domain.cloud.PartitionEvent event, List<org.rhq.core.domain.cloud.Server> servers, List<org.rhq.core.domain.resource.Agent> agents)
          Primarily a testing entry point.
 

Method Detail

deleteServerListsForAgent

void deleteServerListsForAgent(org.rhq.core.domain.resource.Agent agent)
For an agent being deleted it is necessary to remove server lists for the agent.

This is primarily a test entry point as of 1.1.0 since we currently never delete agents from the database.

Parameters:
agent -

deleteServerListDetailsForServer

void deleteServerListDetailsForServer(int serverId)
For a server being deleted it is necessary to remove server lists details referencing the server. This may create a gap in the server list ordinal values but that shouldn't matter, ordering is still preserved and we never access a specific server by ordinal.

Parameters:
server -

getExistingForSingleAgent

org.rhq.core.domain.cloud.composite.FailoverListComposite getExistingForSingleAgent(String agentName)
Returns the existing server list for the specified agent, if it exists.

Parameters:
agentName -
Returns:
the existing server list. Null if for any reason the list is not found.
Throws:
IllegalArgumentException - if the agent is not registered

getForSingleAgent

org.rhq.core.domain.cloud.composite.FailoverListComposite getForSingleAgent(org.rhq.core.domain.cloud.PartitionEvent event,
                                                                            String agentName)
Note that load is balanced as best as possible without a full refresh.

Parameters:
event - the partition event prompting this get/create.
agentName -
Returns:
the existing server list for the specified agent, if it exists, otherwise a newly generated server list is returned.
Throws:
IllegalArgumentException - if the agent is not registered

refresh

Map<org.rhq.core.domain.resource.Agent,org.rhq.core.domain.cloud.composite.FailoverListComposite> refresh(org.rhq.core.domain.cloud.PartitionEvent event)

Performs a full repartition, re-balancing the agent load on available servers and generating new server lists for every agent. Previous server lists are deleted from the database and the new server lists are persisted.

Currently assigns to all known agents. This seems right even though some "down" agents may be dead and never come back online. That is really a separate design decision and is subject to change.

Returns:

refresh

Map<org.rhq.core.domain.resource.Agent,org.rhq.core.domain.cloud.composite.FailoverListComposite> refresh(org.rhq.core.domain.cloud.PartitionEvent event,
                                                                                                          List<org.rhq.core.domain.cloud.Server> servers,
                                                                                                          List<org.rhq.core.domain.resource.Agent> agents)
Primarily a testing entry point. In general use refresh().

Parameters:
servers -
agents -
Returns:


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.