com.waveset.policy
Class LighthouseAccountPolicy

java.lang.Object
  extended bycom.waveset.policy.PolicyImplementation
      extended bycom.waveset.policy.LighthouseAccountPolicy

public class LighthouseAccountPolicy
extends PolicyImplementation

Implement the policies for the lighthouse account that used to live on the role. The attributes that control the policy behavior are both in the policy and stored on the user.


Nested Class Summary
static class LighthouseAccountPolicy.Question
          A class used to represent one authentication question.
static class LighthouseAccountPolicy.QuestionPolicy
          Used for values of the _questionPolicy field.
static class LighthouseAccountPolicy.ResetCheck
          Used for values of the _resetCheck field.
static class LighthouseAccountPolicy.ResetOption
          Used for values of the _passwordResetOption field.
static class LighthouseAccountPolicy.SourceOption
          An enumeration class Used for values of the _idOption and _passwordOption fields in the role.
 
Field Summary
static java.lang.String ACCOUNT_LOCK_EXPIRY
          An optional time period specifying how long user accounts are to remain locked, if locked, before they will become unlocked at the next login by the user.
static java.lang.String ACCOUNTID_POLICY
          Accountid policy for the lighthouse account
static java.lang.String ALL_INTERFACES
           
static java.lang.String code_id
           
static java.lang.String DESC
          The description to use in the prototype instance.
static java.lang.String ID_SOURCE
          An option that specifies where account ids come from.
static java.lang.String LOGIN_INTERFACE
          This is a wrapper class that defines the question policy, questions, and other question related attributes per Lighthouse interface/ application.
static java.lang.String PASSWORD_EXPIRY
          An optional time period specifying how long passwords are allowed to be used before they are considered expired.
static java.lang.String PASSWORD_EXPIRY_WARNING
          If the password expiration policy is specified, this option specifies how many days prior to password expiration the user should be notified at login time that their password is going to expire.
static java.lang.String PASSWORD_MAX_FAILED_LOGIN_COUNT
          Maximum number of allowed failed login attempts before locking the account
static java.lang.String PASSWORD_POLICY
          Password policy for the lighthouse account
static java.lang.String PASSWORD_RESET_CHECK
          An option that specifies how the reset password is conveyed to the user.
static java.lang.String PASSWORD_RESET_LIMIT
          An optinal limit on the number of password resets that will be allowed.
static java.lang.String PASSWORD_RESET_LIMIT_PERIOD
          An optional time period in which only a certain number of password resets will be allowed.
static java.lang.String PASSWORD_SOURCE
          An option that specifies where passwords come from.
static java.lang.String PREVIOUS_LOGIN_INTERFACE
           
static java.lang.String PROTONAME
          The name to use in our prototype instance.
static java.lang.String QUESTION_ALLOW_USER_SUPPLIED
          Whether the current question policy should allow user supplied questions.
static java.lang.String QUESTION_ANSWER_QUALITY_POLICY
          Policy for checking answer strength, for answers to admin and user supplied questions.
static java.lang.String QUESTION_ANSWER_QUALITY_POLICY_SUMMARY
          Summary of question quality policy.
static java.lang.String QUESTION_ANY_COUNT
          When the question policy is ANY, this defines the minimum number of questions that must be answered by the user.
static java.lang.String[] QUESTION_ATTRS
           
static java.lang.String QUESTION_MAX_FAILED_LOGIN_COUNT
          Maximum number of allowed failed login attempts before locking the account
static java.lang.String QUESTION_MINIMUM_USER_SUPPLIED
          Minimum number of user supplied questions required.
static java.lang.String QUESTION_POLICY
          An option that specifies how to present multiple questions.
static java.lang.String QUESTION_PROMPT
           
static java.lang.String QUESTION_RANDOM_COUNT
          When the question policy is "random", this defines the number of questions that will be randomly selected.
static java.lang.String QUESTION_ROUND_ROBIN_INDEX
          When the question policy is "roundrobin", this attribute maintains the index to the next question to be return from the set of questions
static java.lang.String QUESTION_SUPPLIED_QUESTION_VALIDATION_POLICY
          Question strength policy for user supplied questions.
static java.lang.String QUESTION_SUPPLIED_QUESTION_VALIDATION_POLICY_SUMMARY
          Summary for questionSuppliedQuestionValidationPolicy.
static java.lang.String QUESTIONS
          A full set of questions to be used as an alternate means of authenticating a user.
static java.lang.String QUESTIONS_FOR_LOGIN
          A selected set of questions to be used as an alternate means of authenticating a user (will be asked during login)
static java.lang.String QUESTIONS_FOR_NEW_USER
          A selected set of questions to be used as an alternate means of authenticating a user (will be assigned to the user)
static java.lang.String QUESTIONS_FOR_USER
          A selected set of questions to be used as an alternate means of authenticating a user (will be assigned to the user)
static java.lang.String RESET_OPTION
          An option that specifies how a reset password should be generated.
static java.lang.String SELECTED_LOGIN_INTERFACE
           
