Search in sources :

Example 1 with IpLikeCriteriaBehavior

use of org.opennms.web.rest.support.IpLikeCriteriaBehavior in project opennms by OpenNMS.

the class AlarmRestService method getCriteriaBehaviors.

@Override
protected Map<String, CriteriaBehavior<?>> getCriteriaBehaviors() {
    final Map<String, CriteriaBehavior<?>> map = new HashMap<>();
    // Root alias
    map.putAll(CriteriaBehaviors.ALARM_BEHAVIORS);
    // Allow iplike queries on ipAddr
    map.put("ipAddr", new IpLikeCriteriaBehavior("ipAddr"));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.alarm, CriteriaBehaviors.ALARM_BEHAVIORS));
    // Allow iplike queries on alarm.ipAddr
    map.put(Aliases.alarm.prop("ipAddr"), new IpLikeCriteriaBehavior("ipAddr"));
    // 1st level JOINs
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.distPoller, CriteriaBehaviors.DIST_POLLER_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix("lastEvent", CriteriaBehaviors.EVENT_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.node, CriteriaBehaviors.NODE_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.serviceType, CriteriaBehaviors.SERVICE_TYPE_BEHAVIORS));
    // 2nd level JOINs
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.assetRecord, CriteriaBehaviors.ASSET_RECORD_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.eventParameter, CriteriaBehaviors.ALARM_LASTEVENT_PARAMETER_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.ipInterface, CriteriaBehaviors.IP_INTERFACE_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.location, CriteriaBehaviors.MONITORING_LOCATION_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.category, CriteriaBehaviors.NODE_CATEGORY_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.snmpInterface, CriteriaBehaviors.SNMP_INTERFACE_BEHAVIORS));
    return map;
}
Also used : HashMap(java.util.HashMap) IpLikeCriteriaBehavior(org.opennms.web.rest.support.IpLikeCriteriaBehavior) CriteriaBehavior(org.opennms.web.rest.support.CriteriaBehavior) IpLikeCriteriaBehavior(org.opennms.web.rest.support.IpLikeCriteriaBehavior)

Example 2 with IpLikeCriteriaBehavior

use of org.opennms.web.rest.support.IpLikeCriteriaBehavior in project opennms by OpenNMS.

the class EventRestService method getCriteriaBehaviors.

@Override
protected Map<String, CriteriaBehavior<?>> getCriteriaBehaviors() {
    final Map<String, CriteriaBehavior<?>> map = new HashMap<>();
    // Root alias
    map.putAll(CriteriaBehaviors.EVENT_BEHAVIORS);
    // Allow iplike queries on ipAddr
    map.put("ipAddr", new IpLikeCriteriaBehavior("ipAddr"));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.event, CriteriaBehaviors.EVENT_BEHAVIORS));
    // Allow iplike queries on event.ipAddr
    map.put(Aliases.event.prop("ipAddr"), new IpLikeCriteriaBehavior("ipAddr"));
    // 1st level JOINs
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.alarm, CriteriaBehaviors.ALARM_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.distPoller, CriteriaBehaviors.DIST_POLLER_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.eventParameter, CriteriaBehaviors.EVENT_PARAMETER_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.node, CriteriaBehaviors.NODE_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.serviceType, CriteriaBehaviors.SERVICE_TYPE_BEHAVIORS));
    // 2nd level JOINs
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.assetRecord, CriteriaBehaviors.ASSET_RECORD_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.ipInterface, CriteriaBehaviors.IP_INTERFACE_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.location, CriteriaBehaviors.MONITORING_LOCATION_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.category, CriteriaBehaviors.NODE_CATEGORY_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.snmpInterface, CriteriaBehaviors.SNMP_INTERFACE_BEHAVIORS));
    return map;
}
Also used : HashMap(java.util.HashMap) IpLikeCriteriaBehavior(org.opennms.web.rest.support.IpLikeCriteriaBehavior) CriteriaBehavior(org.opennms.web.rest.support.CriteriaBehavior) IpLikeCriteriaBehavior(org.opennms.web.rest.support.IpLikeCriteriaBehavior)

Example 3 with IpLikeCriteriaBehavior

use of org.opennms.web.rest.support.IpLikeCriteriaBehavior in project opennms by OpenNMS.

the class NotificationRestService method getCriteriaBehaviors.

@Override
protected Map<String, CriteriaBehavior<?>> getCriteriaBehaviors() {
    Map<String, CriteriaBehavior<?>> map = new HashMap<>();
    // Root alias
    map.putAll(CriteriaBehaviors.NOTIFICATION_BEHAVIORS);
    // Allow iplike queries on ipAddress
    map.put("ipAddress", new IpLikeCriteriaBehavior("interfaceId"));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.notification, CriteriaBehaviors.NOTIFICATION_BEHAVIORS));
    // Allow iplike queries on notification.ipAddress
    map.put(Aliases.notification.prop("ipAddress"), new IpLikeCriteriaBehavior("interfaceId"));
    // 1st level JOINs
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.event, CriteriaBehaviors.EVENT_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.node, CriteriaBehaviors.NODE_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.serviceType, CriteriaBehaviors.SERVICE_TYPE_BEHAVIORS));
    // 2nd level JOINs
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.assetRecord, CriteriaBehaviors.ASSET_RECORD_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.distPoller, CriteriaBehaviors.DIST_POLLER_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.eventParameter, CriteriaBehaviors.EVENT_PARAMETER_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.ipInterface, CriteriaBehaviors.IP_INTERFACE_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.location, CriteriaBehaviors.MONITORING_LOCATION_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.category, CriteriaBehaviors.NODE_CATEGORY_BEHAVIORS));
    map.putAll(CriteriaBehaviors.withAliasPrefix(Aliases.snmpInterface, CriteriaBehaviors.SNMP_INTERFACE_BEHAVIORS));
    return map;
}
Also used : HashMap(java.util.HashMap) IpLikeCriteriaBehavior(org.opennms.web.rest.support.IpLikeCriteriaBehavior) CriteriaBehavior(org.opennms.web.rest.support.CriteriaBehavior) IpLikeCriteriaBehavior(org.opennms.web.rest.support.IpLikeCriteriaBehavior)

Aggregations

HashMap (java.util.HashMap)3 CriteriaBehavior (org.opennms.web.rest.support.CriteriaBehavior)3 IpLikeCriteriaBehavior (org.opennms.web.rest.support.IpLikeCriteriaBehavior)3