All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hirezapi.session.EnvironmentalSessionStorage Maven / Gradle / Ivy

The newest version!
package hirezapi.session;

import hirezapi.Platform;
import hirezapi.json.SessionCreation;

import java.util.LinkedHashMap;
import java.util.Map;

public class EnvironmentalSessionStorage implements SessionStorage {
  private final Map session = new LinkedHashMap<>();

  @Override
  public String set(Platform platform, SessionCreation session) {
    return this.session.put(platform, session.getSessionId());
  }

  @Override
  public String get(Platform platform) {
    return this.session.get(platform);
  }

  @Override
  public boolean remove(Platform platform) {
    return this.session.remove(platform) != null;
  }

  @Override
  public boolean contains(Platform platform) {
    return this.session.containsKey(platform);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy