public class MaintenanceStateHelper extends Object
Constructor and Description |
---|
MaintenanceStateHelper(com.google.inject.Injector injector) |
Modifier and Type | Method and Description |
---|---|
RequestStatusResponse |
createRequests(AmbariManagementController amc,
Map<String,String> requestProperties,
Set<String> clusterNames)
Creates the requests to send to the clusters
|
MaintenanceState |
getEffectiveState(ServiceComponentHost sch)
Gets the effective state for a HostComponent
|
MaintenanceState |
getEffectiveState(ServiceComponentHost sch,
Host host)
Get effective state of HostComponent
|
Set<Map<String,String>> |
getMaintenanceHostComponents(Clusters clusters,
Cluster cluster) |
boolean |
isOperationAllowed(Resource.Type sourceType,
ServiceComponentHost sch)
Determine based on the requesting Resource level and the state of the
operand whether to allow operations on it.
|
@Inject public MaintenanceStateHelper(com.google.inject.Injector injector)
public MaintenanceState getEffectiveState(ServiceComponentHost sch, Host host) throws AmbariException
sch
- the host componenthost
- the hostAmbariException
public MaintenanceState getEffectiveState(ServiceComponentHost sch) throws AmbariException
sch
- the host componentAmbariException
public Set<Map<String,String>> getMaintenanceHostComponents(Clusters clusters, Cluster cluster) throws AmbariException
clusters
- the collection of clusterscluster
- the specific cluster to checkMaintenanceState.ON
or
MaintenanceState.IMPLIED_FROM_HOST
or
MaintenanceState.IMPLIED_FROM_SERVICE
or
MaintenanceState.IMPLIED_FROM_SERVICE_AND_HOST
)AmbariException
public RequestStatusResponse createRequests(AmbariManagementController amc, Map<String,String> requestProperties, Set<String> clusterNames) throws AmbariException
amc
- the controllerrequestProperties
- the request propertiesclusterNames
- the names of all the clusters to updateAmbariException
public boolean isOperationAllowed(Resource.Type sourceType, ServiceComponentHost sch) throws AmbariException
sourceType
- Request Source: {CLUSTER, SERVICE, HOSTCOMPONENT, HOST}sch
- HostComponent which is the operand of the operationAmbariException
Copyright © 2015. All rights reserved.