Search in sources :

Example 1 with CIMDataType

use of javax.cim.CIMDataType in project coprhd-controller by CoprHD.

the class CimSubscriptionManager method createSubscription.

/**
 * Creates an indication subscription in the CIMOM for the given filter.
 *
 * @param filterInfo the filter information.
 *
 * @return the CIM object path of the subscription
 *
 * @throws WBEMException, ConnectionManagerException
 */
protected CIMObjectPath createSubscription(CimFilterInfo filterInfo) throws WBEMException, ConnectionManagerException {
    CIMObjectPath filterPath;
    if (filterInfo instanceof CimManagedFilterInfo) {
        filterPath = createFilter((CimManagedFilterInfo) filterInfo);
    } else {
        filterPath = getInstance(CimConstants.CIM_FILTER_NAME, filterInfo.getName()).getObjectPath();
    }
    s_logger.trace("filterPath :{}", filterPath);
    CIMProperty<?> filterProp = new CIMProperty<CIMObjectPath>(CimConstants.SUBSCRIPTION_PROP_FILTER, new CIMDataType(CimConstants.CIM_FILTER_NAME), filterPath);
    CIMProperty<?> handlerProp = new CIMProperty<CIMObjectPath>(CimConstants.SUBSCRIPTION_PROP_HANDLER, new CIMDataType(CimConstants.CIM_HANDLER_NAME), getHandler());
    s_logger.trace("filterProp :{}", filterProp);
    s_logger.trace("handlerProp :{}", handlerProp);
    CIMProperty<?>[] subscriptionProperties = new CIMProperty[] { filterProp, handlerProp };
    CIMObjectPath subscriptionPath = createInstance(CimConstants.CIM_SUBSCRIPTION_NAME, subscriptionProperties);
    _subscriptionPaths.add(subscriptionPath);
    s_logger.trace("subscriptionPath :{}", subscriptionPath);
    return subscriptionPath;
}
Also used : CIMProperty(javax.cim.CIMProperty) CIMDataType(javax.cim.CIMDataType) CIMObjectPath(javax.cim.CIMObjectPath)

Aggregations

CIMDataType (javax.cim.CIMDataType)1 CIMObjectPath (javax.cim.CIMObjectPath)1 CIMProperty (javax.cim.CIMProperty)1