gov.nih.nlm.nls.util
Class PropertyAuthImpl

java.lang.Object
  extended by gov.nih.nlm.nls.util.Authenticator
      extended by gov.nih.nlm.nls.util.PropertyAuthImpl

public class PropertyAuthImpl
extends Authenticator

An http authenthicator that uses system properities for initialization. This http 1.1 authenticator is initialized using system properties:

nls.service.username
username to supply to service
nls.service.password
password to supply to service
   nls.service.username=<username>
   nls.service.password=<password>
 

Version:
$Id: PropertyAuthImpl.java,v 1.3 2005/05/24 13:40:01 wrogers Exp $
Author:
Willie Rogers

Field Summary
private  char[] password
           
private  java.lang.String username
           
 
Constructor Summary
PropertyAuthImpl()
           
 
Method Summary
 java.net.PasswordAuthentication getPasswordAuthentication()
          Get password authentication credentials.
 void setPassword(java.lang.String password)
          Set password from supplied string.
 void setPasswordViaProperty(java.util.Properties properties)
          Set password from user specified property.If property is null or not present use default property nls.service.password.
 void setUsername(java.lang.String username)
          Set username from supplied string.
 void setUsernameViaProperty(java.util.Properties properties)
          Set username from user specified property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

username

private java.lang.String username

password

private char[] password
Constructor Detail

PropertyAuthImpl

public PropertyAuthImpl()
Method Detail

setUsernameViaProperty

public void setUsernameViaProperty(java.util.Properties properties)
Set username from user specified property. If property is null or not present use default property nls.service.username.

Parameters:
properties - properties object

setPasswordViaProperty

public void setPasswordViaProperty(java.util.Properties properties)
Set password from user specified property.If property is null or not present use default property nls.service.password.

Parameters:
properties - properties object

setUsername

public void setUsername(java.lang.String username)
Set username from supplied string.

Parameters:
username - name of user.

setPassword

public void setPassword(java.lang.String password)
Set password from supplied string.

Parameters:
password - password of user.

getPasswordAuthentication

public java.net.PasswordAuthentication getPasswordAuthentication()
Description copied from class: Authenticator
Get password authentication credentials.

Overrides:
getPasswordAuthentication in class Authenticator
Returns:
a filled-in PasswordAuthentication instance.


NLS Projects