Codota Logo
SecureStorageManager
Code IndexAdd Codota to your IDE (free)

How to use
SecureStorageManager
in
org.phenotips.data.securestorage

Best Java code snippets using org.phenotips.data.securestorage.SecureStorageManager (Showing top 19 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: phenotips/phenotips

  @Override
  public void onEvent(Event event, Object source, Object data)
  {
    XWikiDocument doc = (XWikiDocument) source;
    String patientId = doc.getDocumentReference().getName();
    this.pushStorageManager.deletePatientPushInfo(patientId);
  }
}
origin: phenotips/phenotips

protected TokenStatus checkUserToken(String userName, String serverName, String token, long tokenLifeTimeInDays)
{
  if (token == null) {
    return TokenStatus.INVALID;
  }
  LocalLoginToken storedToken = this.storageManager.getLocalLoginToken(userName, serverName);
  if (storedToken == null) {
    return TokenStatus.INVALID;
  }
  // this.logger.debug("Expected token for user [{}]: [{}] aged [{}] out of [{}]",
  // userName, storedToken.getLoginToken(), storedToken.getTokenAgeInDays(), tokenLifeTimeInDays);
  if (!token.equals(storedToken.getLoginToken())) {
    this.logger.warn("Stored token does not match provided token");
    return TokenStatus.INVALID;
  }
  if (tokenLifeTimeInDays != 0 && (storedToken.getTokenAgeInDays() > tokenLifeTimeInDays)) {
    this.logger.warn("Stored token has expired");
    return TokenStatus.EXPIRED;
  }
  return TokenStatus.VALID;
}
origin: org.phenotips/patient-data-sharing-push-api

@Override
public PatientPushHistory getPatientPushHistory(String localPatientID, String remoteServerIdentifier)
{
  PatientPushedToInfo pushInfo = this.storageManager.getPatientPushInfo(localPatientID, remoteServerIdentifier);
  PatientPushHistory history = (pushInfo == null) ? null : new DefaultPatientPushHistory(pushInfo);
  return history;
}
origin: phenotips/phenotips

@Override
public PushServerSendPatientResponse sendPatient(String patientID, String exportFieldListJSON, String patientState,
  String groupName, String remoteGUID, String remoteServerIdentifier, String remoteUserName, String password)
{
  Patient patient = getPatientByID(patientID, "push");
  if (patient == null) {
    return new DefaultPushServerSendPatientResponse(DefaultPushServerResponse.generateActionFailedJSON());
  }
  Set<String> exportFields = parseJSONArrayIntoSet(exportFieldListJSON);
  JSONObject patientStateJSON = this.parsePatientStateToJSON(patientState);
  PushServerSendPatientResponse response = this.internalService.sendPatient(patient, exportFields,
    patientStateJSON, groupName, remoteGUID, remoteServerIdentifier, remoteUserName, password, null);
  if (response != null && response.isSuccessful()) {
    this.storageManager.storePatientPushInfo(patient.getId(), remoteServerIdentifier,
      response.getRemotePatientGUID(), response.getRemotePatientID(), response.getRemotePatientURL());
  }
  return response;
}
origin: org.phenotips/patient-data-sharing-push-api

protected void storeUserData(String remoteServerIdentifier, String remoteUser, String loginToken)
{
  String localUserName = getLocalUserName();
  this.storageManager.storeRemoteLoginData(localUserName, remoteServerIdentifier, remoteUser, loginToken);
}
origin: phenotips/phenotips

protected RemoteLoginData getStoredData(String remoteServerIdentifier)
{
  String localUserName = getLocalUserName();
  return this.storageManager.getRemoteLoginData(localUserName, remoteServerIdentifier);
}
origin: org.phenotips/patient-data-sharing-push-api

protected void removeUserData(String remoteServerIdentifier)
{
  String localUserName = getLocalUserName();
  this.storageManager.removeRemoteLoginData(localUserName, remoteServerIdentifier);
}
origin: org.phenotips/patient-data-sharing-receiver-api