static java.lang.String SUPPLIED_QUESTIONS
          User supplied questions to be used as an alternate means of authenticating a user.
static java.lang.String TEMP_PASSWORD_EXPIRY
          An optional time period specifying how long temporary passwords may be used.
static java.lang.String TYPE
          A policy attribute that can be used to supply a string used to make formatting message clearer.
 
Fields inherited from class com.waveset.policy.PolicyImplementation
ALL_CHARS, NO_VALUE, trace
 
Constructor Summary
LighthouseAccountPolicy()
          Create an empty policy object.
 
Method Summary
 void addQuestion(Policy p, java.lang.String loginInterface, java.lang.String question)
          Add one authentication question to the role.
 void check(Policy policy, java.lang.Object value, java.util.Map map, java.util.List pwdhistory, java.lang.String owner)
          Tests a string for certain characteristics.
 void check(Policy policy, java.lang.Object value, java.lang.String owner)
          Analyzes a single value for adherance to the policy.
 Policy convertRoleMap(GenericObject mapFromRole)
          Build from a map created from an old style role (this is the upgrade method).
 java.lang.String getAccountIdPolicy(Policy p)
          Get the accountId policy option.
 Util.TimePeriod getAccountLockExpiry(Policy p)
          Get the account lock expiration period.
 boolean getAllowUserSuppliedQuestions(Policy p, java.lang.String loginInterface)
          Get whether user supplied questions are allowed.
 LighthouseAccountPolicy.Question[] getAllQuestions(Policy p, java.lang.String loginInterface)
          Get the array of authentication question objects assigned to this role.
 LighthouseAccountPolicy.Question[] getAnsweredRandomQuestions(Policy policy, java.lang.String loginInterface, WSUser user)
           
 LighthouseAccountPolicy.Question[] getAnsweredRoundRobinQuestion(Policy policy, java.lang.String loginInterface, WSUser user)
           
 ObjectRef getAnswerQualityPolicy(Policy p, java.lang.String loginInterface)
          Get the answer quality policy option.
 int getAnyQuestionCount(Policy p, java.lang.String loginInterface)
          Get the any question count.
static java.lang.String[] getAttributeNames()
           
 LighthouseAccountPolicy.SourceOption getIdSource(Policy p)
          Get the account ID source option.
 LighthouseAccountPolicy.Question[] getLoginQuestions(Policy policy, java.lang.String loginInterface, WSUser user)
           
 int getMaxFailedPasswordLoginCount(Policy p)
          Get the max failed login count.
 int getMaxFailedQuestionLoginCount(Policy p, java.lang.String loginInterface)
          Get the max failed login count.
 int getMinimumUserSupplied(Policy p, java.lang.String loginInterface)
          Get the minimum number of user supplied questions allowed.
 LighthouseAccountPolicy.Question[] getNewUserQuestions(Policy p, java.lang.String loginInterface)
           
 Util.TimePeriod getPasswordExpiry(Policy p)
          Get the password expiration period.
 Util.TimePeriod getPasswordExpiryWarning(Policy p)
          Get the password expiration warning period in units of days.
 java.lang.String getPasswordPolicy(Policy p)
          Get the accointid policy option.
 LighthouseAccountPolicy.SourceOption getPasswordSource(Policy p)
          Get the password source option.
 Policy getPrototype()
          Returns the prototype instance for this policy.
 LighthouseAccountPolicy.Question getQuestion(Policy p, java.lang.String loginInterface, java.lang.String id)
          Get the question object with a given id.
