public ConfigurationVO(String component, ConfigKey<?> key) { this(key.category(), "DEFAULT", component, key.key(), key.defaultValue(), key.description()); defaultValue = key.defaultValue(); dynamic = key.isDynamic(); scope = key.scope() != null ? key.scope().toString() : null; }
@Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof Configurable) { configDepotAdmin.populateConfiguration((Configurable)bean); } return bean; }
public VmJobVirtualMachineOutcome(final AsyncJob job, final long vmId) { super(VirtualMachine.class, job, VmJobCheckInterval.value(), new Predicate() { @Override public boolean checkCondition() { AsyncJobVO jobVo = _entityMgr.findById(AsyncJobVO.class, job.getId()); assert (jobVo != null); if (jobVo == null || jobVo.getStatus() != JobInfo.Status.IN_PROGRESS) return true; return false; } }, AsyncJob.Topics.JOB_STATE); }
public T valueIn(Long id) { if (id == null) { return value(); } String value = s_depot != null ? s_depot.findScopedConfigStorage(this).getConfigValue(id, this) : null; if (value == null) { return value(); } else { return valueOf(value); } }
@Override public Long getLBPreferredHostCheckInterval(final Long clusterId) { return IndirectAgentLBCheckInterval.valueIn(clusterId); }
public ScopedConfigStorage findScopedConfigStorage(ConfigKey<?> config) { for (ScopedConfigStorage storage : _scopedStorages) { if (storage.getScope() == config.scope()) { return storage; } } throw new CloudRuntimeException("Unable to find config storage for this scope: " + config.scope() + " for " + config.key()); }
private Config(String category, Class<?> componentClass, Class<?> type, String name, String defaultValue, String description, String range) { _category = category; _componentClass = componentClass; _type = type; _name = name; _defaultValue = defaultValue; _description = description; _range = range; _scope = ConfigKey.Scope.Global.toString(); }
@Override public Long getDelay() { return CABackgroundJobDelay.value() * 1000L; } }
public static float getCpuOverprovisioningFactor(long clusterId) { float opFactor = CapacityManager.CpuOverprovisioningFactor.valueIn(clusterId); return opFactor; }
public static float getMemOverprovisioningFactor(long clusterId) { float opFactor = CapacityManager.MemOverprovisioningFactor.valueIn(clusterId); return opFactor; }
@Override public int getHeartbeatThreshold() { return ClusterManager.HeartbeatThreshold.value(); } }
@Override public boolean getExecuteInSequence(final HypervisorType hypervisorType) { if (HypervisorType.KVM == hypervisorType || HypervisorType.XenServer == hypervisorType || HypervisorType.Hyperv == hypervisorType || HypervisorType.LXC == hypervisorType) { return false; } else if (HypervisorType.VMware == hypervisorType) { final Boolean fullClone = HypervisorGuru.VmwareFullClone.value(); return fullClone; } else { return ExecuteInSequence.value(); } }
@Override public boolean isEnabled() { return CloudianConnectorEnabled.value(); }
@Override public float getPingTimeout() { return ManagementServiceConfiguration.PingTimeout.value(); }
@Override public Boolean isQuotaServiceEnabled() { return QuotaPluginEnabled.value(); }
public VmJobVMSnapshotOutcome(final AsyncJob job, final long vmSnapshotId) { super(VMSnapshot.class, job, VmJobCheckInterval.value(), new Predicate() { @Override public boolean checkCondition() { AsyncJobVO jobVo = _entityMgr.findById(AsyncJobVO.class, job.getId()); assert (jobVo != null); if (jobVo == null || jobVo.getStatus() != JobInfo.Status.IN_PROGRESS) return true; return false; } }, AsyncJob.Topics.JOB_STATE); _vmSnapshotId = vmSnapshotId; }
@Override public int getPingInterval() { return ManagementServiceConfiguration.PingInterval.value(); }
@Override public String getLBAlgorithmName() { return IndirectAgentLBAlgorithm.value(); }
@Override public boolean isEnabled() { return RoleService.EnableDynamicApiChecker.value(); }