Hello i need a user-based storage for objects. I could use javax.xml.bind.annotation for a XML based serialization to store/load those objects, but what storage is intended to be used?
Bandana? ActiveObject?
For the purpose of those objects: They are stored temporary and removed after a specific ammount of time (timeout) or on a specific action.
Community moderators have prevented the ability to post new answers.
Well i have chosen bandana with a own user context for now:
public class UserContext implements KeyedBandanaContext { private String userName; public UserContext(String userName) { this.userName = userName; } @Override public String getContextKey() { return this.userName; } @Override public BandanaContext getParentContext() { return null; //To change body of implemented methods use File | Settings | File Templates. } @Override public boolean hasParentContext() { return false; //To change body of implemented methods use File | Settings | File Templates. } }
And using bandana with
User user = AuthenticatedUserThreadLocal.getUser(); UserContext userContext = new UserContext(user.name); bandanaManager.getValue(userContext,"somekey"); bandanaManager.setValue(userContext,"somekey", "somevalue");
How long is 'temporary'?
Sounds like storing the data in the HTTP session might be a solution too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hmm, well the livetime of the session is the maximum, thats for sure. So lets say the maximum ammount of time could be 3 hours (max).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how would i actually use the session as a storage, is there an API Stefan?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.