Search in sources :

Example 16 with PropertyInfo

use of com.emc.storageos.model.property.PropertyInfo in project coprhd-controller by CoprHD.

the class InternalApiSignatureKeyGenerator method loadKeys.

/**
 * Reads keys from coordinator.
 *
 * @throws Exception if current key can't be found
 * @return the previous key if available or current key
 */
public synchronized void loadKeys() {
    try {
        PropertyInfo props = _coordinator.getPropertyInfo();
        String internalApiAlgoOverride = null;
        if (props != null) {
            internalApiAlgoOverride = props.getProperty(SYSTEM_PROPERTY_INTERNAL_API_ALGO);
        }
        _log.debug("Internal Api algo override property: " + internalApiAlgoOverride);
        if (internalApiAlgoOverride != null && internalApiAlgoOverride.equals(SYSTEM_PROPERTY_INTERNAL_API_ALGO_VALUE_NEW)) {
            _internalApiCurrentKey = getSignatureKey2(NEW_SIGNATURE_INTERNALAPI_KEY, NEW_INTERNAL_API_SIGN_ALGO);
            deleteSignatureKey(CURRENT_SIGNATURE_INTERNALAPI_KEY);
        } else {
            _internalApiCurrentKey = getSignatureKey2(CURRENT_SIGNATURE_INTERNALAPI_KEY, CURRENT_INTERNAL_API_SIGN_ALGO);
        }
        // get inter vdc key
        _interVDCCurrentKey = getSignatureKey2(SIGNATURE_INTERVDC_KEY, CURRENT_INTERVDC_API_SIGN_ALGO);
    } catch (Exception e) {
        throw new IllegalStateException("Exception while retrieving key", e);
    }
    if (_internalApiCurrentKey == null) {
        throw new IllegalStateException("Key was null / Unable to get current internal api key.");
    }
    if (_interVDCCurrentKey == null) {
        throw new IllegalStateException("Key was null / Unable to get current inter vdc api key.");
    }
    _initialized = true;
    _lastUpdated.set(System.currentTimeMillis());
    return;
}
Also used : PropertyInfo(com.emc.storageos.model.property.PropertyInfo)

Example 17 with PropertyInfo

use of com.emc.storageos.model.property.PropertyInfo in project coprhd-controller by CoprHD.

the class BourneUtil method getBaseClientConfig.

private static ClientConfig getBaseClientConfig() {
    ClientConfig config = new ClientConfig();
    config.setHost(getViprHost());
    config.setRequestLoggingEnabled(isConfigPropertySet("storageos.api.debugging"));
    // Client timeout
    PropertyInfo propInfo = null;
    if (!Play.mode.isDev()) {
        propInfo = StorageOsPlugin.getInstance().getCoordinatorClient().getPropertyInfo();
    }
    String timeoutProperty = null;
    int timeout = 5;
    if (propInfo != null) {
        timeoutProperty = propInfo.getProperty("portal_service_timeout");
    }
    if (timeoutProperty != null) {
        timeout = Integer.parseInt(timeoutProperty);
    } else {
        timeout = Integer.parseInt(Play.configuration.getProperty("vipr.client.timeout.minutes", "5"));
    }
    config.setReadTimeout(timeout * MINUTES_IN_MS);
    config.setConnectionTimeout(timeout * MINUTES_IN_MS);
    if (StorageOsPlugin.isEnabled()) {
        config.setSocketFactory(getSocketFactory());
        config.setHostnameVerifier(SSLUtil.getNullHostnameVerifier());
    } else {
        config.setIgnoreCertificates(true);
    }
    return config;
}
Also used : ClientConfig(com.emc.vipr.client.ClientConfig) PropertyInfo(com.emc.storageos.model.property.PropertyInfo)

Example 18 with PropertyInfo

use of com.emc.storageos.model.property.PropertyInfo in project coprhd-controller by CoprHD.

the class DisasterRecoveryService method precheckForPause.

