public void storeSipSessionAttributes(Fqn<String> fqn, OutgoingSessionGranularitySessionData sessionData) { if(sessionData.getSessionAttributes() != null) { if (log_.isDebugEnabled()) { log_.debug("storeSipSessionAttributes(): putting sip session attributes " + sessionData.getSessionAttributes()); String attribLog = "\n"; for(String name : sessionData.getSessionAttributes().keySet()) { attribLog += "ATTRIBUTE(" + name + ") -> " + sessionData.getSessionAttributes().get(name) + "\n"; } log_.debug(attribLog); } cacheWrapper_.put(fqn, ATTRIBUTE_KEY.toString(), getMarshalledValue(sessionData.getSessionAttributes())); } }
public void storeSipApplicationSessionAttributes(Fqn<String> fqn, OutgoingSessionGranularitySessionData sessionData) { if(sessionData.getSessionAttributes() != null) { if (log_.isDebugEnabled()) { log_ .debug("storeSipApplicationSessionAttributes(): putting sip app session attributes " + sessionData.getSessionAttributes()); String attribLog = "\n"; for(String name : sessionData.getSessionAttributes().keySet()) { attribLog += "ATTRIBUTE(" + name + ") -> " + sessionData.getSessionAttributes().get(name) + "\n"; } log_.debug(attribLog); } cacheWrapper_.put(fqn, ATTRIBUTE_KEY.toString(), getMarshalledValue(sessionData.getSessionAttributes())); } }
@Override protected void storeSessionAttributes(Map<Object, Object> dataMap, OutgoingSessionGranularitySessionData sessionData) { if(log_.isTraceEnabled()) { Map<String, Object> attrs = sessionData.getSessionAttributes(); if(attrs != null) { for (Entry<String, Object> entry : attrs.entrySet()) { log_.trace("attribute key " + entry.getKey() + ", value=" + entry.getValue()); } } else { log_.trace("attributes null, not replicating"); } } super.storeSessionAttributes(dataMap, sessionData); } }
private byte[] writeSessionAttributes(OutgoingSessionGranularitySessionData session) throws IOException { Map<String, Object> attrs = session.getSessionAttributes(); if (attrs == null) { return null; } ObjectOutputStream oos = null; ByteArrayOutputStream bos = null; try { bos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(new BufferedOutputStream(bos)); oos.writeObject(new SimpleCachableMarshalledValue((Serializable) attrs)); oos.close(); return bos.toByteArray(); } finally { if (oos != null) { oos.close(); } if (bos != null) { bos.close(); } } }
/** * {@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, OutgoingSessionGranularitySessionData sessionData) { Map<String, Object> attributes = sessionData.getSessionAttributes(); if (attributes != null) { SessionMapEntry.ATTRIBUTES.put(map, this.marshaller.marshal(attributes)); } }