this.logger.debug("Remote server name: [{}]", serverName);
this.storageManager.storeLocalLoginToken(userName, serverName, token);
origin: org.phenotips/patient-data-sharing-receiver-api

String sourceServerName = getRemoteServerName(serverConfig, request);
String patientGUID = getPatientGUID(affectedPatient);
this.storageManager.storePatientSourceServerInfo(patientGUID, sourceServerName);
origin: org.phenotips/patient-data-sharing-push-api

@Override
public PushServerSendPatientResponse sendPatient(String patientID, String exportFieldListJSON, String patientState,
  String groupName, String remoteGUID, String remoteServerIdentifier, String remoteUserName, String password)
{
  Patient patient = getPatientByID(patientID, "push");
  if (patient == null) {
    return new DefaultPushServerSendPatientResponse(DefaultPushServerResponse.generateActionFailedJSON());
  }
  Set<String> exportFields = parseJSONArrayIntoSet(exportFieldListJSON);
  JSONObject patientStateJSON = this.parsePatientStateToJSON(patientState);
  PushServerSendPatientResponse response = this.internalService.sendPatient(patient, exportFields,
    patientStateJSON, groupName, remoteGUID, remoteServerIdentifier, remoteUserName, password, null);
  if (response != null && response.isSuccessful()) {
    this.storageManager.storePatientPushInfo(patient.getDocument().getName(), remoteServerIdentifier,
      response.getRemotePatientGUID(), response.getRemotePatientID(), response.getRemotePatientURL());
  }
  return response;
}
origin: phenotips/phenotips

protected void storeUserData(String remoteServerIdentifier, String remoteUser, String loginToken)
{
  String localUserName = getLocalUserName();
  this.storageManager.storeRemoteLoginData(localUserName, remoteServerIdentifier, remoteUser, loginToken);
}
origin: org.phenotips/patient-data-sharing-push-api

protected RemoteLoginData getStoredData(String remoteServerIdentifier)
{
  String localUserName = getLocalUserName();
  return this.storageManager.getRemoteLoginData(localUserName, remoteServerIdentifier);
}
origin: phenotips/phenotips

protected void removeUserData(String remoteServerIdentifier)
{
  String localUserName = getLocalUserName();
  this.storageManager.removeRemoteLoginData(localUserName, remoteServerIdentifier);
}
origin: phenotips/phenotips

this.logger.debug("Remote server name: [{}]", serverName);
this.storageManager.storeLocalLoginToken(userName, serverName, token);
origin: phenotips/phenotips

String sourceServerName = getRemoteServerName(serverConfig, request);
String patientGUID = getPatientGUID(affectedPatient);
this.storageManager.storePatientSourceServerInfo(patientGUID, sourceServerName);
origin: phenotips/phenotips

@Override
public PushServerSendPatientResponse sendPatient(String patientID, String exportFieldListJSON, String patientState,
  String groupName, String remoteGUID, String remoteServerIdentifier)
{
  Patient patient = getPatientByID(patientID, "push");
  if (patient == null) {
    return new DefaultPushServerSendPatientResponse(DefaultPushServerResponse.generateActionFailedJSON());
  }
  RemoteLoginData storedData = getStoredData(remoteServerIdentifier);
  if (storedData == null || storedData.getRemoteUserName() == null || storedData.getLoginToken() == null) {
    return new DefaultPushServerSendPatientResponse(
      DefaultPushServerResponse.generateIncorrectCredentialsJSON());
  }
  Set<String> exportFields = parseJSONArrayIntoSet(exportFieldListJSON);
  JSONObject patientStateJSON = this.parsePatientStateToJSON(patientState);
  PushServerSendPatientResponse response = this.internalService.sendPatient(patient, exportFields,
    patientStateJSON, groupName, remoteGUID, remoteServerIdentifier, storedData.getRemoteUserName(), null,
    storedData.getLoginToken());
  if (response != null && response.isSuccessful()) {
    this.storageManager.storePatientPushInfo(patient.getId(), remoteServerIdentifier,
      response.getRemotePatientGUID(), response.getRemotePatientID(), response.getRemotePatientURL());
  }
  return response;
}
origin: phenotips/phenotips

