use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.
the class CIMObjectPathCreatorFactory method getConfigSvcPath.
@Override
public CIMObjectPath getConfigSvcPath(StorageSystem storageDevice) {
CIMObjectPath configSvcPath;
try {
CIMProperty[] configSvcPropKeys = { cimPropertyFactory.string(CP_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_CONFIGURATION_SERVICE)), cimPropertyFactory.string(CP_NAME, EMC_STORAGE_CONFIGURATION_SERVICE), cimPropertyFactory.string(CP_SYSTEM_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_SYSTEM)), cimPropertyFactory.string(CP_SYSTEM_NAME, getSystemName(storageDevice)) };
configSvcPath = CimObjectPathCreator.createInstance(prefixWithParamName(STORAGE_CONFIGURATION_SERVICE), getCimConnectionFactory().getNamespace(storageDevice), configSvcPropKeys);
} catch (Exception e) {
_log.error(e.getMessage(), e);
throw new IllegalStateException("Problem getting config service: " + storageDevice.getSerialNumber());
}
return configSvcPath;
}
use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.
the class CIMObjectPathCreatorFactory method getElementCompositionSvcPath.
@Override
public CIMObjectPath getElementCompositionSvcPath(StorageSystem storageDevice) {
CIMObjectPath elementCompositionSvcPath;
try {
CIMProperty[] elementCompositionSvcPropKeys = { cimPropertyFactory.string(CP_CREATION_CLASS_NAME, prefixWithParamName(ELEMENT_COMPOSITION_SERVICE)), cimPropertyFactory.string(CP_NAME, EMC_ELEMENT_COMPOSITION_SERVICE), cimPropertyFactory.string(CP_SYSTEM_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_SYSTEM)), cimPropertyFactory.string(CP_SYSTEM_NAME, getSystemName(storageDevice)) };
elementCompositionSvcPath = CimObjectPathCreator.createInstance(prefixWithParamName(ELEMENT_COMPOSITION_SERVICE), getCimConnectionFactory().getNamespace(storageDevice), elementCompositionSvcPropKeys);
} catch (Exception e) {
throw new IllegalStateException("Problem getting element composition service: " + storageDevice.getSerialNumber());
}
return elementCompositionSvcPath;
}
use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.
the class CIMObjectPathCreatorFactory method getVolumePaths.
@Override
public CIMObjectPath[] getVolumePaths(StorageSystem storageDevice, String[] volumeNames) throws Exception {
ArrayList<CIMObjectPath> theElementsList = new ArrayList<CIMObjectPath>();
for (String volumeName : volumeNames) {
CIMProperty[] volumeKeys = { cimPropertyFactory.string(CP_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_VOLUME)), cimPropertyFactory.string(CP_DEVICE_ID, volumeName), cimPropertyFactory.string(CP_SYSTEM_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_SYSTEM)), cimPropertyFactory.string(CP_SYSTEM_NAME, getSystemName(storageDevice)) };
CIMObjectPath volumePath = CimObjectPathCreator.createInstance(prefixWithParamName(STORAGE_VOLUME), cimConnectionFactory.getNamespace(storageDevice), volumeKeys);
theElementsList.add(volumePath);
}
CIMObjectPath[] volArray = {};
volArray = theElementsList.toArray(volArray);
return volArray;
}
use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.
the class CIMObjectPathCreatorFactory method getTargetPortPaths.
@Override
public CIMObjectPath[] getTargetPortPaths(StorageSystem storageDevice, List<URI> targetURIList) throws Exception {
List<CIMObjectPath> objectPaths = new ArrayList<CIMObjectPath>();
Set<String> portSet = new HashSet<String>();
for (URI target : targetURIList) {
StoragePort storagePort = dbClient.queryObject(StoragePort.class, target);
String portName;
if (storagePort.getTransportType().equals("FC")) {
portName = storagePort.getPortNetworkId().replaceAll(":", "");
} else {
portName = storagePort.getPortEndPointID();
}
portSet.add(portName);
}
CIMObjectPath storageSystemPath = getStorageSystem(storageDevice);
CloseableIterator<CIMInstance> storageProcessorSystemItr = null;
CloseableIterator<CIMInstance> protocolEndpointItr = null;
try {
// Get all of the Storage Processor Systems associated with the Storage System
storageProcessorSystemItr = cimConnectionFactory.getConnection(storageDevice).getCimClient().associatorInstances(storageSystemPath, null, EMC_STORAGE_PROCESSOR_SYSTEM, null, null, false, null);
while (storageProcessorSystemItr.hasNext()) {
CIMInstance cimSPSInstance = storageProcessorSystemItr.next();
// Get all of the Protocol Endpoints associated with the Storage Processor System
protocolEndpointItr = cimConnectionFactory.getConnection(storageDevice).getCimClient().associatorInstances(cimSPSInstance.getObjectPath(), null, CIM_PROTOCOL_ENDPOINT, null, null, false, null);
while (protocolEndpointItr.hasNext()) {
CIMInstance cimPEInstance = protocolEndpointItr.next();
String protocolEndpointName = CIMPropertyFactory.getPropertyValue(cimPEInstance, SmisConstants.CP_NAME);
if (portSet.contains(protocolEndpointName)) {
objectPaths.add(cimPEInstance.getObjectPath());
}
}
}
} catch (Exception e) {
_log.error("Failed trying to find suitable target protocol endpoints for Storage System {}", storageDevice.getId(), e);
throw e;
} finally {
closeCIMIterator(storageProcessorSystemItr);
closeCIMIterator(protocolEndpointItr);
}
CIMObjectPath[] objectPathArray = {};
objectPathArray = objectPaths.toArray(objectPathArray);
return objectPathArray;
}
use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.
the class CIMObjectPathQueryFactory method getSyncAspectPath.
@Override
public CIMObjectPath getSyncAspectPath(StorageSystem storage, String aspectInstanceId) {
String syncAspectPathStr = storage.checkIfVmax3() ? SYMM_SYNCHRONIZATION_ASPECT_FOR_SOURCE : CLAR_SYNCHRONIZATION_ASPECT_FOR_SOURCE;
String wql1 = format("SELECT * FROM %s WHERE InstanceID like '%s' AND InstanceID like '%s'", syncAspectPathStr, aspectInstanceId, storage.getSerialNumber());
// TODO instanceID is stored in DB, so ideally this should work for V3
// REVIST : This class is not found for V2.
CIMObjectPath queryClass = getQueryClass(syncAspectPathStr);
CIMObjectPath[] paths = execQuery(storage, queryClass, wql1);
if (paths.length == 0) {
return null;
}
return paths[0];
}
Aggregations