Search in sources :

Example 1 with ConstraintInfo

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

the class ACSRemoteAccess method createFilter.

/**
	 * This method can not be used in the current implementation of ACS logging
	 * But it will be useful for archiving.
	 */
private void createFilter() {
    // create filter
    if (eventChannel == null)
        return;
    FilterFactory filterFactory = eventChannel.default_filter_factory();
    Filter filter = null;
    try {
        filter = filterFactory.create_filter("EXTENDED_TCL");
    } catch (InvalidGrammar e) {
        System.out.println("Invalid grammar in ACSRemoteAccess::createFilter(): " + e);
    }
    // create constaints
    try {
        ConstraintInfo[] info = filter.add_constraints(createConstraints());
    } catch (InvalidConstraint e) {
        System.out.println("Invalid constraint in ACSRemoteAccess::createFilter(): " + e);
    }
// add constraints to filter
}
Also used : ConstraintInfo(org.omg.CosNotifyFilter.ConstraintInfo) Filter(org.omg.CosNotifyFilter.Filter) InvalidGrammar(org.omg.CosNotifyFilter.InvalidGrammar) InvalidConstraint(org.omg.CosNotifyFilter.InvalidConstraint) FilterFactory(org.omg.CosNotifyFilter.FilterFactory)

Example 2 with ConstraintInfo

use of org.omg.CosNotifyFilter.ConstraintInfo 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)

Aggregations

ConstraintInfo (org.omg.CosNotifyFilter.ConstraintInfo)2 Filter (org.omg.CosNotifyFilter.Filter)2 EventType (org.omg.CosNotification.EventType)1 FilterFactory (org.omg.CosNotifyFilter.FilterFactory)1 FilterNotFound (org.omg.CosNotifyFilter.FilterNotFound)1 InvalidConstraint (org.omg.CosNotifyFilter.InvalidConstraint)1 InvalidGrammar (org.omg.CosNotifyFilter.InvalidGrammar)1