ServiceInfo implements Validable { public Boolean isRestartRequiredAfterRackChange() { return restartRequiredAfterRackChange; }  Boolean isRestartRequiredAfterChange(); void setRestartRequiredAfterChange(Boolean restartRequiredAfterChange); @Override boolean isValid(); @Override void setValid(boolean valid); @Override void addError(String error); @Override Collection<String> getErrors(); @Override void addErrors(Collection<String> errors); boolean isDeleted(); void setDeleted(boolean deleted); String getName(); void setName(String name); String getParent(); void setParent(String parent); String getDisplayName(); void setDisplayName(String displayName); String getServiceType(); void setServiceType(String serviceType); String getVersion(); void setVersion(String version); Selection getSelection(); void setSelection(Selection selection); boolean isSelectionEmpty(); String getComment(); void setComment(String comment); List<String> getRequiredServices(); String getWidgetsFileName(); void setWidgetsFileName(String widgetsFileName); String getMetricsFileName(); void setMetricsFileName(String metricsFileName); void setRequiredServices(List<String> requiredServices); List<PropertyInfo> getProperties(); void setProperties(List properties); List<ComponentInfo> getComponents(); ComponentInfo getComponentByName(String componentName); boolean isClientOnlyService(); ComponentInfo getClientComponent(); File getAdvisorFile(); void setAdvisorFile(File advisorFile); String getAdvisorName(); void setAdvisorName(String advisorName); boolean isCredentialStoreSupported(); void setCredentialStoreSupported(boolean credentialStoreSupported); boolean isCredentialStoreRequired(); void setCredentialStoreRequired(boolean credentialStoreRequired); boolean isCredentialStoreEnabled(); void setCredentialStoreEnabled(boolean credentialStoreEnabled); CredentialStoreInfo getCredentialStoreInfo(); void setCredentialStoreInfo(CredentialStoreInfo credentialStoreInfo); @Override String toString(); synchronized Map<String, Map<String, Map<String, String>>> getConfigTypeAttributes(); synchronized void setTypeAttributes(String type, Map<String, Map<String, String>> typeAttributes); synchronized void setAllConfigAttributes(Map<String, Map<String, Map<String, String>>> types); boolean hasConfigDependency(String type); boolean hasConfigType(String type); boolean hasDependencyAndPropertyFor(String type, Collection<String> keyNames); List<String> getConfigDependencies(); List<String> getConfigDependenciesWithComponents(); void setConfigDependencies(List<String> configDependencies); String getSchemaVersion(); void setSchemaVersion(String schemaVersion); String getServicePackageFolder(); void setServicePackageFolder(String servicePackageFolder); File getServiceUpgradesFolder(); void setServiceUpgradesFolder(File serviceUpgradesFolder); File getChecksFolder(); void setChecksFolder(File checksFolder); Map<String, ServiceOsSpecific> getOsSpecifics(); void setOsSpecifics(Map<String, ServiceOsSpecific> serviceOsSpecificsMap); List<CustomCommandDefinition> getCustomCommands(); void setCustomCommands(List<CustomCommandDefinition> customCommands); CommandScriptDefinition getCommandScript(); void setCommandScript(CommandScriptDefinition commandScript); void setMetricsFile(File file); File getMetricsFile(); Map<String, Map<String, List<MetricDefinition>>> getMetrics(); void setMetrics(Map<String, Map<String, List<MetricDefinition>>> map); String getConfigDir(); Boolean isMonitoringService(); void setMonitoringService(Boolean monitoringService); void setAlertsFile(File file); File getAlertsFile(); void setKerberosDescriptorFile(File file); File getKerberosDescriptorFile(); File getWidgetsDescriptorFile(); void setWidgetsDescriptorFile(File widgetsDescriptorFile); StackRoleCommandOrder getRoleCommandOrder(); void setRoleCommandOrder(StackRoleCommandOrder roleCommandOrder); Set<String> getExcludedConfigTypes(); void setExcludedConfigTypes(Set<String> excludedConfigTypes); Map<String, PropertyInfo> getRequiredProperties(); Boolean isRestartRequiredAfterRackChange(); void setRestartRequiredAfterRackChange(Boolean restartRequiredAfterRackChange); String getThemesDir(); void setThemesDir(String themesDir); List<ThemeInfo> getThemes(); void setThemes(List<ThemeInfo> themes); Map<String, ThemeInfo> getThemesMap(); void setThemesMap(Map<String, ThemeInfo> themesMap); String getQuickLinksConfigurationsDir(); void setQuickLinksConfigurationsDir(String quickLinksConfigurationsDir); List<QuickLinksConfigurationInfo> getQuickLinksConfigurations(); void setQuickLinksConfigurations(List<QuickLinksConfigurationInfo> quickLinksConfigurations); Map<String, QuickLinksConfigurationInfo> getQuickLinksConfigurationsMap(); void setQuickLinksConfigurationsMap(Map<String, QuickLinksConfigurationInfo> quickLinksConfigurationsMap); List<ServicePropertyInfo> getServicePropertyList(); void setServicePropertyList(List<ServicePropertyInfo> servicePropertyList); Map<String, String> getServiceProperties(); static final AbstractMap.SimpleEntry<String, String> DEFAULT_SERVICE_INSTALLABLE_PROPERTY; static final AbstractMap.SimpleEntry<String, String> DEFAULT_SERVICE_MANAGED_PROPERTY; static final AbstractMap.SimpleEntry<String, String> DEFAULT_SERVICE_MONITORED_PROPERTY; }
@Test public void testIsRestartRequiredAfterRackChange() throws Exception { String serviceInfoXml = "<metainfo>\n" + " <schemaVersion>2.0</schemaVersion>\n" + " <services>\n" + " <service>\n" + " <name>RESTART</name>\n" + " <displayName>RESTART</displayName>\n" + " <comment>Apache Hadoop Distributed File System</comment>\n" + " <version>2.1.0.2.0</version>\n" + " <restartRequiredAfterRackChange>true</restartRequiredAfterRackChange>\n" + " </service>\n" + " <service>\n" + " <name>NO_RESTART</name>\n" + " <displayName>NO_RESTART</displayName>\n" + " <comment>Apache Hadoop Distributed File System</comment>\n" + " <version>2.1.0.2.0</version>\n" + " <restartRequiredAfterRackChange>false</restartRequiredAfterRackChange>\n" + " </service>\n" + " <service>\n" + " <name>DEFAULT_RESTART</name>\n" + " <displayName>DEFAULT_RESTART</displayName>\n" + " <comment>Apache Hadoop Distributed File System</comment>\n" + " <version>2.1.0.2.0</version>\n" + " </service>\n" + " <service>\n" + " <name>HCFS_SERVICE</name>\n" + " <displayName>HCFS_SERVICE</displayName>\n" + " <comment>Hadoop Compatible File System</comment>\n" + " <version>2.1.1.0</version>\n" + " <serviceType>HCFS</serviceType>\n" + " </service>\n" + " </services>\n" + "</metainfo>\n"; Map<String, ServiceInfo> serviceInfoMap = getServiceInfo(serviceInfoXml); assertTrue(serviceInfoMap.get("RESTART").isRestartRequiredAfterRackChange()); assertFalse(serviceInfoMap.get("NO_RESTART").isRestartRequiredAfterRackChange()); assertNull(serviceInfoMap.get("DEFAULT_RESTART").isRestartRequiredAfterRackChange()); assertEquals(serviceInfoMap.get("HCFS_SERVICE").getServiceType(),"HCFS"); }