use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class CIMStoragePortUpdatableDeviceEvent method getOperationalStatusCodesArray.
/**
* Converts {@link String}operationalStatusCode to UnsignedInteger16[] format
*
* @return {@link UnsignedInteger16}[] operationalStatusCodes of port
*/
private UnsignedInteger16[] getOperationalStatusCodesArray() {
String operationalStatusCode = getOperationalStatusCodes();
_logger.debug("operationalStatusCode :{}", operationalStatusCode);
String[] opStausCodeArray = operationalStatusCode.split(",");
UnsignedInteger16[] unsignedArray = new UnsignedInteger16[opStausCodeArray.length];
for (int i = 0, size = opStausCodeArray.length; i < size; i++) {
unsignedArray[i] = new UnsignedInteger16(opStausCodeArray[i].trim());
}
_logger.debug("Unsigned16 array value :{}", unsignedArray);
return unsignedArray;
}
use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class StoragePortProcessor method setCompatibilityByACLXFlag.
private void setCompatibilityByACLXFlag(StorageSystem storageSystem, CIMInstance portInstance, StoragePort port) {
Object portAttributesValue = portInstance.getPropertyValue(EMC_PORT_ATTRIBUTES);
if (portAttributesValue != null && storageSystem.checkIfVmax3()) {
boolean foundACLXFlag = false;
UnsignedInteger16[] portAttributes = (UnsignedInteger16[]) portAttributesValue;
for (UnsignedInteger16 portAttribute : portAttributes) {
if (portAttribute.equals(EMC_PORT_ATTRIBUTE_ACLX_FLAG)) {
foundACLXFlag = true;
break;
}
}
// If there is Virtual ProtocolEndpoint associated to this physical port, consider masking is enabled...
if (LINKTECHNOLOGY_ETHERNET.equalsIgnoreCase(getCIMPropertyValue(portInstance, LINKTECHNOLOGY))) {
foundACLXFlag = true;
}
String compatibilityStatus = (foundACLXFlag) ? DiscoveredDataObject.CompatibilityStatus.COMPATIBLE.name() : DiscoveredDataObject.CompatibilityStatus.INCOMPATIBLE.name();
_logger.info(String.format("setCompatibilityByACLXFlag(%s) = %s", port.getNativeGuid(), compatibilityStatus));
port.setCompatibilityStatus(compatibilityStatus);
}
}
use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class SupportedAsynchronousActionsProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
try {
_log.info("***Inside SupportedAsynchronousActionsProcessor****");
_dbClient = (DbClient) keyMap.get(Constants.dbClient);
AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
Iterator<CIMInstance> iterator = (Iterator<CIMInstance>) resultObj;
while (iterator.hasNext()) {
CIMInstance instance = iterator.next();
UnsignedInteger16[] supportedAsyncActions = (UnsignedInteger16[]) instance.getPropertyValue(Constants.SUPPORTED_ASYNCHRONOUS_ACTIONS);
StorageSystem device = getStorageSystem(_dbClient, profile.getSystemId());
addSupportedAsynchronousActionsToStorageSystem(supportedAsyncActions, device);
StringSet replicationTypes = new StringSet();
replicationTypes.add(SupportedReplicationTypes.LOCAL.toString());
device.setSupportedReplicationTypes(replicationTypes);
}
} catch (Exception e) {
_log.error("Supported asynchronous action processing failed", e);
}
}
use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class SupportedCopyTypesProcessor method addCopyTypesToStoragePool.
private void addCopyTypesToStoragePool(UnsignedInteger16[] copyTypes, StoragePool storagePool, String thinProvisionedPreAllocateSupported, Map<URI, StoragePool> poolsToMatchWithVpool) {
StringSet set = new StringSet();
for (UnsignedInteger16 n : copyTypes) {
switch(n.intValue()) {
case Constants.ASYNC_COPY_TYPE:
set.add(StoragePool.CopyTypes.ASYNC.name());
break;
case Constants.SYNC_COPY_TYPE:
set.add(StoragePool.CopyTypes.SYNC.name());
break;
case Constants.UNSYNC_ASSOC_COPY_TYPE:
set.add(StoragePool.CopyTypes.UNSYNC_ASSOC.name());
break;
case Constants.UNSYNC_UNASSOC_COPY_TYPE:
set.add(StoragePool.CopyTypes.UNSYNC_UNASSOC.name());
break;
default:
_log.warn("Encountered unknown copy type {} for pool {}", n.intValue(), storagePool.getId());
}
}
storagePool.setThinVolumePreAllocationSupported(Boolean.valueOf(thinProvisionedPreAllocateSupported));
// If the modified list already has this pool, skip the check.
if (!poolsToMatchWithVpool.containsKey(storagePool.getId()) && ImplicitPoolMatcher.checkPoolPropertiesChanged(storagePool.getSupportedCopyTypes(), set)) {
poolsToMatchWithVpool.put(storagePool.getId(), storagePool);
}
storagePool.setSupportedCopyTypes(set);
_dbClient.persistObject(storagePool);
}
use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class AbstractCloneOperations method getReplicationSettingDataInstanceForThinProvisioningPolicy.
@SuppressWarnings("rawtypes")
private CIMInstance getReplicationSettingDataInstanceForThinProvisioningPolicy(final StorageSystem storageSystem, int desiredValue) {
CIMInstance modifiedInstance = null;
try {
CIMObjectPath replicationSettingCapabilities = _cimPath.getReplicationServiceCapabilitiesPath(storageSystem);
CIMArgument[] inArgs = _helper.getReplicationSettingDataInstance();
CIMArgument[] outArgs = new CIMArgument[5];
_helper.invokeMethod(storageSystem, replicationSettingCapabilities, GET_DEFAULT_REPLICATION_SETTING_DATA, inArgs, outArgs);
for (CIMArgument<?> outArg : outArgs) {
if (null == outArg) {
continue;
}
if (outArg.getName().equalsIgnoreCase(SmisConstants.DEFAULT_INSTANCE)) {
CIMInstance repInstance = (CIMInstance) outArg.getValue();
if (null != repInstance) {
CIMProperty<?> thinProvisioningPolicy = new CIMProperty<Object>(SmisConstants.THIN_PROVISIONING_POLICY, UINT16_T, new UnsignedInteger16(desiredValue));
CIMProperty<?> targetElementSupplier = new CIMProperty<Object>(TARGET_ELEMENT_SUPPLIER, UINT16_T, new UnsignedInteger16(CREATE_NEW_TARGET_VALUE));
CIMProperty<?>[] propArray = new CIMProperty<?>[] { thinProvisioningPolicy, targetElementSupplier };
modifiedInstance = repInstance.deriveInstance(propArray);
break;
}
}
}
} catch (Exception e) {
_log.error("Error retrieving Replication Setting Data Instance ", e);
}
return modifiedInstance;
}
Aggregations