Search in sources :

Example 1 with UnsignedInteger16

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;
}
Also used : UnsignedInteger16(javax.cim.UnsignedInteger16) AlternateIdConstraint(com.emc.storageos.db.client.constraint.AlternateIdConstraint)

Example 2 with UnsignedInteger16

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);
    }
}
Also used : DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnsignedInteger16(javax.cim.UnsignedInteger16)

Example 3 with UnsignedInteger16

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);
    }
}
Also used : Iterator(java.util.Iterator) StringSet(com.emc.storageos.db.client.model.StringSet) AccessProfile(com.emc.storageos.plugins.AccessProfile) CIMInstance(javax.cim.CIMInstance) UnsignedInteger16(javax.cim.UnsignedInteger16) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 4 with UnsignedInteger16

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);
}
Also used : StringSet(com.emc.storageos.db.client.model.StringSet) UnsignedInteger16(javax.cim.UnsignedInteger16)

Example 5 with UnsignedInteger16

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;
}
Also used : CIMProperty(javax.cim.CIMProperty) CIMObjectPath(javax.cim.CIMObjectPath) CIMInstance(javax.cim.CIMInstance) UnsignedInteger16(javax.cim.UnsignedInteger16) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WBEMException(javax.wbem.WBEMException) CIMArgument(javax.cim.CIMArgument)

Aggregations

UnsignedInteger16 (javax.cim.UnsignedInteger16)27 CIMInstance (javax.cim.CIMInstance)13 CIMArgument (javax.cim.CIMArgument)10 CIMObjectPath (javax.cim.CIMObjectPath)9 CIMProperty (javax.cim.CIMProperty)8 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)7 ArrayList (java.util.ArrayList)7 WBEMException (javax.wbem.WBEMException)6 AlternateIdConstraint (com.emc.storageos.db.client.constraint.AlternateIdConstraint)5 StringSet (com.emc.storageos.db.client.model.StringSet)5 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)5 Iterator (java.util.Iterator)5 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)4 AccessProfile (com.emc.storageos.plugins.AccessProfile)4 URI (java.net.URI)3 BlockObject (com.emc.storageos.db.client.model.BlockObject)2 DiscoveredDataObject (com.emc.storageos.db.client.model.DiscoveredDataObject)2 StoragePool (com.emc.storageos.db.client.model.StoragePool)2 StoragePort (com.emc.storageos.db.client.model.StoragePort)2 OperationalStatus (com.emc.storageos.db.client.model.StoragePort.OperationalStatus)2