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, mergeChildModulespublic 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()
StackDefinitionModulegetModuleInfo 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
StackDefinitionModuleresolve 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.AmbariExceptionpublic 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.AmbariExceptionpublic 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.AmbariExceptionpublic boolean isDeleted()
StackDefinitionModuleisDeleted in interface StackDefinitionModule<ServiceModule,ServiceInfo>public String getId()
StackDefinitionModulegetId in interface StackDefinitionModule<ServiceModule,ServiceInfo>public void finalizeModule()
StackDefinitionModulefinalizeModule in interface StackDefinitionModule<ServiceModule,ServiceInfo>finalizeModule in class BaseModule<ServiceModule,ServiceInfo>public boolean isValid()
isValid in interface StackDefinitionModule<ServiceModule,ServiceInfo>isValid in interface Validablepublic void setValid(boolean valid)
setValid in interface StackDefinitionModule<ServiceModule,ServiceInfo>setValid in interface Validablevalid - 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.