Search in sources :

Example 1 with META_TYPE

use of com.emc.storageos.db.client.model.StorageSystemType.META_TYPE in project coprhd-controller by CoprHD.

the class StorageSystemTypesInitUtils method insertStorageSystemTypes.

private void insertStorageSystemTypes() {
    for (Map.Entry<META_TYPE, List<String>> entry : SYSTEMS_AND_PROVIDERS.entrySet()) {
        META_TYPE metaType = entry.getKey();
        List<String> systems = entry.getValue();
        for (String system : systems) {
            if (!PlatformUtils.isOssBuild() && system.equals(CEPH)) {
                log.info("Skip inserting ceph meta data in non-oss build");
                continue;
            }
            StorageSystemType type = new StorageSystemType();
            URI uri = URIUtil.createId(StorageSystemType.class);
            type.setId(uri);
            type.setStorageTypeId(uri.toString());
            type.setStorageTypeName(system);
            type.setStorageTypeDispName(DISPLAY_NAME_MAP.get(system));
            type.setMetaType(mapType(metaType));
            type.setDriverClassName(metaType.toString().toLowerCase());
            type.setIsSmiProvider(metaType.isProvider());
            type.setIsDefaultSsl(SSL_ENABLE_TYPE_LIST.contains(system));
            type.setIsDefaultMDM(MDM_ENABLE_LIST.contains(system));
            type.setIsOnlyMDM(ONLY_MDM_LIST.contains(system));
            type.setIsElementMgr(ELEMENT_MANAGER_LIST.contains(system));
            type.setIsSecretKey(SECREAT_KEY_ENABLE_LIST.contains(system));
            type.setSslPort(SSL_PORT_MAP.get(system));
            type.setNonSslPort(NON_SSL_PORT_MAP.get(system));
            type.setIsNative(true);
            if (alreadyExists(type)) {
                log.info("Meta data for {} already exist", type.getStorageTypeName());
                continue;
            }
            log.info("Meta data for {} don't exist or have changed, update", type.getStorageTypeName());
            dbClient.createObject(type);
        }
    }
}
Also used : List(java.util.List) Arrays.asList(java.util.Arrays.asList) META_TYPE(com.emc.storageos.db.client.model.StorageSystemType.META_TYPE) StorageSystemType(com.emc.storageos.db.client.model.StorageSystemType) HashMap(java.util.HashMap) Map(java.util.Map) URI(java.net.URI)

Aggregations

StorageSystemType (com.emc.storageos.db.client.model.StorageSystemType)1 META_TYPE (com.emc.storageos.db.client.model.StorageSystemType.META_TYPE)1 URI (java.net.URI)1 Arrays.asList (java.util.Arrays.asList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1