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

normalise event map

File:
1 edited

Legend:

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

    r8777 r8778  
    5151
    5252        Map args = req.getParameterMap();
    53         // TODO stop this, we need multi-valued stuff
    54         args = normalise(args);
    55 
     53       
    5654        if (action != null && action.equals("receiveEvent")) {
    5755            receiveEvent(args);
    5856            return null;
    5957        }
     58       
     59        // TODO stop this, we need multi-valued stuff
     60        args = normalise(args);
    6061       
    6162        if (action == null || !ArrayHelper.contains(actions, action)) {
     
    207208    }
    208209   
    209     public void receiveEvent(Map event) {
     210    public void receiveEvent(Map rawEvent) {
     211        Map event = new TreeMap();
     212        for (Iterator iter = rawEvent.keySet().iterator(); iter.hasNext();) {
     213            String key = (String) iter.next();
     214            String[] value = (String[]) rawEvent.get(key);
     215            event.put(key, value[0]);
     216        }
     217       
    210218        GreenstoneCommunicator gsComm = null;
    211219        try {
     
    219227        }
    220228        Set matchedSubscriptions = ProfileStore.getInstance().filter(event, gsComm);
     229        System.out.println(matchedSubscriptions.size() + " matching subscriptions: " + matchedSubscriptions);
    221230        // TODO do something with the matched subscriptions
    222231    }
Note: See TracChangeset for help on using the changeset viewer.