Changeset 44
- Timestamp:
- 10/02/10 08:51:44 (13 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CardServProxy.ipr
r3 r44 11 11 <properties /> 12 12 </buildFile> 13 <buildFile url="file://$PROJECT_DIR$/build.local.xml"> 14 <additionalClassPath /> 15 <antReference projectDefault="true" /> 16 <customJdkName value="" /> 17 <maximumHeapSize value="128" /> 18 <maximumStackSize value="32" /> 19 <properties /> 20 </buildFile> 13 21 </component> 14 22 <component name="BuildJarProjectSettings"> … … 22 30 <option name="PER_PROJECT_SETTINGS"> 23 31 <value> 24 <ADDITIONAL_INDENT_OPTIONS fileType=" ">32 <ADDITIONAL_INDENT_OPTIONS fileType="java"> 25 33 <option name="INDENT_SIZE" value="4" /> 26 34 <option name="CONTINUATION_INDENT_SIZE" value="8" /> … … 31 39 <option name="LABEL_INDENT_ABSOLUTE" value="false" /> 32 40 </ADDITIONAL_INDENT_OPTIONS> 33 <ADDITIONAL_INDENT_OPTIONS fileType="j ava">41 <ADDITIONAL_INDENT_OPTIONS fileType="jsp"> 34 42 <option name="INDENT_SIZE" value="4" /> 35 43 <option name="CONTINUATION_INDENT_SIZE" value="8" /> … … 102 110 </component> 103 111 <component name="ExportToHTMLSettings"> 104 <option name="PRINT_LINE_NUMBERS" value="false" /> 105 <option name="OPEN_IN_BROWSER" value="false" /> 106 <option name="OUTPUT_DIRECTORY" /> 112 <option name="OUTPUT_DIRECTORY" value="C:\IdeaProjects\CSP-svn\exportToHTML" /> 107 113 </component> 108 114 <component name="FacetAutodetectingManager"> … … 131 137 <option name="m_ignoreIgnoreParameter" value="true" /> 132 138 </inspection_tool> 133 <inspection_tool class="ImplicitTypeConversion" level="WARNING" enabled="false">139 <inspection_tool class="ImplicitTypeConversion" enabled="false" level="WARNING" enabled_by_default="false"> 134 140 <option name="BITS" value="1720" /> 135 141 <option name="FLAG_EXPLICIT_CONVERSION" value="true" /> … … 138 144 <inspection_tool class="SerializableHasSerialVersionUIDField" enabled="true" level="INFO" enabled_by_default="true"> 139 145 <option name="superClassString" value="java.awt.Component" /> 146 </inspection_tool> 147 <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false"> 148 <option name="processCode" value="true" /> 149 <option name="processLiterals" value="true" /> 150 <option name="processComments" value="true" /> 140 151 </inspection_tool> 141 152 <inspection_tool class="ThrowableInstanceNeverThrown" enabled="true" level="INFO" enabled_by_default="true" /> … … 154 165 </option> 155 166 </inspection_tool> 156 <inspection_tool class="UnterminatedStatementJS" level="WARNING" enabled="false" /> 167 <inspection_tool class="UnterminatedStatementJS" enabled="false" level="WARNING" enabled_by_default="false" /> 168 <inspection_tool class="UnusedDeclaration" enabled="false" level="WARNING" enabled_by_default="false"> 169 <option name="ADD_MAINS_TO_ENTRIES" value="true" /> 170 <option name="ADD_APPLET_TO_ENTRIES" value="true" /> 171 <option name="ADD_SERVLET_TO_ENTRIES" value="true" /> 172 <option name="ADD_NONJAVA_TO_ENTRIES" value="true" /> 173 <option name="ADDITIONAL_ANNOTATIONS"> 174 <value> 175 <list size="1"> 176 <item index="0" class="java.lang.String" itemvalue="javax.ws.rs.*" /> 177 </list> 178 </value> 179 </option> 180 <option name="ADD_EJB_TO_ENTRIES" value="true" /> 181 <option name="ADD_TESTNG_TO_ENTRIES" value="true" /> 182 <option name="ADD_JUNIT_TO_ENTRIES" value="true" /> 183 </inspection_tool> 157 184 </profile> 158 185 </profiles> … … 316 343 </component> 317 344 <component name="ProjectKey"> 318 <option name="state" value=" :pserver:bowman@cvs.3dfxsweden.net:/home/cvs|CardServProxy/CardServProxy.ipr" />345 <option name="state" value="http://streamboard.gmc.to/svn/CSP/trunk/CardServProxy.ipr" /> 319 346 </component> 320 347 <component name="ProjectModuleManager"> … … 332 359 </component> 333 360 <component name="SvnBranchConfigurationManager"> 361 <option name="myConfigurationMap"> 362 <map> 363 <entry key="$PROJECT_DIR$"> 364 <value> 365 <SvnBranchConfiguration> 366 <option name="trunkUrl" value="http://streamboard.gmc.to/svn/CSP/trunk" /> 367 </SvnBranchConfiguration> 368 </value> 369 </entry> 370 </map> 371 </option> 334 372 <option name="mySupportsUserInfoFilter" value="true" /> 335 373 </component> -
trunk/changelog.txt
r43 r44 10 10 - Fixed: Radegast support updated to make sense with 0.9.x. 11 11 - Changed: Two ecms (or dcw replies) with the same payload data but different dvb table ids (even/0x80 vs odd/0x81) are 12 now considered identical by the proxy. 13 - Changed: ClusteredCache transport format now includes meta-data such as ca-id and onid. This breaks compatibility14 with previous versions. If one node has the new format, all nodes must be upgraded.12 now considered identical by the proxy. Implications unknown. 13 - Changed: ClusteredCache transport format now includes meta-data such as ca-id and network-id. 14 NOTE: This breaks compatibility with previous versions. If one node has the new format, all nodes must be upgraded. 15 15 - Added: Cws event for found service now shown in the status-web (despite the command being called error-log). 16 - Added: Experimental sid cache linking feature, allows cache hits based on meta-data rather than ecm payload. 16 - Added: Experimental sid cache linking feature, allows cache hits based on meta-data like sid rather than ecm payload. 17 Links added via the web commands are stored in etc/links.cfg (this file is monitored for changes and autoloaded also). 18 - Added: More sanity checks to DcwFilterPlugin (checksums, length and an option to monitor all replies for duplicates). 19 20 - Changes to proxy.xml: 21 Added: Attribute 'enable-service-linking' to <cache-handler> (true/false, default: false). Enables sid cache linker. 22 23 - Changes to the http/xml api: 24 Added: Attribute 'filtered-by' to <ecm> (transaction logs). Contains the reason for a B flag, or the filtering plugin. 25 Added: New event type 9 - "found service" added to connector events output (error-log, yes - not really an error). 17 26 18 27 -
trunk/config/proxy-reference.html
r43 r44 779 779 <a name="connection-manager/reconnect-interval"> 780 780 <div class='indent'>connection-manager/reconnect-interval</div><br /> 781 The interval between connection attempts (in seconds) for servers that are not are not connected. Applies to all CWS connectors. Minimum interval is 5 seconds (anything lower becomes 5).<br />782 <strong>NOTE: </strong>If you have connectors that sporadically seem to get stuck and never reconnect, it isvery likely means you have this set too low. <br />781 The interval between connection attempts (in seconds) for servers that are not are not connected. Applies to all CWS connectors. Minimum interval is 3 seconds (anything lower will result in the default of 60 secs).<br /> 782 <strong>NOTE: </strong>If you have connectors that sporadically seem to get stuck and never reconnect, it very likely means you have this set too low. <br /> 783 783 <br /> 784 784 </a> -
trunk/plugins/DcwFilterPlugin/DcwFilterPlugin.ipr
r1 r44 236 236 <component name="ProjectFileVersion" converted="true" /> 237 237 <component name="ProjectKey"> 238 <option name="state" value="project://C:\IdeaProjects\C ardServProxy\plugins\DcwFilterPlugin\DcwFilterPlugin.ipr" />238 <option name="state" value="project://C:\IdeaProjects\CSP-svn\plugins\DcwFilterPlugin\DcwFilterPlugin.ipr" /> 239 239 </component> 240 240 <component name="ProjectModuleManager"> -
trunk/plugins/DcwFilterPlugin/src/com/bowman/cardserv/DcwFilterPlugin.java
r39 r44 103 103 links.add(config.getService(prev.getProfileName(), prev.getServiceId()).toString()); 104 104 links.add(config.getService(msg.getProfileName(), msg.getServiceId()).toString()); 105 if(sidMap.put(prevId, links) == null || sidMap.put(msgId, links) == null) 105 if(sidMap.put(prevId, links) == null || sidMap.put(msgId, links) == null) { 106 106 System.out.println("Link found: " + links + "\n\t" + prev + "\n\t" + msg); 107 } 107 108 } 108 109 -
trunk/src/com/bowman/cardserv/CaProfile.java
r35 r44 344 344 345 345 public String getNetworkIdStr() { 346 String s = Integer.toHexString(networkId); 347 while(s.length() < 4) s = "0" + s; 348 return s; 346 return DESUtil.intToHexString(networkId, 4); 349 347 } 350 348 … … 446 444 if(this == MULTIPLE) throw new IllegalStateException("getServices(" + canDecode +") called on profile *."); 447 445 return ProxyConfig.getInstance().getConnManager().getServicesForProfile(name, canDecode); 446 } 447 448 public String getKeyStr() { 449 return getKeyStr(this); 450 } 451 452 public static String getKeyStr(CaProfile profile) { 453 return getKeyStr(profile.networkId, profile.caId); 454 } 455 456 public static String getKeyStr(int networkId, int caId) { 457 return DESUtil.intToHexString(networkId, 4) + '-' + DESUtil.intToHexString(caId, 4); 448 458 } 449 459 -
trunk/src/com/bowman/cardserv/CamdNetMessage.java
r43 r44 657 657 public String getProfileName() { 658 658 return profileName; 659 } 659 } 660 660 661 661 public void setLinkedService(String linkedService) { -
trunk/src/com/bowman/cardserv/CardServProxy.java
r40 r44 400 400 ServiceMapping id = new ServiceMapping(msg); 401 401 402 403 402 ConnectorSelection connectors; 404 403 … … 486 485 emmCount++; 487 486 int seqNr = msg.getSequenceNr(); 488 if(!profile.isCacheOnly() ) forwardEmmRequest(session, msg);487 if(!profile.isCacheOnly() && msg.getProfileName() != null) forwardEmmRequest(session, msg); 489 488 CamdNetMessage emmReplyMsg = msg.getEmmReply(); 490 489 ((NewcamdSession)session).sendMessageNative(emmReplyMsg, seqNr, true); // acknowledge the emm by giving the client the correct signature? -
trunk/src/com/bowman/cardserv/DefaultCache.java
r39 r44 139 139 notifyAll(); 140 140 } else { 141 if(listener != null) listener.onReply(request, reply); 141 142 if(pendingEcms.containsKey(request)) { 142 143 addReply(request, reply); … … 192 193 " Current: " + reply.toDebugString()); 193 194 } 194 } else if(listener != null) listener.onReply(request, reply);195 } // else if(listener != null) listener.onReply(request, reply); 195 196 } 196 197 -
trunk/src/com/bowman/cardserv/ProxyConfig.java
r43 r44 58 58 private Map pluginLoadData = new HashMap(); 59 59 private Map profiles = new HashMap(); 60 private Map profilesById = new HashMap(); 60 61 private Set disabledProfiles = new HashSet(); 61 62 … … 84 85 } 85 86 86 public CaProfile getProfileById(int onid, int caid) { 87 if(onid == 0) return null; 88 CaProfile profile; 89 for(Iterator iter = profiles.values().iterator(); iter.hasNext(); ) { 90 profile = (CaProfile)iter.next(); 91 if(profile.getNetworkId() == onid && profile.getCaId() == caid) return profile; 92 } 93 return null; 87 public CaProfile getProfileById(int networkId, int caId) { 88 if(networkId == 0) return null; 89 return (CaProfile)profilesById.get(CaProfile.getKeyStr(networkId, caId)); 90 } 91 92 public String getProfileNameById(int networkId, int caId) { 93 CaProfile profile = getProfileById(networkId, caId); 94 if(profile == null) return null; 95 else return profile.getName(); 94 96 } 95 97 … … 497 499 profileChanged(profile, true); 498 500 } else { 501 profilesById.remove(profile.getKeyStr()); 499 502 profile.configUpdated(profileConfig); 500 503 if(!profile.isEnabled()) { 501 504 profiles.remove(profile.getName()); 502 505 disabledProfiles.add(profile.getName()); 503 } 506 } else profilesById.put(profile.getKeyStr(), profile); 504 507 profileChanged(profile, false); 505 508 } … … 512 515 if(!newProfiles.contains(name)) { 513 516 profile = (CaProfile)profiles.remove(name); 517 profilesById.remove(profile.getKeyStr()); 514 518 profile.setEnabled(false); 515 519 disabledProfiles.remove(profile.getName()); 520 516 521 profileChanged(profile, false); 517 522 } … … 529 534 profile.getNetworkIdStr() + "' and ca-id '" + profile.getCaIdStr() + "'."); 530 535 profiles.put(profile.getName(), profile); 536 profilesById.put(profile.getKeyStr(), profile); 531 537 // if the proxy is already running, start any new added profiles immediately 532 538 if(defaultListener != null) profile.startListening(defaultListener); -
trunk/src/com/bowman/cardserv/SidCacheLinker.java
r43 r44 106 106 for(Iterator iter = sidLinksMap.values().iterator(); iter.hasNext(); ) linkStrs.add(iter.next().toString()); 107 107 logger.info("Loaded sid links file, " + linkStrs.size() + " collections: " + linkStrs); 108 refreshAddedSet(); 108 109 linksChanged = false; 109 110 } catch(Exception e) { … … 249 250 String[] profiles = (String[])params.get("profiles"); 250 251 TvService[] services = (TvService[])requiredServices.keySet().toArray(new TvService[requiredServices.size()]); 252 Set opens; 251 253 xb.appendElement("required-services", "count", services.length); 252 XmlHelper.xmlFormatServices(services, xb, false, true, false, null, profiles); 254 for(int i = 0; i < services.length; i++) { 255 opens = (Set)requiredServices.get(services[i]); 256 if(opens != null && !opens.isEmpty()) { 257 xb.appendElement("link").appendAttr("id", i + 1).endElement(false); 258 xb.appendElement("required"); 259 XmlHelper.xmlFormatServices(new TvService[] {services[i]}, xb, false, true, false, null, profiles); 260 xb.closeElement("required"); 261 xb.appendElement("opens"); 262 XmlHelper.xmlFormatServices((TvService[])opens.toArray(new TvService[opens.size()]), xb, false, true, false, null, profiles); 263 xb.closeElement("opens"); 264 xb.closeElement("link"); 265 } 266 } 253 267 xb.closeElement("required-services"); 254 268 } 255 269 256 270 public boolean lockRequest(int successFactor, CamdNetMessage req) { 257 SidEntry se; 258 if(req.getProfileName() == null) se = new SidEntry(req.getServiceId(), defaultProfile); // todo259 elsese = new SidEntry(req);271 272 if(req.getProfileName() == null) req.setProfileName(config.getProfileNameById(req.getNetworkId(), req.getCaId())); 273 SidEntry se = new SidEntry(req); 260 274 261 275 if(sidLockMap.containsKey(se)) { // linked request already in progress … … 301 315 public void onRequest(int successFactor, CamdNetMessage req) { 302 316 if(successFactor == -1) return; // can't succeed - never create locks 303 SidEntry se; 304 if(req.getProfileName() == null) se = new SidEntry(req.getServiceId(), defaultProfile); // todo 305 else se = new SidEntry(req); 317 if(req.getProfileName() == null) req.setProfileName(config.getProfileNameById(req.getNetworkId(), req.getCaId())); 318 SidEntry se = new SidEntry(req); 306 319 if(sidLockMap.containsKey(se)) return; // already locked 307 320 … … 333 346 } else { // reply might match locked undecodable requests 334 347 335 if(req.getProfileName() == null) { // todo - clusteredcache format doesn't include profile info, guess wildly 336 se = new SidEntry(req.getServiceId(), defaultProfile); 337 } else se = new SidEntry(req); 348 if(req.getProfileName() == null) req.setProfileName(config.getProfileNameById(req.getNetworkId(), req.getCaId())); 349 se = new SidEntry(req); 338 350 339 351 Set links = (Set)sidLinksMap.get(se); … … 402 414 links.remove(se2); 403 415 boolean removed = (sidLinksMap.remove(se1) != null || sidLinksMap.remove(se2) != null); 404 if(removed) linksChanged = true; 416 if(removed) { 417 linksChanged = true; 418 refreshAddedSet(); 419 } 405 420 } 406 421 407 422 private void reportAddedService(CamdNetMessage req, CamdNetMessage origReq) { 408 423 String profileName = req.getProfileName(); 409 if(profileName == null) profileName = origReq.getProfileName(); // todo410 if(profileName == null) profileName = defaultProfile;411 424 TvService ts1 = config.getService(profileName, origReq.getServiceId()); 412 425 Set services = (Set)requiredServices.get(ts1); … … 426 439 } 427 440 441 private void refreshAddedSet() { 442 SidEntry se; TvService ts; Set retained = new HashSet(); 443 for(Iterator iter = requiredServices.keySet().iterator(); iter.hasNext(); ) { 444 ts = (TvService)iter.next(); 445 se = new SidEntry(ts.getId(), ts.getProfileName()); 446 if(!sidLinksMap.containsKey(se)) iter.remove(); // service is no longer linked 447 else retained.addAll((Set)requiredServices.get(ts)); 448 } 449 Set added; String profileName; ServiceMapping sm; 450 for(Iterator iter = addedServices.keySet().iterator(); iter.hasNext(); ) { 451 profileName = (String)iter.next(); 452 added = (Set)addedServices.get(profileName); 453 for(Iterator i = added.iterator(); i.hasNext(); ) { 454 sm = (ServiceMapping)i.next(); 455 ts = config.getService(profileName, sm); 456 if(!retained.contains(ts)) { 457 i.remove(); 458 logger.info("Linked service no longer available: " + ts); 459 // config.getConnManager().cwsLostService(null, ts); // todo 460 } 461 } 462 if(added.isEmpty()) iter.remove(); 463 } 464 } 465 428 466 public Set getServicesForProfile(String profileName) { 429 467 if(!addedServices.containsKey(profileName)) return Collections.EMPTY_SET; -
trunk/src/com/bowman/cardserv/rmi/AbstractStatus.java
r1 r44 15 15 16 16 public void setProperty(String name, String value) { 17 data.setProperty(name, value);17 if(value != null) data.setProperty(name, value); 18 18 } 19 19 -
trunk/src/com/bowman/cardserv/rmi/RemoteHandler.java
r43 r44 535 535 re.setProperty("time", String.valueOf(transaction.getDuration())); 536 536 re.setProperty("flags", transaction.getFlags()); 537 re.setProperty("filtered-by", transaction.getFilteredBy()); 537 538 re.setProperty("service", transaction.getService().getName() + " (" + transaction.getService().getProfileName() + 538 539 ":" + Integer.toHexString(sid) + ")"); -
trunk/src/com/bowman/cardserv/session/EcmTransaction.java
r24 r44 53 53 for(Iterator iter = trFlags.iterator(); iter.hasNext();) sb.append(iter.next()); 54 54 return sb.toString(); 55 } 56 57 public String getFilteredBy() { 58 return request.getFilteredBy(); 55 59 } 56 60 -
trunk/src/com/bowman/cardserv/session/ExtNewcamdSession.java
r43 r44 23 23 24 24 private CardData mainCard; 25 private int mainCaId ;25 private int mainCaId, mainNetworkId; 26 26 private Integer[] mergedProviders; 27 27 … … 89 89 if(card.getCaId() == mainCaId && mergedProviders != null) card = CardData.createMergedData(card, mergedProviders); 90 90 91 if(au) this.mainCard = card; 92 else this.mainCard = new CardData(card.getData(true)); 91 if(au) { 92 mainCard = card; 93 mainNetworkId = auConn.getProfile().getNetworkId(); 94 } else mainCard = new CardData(card.getData(true)); 93 95 94 96 CamdNetMessage cardDataMsg = new CamdNetMessage(MSG_CARD_DATA); … … 176 178 } else if(msg.isEmm()) { 177 179 if(mainCard != null) { 178 msg.setCaId(mainCard.getCaId()); 180 msg.setCaId(mainCard.getCaId()); 179 181 msg.setProviderIdent(msg.getProviderFromHdr()); 180 182 181 183 CaidProviderPair pair = new CaidProviderPair(mainCard.getCaId(), msg.getProviderIdent()); 182 if(!sentData.containsKey(pair)) 183 logger.warning("User '" + user + "' sent request for ca-id/provider-ident not previously communicated: " + pair); 184 else msg.setNetworkId(((CaProfile)sentData.get(pair)).getNetworkId()); 184 if(!sentData.containsKey(pair)) { 185 // not able to determine profile target for emm based on caid and ident in header (probably normal, no ident associated with emms?) 186 // obtain profile from the card data context instead 187 msg.setNetworkId(mainNetworkId); 188 } else msg.setNetworkId(((CaProfile)sentData.get(pair)).getNetworkId()); 185 189 } 186 190 } -
trunk/src/com/bowman/cardserv/session/NewcamdSession.java
r43 r44 415 415 if(msg != null) { 416 416 msgCount++; 417 if(msg.isEcm()) ecmCount++; 418 else if(msg.isEmm()) emmCount++; 417 if(msg.isEcm()) { 418 ecmCount++; 419 420 if(msg.getProviderIdent() == - 1 && !noValidation) { // attempt to get provider ident from header if port is set to validating 421 if(msg.getProviderFromHdr() != 0) msg.setProviderIdent(msg.getProviderFromHdr()); // nonzero value, probably a real ident regardless of client 422 else { 423 // value is 0, could be ident 0 or just nothing set (significant difference for later handling) 424 if("CCcam".equals(clientId)) msg.setProviderIdent(msg.getProviderFromHdr()); 425 // todo add any other clients that specify ident in hdr even for old newcamd 426 } 427 } 428 } else if(msg.isEmm()) emmCount++; 419 429 else if(msg.isKeepAlive()) keepAliveCount++; 420 if(card != null) { 421 msg.setProviderContext(card.getProviders()); 422 } 430 if(card != null) msg.setProviderContext(card.getProviders()); 423 431 msg.setCaId(listenPort.getProfile().getCaId()); 424 if(!noValidation) msg.setProviderIdent(msg.getProviderFromHdr());425 432 msg.setNetworkId(listenPort.getProfile().getNetworkId()); 426 433 } -
trunk/src/com/bowman/cardserv/web/XmlHelper.java
r38 r44 1129 1129 xb.appendAttr("ecm-size", event.getProperty("ecm-size")); 1130 1130 if(event.getProperty("cw") != null) xb.appendAttr("cw", event.getProperty("cw")); 1131 // if(event.getProperty("provider-ident") != null) xb.appendAttr("provider-ident", event.getProperty("provider-ident"));1132 1131 if(event.getProperty("ext-newcamd") != null) xb.appendAttr("ext-newcamd", event.getProperty("ext-newcamd")); 1133 1132 xb.appendAttr("session-id", event.getProperty("id")); … … 1140 1139 xb.appendAttr("time", event.getProperty("time")); 1141 1140 xb.appendAttr("flags", event.getProperty("flags")); 1141 if(event.getProperty("filtered-by") != null) xb.appendAttr("filtered-by", event.getProperty("filtered-by")); 1142 1142 1143 1143 if(cwsLog) xb.appendAttr("user-name", event.getMessage());
Note:
See TracChangeset
for help on using the changeset viewer.