Changeset 141
- Timestamp:
- 06/17/11 11:53:46 (13 years ago)
- Location:
- trunk/src/com/bowman/cardserv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/bowman/cardserv/SidCacheLinker.java
r118 r141 21 21 public class SidCacheLinker implements CacheListener, FileChangeListener, CronTimerListener { 22 22 23 private static final int MAX_DELTA = 8000;23 private static final int MAX_DELTA = 5000; 24 24 25 25 private ProxyConfig config; … … 492 492 if(services.add(sm)) { 493 493 logger.info("Linked previously undecodable service: " + ts2 + " (unlocked by: " + ts1 + ")"); 494 // config.getConnManager().cwsFoundService(null, ts2); // todo494 config.getConnManager().cwsFoundService(null, ts2, true); 495 495 } 496 496 addedServices.put(profileName, services); // profileName -> all services that wouldn't decode without links … … 520 520 i.remove(); 521 521 logger.info("Linked service no longer available: " + ts); 522 // config.getConnManager().cwsLostService(null, ts); // todo522 config.getConnManager().cwsLostService(null, ts, true); 523 523 } 524 524 } … … 572 572 573 573 public Set getServicesForProfile(String profileName) { 574 if(cache.getListener() == null) return Collections.EMPTY_SET;574 if(cache.getListener() != this) return Collections.EMPTY_SET; 575 575 if(!addedServices.containsKey(profileName)) return Collections.EMPTY_SET; 576 576 else return (Set)addedServices.get(profileName); -
trunk/src/com/bowman/cardserv/cws/CwsConnectorManager.java
r101 r141 718 718 719 719 public ConnectorSelection getConnectorsForService(String profile, ServiceMapping id, Set allowedConnectorNames) { 720 if(config.getSidCacheLinker() != null) // dont bother trying to find services only provided through sid cache linker 721 if(config.getSidCacheLinker().getServicesForProfile(profile).contains(id)) return ConnectorSelection.EMPTY; 720 722 return getServiceMapper(profile).getConnectorsForService(id, allowedConnectorNames); 721 723 } -
trunk/src/com/bowman/cardserv/rmi/RemoteHandler.java
r100 r141 521 521 522 522 public void cwsFoundService(CwsConnector cws, TvService service, boolean show) { 523 if(service != null && show) 524 fireRemoteEvent(new RemoteEvent(RemoteEvent.CWS_FOUND_SERVICE, cws.getLabel(), service.toString(), service.getProfileName())); 523 if(service != null && show) { 524 String label = cws==null?"Internal[SidCacheLinker]":cws.getLabel(); 525 fireRemoteEvent(new RemoteEvent(RemoteEvent.CWS_FOUND_SERVICE, label, service.toString(), service.getProfileName())); 526 } 525 527 } 526 528 -
trunk/src/com/bowman/cardserv/session/CspSession.java
r94 r141 310 310 311 311 public void cwsLostService(CwsConnector cws, TvService service, boolean show) { 312 if(cws.getProfile().getNetworkId() == 0) return; 312 CaProfile profile = cws==null?ProxyConfig.getInstance().getProfile(service.getProfileName()):cws.getProfile(); 313 if(profile == null || profile.getNetworkId() == 0) return; 313 314 // check if this service has disappeared entirely from all connectors 314 ConnectorSelection conns = cm.getConnectorsForService( cws.getProfileName(), new ServiceMapping(service), null);315 CspNetMessage.ProfileKey key = new CspNetMessage.ProfileKey( cws.getProfile());315 ConnectorSelection conns = cm.getConnectorsForService(profile.getName(), new ServiceMapping(service), null); 316 CspNetMessage.ProfileKey key = new CspNetMessage.ProfileKey(profile); 316 317 Integer sid = new Integer(service.getId()); 317 318 List state = (List)sentState.get(key); … … 332 333 333 334 public void cwsFoundService(CwsConnector cws, TvService service, boolean show) { 334 if(cws.getProfile().getNetworkId() == 0) return; 335 CspNetMessage.ProfileKey key = new CspNetMessage.ProfileKey(cws.getProfile()); 335 CaProfile profile = cws==null?ProxyConfig.getInstance().getProfile(service.getProfileName()):cws.getProfile(); 336 if(profile == null || profile.getNetworkId() == 0) return; 337 CspNetMessage.ProfileKey key = new CspNetMessage.ProfileKey(profile); 336 338 Integer sid = new Integer(service.getId()); 337 339 List state = (List)sentState.get(key);
Note:
See TracChangeset
for help on using the changeset viewer.