org.rhq.enterprise.server.cloud
Class CloudManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.cloud.CloudManagerBean
All Implemented Interfaces:
CloudManagerLocal

public class CloudManagerBean
extends Object
implements CloudManagerLocal

This class manages and reports information about the RHQ Server Cloud as a whole. It does not discern which server is which, and can be called from any server in the cloud and will operate identically the same results.

Author:
Joseph Marques

Constructor Summary
CloudManagerBean()
           
 
Method Summary
 void deleteServer(Integer serverId)
           
 void deleteServers(Integer[] serverIds)
           
 List<org.rhq.core.domain.resource.Agent> getAgentsByServerName(String serverName)
           
 List<org.rhq.core.domain.cloud.Server> getAllCloudServers()
          Return every server registered in the database considered part of the active cloud.
 List<org.rhq.core.domain.cloud.Server> getAllServers()
          Return every server registered in the database.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.cloud.FailoverListDetails> getFailoverListDetailsByAgentId(int agentId, org.rhq.core.domain.util.PageControl pc)
           
 int getNormalServerCount()
          Returns the number of servers that are part of the "server cloud" that are currently running in "normal" mode.
 org.rhq.core.domain.cloud.Server getServerById(int serverId)
           
 org.rhq.core.domain.cloud.Server getServerByName(String serverName)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.cloud.composite.ServerWithAgentCountComposite> getServerComposites(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.util.PageControl pc)
           
 int getServerCount()
          Returns the number of servers that are part of the "server cloud", which excludes servers that have been installed but not associated with the cloud.
 void markStaleServersDown(org.rhq.core.domain.auth.Subject subject)
           
 org.rhq.core.domain.cloud.Server updateServer(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.cloud.Server server)
           
 void updateServerMode(Integer[] serverIds, org.rhq.core.domain.cloud.Server.OperationMode mode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloudManagerBean

public CloudManagerBean()
Method Detail

getAgentsByServerName

public List<org.rhq.core.domain.resource.Agent> getAgentsByServerName(String serverName)
Specified by:
getAgentsByServerName in interface CloudManagerLocal

getServerById

public org.rhq.core.domain.cloud.Server getServerById(int serverId)
Specified by:
getServerById in interface CloudManagerLocal

getServerByName

public org.rhq.core.domain.cloud.Server getServerByName(String serverName)
Specified by:
getServerByName in interface CloudManagerLocal

getAllCloudServers

public List<org.rhq.core.domain.cloud.Server> getAllCloudServers()
Description copied from interface: CloudManagerLocal
Return every server registered in the database considered part of the active cloud. This will exclude, for example, servers in INSTALLED mode or any other mode that should not be included when performing cloud operations such as partitioning.

Specified by:
getAllCloudServers in interface CloudManagerLocal
Returns:
All servers available to the cloud.

getAllServers

public List<org.rhq.core.domain.cloud.Server> getAllServers()
Description copied from interface: CloudManagerLocal
Return every server registered in the database.

Specified by:
getAllServers in interface CloudManagerLocal
Returns:
All servers, regardless of operation mode.

getServerComposites

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.cloud.composite.ServerWithAgentCountComposite> getServerComposites(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                org.rhq.core.domain.util.PageControl pc)
Specified by:
getServerComposites in interface CloudManagerLocal

getServerCount

public int getServerCount()
Description copied from interface: CloudManagerLocal
Returns the number of servers that are part of the "server cloud", which excludes servers that have been installed but not associated with the cloud. The returned count will include those servers that are down or in maintenance mode, in addition to those servers that are currently running in a normal state.

Specified by:
getServerCount in interface CloudManagerLocal
Returns:
count of servers in the cloud

getNormalServerCount

public int getNormalServerCount()
Description copied from interface: CloudManagerLocal
Returns the number of servers that are part of the "server cloud" that are currently running in "normal" mode. This excludes all other servers such as those servers that have been installed but not associated with the cloud, servers that are down or in maintenance mode.

Specified by:
getNormalServerCount in interface CloudManagerLocal
Returns:
count of servers in the cloud that are in a normal running state

deleteServers

public void deleteServers(Integer[] serverIds)
                   throws CloudManagerException
Specified by:
deleteServers in interface CloudManagerLocal
Throws:
CloudManagerException

deleteServer

public void deleteServer(Integer serverId)
                  throws CloudManagerException
Specified by:
deleteServer in interface CloudManagerLocal
Throws:
CloudManagerException

updateServerMode

public void updateServerMode(Integer[] serverIds,
                             org.rhq.core.domain.cloud.Server.OperationMode mode)
Specified by:
updateServerMode in interface CloudManagerLocal

updateServer

public org.rhq.core.domain.cloud.Server updateServer(org.rhq.core.domain.auth.Subject subject,
                                                     org.rhq.core.domain.cloud.Server server)
Specified by:
updateServer in interface CloudManagerLocal

getFailoverListDetailsByAgentId

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.cloud.FailoverListDetails> getFailoverListDetailsByAgentId(int agentId,
                                                                                                                        org.rhq.core.domain.util.PageControl pc)
Specified by:
getFailoverListDetailsByAgentId in interface CloudManagerLocal

markStaleServersDown

public void markStaleServersDown(org.rhq.core.domain.auth.Subject subject)
Specified by:
markStaleServersDown in interface CloudManagerLocal


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