@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { if(super.configure(name, params)) { validate(params); } return true; }
public ManagerBase() { super(); // set default run level for manager components setRunLevel(ComponentLifecycle.RUN_LEVEL_COMPONENT_BOOTSTRAP); } }
@Override public boolean start() { s_logger.info("Firewall provider list is " + _firewallElements.iterator().next()); return super.start(); }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); String timeZoneStr = _configDao.getValue(Config.UsageAggregationTimezone.toString()); if (timeZoneStr == null) { timeZoneStr = "GMT"; } _usageTimezone = TimeZone.getTimeZone(timeZoneStr); return true; }
public ManagerBase() { super(); // set default run level for manager components setRunLevel(ComponentLifecycle.RUN_LEVEL_COMPONENT_BOOTSTRAP); }
@Override public boolean start() { super.start(); initializeCaProviderMap(); if (caProviderMap.containsKey(CAProviderPlugin.value())) { configuredCaProvider = caProviderMap.get(CAProviderPlugin.value()); } if (configuredCaProvider == null) { LOG.error("Failed to find valid configured CA provider, please check!"); return false; } return true; }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); Map<String, String> configs = _configDao.getConfiguration(params); if (params != null) { mergeConfigs(configs, params); } String aggregationRange = configs.get("usage.stats.job.aggregation.range"); String timeZoneStr = configs.get("usage.aggregation.timezone"); if (timeZoneStr == null) { timeZoneStr = "GMT"; } _usageTimezone = TimeZone.getTimeZone(timeZoneStr); _aggregationDuration = Integer.parseInt(aggregationRange); if (_aggregationDuration < UsageUtils.USAGE_AGGREGATION_RANGE_MIN) { s_logger.warn("Usage stats job aggregation range is to small, using the minimum value of " + UsageUtils.USAGE_AGGREGATION_RANGE_MIN); _aggregationDuration = UsageUtils.USAGE_AGGREGATION_RANGE_MIN; } s_logger.info("Usage timezone = " + _usageTimezone + " AggregationDuration=" + _aggregationDuration); return true; }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); String timeZoneStr = _configDao.getValue(Config.UsageAggregationTimezone.toString()); String aggregationRange = _configDao.getValue(Config.UsageStatsJobAggregationRange.toString()); if (timeZoneStr == null) { timeZoneStr = "GMT"; } _usageTimezone = TimeZone.getTimeZone(timeZoneStr); _aggregationDuration = Integer.parseInt(aggregationRange); if (_aggregationDuration < UsageUtils.USAGE_AGGREGATION_RANGE_MIN) { s_logger.warn("Usage stats job aggregation range is to small, using the minimum value of " + UsageUtils.USAGE_AGGREGATION_RANGE_MIN); _aggregationDuration = UsageUtils.USAGE_AGGREGATION_RANGE_MIN; } if (s_logger.isDebugEnabled()) { s_logger.debug("Usage timezone = " + _usageTimezone + " AggregationDuration=" + _aggregationDuration); } return true; }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); Map<String, String> configs = _configDao.getConfiguration(params); if (params != null) { mergeConfigs(configs, params); } String period_str = configs.get(QuotaConfig.QuotaStatementPeriod.key()); int period = period_str == null ? 1 : Integer.parseInt(period_str); QuotaStatementPeriods _period = QuotaStatementPeriods.values()[period]; return true; }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); Map<String, String> configs = _configDao.getConfiguration(params); if (params != null) { mergeConfigs(configs, params); } final String smtpHost = configs.get(QuotaConfig.QuotaSmtpHost.key()); int smtpPort = NumbersUtil.parseInt(configs.get(QuotaConfig.QuotaSmtpPort.key()), 25); String useAuthStr = configs.get(QuotaConfig.QuotaSmtpAuthType.key()); boolean useAuth = ((useAuthStr != null) && Boolean.parseBoolean(useAuthStr)); String smtpUsername = configs.get(QuotaConfig.QuotaSmtpUser.key()); String smtpPassword = configs.get(QuotaConfig.QuotaSmtpPassword.key()); String emailSender = configs.get(QuotaConfig.QuotaSmtpSender.key()); _lockAccountEnforcement = "true".equalsIgnoreCase(configs.get(QuotaConfig.QuotaEnableEnforcement.key())); _emailQuotaAlert = new EmailQuotaAlert(smtpHost, smtpPort, useAuth, smtpUsername, smtpPassword, emailSender, _smtpDebug); return true; }
@Override public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException { _agentMgr.registerForHostEvents(this, true, false, true); VirtualMachine.State.getStateMachine().registerListener(this); _messageBus.subscribe("VM_ReservedCapacity_Free", new MessageSubscriber() { @Override public void onPublishMessage(String senderAddress, String subject, Object obj) { VMInstanceVO vm = ((VMInstanceVO)obj); s_logger.debug("MessageBus message: host reserved capacity released for VM: " + vm.getLastHostId() + ", checking if host reservation can be released for host:" + vm.getLastHostId()); Long hostId = vm.getLastHostId(); checkHostReservationRelease(hostId); } }); _vmCapacityReleaseInterval = NumbersUtil.parseInt(_configDao.getValue(Config.CapacitySkipcountingHours.key()), 3600); String hostReservationReleasePeriod = _configDao.getValue(Config.HostReservationReleasePeriod.key()); if (hostReservationReleasePeriod != null) { _hostReservationReleasePeriod = Long.parseLong(hostReservationReleasePeriod); if (_hostReservationReleasePeriod <= 0) _hostReservationReleasePeriod = Long.parseLong(Config.HostReservationReleasePeriod.getDefaultValue()); } _timer = new Timer("HostReservationReleaseChecker"); _nodeId = ManagementServerNode.getManagementServerId(); return super.configure(name, params); }