uk.ac.starlink.table.jdbc

## Class TextModelsAuthenticator

- java.lang.Object
- - uk.ac.starlink.table.jdbc.TextModelsAuthenticator

- All Implemented Interfaces:
    JDBCAuthenticator

      public class TextModelsAuthenticator
      extends java.lang.Object
      implements JDBCAuthenticator

  JDBC authenticator which keeps its data in the models of text GUI components (`Document` objects). The advantage of this is that multiple GUI compoents can share the same data, and changing the password in one will have the effect of changing it in all.
  Since:
    13 Feb 2006

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextModelsAuthenticator()` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String[]` | `authenticate()` Obtains username and password.
    `javax.swing.text.Document` | `getPasswordDocument()` Returns the text model for the password string.
    `javax.swing.text.Document` | `getUserDocument()` Returns the text model for the username string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TextModelsAuthenticator

          public TextModelsAuthenticator()

      Constructor.

  - ### Method Detail

    - #### getUserDocument

          public javax.swing.text.Document getUserDocument()

      Returns the text model for the username string.
      Returns:
        username document

    - #### getPasswordDocument

          public javax.swing.text.Document getPasswordDocument()

      Returns the text model for the password string.
      Returns:
        password document

    - #### authenticate

          public java.lang.String[] authenticate()

      Description copied from interface: `JDBCAuthenticator`
      Obtains username and password. The return value is a two-element array containing the username and password to be used, in that order. Either or both of these may be `null`.
      Specified by:
        `authenticate` in interface `JDBCAuthenticator`
      Returns:
        `String[]{username,password}`