Changeset 152
- Timestamp:
- 06/23/11 14:36:55 (12 years ago)
- Location:
- trunk/src/com/bowman/cardserv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/bowman/cardserv/cws/CspCwsConnector.java
r11 r152 150 150 } 151 151 152 private void handleStatusUpdate(CspNetMessage msg, boolean full ) throws IOException {152 private void handleStatusUpdate(CspNetMessage msg, boolean full, boolean initial) throws IOException { 153 153 // notify service mappers 154 154 if(!msg.isEmpty()) { … … 158 158 updates = msg.getStatusUpdatesForKey(key); 159 159 if(updates != null) reportRemoteState(key, updates, full); 160 } 161 if(initial) { // remove profiles no longer available from the state before saving 162 for(Iterator iter = receivedState.keySet().iterator(); iter.hasNext(); ) { 163 key = (CspNetMessage.ProfileKey)iter.next(); 164 if(!keys.contains(key)) { 165 iter.remove(); 166 logger.warning("Profile no longer available: " + key); 167 CaProfile profile = config.getProfileById(key.onid, key.caid); 168 if(profile != null) { // remove local service mappings if removed remote profile had a corresponding local one 169 connManager.reportMultiStatus(this, profile, new ServiceMapping[0], true, false); // clear candecode 170 connManager.reportMultiStatus(this, profile, new ServiceMapping[0], false, false); // clear cannotdecode 171 } 172 } 173 } 160 174 } 161 175 saveRemoteState(); … … 272 286 } else { 273 287 remoteProxyId = msg.getOriginId(); 274 handleStatusUpdate(msg, true );288 handleStatusUpdate(msg, true, true); 275 289 276 290 if(remoteProxyId == config.getProxyOriginId()) { … … 308 322 break; 309 323 case CspNetMessage.TYPE_FULLSTATE: 310 handleStatusUpdate(msg, true );324 handleStatusUpdate(msg, true, false); 311 325 break; 312 326 case CspNetMessage.TYPE_INCRSTATE: 313 handleStatusUpdate(msg, false );327 handleStatusUpdate(msg, false, false); 314 328 break; 315 329 case CspNetMessage.TYPE_STATEACK: -
trunk/src/com/bowman/cardserv/session/AbstractSession.java
r142 r152 26 26 boolean userDebug; 27 27 28 Set allowedConnectors, mappedProfiles ;28 Set allowedConnectors, mappedProfiles, allowedProfiles = new HashSet(); 29 29 Map allowedServices, blockedServices; 30 30 int allowedRate; … … 141 141 allowedConnectors = um.getAllowedConnectors(user); 142 142 allowedRate = um.getAllowedEcmRate(user); 143 allowedProfiles = um.getAllowedProfiles(user); 143 144 if(allowedRate != -1) allowedRate = allowedRate * 1000; 144 145 if(um.isAdmin(user)) maxPending = 30; … … 188 189 189 190 if(interval < 60000) avgList.addRecord(now, (int)interval); // avoid extreme entries after standby/idletime 191 192 if(!allowedProfiles.isEmpty()) 193 if(!allowedProfiles.contains(profileName)) { 194 msg.setFilteredBy("Profile not allowed: " + profileName); 195 return false; 196 } 190 197 191 198 Set services;
Note:
See TracChangeset
for help on using the changeset viewer.