TrueLicense Core 1.33

de.schlichtherle.license
Class Policy

java.lang.Object
  extended by de.schlichtherle.license.Policy

public class Policy
extends Object

Provides an interface for security policies and implements the default policy.

Author:
Christian Schlichtherle

Field Summary
private static Policy current
          The current policy.
 
Constructor Summary
protected Policy()
          Only subclasses can instantiate this class.
 
Method Summary
 void checkPwd(String pwd)
          Checks the given password for compliance to the current password policy.
static Policy getCurrent()
          Returns the current policy.
static void setCurrent(Policy current)
          Sets the current policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

private static Policy current
The current policy.

Constructor Detail

Policy

protected Policy()
Only subclasses can instantiate this class.

Method Detail

checkPwd

public void checkPwd(String pwd)
Checks the given password for compliance to the current password policy.

The default policy implemented by this class ensures that the password is at least six characters long and consists of letters and digits.

Throws:
IllegalPasswordException - If the given password does not comply to the current policy.

getCurrent

public static Policy getCurrent()
Returns the current policy. If no current policy has been set, the default policy implemented by this class is installed as the current policy and returned.


setCurrent

public static void setCurrent(Policy current)
Sets the current policy.

Parameters:
current - The new current policy. May be null to cause the default policy implemented by this class to be installed and returned by getCurrent().

TrueLicense Core 1.33

Copyright © 2005-2015 Schlichtherle IT Services. All Rights Reserved.