Class UsernamePasswordStore

java.lang.Object
com.sun.enterprise.security.UsernamePasswordStore

public final class UsernamePasswordStore extends Object
This class is used to share information between either of the following scenarios 1. Different points of execution of a single thread 2. Different threads that wish to share the username and password information Which of the above two condition is applicable depends upon the system property key "com.sun.appserv.iiopclient.perthreadauth"; When set to true, scenario #1 above applies and the username/password information is not shared between threads. When set to false, scenario #2 above applies and the username/password information stored by one thread is global and visible to all threads.
  • Method Summary

    Modifier and Type
    Method
    Description
    static char[]
    Returns the password, that was previously stored.
    static String
    Returns the username, that was previously stored.
    static void
    Clears the username and password, that might have been previously stored, either globally or locally to each thread.
    static void
    Clears the username and password only is they were stored locally to each thread
    static void
    set(String username, char[] password)
    This method sets the username and password as thread-local or global variable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • set

      public static void set(String username, char[] password)
      This method sets the username and password as thread-local or global variable
      Parameters:
      username -
      password -
    • reset

      public static void reset()
      Clears the username and password, that might have been previously stored, either globally or locally to each thread.
    • resetThreadLocalOnly

      public static void resetThreadLocalOnly()
      Clears the username and password only is they were stored locally to each thread
    • getUsername

      public static String getUsername()
      Returns the username, that was previously stored.
      Returns:
      The username set previously or null if not set
    • getPassword

      public static char[] getPassword()
      Returns the password, that was previously stored.
      Returns:
      The password set previously or null if not set