static java.lang.String getQuestionAttrPath(java.lang.String loginInterface, java.lang.String attrName)
           
 LighthouseAccountPolicy.QuestionPolicy getQuestionPolicy(Policy p, java.lang.String loginInterface)
          Return the question policy.
 ObjectRef getQuestionQualityPolicy(Policy p, java.lang.String loginInterface)
          Get the question quality policy option.
 int getRandomQuestionCount(Policy p, java.lang.String loginInterface)
          Get the random question count.
 LighthouseAccountPolicy.ResetCheck getResetCheck(Policy p)
          Get the password reset notification option.
 int getResetLimit(Policy p)
          Get the password reset limit count.
 Util.TimePeriod getResetLimitPeriod(Policy p)
          Get the password reset limit period.
 LighthouseAccountPolicy.ResetOption getResetOption(Policy p)
          Get the password reset option.
 LighthouseAccountPolicy.Question getRoundRobinQuestion(Policy policy, java.lang.String loginInterface, boolean updateIndex)
           
 int getRoundRobinQuestionIndex(Policy p, java.lang.String loginInterface)
          Get the round robin question index.
 Util.TimePeriod getTempPasswordExpiry(Policy p)
          Get the temporary password expiration period.
 LighthouseAccountPolicy.Question[] getUserQuestions(Policy policy, java.lang.String loginInterface, WSUser user)
           
 java.lang.Object getValue(Policy policy, java.util.Map params, java.lang.String owner)
          similar to check, above.
 Policy parseOldRole(org.w3c.dom.Element e)
           
 LighthouseAccountPolicy.Question removeQuestion(Policy p, java.lang.String loginInterface, java.lang.String id)
          Remove one question from the role, given its id.
 void setAccountIdPolicy(Policy p, java.lang.String name)
          Set the accountId policy option.
 void setAccountLockExpiry(Policy p, Util.TimePeriod period)
          Set the account lock expiration period.
 void setAllowUserSuppliedQuestions(Policy p, java.lang.String loginInterface, boolean allow)
          Sets whether user supplied questions are allowed.
 void setAnswerQualityPolicy(Policy p, java.lang.String loginInterface, java.lang.String name)
          Set the password policy option.
 void setAnyQuestionCount(Policy p, java.lang.String loginInterface, int n)
          Set the any question count.
 void setIdSource(Policy p, LighthouseAccountPolicy.SourceOption op)
          Set the account ID source option.
 void setMaxFailedPasswordLoginCount(Policy p, int n)
          Set the max failed login count.
 void setMaxFailedQuestionLoginCount(Policy p, java.lang.String loginInterface, int n)
          Set the max failed login count.
 void setMinimumNumberOfUserSuppliedQuestions(Policy p, java.lang.String loginInterface, int minimum)
          Sets minimum number of user supplied questions.
 void setPasswordExpiry(Policy p, Util.TimePeriod period)
          Set the password expiration period.
 void setPasswordExpiryWarning(Policy p, Util.TimePeriod period)
          Set the password expiration warning period in units of days.
 void setPasswordPolicy(Policy p, java.lang.String name)
          Set the password policy option.
 void setPasswordSource(Policy p, LighthouseAccountPolicy.SourceOption op)
          Set the password source option.
 void setQuestionPolicy(Policy p, java.lang.String loginInterface, LighthouseAccountPolicy.QuestionPolicy qp)
          Set the question policy.
 void setQuestionQualityPolicy(Policy p, java.lang.String loginInterface, java.lang.String name)
          Set the accountId policy option.
 void setQuestions(Policy p, java.lang.String loginInterface, LighthouseAccountPolicy.Question[] questions)
          Save the questions to the attributes.
 void setRandomQuestionCount(Policy p, java.lang.String loginInterface, int n)
          Set the random question count.
 void setResetCheck(Policy p, LighthouseAccountPolicy.ResetCheck c)
          Set the password reset notification option.
 void setResetLimit(Policy p, int l)
          Sets the password reset limit count.
 void setResetLimitPeriod(Policy p, Util.TimePeriod period)
          Set the password reset limit period.
 void setResetOption(Policy p, LighthouseAccountPolicy.ResetOption o)
          Set the password reset option.
 void setRoundRobinQuestionIndex(Policy p, java.lang.String loginInterface, int n)
          Set the round robin question index.
 void setTempPasswordExpiry(Policy p, Util.TimePeriod period)
          Set the temporary password expiration period.
 void updateAllQuestions(Policy policy, java.lang.String loginInterface, WSUser user, java.util.List userqlist)
           
 void updateQuestion(Policy p, java.lang.String loginInterface, LighthouseAccountPolicy.Question newQuestion)
          Update one question, finding by id.
 void updateRoundRobinQuestion(Policy policy, java.lang.String loginInterface, Answer[] answers, java.util.List userqlist)
           
 
Methods inherited from class com.waveset.policy.PolicyImplementation
checkPolicyArg, generate, generate, generateByteArray, getAllowedAttributeValues, getAttributeFromUser, getBooleanAttribute, getContext, getIntAttribute, getIntAttribute, getObjectAttribute, getStringAttribute, getStringListAttribute, getUserPropertyName, setAttributeOnUser, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

PROTONAME

public static final java.lang.String PROTONAME
The name to use in our prototype instance.

See Also:
Constant Field Values

DESC

public static final java.lang.String DESC
The description to use in the prototype instance. !! This should be in a message catalog.

See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
A policy attribute that can be used to supply a string used to make formatting message clearer. For example, if the policy is used for passwords, setting this policy attribute to "password" will make it clear what policy has been violated. This is especially important for LighthouseAccountPolicy since it can be used in many contexts.

See Also:
Constant Field Values

ID_SOURCE

public static final java.lang.String ID_SOURCE
An option that specifies where account ids come from.

See Also:
Constant Field Values

PASSWORD_SOURCE

public static final java.lang.String PASSWORD_SOURCE
An option that specifies where passwords come from.

See Also:
Constant Field Values

PASSWORD_POLICY

public static final java.lang.String PASSWORD_POLICY
Password policy for the lighthouse account

See Also:
Constant Field Values

ACCOUNTID_POLICY

public static final java.lang.String ACCOUNTID_POLICY
Accountid policy for the lighthouse account

See Also:
Constant Field Values

ACCOUNT_LOCK_EXPIRY

