/** * {@inheritDoc} * @see org.jboss.web.tomcat.service.session.distributedcache.ispn.SessionAttributeStorage#store(org.infinispan.atomic.AtomicMap, org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData) */ @Override public void store(Map<Object, Object> map, OutgoingAttributeGranularitySessionData sessionData) { Map<String, Object> modified = sessionData.getModifiedSessionAttributes(); if (modified != null) { for (Map.Entry<String, Object> entry: modified.entrySet()) { map.put(entry.getKey(), this.marshaller.marshal(entry.getValue())); } } Set<String> removed = sessionData.getRemovedSessionAttributes(); if (removed != null) { for (String attribute: removed) { map.remove(attribute); } } }
public void storeSipSessionAttributes(Fqn<String> fqn, OutgoingAttributeGranularitySessionData sessionData) { Map<String, Object> map = sessionData.getModifiedSessionAttributes(); if (map != null) { // Duplicate the map with marshalled values Map<Object, Object> marshalled = new HashMap<Object, Object>(map .size()); for (Map.Entry<String, Object> entry : map.entrySet()) { marshalled.put(entry.getKey(), getMarshalledValue(entry .getValue())); } if(log_.isDebugEnabled()) { String attribLog = "\n"; for(String name : sessionData.getModifiedSessionAttributes().keySet()) { attribLog += "ATTRIBUTE(" + name + ") -> " + sessionData.getModifiedSessionAttributes().get(name) + "\n"; } log_.debug(attribLog); } cacheWrapper_.put(fqn, marshalled); } Set<String> removed = sessionData.getRemovedSessionAttributes(); if (removed != null) { for (String key : removed) { cacheWrapper_.remove(fqn, key); } } }
public void storeSipApplicationSessionAttributes( Fqn<String> fqn, OutgoingAttributeGranularitySessionData sessionData) { Map<String, Object> map = sessionData.getModifiedSessionAttributes(); if (map != null) { // Duplicate the map with marshalled values Map<Object, Object> marshalled = new HashMap<Object, Object>(map .size()); for (Map.Entry<String, Object> entry : map.entrySet()) { marshalled.put(entry.getKey(), getMarshalledValue(entry .getValue())); } if(log_.isDebugEnabled()) { String attribLog = "\n"; for(String name : sessionData.getModifiedSessionAttributes().keySet()) { attribLog += "ATTRIBUTE(" + name + ") -> " + sessionData.getModifiedSessionAttributes().get(name) + "\n"; } log_.debug(attribLog); } cacheWrapper_.put(fqn, marshalled); } Set<String> removed = sessionData.getRemovedSessionAttributes(); if (removed != null) { for (String key : removed) { cacheWrapper_.remove(fqn, key); } } }