/** * Gets attribute names. * * @param id the id * @return the attribute names * @throws Exception the exception */ public Set<String> getAttributeNames(String id) throws Exception { return (Set<String>) executeOnKey(id, new GetAttributeNamesEntryProcessor()); }
/** * Gets attribute. * * @param sessionId the session id * @param attributeName the attribute name * @return the attribute * @throws Exception the exception */ Object getAttribute(String sessionId, String attributeName) throws Exception { GetAttributeEntryProcessor entryProcessor = new GetAttributeEntryProcessor(attributeName); return executeOnKey(sessionId, entryProcessor); }
private void doDeleteSession(String sessionId, boolean invalidate) throws Exception { DeleteSessionEntryProcessor entryProcessor = new DeleteSessionEntryProcessor(invalidate); executeOnKey(sessionId, entryProcessor); }
/** * Gets attribute. * * @param sessionId the session id * @param attributeName the attribute name * @return the attribute * @throws Exception the exception */ Object getAttribute(String sessionId, String attributeName) throws Exception { GetAttributeEntryProcessor entryProcessor = new GetAttributeEntryProcessor(attributeName); return executeOnKey(sessionId, entryProcessor); }
/** * Gets attribute names. * * @param id the id * @return the attribute names * @throws Exception the exception */ public Set<String> getAttributeNames(String id) throws Exception { return (Set<String>) executeOnKey(id, new GetAttributeNamesEntryProcessor()); }
private void doDeleteSession(String sessionId, boolean invalidate) throws Exception { DeleteSessionEntryProcessor entryProcessor = new DeleteSessionEntryProcessor(invalidate); executeOnKey(sessionId, entryProcessor); }
/** * Update attributes. * * @param id the id * @param updates the updates * @throws Exception the exception */ public void updateAttributes(String id, Map<String, Object> updates) throws Exception { SerializationService ss = sss.getSerializationService(); SessionUpdateEntryProcessor sessionUpdate = new SessionUpdateEntryProcessor(updates.size()); for (Map.Entry<String, Object> entry : updates.entrySet()) { String name = entry.getKey(); Object value = entry.getValue(); sessionUpdate.getAttributes().put(name, ss.toData(value)); } executeOnKey(id, sessionUpdate); }
/** * Update attributes. * * @param id the id * @param updates the updates * @throws Exception the exception */ public void updateAttributes(String id, Map<String, Object> updates) throws Exception { SerializationService ss = sss.getSerializationService(); SessionUpdateEntryProcessor sessionUpdate = new SessionUpdateEntryProcessor(updates.size()); for (Map.Entry<String, Object> entry : updates.entrySet()) { String name = entry.getKey(); Object value = entry.getValue(); sessionUpdate.getAttributes().put(name, ss.toData(value)); } executeOnKey(id, sessionUpdate); }
/** * Gets attributes. * * @param sessionId the session id * @return the attributes * @throws Exception the exception */ Set<Map.Entry<String, Object>> getAttributes(String sessionId) throws Exception { GetSessionStateEntryProcessor entryProcessor = new GetSessionStateEntryProcessor(); SessionState sessionState = (SessionState) executeOnKey(sessionId, entryProcessor); if (sessionState == null) { return null; } Map<String, Data> dataAttributes = sessionState.getAttributes(); Set<Map.Entry<String, Object>> attributes = new HashSet<Map.Entry<String, Object>>(dataAttributes.size()); for (Map.Entry<String, Data> entry : dataAttributes.entrySet()) { String key = entry.getKey(); Object value = sss.getSerializationService().toObject(entry.getValue()); attributes.add(new MapEntrySimple<String, Object>(key, value)); } return attributes; }
/** * Gets attributes. * * @param sessionId the session id * @return the attributes * @throws Exception the exception */ Set<Map.Entry<String, Object>> getAttributes(String sessionId) throws Exception { GetSessionStateEntryProcessor entryProcessor = new GetSessionStateEntryProcessor(); SessionState sessionState = (SessionState) executeOnKey(sessionId, entryProcessor); if (sessionState == null) { return null; } Map<String, Data> dataAttributes = sessionState.getAttributes(); Set<Map.Entry<String, Object>> attributes = new HashSet<Map.Entry<String, Object>>(dataAttributes.size()); for (Map.Entry<String, Data> entry : dataAttributes.entrySet()) { String key = entry.getKey(); Object value = sss.getSerializationService().toObject(entry.getValue()); attributes.add(new MapEntrySimple<String, Object>(key, value)); } return attributes; }
/** * Sets attribute. * * @param sessionId the session id * @param attributeName the attribute name * @param value the value * @throws Exception the exception */ void setAttribute(String sessionId, String attributeName, Object value) throws Exception { Data dataValue = (value == null) ? null : sss.getSerializationService().toData(value); SessionUpdateEntryProcessor sessionUpdateProcessor = new SessionUpdateEntryProcessor(attributeName, dataValue); executeOnKey(sessionId, sessionUpdateProcessor); }
/** * Sets attribute. * * @param sessionId the session id * @param attributeName the attribute name * @param value the value * @throws Exception the exception */ void setAttribute(String sessionId, String attributeName, Object value) throws Exception { Data dataValue = (value == null) ? null : sss.getSerializationService().toData(value); SessionUpdateEntryProcessor sessionUpdateProcessor = new SessionUpdateEntryProcessor(attributeName, dataValue); executeOnKey(sessionId, sessionUpdateProcessor); }