@Override
public PatientPushHistory getPatientPushHistory(String localPatientID, String remoteServerIdentifier)
{
  PatientPushedToInfo pushInfo = this.storageManager.getPatientPushInfo(localPatientID, remoteServerIdentifier);
  PatientPushHistory history = (pushInfo == null) ? null : new DefaultPatientPushHistory(pushInfo);
  return history;
}
origin: org.phenotips/patient-data-sharing-receiver-api

protected TokenStatus checkUserToken(String userName, String serverName, String token, long tokenLifeTimeInDays)
{
  if (token == null) {
    return TokenStatus.INVALID;
  }
  LocalLoginToken storedToken = this.storageManager.getLocalLoginToken(userName, serverName);
  if (storedToken == null) {
    return TokenStatus.INVALID;
  }
  // this.logger.debug("Expected token for user [{}]: [{}] aged [{}] out of [{}]",
  // userName, storedToken.getLoginToken(), storedToken.getTokenAgeInDays(), tokenLifeTimeInDays);
  if (!token.equals(storedToken.getLoginToken())) {
    this.logger.warn("Stored token does not match provided token");
    return TokenStatus.INVALID;
  }
  if (tokenLifeTimeInDays != 0 && (storedToken.getTokenAgeInDays() > tokenLifeTimeInDays)) {
    this.logger.warn("Stored token has expired");
    return TokenStatus.EXPIRED;
  }
  return TokenStatus.VALID;
}
origin: org.phenotips/patient-data-sharing-push-api

@Override
public PushServerSendPatientResponse sendPatient(String patientID, String exportFieldListJSON, String patientState,
  String groupName, String remoteGUID, String remoteServerIdentifier)
{
  Patient patient = getPatientByID(patientID, "push");
  if (patient == null) {
    return new DefaultPushServerSendPatientResponse(DefaultPushServerResponse.generateActionFailedJSON());
  }
  RemoteLoginData storedData = getStoredData(remoteServerIdentifier);
  if (storedData == null || storedData.getRemoteUserName() == null || storedData.getLoginToken() == null) {
    return new DefaultPushServerSendPatientResponse(
      DefaultPushServerResponse.generateIncorrectCredentialsJSON());
  }
  Set<String> exportFields = parseJSONArrayIntoSet(exportFieldListJSON);
  JSONObject patientStateJSON = this.parsePatientStateToJSON(patientState);
  PushServerSendPatientResponse response = this.internalService.sendPatient(patient, exportFields,
    patientStateJSON, groupName, remoteGUID, remoteServerIdentifier, storedData.getRemoteUserName(), null,
    storedData.getLoginToken());
  if (response != null && response.isSuccessful()) {
    this.storageManager.storePatientPushInfo(patient.getDocument().getName(), remoteServerIdentifier,
      response.getRemotePatientGUID(), response.getRemotePatientID(), response.getRemotePatientURL());
  }
  return response;
}
org.phenotips.data.securestorageSecureStorageManager

Javadoc

Used to store data in a way inaccessible from any of the wiki pages by regular users without programming rights.

Most sensitive information stored is remote user names and login tokens, which can be used to push data to a remote server without a password.

Most used methods

  • deletePatientPushInfo
  • getLocalLoginToken
  • getPatientPushInfo
  • getRemoteLoginData
  • removeRemoteLoginData
  • storeLocalLoginToken
  • storePatientPushInfo
  • storePatientSourceServerInfo
  • storeRemoteLoginData

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now