net.plsar.model.NetworkSession Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plsar-java Show documentation
Show all versions of plsar-java Show documentation
PLSA.R is an Open Source Server + Framework Environment
for small to large scale requirements. There are no static
references, no file reads, access to static fields per request.
Everything is either cached and or instantiated on the fly.
PLSA.R runs via one command so there are no .war files to deploy,
no additional plugins to install it is a simple yet powerful
alternative to container deployment environments.
package net.plsar.model;
import net.plsar.resources.ServerResources;
import java.util.HashMap;
import java.util.Map;
public class NetworkSession {
String guid;
Long time;
Map attributes;
public NetworkSession(Long time, String guid, ServerResources serverResources){
this.guid = guid;
this.time = time;
this.attributes = new HashMap<>();
}
public NetworkSession(Long time, String guid){
this.guid = guid;
this.time = time;
this.attributes = new HashMap<>();
}
public NetworkSession(Long time, ServerResources serverResources){
this.guid = serverResources.getGuid(24);
this.time = time;
this.attributes = new HashMap<>();
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public Long getTime() {
return time;
}
public void setTime(Long time) {
this.time = time;
}
public boolean set(String key, Object value){
this.attributes.put(key, value);
return true;
}
public Object get(String key){
if(this.attributes.containsKey(key)){
return this.attributes.get(key);
}
return "";
}
public boolean remove(String key){
this.attributes.remove(key);
return true;
}
public Map getAttributes(){
return this.attributes;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy