use of com.emc.storageos.geomodel.VdcIpsecPropertiesResponse in project coprhd-controller by CoprHD.
the class IPSecMonitor method getIpsecPropsThroughHTTPS.
private Map<String, String> getIpsecPropsThroughHTTPS(String node) {
Map<String, String> props = new HashMap<String, String>();
try {
GeoClientCacheManager geoClientMgr = getGeoClientManager();
if (geoClientMgr != null) {
GeoServiceClient geoClient = geoClientMgr.getGeoClient(getVdcShortIdByIp(node));
String version = geoClient.getViPRVersion();
if (version.compareTo("vipr-2.5") < 0) {
log.info("remote vdc version is less than 2.5, skip getting ipsec properties");
return props;
}
VdcIpsecPropertiesResponse ipsecProperties = geoClient.getIpsecProperties();
if (ipsecProperties != null) {
props.put(IPSEC_KEY, ipsecProperties.getIpsecKey());
props.put(VDC_CONFIG_VERSION, ipsecProperties.getVdcConfigVersion());
props.put(IPSEC_STATUS, ipsecProperties.getIpsecStatus());
}
} else {
log.warn("GeoClientCacheManager is null, skip getting ipsec properties from " + node);
}
} catch (Exception e) {
log.warn("can't get ipsec properties from remote vdc: " + node, e);
}
return props;
}
use of com.emc.storageos.geomodel.VdcIpsecPropertiesResponse in project coprhd-controller by CoprHD.
the class IpsecService method getIpsecProperties.
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/properties")
public VdcIpsecPropertiesResponse getIpsecProperties() {
log.info("in getIpsecProperties()");
VdcIpsecPropertiesResponse response = new VdcIpsecPropertiesResponse();
try {
String localIP = IpUtils.getLocalIPAddress();
Map<String, String> localIpsecProp = LocalRepository.getInstance().getIpsecProperties(localIP);
response.setIpsecKey(localIpsecProp.get(IPSEC_KEY));
response.setIpsecStatus(localIpsecProp.get(IPSEC_STATUS));
response.setVdcConfigVersion(localIpsecProp.get(VDC_CONFIG_VERSION));
} catch (Exception e) {
log.error("retrieve local ipsec properties error: " + e.getMessage());
}
return response;
}
Aggregations