org.pf.security.authentication
Class LocationCredentials

java.lang.Object
  extended by org.pf.security.authentication.LocationCredentials

public class LocationCredentials
extends Object

Holds the userId and a password for a collection of URL patterns.

Version:
1.0
Author:
Manfred Duchrow

Constructor Summary
LocationCredentials(String userId, String password)
          Initialize the new instance with a userId and corresponding passwords.
LocationCredentials(String realm, String userId, String password)
          Initialize the new instance with a userId and corresponding passwords.
 
Method Summary
 void addPattern(String pattern)
          Adds the given pattern to the URL patterns that can be accessed with this object's authentication credentials.
 void addPattern(org.pf.text.StringPattern pattern)
          Adds the given pattern to the URL patterns that can be accessed with this object's authentication credentials.
 boolean appliesTo(String realm, String url)
          Returns true if the given realm and URL match the settings in this object.
 boolean appliesToRealm(String realm)
          Returns true if the given realm matches the realm name of this object.
 boolean appliesToURL(String url)
          Returns true if the given URL matches any of the underlying patterns.
 PasswordAuthentication getPasswordAuthentication()
          Returns the password based authentication data.
 String getRealm()
          Returns the realm this credentials apply to
 void setRealm(String realm)
          Sets the realm this credentials apply to
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationCredentials

public LocationCredentials(String userId,
                           String password)
Initialize the new instance with a userId and corresponding passwords. URL patterns can be added later with method addPattern().

Parameters:
userId - The userId to be used for authentication
password - The password to be used for authentication

LocationCredentials

public LocationCredentials(String realm,
                           String userId,
                           String password)
Initialize the new instance with a userId and corresponding passwords. URL patterns can be added later with method addPattern().

Parameters:
realm - The realm that is accessible with the given credentials
userId - The userId to be used for authentication
password - The password to be used for authentication
Method Detail

getPasswordAuthentication

public PasswordAuthentication getPasswordAuthentication()
Returns the password based authentication data.


getRealm

public String getRealm()
Returns the realm this credentials apply to


setRealm

public void setRealm(String realm)
Sets the realm this credentials apply to


addPattern

public void addPattern(String pattern)
Adds the given pattern to the URL patterns that can be accessed with this object's authentication credentials.

Parameters:
pattern - A URL pattern that might contain '*' as wildcards

addPattern

public void addPattern(org.pf.text.StringPattern pattern)
Adds the given pattern to the URL patterns that can be accessed with this object's authentication credentials.

Parameters:
pattern - A URL pattern that might contain '*' as wildcards

appliesTo

public boolean appliesTo(String realm,
                         String url)
Returns true if the given realm and URL match the settings in this object.


appliesToURL

public boolean appliesToURL(String url)
Returns true if the given URL matches any of the underlying patterns.


appliesToRealm

public boolean appliesToRealm(String realm)
Returns true if the given realm matches the realm name of this object.



Copyright © 2013 Manfred Duchrow Consulting & Software. All Rights Reserved.