Changeset 24


Ignore:
Timestamp:
08/10/10 18:07:03 (14 years ago)
Author:
bowman
Message:

Added ecm source to logging for service discovery (easier to se who caused an addition to service maps).

Location:
trunk/src/com/bowman/cardserv
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/bowman/cardserv/CardServProxy.java

    r23 r24  
    434434          // cache hit, we're done
    435435          // well except for probing...
    436           if(connectors.getUnknown() != null) {
    437             if(!userManager.isMapExcluded(session.getUser())) {
    438               session.setFlag(msg, 'P');
    439               broadcastMessage(msg, connectors.getUnknown(), true); // and probe the unknowns
    440             }
    441           }
     436          probeConnectors(connectors.getUnknown(), session, msg);
    442437          session.sendEcmReply(msg, cached);
    443438
     
    576571
    577572    // any additional connectors returned for channel auto-discovery?
    578     if(connectors.getUnknown() != null) {
    579       if(!userManager.isMapExcluded(session.getUser())) {
    580         session.setFlag(msg, 'P');
    581         // hack to track the origin user of the probe later (conn name is normally only used for reply messages)
    582         msg.setConnectorName(session.toString());
    583 
    584         broadcastMessage(msg, connectors.getUnknown(), true);
    585       }
    586     }
     573    probeConnectors(connectors.getUnknown(), session, msg);
    587574
    588575    // any connectors selected for broadcast?
     
    673660  }
    674661
     662  private void probeConnectors(List candidates, ProxySession session, CamdNetMessage msg) {
     663    if(candidates != null) {
     664      if(!userManager.isMapExcluded(session.getUser())) {
     665        session.setFlag(msg, 'P');
     666        msg.setOriginAddress(session.toString()); // hack to track the origin user of the probe later
     667        broadcastMessage(msg, candidates, true);
     668      }
     669    }
     670  }
     671
    675672  private void broadcastMessage(CamdNetMessage msg, List connectors, boolean probe) {
    676673    broadcastQueue.add(new BroadcastEntry(msg, connectors, probe));
  • trunk/src/com/bowman/cardserv/cws/CwsServiceMapper.java

    r23 r24  
    542542    if(!connectors.contains(conn.getName())) {
    543543      connectors.add(conn.getName());
    544       String source = (session==null?msg.getConnectorName():session.toString()); // conn name contains origin-session in case of probes
     544      String source = (session==null?msg.getOriginAddress():session.toString()); // contains origin-session in case of probes
    545545      logger.info("Discovered service [" + config.getServiceName(msg) + "] on CWS: " + conn +
    546546          (source==null?"":" - Ecm source was: " + source));
  • trunk/src/com/bowman/cardserv/session/EcmTransaction.java

    r23 r24  
    106106  public String getConnectorName() {
    107107    if(reply != null && reply.getConnectorName() != null) return reply.getConnectorName();
     108    else if(request != null && request.getConnectorName() != null) return request.getConnectorName();
    108109    else return null;
    109110  }
Note: See TracChangeset for help on using the changeset viewer.