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;
}
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;
}
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");
}
}
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);
}
Aggregations