public static final java.lang.String ACCOUNT_LOCK_EXPIRY
An optional time period specifying how long user accounts are to remain locked, if locked, before they will become unlocked at the next login by the user.

See Also:
Constant Field Values

PASSWORD_EXPIRY

public static final java.lang.String PASSWORD_EXPIRY
An optional time period specifying how long passwords are allowed to be used before they are considered expired.

See Also:
Constant Field Values

PASSWORD_EXPIRY_WARNING

public static final java.lang.String PASSWORD_EXPIRY_WARNING
If the password expiration policy is specified, this option specifies how many days prior to password expiration the user should be notified at login time that their password is going to expire.

See Also:
Constant Field Values

RESET_OPTION

public static final java.lang.String RESET_OPTION
An option that specifies how a reset password should be generated.

See Also:
Constant Field Values

TEMP_PASSWORD_EXPIRY

public static final java.lang.String TEMP_PASSWORD_EXPIRY
An optional time period specifying how long temporary passwords may be used. This is normally less than the _passwordExpiry time.

See Also:
Constant Field Values

PASSWORD_RESET_CHECK

public static final java.lang.String PASSWORD_RESET_CHECK
An option that specifies how the reset password is conveyed to the user.

See Also:
Constant Field Values

PASSWORD_RESET_LIMIT_PERIOD

public static final java.lang.String PASSWORD_RESET_LIMIT_PERIOD
An optional time period in which only a certain number of password resets will be allowed. Used in conjunctino with _resetLimit.

See Also:
Constant Field Values

PASSWORD_RESET_LIMIT

public static final java.lang.String PASSWORD_RESET_LIMIT
An optinal limit on the number of password resets that will be allowed. Used in conjunction with _resetLimitPeriod.

See Also:
Constant Field Values

PASSWORD_MAX_FAILED_LOGIN_COUNT

public static final java.lang.String PASSWORD_MAX_FAILED_LOGIN_COUNT
Maximum number of allowed failed login attempts before locking the account

See Also:
Constant Field Values

QUESTIONS

public static final java.lang.String QUESTIONS
A full set of questions to be used as an alternate means of authenticating a user.

See Also:
Constant Field Values

SUPPLIED_QUESTIONS

public static final java.lang.String SUPPLIED_QUESTIONS
User supplied questions to be used as an alternate means of authenticating a user.

See Also:
Constant Field Values

QUESTIONS_FOR_NEW_USER

public static final java.lang.String QUESTIONS_FOR_NEW_USER
A selected set of questions to be used as an alternate means of authenticating a user (will be assigned to the user)

See Also:
Constant Field Values

QUESTIONS_FOR_USER

public static final java.lang.String QUESTIONS_FOR_USER
A selected set of questions to be used as an alternate means of authenticating a user (will be assigned to the user)

See Also:
Constant Field Values

QUESTIONS_FOR_LOGIN

public static final java.lang.String QUESTIONS_FOR_LOGIN
A selected set of questions to be used as an alternate means of authenticating a user (will be asked during login)

See Also:
Constant Field Values

QUESTION_POLICY

public static final java.lang.String QUESTION_POLICY
An option that specifies how to present multiple questions.

See Also:
Constant Field Values

QUESTION_ANY_COUNT

public static final java.lang.String QUESTION_ANY_COUNT
When the question policy is ANY, this defines the minimum number of questions that must be answered by the user. Default is 1.

See Also:
Constant Field Values

QUESTION_RANDOM_COUNT

public static final java.lang.String QUESTION_RANDOM_COUNT
When the question policy is "random", this defines the number of questions that will be randomly selected.

See Also:
Constant Field Values

QUESTION_ROUND_ROBIN_INDEX

public static final java.lang.String QUESTION_ROUND_ROBIN_INDEX
When the question policy is "roundrobin", this attribute maintains the index to the next question to be return from the set of questions

See Also:
Constant Field Values

QUESTION_MAX_FAILED_LOGIN_COUNT

public static final java.lang.String QUESTION_MAX_FAILED_LOGIN_COUNT
Maximum number of allowed failed login attempts before locking the account

See Also:
Constant Field Values

QUESTION_ALLOW_USER_SUPPLIED

public static final java.lang.String QUESTION_ALLOW_USER_SUPPLIED
Whether the current question policy should allow user supplied questions.

See Also:
Constant Field Values

QUESTION_MINIMUM_USER_SUPPLIED

public static final java.lang.String QUESTION_MINIMUM_USER_SUPPLIED
Minimum number of user supplied questions required.

See Also:
Constant Field Values

QUESTION_SUPPLIED_QUESTION_VALIDATION_POLICY

public static final java.lang.String QUESTION_SUPPLIED_QUESTION_VALIDATION_POLICY
Question strength policy for user supplied questions.

See Also:
Constant Field Values

QUESTION_SUPPLIED_QUESTION_VALIDATION_POLICY_SUMMARY

public static final java.lang.String QUESTION_SUPPLIED_QUESTION_VALIDATION_POLICY_SUMMARY
Summary for questionSuppliedQuestionValidationPolicy.

