org.eclipse.jetty.security

## Class PropertyUserStore

- java.lang.Object
- - org.eclipse.jetty.util.component.AbstractLifeCycle
  - - org.eclipse.jetty.security.PropertyUserStore

- All Implemented Interfaces:
    LifeCycle

      public class PropertyUserStore
      extends AbstractLifeCycle

  PropertyUserStore This class monitors a property file of the format mentioned below and notifies registered listeners of the changes to the the given file.

        username: password [,rolename ...]

  Passwords may be clear text, obfuscated or checksummed. The class com.eclipse.Util.Password should be used to generate obfuscated passwords or password checksums. If DIGEST Authentication is used, the password must be in a recoverable format, either plain text or OBF:.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `PropertyUserStore.UserListener` UserListener

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `AbstractLifeCycle.AbstractLifeCycleListener`

    - ### Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

      `LifeCycle.Listener`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PropertyUserStore()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doStart()` Depending on the value of the refresh interval, this method will either start up a scanner thread that will monitor the properties file for changes after it has initially loaded it.
    `protected void` | `doStop()`
    `String` | `getConfig()`
    `Resource` | `getConfigResource()` returns the resource associated with the configured properties file, creating it if necessary
    `int` | `getRefreshInterval()` refresh interval in seconds for how often the properties file should be checked for changes
    `UserIdentity` | `getUserIdentity(String userName)`
    `void` | `registerUserListener(PropertyUserStore.UserListener listener)` registers a listener to be notified of the contents of the property file
    `void` | `setConfig(String config)`
    `void` | `setRefreshInterval(int msec)` sets the refresh interval (in seconds)

    - ### Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

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

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

- - ### Constructor Detail

    - #### PropertyUserStore

          public PropertyUserStore()

  - ### Method Detail

    - #### getConfig

          public String getConfig()

    - #### setConfig

          public void setConfig(String config)

    - #### getUserIdentity

          public UserIdentity getUserIdentity(String userName)

    - #### getConfigResource

          public Resource getConfigResource()
                                     throws IOException

      returns the resource associated with the configured properties file, creating it if necessary
      Throws:
        `IOException`

    - #### setRefreshInterval

          public void setRefreshInterval(int msec)

      sets the refresh interval (in seconds)

    - #### getRefreshInterval

          public int getRefreshInterval()

      refresh interval in seconds for how often the properties file should be checked for changes

    - #### doStart

          protected void doStart()
                          throws Exception

      Depending on the value of the refresh interval, this method will either start up a scanner thread that will monitor the properties file for changes after it has initially loaded it. Otherwise the users will be loaded and there will be no active monitoring thread so changes will not be detected.
      Overrides:
        `doStart` in class `AbstractLifeCycle`
      Throws:
        `Exception`
      See Also:
        `AbstractLifeCycle.doStart()`

    - #### doStop

          protected void doStop()
                         throws Exception

      Overrides:
        `doStop` in class `AbstractLifeCycle`
      Throws:
        `Exception`
      See Also:
        `AbstractLifeCycle.doStop()`

    - #### registerUserListener

          public void registerUserListener(PropertyUserStore.UserListener listener)

      registers a listener to be notified of the contents of the property file

Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.