public class ServiceModule extends BaseModule<ServiceModule,ServiceInfo> implements Validable
Modifier and Type | Field and Description |
---|---|
protected boolean |
valid
validity flag
|
moduleState
Constructor and Description |
---|
ServiceModule(StackContext stackContext,
ServiceInfo serviceInfo,
ServiceDirectory serviceDirectory)
Constructor.
|
ServiceModule(StackContext stackContext,
ServiceInfo serviceInfo,
ServiceDirectory serviceDirectory,
boolean isCommonService)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addError(String error) |
void |
addErrors(Collection<String> errors) |
void |
finalizeModule()
Lifecycle even which is called when the associated stack has been fully resolved.
|
Collection<String> |
getErrors() |
String |
getId()
Obtain the id of the module.
|
ServiceInfo |
getModuleInfo()
Obtain the associated module information.
|
ServiceDirectory |
getServiceDirectory() |
boolean |
hasConfigs()
Whether the service is a special case where it does not include any config types
|
boolean |
isDeleted()
Determine whether the module has been marked for deletion.
|
boolean |
isValid() |
void |
resolve(ServiceModule parentModule,
Map<String,StackModule> allStacks,
Map<String,ServiceModule> commonServices,
Map<String,ExtensionModule> extensions)
Resolve the module state with the specified parent.
|
void |
resolveCommonService(Map<String,StackModule> allStacks,
Map<String,ServiceModule> commonServices,
Map<String,ExtensionModule> extensions)
Resolve common service
|
void |
resolveExplicit(ServiceModule parentModule,
Map<String,StackModule> allStacks,
Map<String,ServiceModule> commonServices,
Map<String,ExtensionModule> extensions) |
void |
resolveInternal(ServiceModule parentModule,
Map<String,StackModule> allStacks,
Map<String,ServiceModule> commonServices,
Map<String,ExtensionModule> extensions,
boolean resolveExplicit) |
void |
setValid(boolean valid) |
String |
toString() |
finalizeChildModules, getModuleState, mergeChildModules
public ServiceModule(StackContext stackContext, ServiceInfo serviceInfo, ServiceDirectory serviceDirectory)
stackContext
- stack context which provides module access to external functionalityserviceInfo
- associated service infoserviceDirectory
- used for all IO interaction with service directory in stack definitionpublic ServiceModule(StackContext stackContext, ServiceInfo serviceInfo, ServiceDirectory serviceDirectory, boolean isCommonService)
stackContext
- stack context which provides module access to external functionalityserviceInfo
- associated service infoserviceDirectory
- used for all IO interaction with service directory in stack definitionisCommonService
- flag to mark a service as a common servicepublic ServiceInfo getModuleInfo()
StackDefinitionModule
getModuleInfo
in interface StackDefinitionModule<ServiceModule,ServiceInfo>
public void resolve(ServiceModule parentModule, Map<String,StackModule> allStacks, Map<String,ServiceModule> commonServices, Map<String,ExtensionModule> extensions) throws org.apache.ambari.server.AmbariException
StackDefinitionModule
resolve
in interface StackDefinitionModule<ServiceModule,ServiceInfo>
parentModule
- the parent that this module will be merged withallStacks
- collection of all stack modules in the treecommonServices
- collection of all common service modules in the treeextensions
- collection of all extension modules in the treeorg.apache.ambari.server.AmbariException
- if resolution failspublic void resolveExplicit(ServiceModule parentModule, Map<String,StackModule> allStacks, Map<String,ServiceModule> commonServices, Map<String,ExtensionModule> extensions) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void resolveInternal(ServiceModule parentModule, Map<String,StackModule> allStacks, Map<String,ServiceModule> commonServices, Map<String,ExtensionModule> extensions, boolean resolveExplicit) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void resolveCommonService(Map<String,StackModule> allStacks, Map<String,ServiceModule> commonServices, Map<String,ExtensionModule> extensions) throws org.apache.ambari.server.AmbariException
allStacks
- all stack modulescommonServices
- common service modulesorg.apache.ambari.server.AmbariException
public boolean isDeleted()
StackDefinitionModule
isDeleted
in interface StackDefinitionModule<ServiceModule,ServiceInfo>
public String getId()
StackDefinitionModule
getId
in interface StackDefinitionModule<ServiceModule,ServiceInfo>
public void finalizeModule()
StackDefinitionModule
finalizeModule
in interface StackDefinitionModule<ServiceModule,ServiceInfo>
finalizeModule
in class BaseModule<ServiceModule,ServiceInfo>
public boolean isValid()
isValid
in interface StackDefinitionModule<ServiceModule,ServiceInfo>
isValid
in interface Validable
public void setValid(boolean valid)
setValid
in interface StackDefinitionModule<ServiceModule,ServiceInfo>
setValid
in interface Validable
valid
- set validity flagpublic Collection<String> getErrors()
public ServiceDirectory getServiceDirectory()
public void addErrors(Collection<String> errors)
public boolean hasConfigs()
Copyright © 2022 Apache Software Foundation. All rights reserved.