Ignore:
Timestamp:
2004-12-11T20:13:02+13:00 (19 years ago)
Author:
schweer
Message:

started to rework algo for partially matched subscriptions (multi-valued attributes etc)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/ProfileStore.java

    r8777 r8780  
    7575        Set result = new TreeSet();
    7676        // TODO rework algo for getting partially matched subs
    77         result.addAll(PredicateFactory.getIdEqualsPredicate("type", (String)event.get("type")).getSubscriptionIDs());
     77        IdEqualsPredicate predicate;
     78        predicate = PredicateFactory.getIdEqualsPredicate("type", (String)event.get("type"));
     79        if (predicate != null)
     80            result.addAll(predicate.getSubscriptionIDs());
    7881       
    7982        Set docIDSubs = new TreeSet();
    80         docIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("documentID", (String)event.get("documentID")).getSubscriptionIDs());
    81         docIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("documentID", null).getSubscriptionIDs());
     83        predicate = PredicateFactory.getIdEqualsPredicate("documentID", (String)event.get("documentID"));
     84        if (predicate != null)
     85            docIDSubs.addAll(predicate.getSubscriptionIDs());
     86        predicate = PredicateFactory.getIdEqualsPredicate("documentID", null);
     87        if (predicate != null)
     88            docIDSubs.addAll(predicate.getSubscriptionIDs());
    8289        result.retainAll(docIDSubs);
    8390       
    8491        Set collIDSubs = new TreeSet();
    85         collIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("collectionID", (String)event.get("collectionID")).getSubscriptionIDs());
    86         collIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("collectionID", null).getSubscriptionIDs());
     92        predicate = PredicateFactory.getIdEqualsPredicate("collectionID", (String)event.get("collectionID"));
     93        if (predicate != null)
     94            collIDSubs.addAll(predicate.getSubscriptionIDs());
     95        predicate = PredicateFactory.getIdEqualsPredicate("collectionID", null);
     96        if (predicate != null)
     97            collIDSubs.addAll(predicate.getSubscriptionIDs());
    8798        result.retainAll(collIDSubs);
    8899       
    89100        Set hostIDSubs = new TreeSet();
    90         hostIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("host", (String)event.get("host")).getSubscriptionIDs());
    91         hostIDSubs.addAll(PredicateFactory.getIdEqualsPredicate("host", null).getSubscriptionIDs());
     101        predicate = PredicateFactory.getIdEqualsPredicate("host", (String)event.get("host"));
     102        if (predicate != null)
     103            hostIDSubs.addAll(predicate.getSubscriptionIDs());
     104        predicate = PredicateFactory.getIdEqualsPredicate("host", null);
     105        if (predicate != null)
     106            hostIDSubs.addAll(predicate.getSubscriptionIDs());
    92107        result.retainAll(hostIDSubs);
    93108       
Note: See TracChangeset for help on using the changeset viewer.