See Also:
Constant Field Values

QUESTION_ANSWER_QUALITY_POLICY

public static final java.lang.String QUESTION_ANSWER_QUALITY_POLICY
Policy for checking answer strength, for answers to admin and user supplied questions.

See Also:
Constant Field Values

QUESTION_ANSWER_QUALITY_POLICY_SUMMARY

public static final java.lang.String QUESTION_ANSWER_QUALITY_POLICY_SUMMARY
Summary of question quality policy.

See Also:
Constant Field Values

QUESTION_ATTRS

public static final java.lang.String[] QUESTION_ATTRS

QUESTION_PROMPT

public static final java.lang.String QUESTION_PROMPT
See Also:
Constant Field Values

LOGIN_INTERFACE

public static final java.lang.String LOGIN_INTERFACE
This is a wrapper class that defines the question policy, questions, and other question related attributes per Lighthouse interface/ application. For backward compatibility, if there is no interface questions found for the current interface then the "All" interface questions will be used. Existing question policies will be parsed into this new structure when loaded.

The association of questions and question policy with a Lighthouse interface will support the ability to have a unique set of questions depending on which interface the user is authenticated to and is accessing Lighthouse from (e.g. IVR verses end-user web, verses admin web, verses SOAP, etc.

See Also:
Constant Field Values

SELECTED_LOGIN_INTERFACE

public static final java.lang.String SELECTED_LOGIN_INTERFACE
See Also:
Constant Field Values

PREVIOUS_LOGIN_INTERFACE

public static final java.lang.String PREVIOUS_LOGIN_INTERFACE
See Also:
Constant Field Values

ALL_INTERFACES

public static final java.lang.String ALL_INTERFACES
See Also:
Constant Field Values
Constructor Detail

LighthouseAccountPolicy

public LighthouseAccountPolicy()
Create an empty policy object.

Method Detail

getPrototype

public Policy getPrototype()
                    throws WavesetException
Returns the prototype instance for this policy.

Specified by:
getPrototype in class PolicyImplementation
Throws:
WavesetException

getAttributeNames

public static java.lang.String[] getAttributeNames()

check

public void check(Policy policy,
                  java.lang.Object value,
                  java.util.Map map,
                  java.util.List pwdhistory,
                  java.lang.String owner)
           throws PolicyViolation,
                  WavesetException
Tests a string for certain characteristics.

Specified by:
check in class PolicyImplementation
Throws:
PolicyViolation
WavesetException

check

public void check(Policy policy,
                  java.lang.Object value,
                  java.lang.String owner)
           throws PolicyViolation,
                  WavesetException
Description copied from class: PolicyImplementation
Analyzes a single value for adherance to the policy.

A policy object representing a particular "instance" of this policy implementation is passed in. This object supplies zero or more "policy attributes" which can be used to tailor the behavior of the policy.

Specified by:
check in class PolicyImplementation
Throws:
PolicyViolation - if the value violates the policy.
WavesetException - if an internal error was encountered.

getValue

public java.lang.Object getValue(Policy policy,
                                 java.util.Map params,
                                 java.lang.String owner)
                          throws WavesetException
similar to check, above. This takes the same parameters as check but returns a value. This can be used to get values for policies that the caller wants to check - like an expiration date or questions.

Overrides:
getValue in class PolicyImplementation
Parameters:
policy - a policy that defines the parameters to the rule.
params - a map of parameters that defines the value that you want to retrieve and the input data (like the user) Supported params are: valueName one of: ID_SOURCE, - returns user or PASSWORD_SOURCE, PASSWORD_EXPIRY, PASSWORD_EXPIRY_WARNING, RESET_OPTION, TEMP_PASSWORD_EXPIRY, PASSWORD_RESET_CHECK, PASSWORD_RESET_LIMIT_PERIOD, PASSWORD_RESET_LIMIT, PASSWORD_MAX_FAILED_LOGIN_COUNT, QUESTIONS, QUESTION_POLICY, QUESTION_RANDOM_COUNT, QUESTION_ROUND_ROBIN_INDEX, QUESTION_MAX_FAILED_LOGIN_COUNT, ACCOUNT_LOCK_EXPIRY
Throws:
WavesetException - if an internal error was encountered.

getIdSource

public LighthouseAccountPolicy.SourceOption getIdSource(Policy p)
                                                 throws WavesetException
Get the account ID source option.

Throws:
WavesetException

setIdSource

public void setIdSource(Policy p,
                        LighthouseAccountPolicy.SourceOption op)
                 throws WavesetException
Set the account ID source option.

!! We have issues with the behavior of generated account ids. While this can be set, I'm not convinced its desireable in most cases.

Throws:
WavesetException

getPasswordSource

public LighthouseAccountPolicy.SourceOption getPasswordSource(Policy p)
                                                       throws WavesetException
Get the password source option.

Throws:
WavesetException

setPasswordSource

public void setPasswordSource(Policy p,
                              LighthouseAccountPolicy.SourceOption op)
                       throws WavesetException
Set the password source option.

Throws:
WavesetException

setPasswordPolicy

public void setPasswordPolicy(Policy p,
                              java.lang.String name)
                       throws WavesetException
Set the password policy option.

Throws:
WavesetException

setAccountIdPolicy

public void setAccountIdPolicy(Policy p,
                               java.lang.String name)
                        throws WavesetException
Set the accountId policy option.

Throws:
WavesetException

getPasswordPolicy

public java.lang.String getPasswordPolicy(Policy p)
                                   throws WavesetException
Get the accointid policy option.

Throws:
WavesetException

getAccountIdPolicy

public java.lang.String getAccountIdPolicy(Policy p)
                                    throws WavesetException
Get the accountId policy option.

Throws:
WavesetException

getAnswerQualityPolicy

public ObjectRef getAnswerQualityPolicy(Policy p,
                                        java.lang.String loginInterface)
                                 throws WavesetException
Get the answer quality policy option.

Throws:
WavesetException

getQuestionQualityPolicy

public ObjectRef getQuestionQualityPolicy(Policy p,
                                          java.lang.String loginInterface)
                                   throws WavesetException
Get the question quality policy option.

Throws:
WavesetException

setAnswerQualityPolicy

public void setAnswerQualityPolicy(Policy p,
                                   java.lang.String loginInterface,
                                   java.lang.String name)
                            throws WavesetException
Set the password policy option.

Throws:
WavesetException

setQuestionQualityPolicy

public void setQuestionQualityPolicy(Policy p,
                                     java.lang.String loginInterface,
                                     java.lang.String name)
                              throws WavesetException
Set the accountId policy option.

Throws:
WavesetException

getAccountLockExpiry

public Util.TimePeriod getAccountLockExpiry(Policy p)
                                     throws WavesetException
Get the account lock expiration period. This may be null, to indicate that locked accounts never expire.

Throws:
WavesetException

setAccountLockExpiry

public void setAccountLockExpiry(Policy p,
                                 Util.TimePeriod period)
                          throws WavesetException
Set the account lock expiration period. This may be null, to indicate that locked accounts never expire.

Throws:
WavesetException

getPasswordExpiry

public Util.TimePeriod getPasswordExpiry(Policy p)
                                  throws WavesetException
Get the password expiration period. This may be null, to indicate that passwords never expire.

Throws:
WavesetException

setPasswordExpiry

public void setPasswordExpiry(Policy p,
                              Util.TimePeriod period)
                       throws WavesetException
Set the password expiration period. This may be null, to indicate that passwords never expire.

Throws:
WavesetException

getPasswordExpiryWarning

public Util.TimePeriod getPasswordExpiryWarning(Policy p)
                                         throws WavesetException
Get the password expiration warning period in units of days. This may be 0, to indicate that the user will never be warned that their password is going to expire

Throws:
WavesetException

setPasswordExpiryWarning

public void setPasswordExpiryWarning(Policy p,
                                     Util.TimePeriod period)
                              throws WavesetException
Set the password expiration warning period in units of days. This may be 0, to indicate that the user will never be warned that their password is going to expire

Throws:
WavesetException

getResetOption

public LighthouseAccountPolicy.ResetOption getResetOption(Policy p)
                                                   throws WavesetException
Get the password reset option.

Throws:
WavesetException

setResetOption

public void setResetOption(Policy p,
                           LighthouseAccountPolicy.ResetOption o)
                    throws WavesetException
Set the password reset option.

Throws:
WavesetException

getTempPasswordExpiry

public Util.TimePeriod getTempPasswordExpiry(Policy p)
                                      throws WavesetException
Get the temporary password expiration period.

Throws:
WavesetException

setTempPasswordExpiry

public void setTempPasswordExpiry(Policy p,
                                  Util.TimePeriod period)
                           throws WavesetException
Set the temporary password expiration period.

Throws:
WavesetException

getResetCheck

public LighthouseAccountPolicy.ResetCheck getResetCheck(Policy p)
                                                 throws WavesetException
Get the password reset notification option.

Throws:
WavesetException

setResetCheck

public void setResetCheck(Policy p,
                          LighthouseAccountPolicy.ResetCheck c)
                   throws WavesetException
Set the password reset notification option.

Throws:
WavesetException

getResetLimitPeriod

public Util.TimePeriod getResetLimitPeriod(Policy p)
                                    throws WavesetException
Get the password reset limit period. This may be null if there is no reset limit. This should always be interpreted in conjuction with the limit count returned by the getResetLimit method.

Throws:
WavesetException
See Also:
getResetLimit(com.waveset.object.Policy)

setResetLimitPeriod

public void setResetLimitPeriod(Policy p,
                                Util.TimePeriod period)
                         throws WavesetException
Set the password reset limit period. This may be null if there is no reset limit.

Throws:
WavesetException

getResetLimit

public int getResetLimit(Policy p)
                  throws WavesetException
Get the password reset limit count. This is the number of times within a certain period that we allow an account to be reset. The time period is returned by the getResetLimitPeriod method.

Throws:
WavesetException
See Also:
getResetLimitPeriod(com.waveset.object.Policy)

setResetLimit

public void setResetLimit(Policy p,
                          int l)
                   throws WavesetException
Sets the password reset limit count.

Throws:
WavesetException

getMaxFailedPasswordLoginCount

public int getMaxFailedPasswordLoginCount(Policy p)
                                   throws WavesetException
Get the max failed login count.

Throws:
WavesetException

setMaxFailedPasswordLoginCount

public void setMaxFailedPasswordLoginCount(Policy p,
                                           int n)
                                    throws WavesetException
Set the max failed login count.

Throws:
WavesetException

getQuestionAttrPath

public static java.lang.String getQuestionAttrPath(java.lang.String loginInterface,
                                                   java.lang.String attrName)

getAllQuestions

public LighthouseAccountPolicy.Question[] getAllQuestions(Policy p,
                                                          java.lang.String loginInterface)
                                                   throws WavesetException
Get the array of authentication question objects assigned to this role. If you are performing authentication, you should use the getRequiredQuestions() method, which will factor in the question policy.

Throws:
WavesetException

setQuestions

public void setQuestions(Policy p,
                         java.lang.String loginInterface,
                         LighthouseAccountPolicy.Question[] questions)
                  throws WavesetException
Save the questions to the attributes. Prune out questions with no ID or question text (they will not be much use)

Throws:
WavesetException

getQuestionPolicy

public LighthouseAccountPolicy.QuestionPolicy getQuestionPolicy(Policy p,
                                                                java.lang.String loginInterface)
                                                         throws WavesetException
Return the question policy.

QuestionPolicy.ANY means that you may ask any question for which the user has supplied an answer.

QuestionPolicy.ALL means that you must ask all the questions, and the user must have supplied all the answers.

QuestionPolicy.RANDOM means that some number of questions is selected at random. The number of questions selected is determined by the _randomQuestionCount field.

Throws:
WavesetException

setQuestionPolicy

public void setQuestionPolicy(Policy p,
                              java.lang.String loginInterface,
                              LighthouseAccountPolicy.QuestionPolicy qp)
                       throws WavesetException
Set the question policy.

If the policy is set to QuestionPolicy.RANDOM, the _randomQuestionCount must be greater than zero, if it is currently zero, it is set to one.

Throws:
WavesetException

getNewUserQuestions

public LighthouseAccountPolicy.Question[] getNewUserQuestions(Policy p,
                                                              java.lang.String loginInterface)
                                                       throws WavesetException
Throws:
WavesetException

getQuestion

public LighthouseAccountPolicy.Question getQuestion(Policy p,
                                                    java.lang.String loginInterface,
                                                    java.lang.String id)
                                             throws WavesetException
Get the question object with a given id.

Throws:
WavesetException

addQuestion

public void addQuestion(Policy p,
                        java.lang.String loginInterface,
                        java.lang.String question)
                 throws WavesetException
Add one authentication question to the role. The question will be assigned a new generated id.

Throws:
WavesetException

removeQuestion

public LighthouseAccountPolicy.Question removeQuestion(Policy p,
                                                       java.lang.String loginInterface,
                                                       java.lang.String id)
                                                throws WavesetException
Remove one question from the role, given its id.

Parameters:
id - the question id
Returns:
the question object if it was found in the role
Throws:
WavesetException

updateQuestion

public void updateQuestion(Policy p,
                           java.lang.String loginInterface,
                           LighthouseAccountPolicy.Question newQuestion)
                    throws WavesetException
Update one question, finding by id. Adds the question if not found.

Parameters:
newQuestion - the new question
Throws:
WavesetException

getAnyQuestionCount

public int getAnyQuestionCount(Policy p,
                               java.lang.String loginInterface)
                        throws WavesetException
Get the any question count.

This field is relevant only if the question policy is QuestionPolicy.ANY. The count is the minimum number of questions that must be answered for authentication

Throws:
WavesetException

setAnyQuestionCount

public void setAnyQuestionCount(Policy p,
                                java.lang.String loginInterface,
                                int n)
                         throws WavesetException
Set the any question count.

Sets the any question count. This is accepted but ignored if the question policy is something other than QuestionPolicy.ANY. If the policy is ANY, the number must be greater than zero. Will will silently set it to 1 if the given number is less than 1. todo PWD set this value back on the user

Throws:
WavesetException

getRandomQuestionCount

public int getRandomQuestionCount(Policy p,
                                  java.lang.String loginInterface)
                           throws WavesetException
Get the random question count.

This field is relevant only if the question policy is QuestionPolicy.RANDOM. The count is the number of questions that will be selected at random for authentication.

Throws:
WavesetException

getMinimumUserSupplied

public int getMinimumUserSupplied(Policy p,
                                  java.lang.String loginInterface)
                           throws WavesetException
Get the minimum number of user supplied questions allowed.

This field is relevant only if the question policy is QuestionPolicy.RANDOM. The count is the number of questions that will be selected at random for authentication.

Throws:
WavesetException

getAllowUserSuppliedQuestions

public boolean getAllowUserSuppliedQuestions(Policy p,
                                             java.lang.String loginInterface)
                                      throws WavesetException
Get whether user supplied questions are allowed.

Parameters:
p -
loginInterface -
Returns:
Throws:
WavesetException

setAllowUserSuppliedQuestions

public void setAllowUserSuppliedQuestions(Policy p,
                                          java.lang.String loginInterface,
                                          boolean allow)
                                   throws WavesetException
Sets whether user supplied questions are allowed.

Parameters:
p -
loginInterface -
allow - true if user supplied questions allowed, false otherwise.
Throws:
WavesetException

setMinimumNumberOfUserSuppliedQuestions

public void setMinimumNumberOfUserSuppliedQuestions(Policy p,
                                                    java.lang.String loginInterface,
                                                    int minimum)
                                             throws WavesetException
Sets minimum number of user supplied questions.

Parameters:
p -
loginInterface -
minimum - Number of questions required.
Throws:
WavesetException

setRandomQuestionCount

public void setRandomQuestionCount(Policy p,
                                   java.lang.String loginInterface,
                                   int n)
                            throws WavesetException
Set the random question count.

Sets the random question count. This is accepted but ignored if the question policy is something other than QuestionPolicy.RANDOM. If the policy is RANDOM, the number must be greater than zero. Will will silently set it to 1 if the given number is less than 1. todo PWD set this value back on the user

Throws:
WavesetException

getRoundRobinQuestionIndex

public int getRoundRobinQuestionIndex(Policy p,
                                      java.lang.String loginInterface)
                               throws WavesetException
Get the round robin question index.

This field is relevant only if the question policy is QuestionPolicy.ROUND_ROBIN. The index is the i'th question that will be selected for authentication.

Throws:
WavesetException

setRoundRobinQuestionIndex

public void setRoundRobinQuestionIndex(Policy p,
                                       java.lang.String loginInterface,
                                       int n)
                                throws WavesetException
Set the round robin question index.

This is accepted but ignored if the question policy is something other than QuestionPolicy.ROUND_ROBIN. If the policy is ROUND_ROBIN, the number must be less than the number of questions (e.g. 0 to n-1) todo PWD set this value back on the user

Throws:
WavesetException

getMaxFailedQuestionLoginCount

public int getMaxFailedQuestionLoginCount(Policy p,
                                          java.lang.String loginInterface)
                                   throws WavesetException
Get the max failed login count.

Throws:
WavesetException

setMaxFailedQuestionLoginCount

public void setMaxFailedQuestionLoginCount(Policy p,
                                           java.lang.String loginInterface,
                                           int n)
                                    throws WavesetException
Set the max failed login count.

Throws:
WavesetException

parseOldRole

public Policy parseOldRole(org.w3c.dom.Element e)
                    throws WavesetException
Throws:
WavesetException

getLoginQuestions

public LighthouseAccountPolicy.Question[] getLoginQuestions(Policy policy,
                                                            java.lang.String loginInterface,
                                                            WSUser user)
                                                     throws WavesetException
Throws:
WavesetException

getUserQuestions

public LighthouseAccountPolicy.Question[] getUserQuestions(Policy policy,
                                                           java.lang.String loginInterface,
                                                           WSUser user)
                                                    throws WavesetException
Throws:
WavesetException

updateAllQuestions

public void updateAllQuestions(Policy policy,
                               java.lang.String loginInterface,
                               WSUser user,
                               java.util.List userqlist)
                        throws WavesetException
Throws:
WavesetException

updateRoundRobinQuestion

public void updateRoundRobinQuestion(Policy policy,
                                     java.lang.String loginInterface,
                                     Answer[] answers,
                                     java.util.List userqlist)
                              throws WavesetException
Throws:
WavesetException

getAnsweredRoundRobinQuestion

public LighthouseAccountPolicy.Question[] getAnsweredRoundRobinQuestion(Policy policy,
                                                                        java.lang.String loginInterface,
                                                                        WSUser user)
                                                                 throws WavesetException
Throws:
WavesetException

getRoundRobinQuestion

public LighthouseAccountPolicy.Question getRoundRobinQuestion(Policy policy,
                                                              java.lang.String loginInterface,
                                                              boolean updateIndex)
                                                       throws WavesetException
Throws:
WavesetException

getAnsweredRandomQuestions

public LighthouseAccountPolicy.Question[] getAnsweredRandomQuestions(Policy policy,
                                                                     java.lang.String loginInterface,
                                                                     WSUser user)
                                                              throws WavesetException
Throws:
WavesetException

convertRoleMap

public Policy convertRoleMap(GenericObject mapFromRole)
                      throws WavesetException
Build from a map created from an old style role (this is the upgrade method). Walk the attributes and create an appropriate policy. This should onloy be used byt the upgrader.

Throws:
WavesetException