Search in sources :

Example 1 with GeoClientCacheManager

use of com.emc.storageos.security.geo.GeoClientCacheManager 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;
}
Also used : HashMap(java.util.HashMap) VdcIpsecPropertiesResponse(com.emc.storageos.geomodel.VdcIpsecPropertiesResponse) GeoClientCacheManager(com.emc.storageos.security.geo.GeoClientCacheManager) GeoServiceClient(com.emc.storageos.security.geo.GeoServiceClient)

Aggregations

VdcIpsecPropertiesResponse (com.emc.storageos.geomodel.VdcIpsecPropertiesResponse)1 GeoClientCacheManager (com.emc.storageos.security.geo.GeoClientCacheManager)1 GeoServiceClient (com.emc.storageos.security.geo.GeoServiceClient)1 HashMap (java.util.HashMap)1