private void precheckForPause(String siteNames) {
    PropertyInfo targetProperty = coordinator.getPropertyInfo();
    String firewallEnabled = targetProperty.getProperty(SYSTEM_ENABLE_FIREWALL);
    if (firewallEnabled != null && firewallEnabled.equals("no")) {
        throw APIException.internalServerErrors.pauseStandbyPrecheckFailed(siteNames, "firewall has been disabled." + "Please make sure to keep it enabled until every standby site has been resumed");
    }
    String ipsecEnabled = ipsecConfig.getIpsecStatus();
    if (ipsecEnabled != null && !ipsecEnabled.equals("enabled")) {
        throw APIException.internalServerErrors.pauseStandbyPrecheckFailed(siteNames, "ipsec has been disabled." + "Please make sure to keep it enabled until every standby site has been resumed");
    }
}
Also used : PropertyInfo(com.emc.storageos.model.property.PropertyInfo)

Example 19 with PropertyInfo

use of com.emc.storageos.model.property.PropertyInfo in project coprhd-controller by CoprHD.

the class VersionCheckerTest method setup.

@BeforeClass
public static void setup() {
    CoordinatorClient coordinator = createMock(CoordinatorClient.class);
    Map<String, String> properties = new HashMap<String, String>();
    properties.put("controller_brocade_firmware_version", "11.2.1");
    properties.put("controller_mds_firmware_version", "5.0(1a)");
    properties.put("controller_rp_firmware_version", "4.1");
    properties.put("controller_vmax_firmware_version", "5876.221");
    properties.put("controller_vnxblock_firmware_version", "05.32");
    properties.put("controller_vnxfile_firmware_version", "7.1.71");
    properties.put("controller_isilon_firmware_version", "7.0.2.0");
    properties.put("controller_netapp_firmware_version", "8.1.1");
    properties.put("controller_vplex_firmware_version", "5.2");
    properties.put("controller_smis_provider_version", "4.6.1.1");
    properties.put("compute_windows_version", "6.0.6002");
    properties.put("compute_suse_linux_version", "11");
    properties.put("compute_redhat_linux_version", "5.9");
    properties.put("compute_hpux_version", "11.31");
    PropertyInfo propertyInfo = new PropertyInfo(properties);
    EasyMock.expect(coordinator.getPropertyInfo()).andReturn(propertyInfo).anyTimes();
    EasyMock.replay(coordinator);
    new VersionChecker().setCoordinator(coordinator);
}
Also used : HashMap(java.util.HashMap) CoordinatorClient(com.emc.storageos.coordinator.client.service.CoordinatorClient) PropertyInfo(com.emc.storageos.model.property.PropertyInfo) BeforeClass(org.junit.BeforeClass)

Aggregations

PropertyInfo (com.emc.storageos.model.property.PropertyInfo)19 CoordinatorException (com.emc.storageos.coordinator.exceptions.CoordinatorException)5 Configuration (com.emc.storageos.coordinator.common.Configuration)3 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)2 BadRequestException (com.emc.storageos.svcs.errorhandling.resources.BadRequestException)2 HashMap (java.util.HashMap)2 PropertyInfoExt (com.emc.storageos.coordinator.client.model.PropertyInfoExt)1 SiteInfo (com.emc.storageos.coordinator.client.model.SiteInfo)1 CoordinatorClient (com.emc.storageos.coordinator.client.service.CoordinatorClient)1 RetryableCoordinatorException (com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException)1 PropertyInfoMapper.decodeFromString (com.emc.storageos.coordinator.mapper.PropertyInfoMapper.decodeFromString)1 DbClientContext (com.emc.storageos.db.client.impl.DbClientContext)1 EncryptionProviderImpl (com.emc.storageos.db.client.impl.EncryptionProviderImpl)1 AuditLog (com.emc.storageos.db.client.model.AuditLog)1 ComputeImageServer (com.emc.storageos.db.client.model.ComputeImageServer)1 ComputeSystem (com.emc.storageos.db.client.model.ComputeSystem)1 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)1 SecurityException (com.emc.storageos.security.exceptions.SecurityException)1 InternalServerErrorException (com.emc.storageos.svcs.errorhandling.resources.InternalServerErrorException)1 MigrationCallbackException (com.emc.storageos.svcs.errorhandling.resources.MigrationCallbackException)1