Search in sources :

Example 1 with FilterNotFound

use of org.omg.CosNotifyFilter.FilterNotFound in project ACS by ACS-Community.

the class NcFilterInspector method getFilterInfo.

public String getFilterInfo() {
    String ret = "NC filter info for '" + serverObjectName + "' ";
    int[] filterIds = serverObject.get_all_filters();
    ret += "(" + filterIds.length + " filters total): ";
    for (int filterId : filterIds) {
        ret += "{ filterId=" + filterId + "; ";
        try {
            Filter f = serverObject.get_filter(filterId);
            String grammarName = f.constraint_grammar();
            ret += "grammar=" + grammarName + "; ";
            ret += "constraints: { ";
            for (ConstraintInfo ci : f.get_all_constraints()) {
                String cExp = ci.constraint_expression.constraint_expr;
                ret += "expr=" + cExp + "; ";
                for (EventType eT : ci.constraint_expression.event_types) {
                    String typeName = eT.type_name;
                    ret += "type=" + typeName + "; ";
                    String domainName = eT.domain_name;
                    ret += "domain=" + domainName + "; ";
                }
            }
            ret += "}; ";
        } catch (FilterNotFound ex) {
            ret += "FilterNotFound!";
        }
        ret += "}; ";
    }
    return ret;
}
Also used : ConstraintInfo(org.omg.CosNotifyFilter.ConstraintInfo) Filter(org.omg.CosNotifyFilter.Filter) EventType(org.omg.CosNotification.EventType) FilterNotFound(org.omg.CosNotifyFilter.FilterNotFound)

Example 2 with FilterNotFound

use of org.omg.CosNotifyFilter.FilterNotFound in project ACS by ACS-Community.

the class NCSubscriber method notifySubscriptionRemoved.

@Override
protected void notifySubscriptionRemoved(Class<?> structClass) throws AcsJEventSubscriptionEx {
    String eventTypeNameShort = (structClass == null ? "*" : structClass.getSimpleName());
    try {
        proxySupplier.remove_filter(subscriptionsFilters.get(eventTypeNameShort));
        subscriptionsFilters.remove(eventTypeNameShort);
        if (logger.isLoggable(AcsLogLevel.DELOUSE)) {
            NcFilterInspector insp = new NcFilterInspector(proxySupplier, channelName + "::" + clientName + "::ProxySupplier", logger);
            logger.log(AcsLogLevel.DELOUSE, "Removed filter for '" + eventTypeNameShort + "'. Current " + insp.getFilterInfo());
        }
    } catch (FilterNotFound e) {
        throw new AcsJEventSubscriptionEx("Filter for '" + eventTypeNameShort + "' not found on the server side: ", e);
    }
    // If receivers is empty we just discard everything
    if (receivers.isEmpty()) {
        discardAllEvents();
    }
}
Also used : AcsJEventSubscriptionEx(alma.acsErrTypeLifeCycle.wrappers.AcsJEventSubscriptionEx) FilterNotFound(org.omg.CosNotifyFilter.FilterNotFound)

Aggregations

FilterNotFound (org.omg.CosNotifyFilter.FilterNotFound)2 AcsJEventSubscriptionEx (alma.acsErrTypeLifeCycle.wrappers.AcsJEventSubscriptionEx)1 EventType (org.omg.CosNotification.EventType)1 ConstraintInfo (org.omg.CosNotifyFilter.ConstraintInfo)1 Filter (org.omg.CosNotifyFilter.Filter)1