use of javax.cim.CIMProperty in project coprhd-controller by CoprHD.
the class CimCompositeIDTest method testCimCompositeID.
/**
* Tests the CimCompositeID constructor.
*/
@SuppressWarnings("rawtypes")
@Test
public void testCimCompositeID() {
CIMProperty[] properties = new CIMProperty[] { new CIMProperty<String>(OBJ_PATH_PROP1_NAME, CIMDataType.STRING_T, OBJ_PATH_PROP1_VALUE), new CIMProperty<String>(OBJ_PATH_PROP2_NAME, CIMDataType.STRING_T, OBJ_PATH_PROP2_VALUE), new CIMProperty<String>(OBJ_PATH_PROP3_NAME, CIMDataType.STRING_T, OBJ_PATH_PROP3_VALUE) };
CIMObjectPath objPath = CimObjectPathCreator.createInstance(OBJ_PATH_NAME, NAME_SPACE, properties);
CimCompositeID compositeId = new CimCompositeID(objPath);
Assert.assertEquals(compositeId.toString(), OBJ_PATH_PROP3_VALUE + "/" + OBJ_PATH_PROP1_VALUE);
}
use of javax.cim.CIMProperty in project coprhd-controller by CoprHD.
the class CimListenerTest method createAlertIndication.
/**
* Creates a CIMInstance representing an alert indication.
*
* @return A CIMInstance representing an alert indication.
*/
@SuppressWarnings("rawtypes")
private CIMInstance createAlertIndication() {
CIMObjectPath objPath = CimObjectPathCreator.createInstance(ALERT_INDICATION_CLASS_NAME);
CIMProperty[] properties = new CIMProperty[] { new CIMProperty<String>(ALERTING_MANGED_ELEMENT_KEY, CIMDataType.STRING_T, ALERTING_MANGED_ELEMENT_VALUE) };
CIMInstance indication = new CIMInstance(objPath, properties);
return indication;
}
use of javax.cim.CIMProperty in project coprhd-controller by CoprHD.
the class SmisDiscoveryArgsCreator method getInitialStorageTierMethodologyValue.
/**
* get Initial Storage Tiering methodology value for given Storage Pool Setting.
* used while modifying Storage Pool Setting Instance
*
* @param argument
* @param keyMap
* @param index
* @return
*/
public Object getInitialStorageTierMethodologyValue(final Argument argument, final Map<String, Object> keyMap, int index) {
@SuppressWarnings("unchecked") List<CIMInstance> vnxPoolSettingInstances = (List<CIMInstance>) keyMap.get(argument.getValue());
CIMInstance vnxPoolSettingInstance = vnxPoolSettingInstances.get(index);
String tierMethod = (String) keyMap.get(vnxPoolSettingInstance.getObjectPath().toString() + Constants.HYPHEN + Constants.TIERMETHODOLOGY);
_logger.debug("Tier Method got from Mapping :" + tierMethod);
CIMProperty<?> prop = new CIMProperty<Object>(Constants.INITIAL_STORAGE_TIER_METHODOLOGY, CIMDataType.UINT16_T, new UnsignedInteger16(tierMethod));
CIMProperty<?> initialStorageTierSelectionProp = new CIMProperty<Object>(Constants.INITIAL_STORAGE_TIERING_SELECTION, CIMDataType.UINT16_T, new UnsignedInteger16(Constants.RELATIVE_PERFORMANCE_ORDER));
CIMProperty<?>[] propArray = new CIMProperty<?>[] { prop, initialStorageTierSelectionProp };
return propArray;
}
use of javax.cim.CIMProperty in project coprhd-controller by CoprHD.
the class SmisCommandHelper method getSettingsDefineStateFromSource.
/**
* Get Synchronization aspects associated with the source block object, then
* constructs SettingsDefineState instances based on the source and aspects.
*
* @param storage
* StorageSystem that holds the SettingsDefineState instances
* @param blockObject
* BlockObject representing the source of replication
* @return A List of CIMObjectPaths for SettingsDefineState instances
* @throws WBEMException
*/
private List<CIMObjectPath> getSettingsDefineStateFromSource(StorageSystem storage, BlockObject blockObject) throws WBEMException {
List<CIMObjectPath> settingsDefineStatePaths = new ArrayList<>();
CIMObjectPath blockObjectPath = _cimPath.getBlockObjectPath(storage, blockObject);
CloseableIterator<CIMInstance> aspectInstancesItr = null;
try {
aspectInstancesItr = getAssociatorInstances(storage, blockObjectPath, null, SYMM_SYNCHRONIZATION_ASPECT_FOR_SOURCE, null, null, new String[] { CP_SYNC_TYPE, CP_SYNC_STATE });
while (aspectInstancesItr.hasNext()) {
CIMInstance aspectInstance = aspectInstancesItr.next();
CIMObjectPath aspectPath = aspectInstance.getObjectPath();
String syncType = CIMPropertyFactory.getPropertyValue(aspectInstance, CP_SYNC_TYPE);
String syncState = CIMPropertyFactory.getPropertyValue(aspectInstance, CP_SYNC_STATE);
if (SNAPSHOT_SYNC_TYPE_STR.equals(syncType) && RESTORED_SYNC_STATE_STR.equals(syncState)) {
CIMProperty[] settingsKeys = { _cimProperty.reference(CP_MANAGED_ELEMENT, blockObjectPath), _cimProperty.reference(CP_SETTING_DATA, aspectPath) };
settingsDefineStatePaths.add(CimObjectPathCreator.createInstance(SYMM_SETTINGS_DEFINE_STATE_SV_SAFS, ROOT_EMC_NAMESPACE, settingsKeys));
}
}
} finally {
closeCIMIterator(aspectInstancesItr);
}
return settingsDefineStatePaths;
}
use of javax.cim.CIMProperty in project coprhd-controller by CoprHD.
the class SmisCommandHelper method getBindVolumeInputArguments.
public CIMArgument[] getBindVolumeInputArguments(StorageSystem storageDevice, StoragePool pool, Volume volume, long thinVolumePreAllocateSize) throws IOException {
ArrayList<CIMArgument> list = new ArrayList<CIMArgument>();
try {
CIMProperty[] inPoolPropKeys = { _cimProperty.string(CP_INSTANCE_ID, _cimPath.getPoolName(storageDevice, pool.getNativeId())) };
CIMObjectPath inPoolPath = CimObjectPathCreator.createInstance(pool.getPoolClassName(), _cimConnection.getNamespace(storageDevice), inPoolPropKeys);
list.add(_cimArgument.reference(CP_IN_POOL, inPoolPath));
CIMObjectPath volumePath = _cimPath.getBlockObjectPath(storageDevice, volume);
list.add(_cimArgument.reference(CP_THE_ELEMENT, volumePath));
if (thinVolumePreAllocateSize > 0) {
list.add(_cimArgument.uint64(CP_SIZE, thinVolumePreAllocateSize));
}
} catch (Exception e) {
throw new IllegalStateException("Problem getting input arguments for volume bind: " + storageDevice.getSerialNumber());
}
CIMArgument[] result = {};
result = list.toArray(result);
return result;
}
Aggregations