|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MAuthenticator
This interface specifies a generic way to authenticate at three levels: student, proctor, and instructor. It is of use if MathTools is deployed as a part of an independent testing package. The specific authentication methodology used is not specified. Rather, authentication is handled very generically at one of the three levels. One method is provided to initialize an implementation ant the other is the acutal authentication method.
The pre-defined authentication levels are:
CapCom
provides a method to specify a global Authenticator along with a method to check authentication using it. It is set using the full
name of the class implementing this interface along with the context Object used to initialize the impementation. Classes implementing the MAuthenticator
interface must provide a zero-argument contstructor; CapCom
uses it when creating the Authenticator.
MAuthenticator
specifies the generateCodes()
method to generate authentication codes. This method is optional but is provided
if needed. Implementations not using it should simply return an empty array. Implementations that do use it must accept an authenticaion level for the codes
generated and the number of codes to generate. An Object...
parameter is also supplied for implementation-specific use.
Field Summary | |
---|---|
static byte |
AUTH_ADMIN
Static constant used to indicate authentication at Admin level. |
static byte |
AUTH_INSTRUCTOR
Static constant used to indicate authentication at Instructor level. |
static byte |
AUTH_NONE
Static constant used to indicate no authentication level. |
static byte |
AUTH_PROCTOR
Static constant used to indicate authentication at Proctor level. |
static byte |
AUTH_STUDENT
Static constant used to indicate authentication at Student level. |
Method Summary | |
---|---|
java.lang.String[] |
generateCodes(byte pLevel,
int pNum,
java.lang.Object... pParams)
This method, if defined, is used to generate authentication codes at the specified level. |
void |
initMAuthenticator(java.lang.Object pContext)
Implement this method to initialize a MAuthenticator implementation. |
boolean |
mAuthenticate(byte pLevel,
java.lang.String pCode)
The raison d'etre for this interface. |
Field Detail |
---|
static final byte AUTH_STUDENT
static final byte AUTH_PROCTOR
static final byte AUTH_INSTRUCTOR
static final byte AUTH_ADMIN
static final byte AUTH_NONE
Method Detail |
---|
void initMAuthenticator(java.lang.Object pContext)
MAuthenticator
implementation. By intent this method should be called once but can be called more than
once. Each call should not only initialize and configure whatever the authenticator needs to function, it should also clear out any old data left from prior
use. More specifically, calling this method with the same context Object should yield the same authenticator regardless of whether it is the first, tenth,
or hundredth call.
pContext
- The context Object containing information necessary to initialize the instance.boolean mAuthenticate(byte pLevel, java.lang.String pCode)
pLevel
- The AUTH_ constant for the desired authentication level.pCode
- The authentication code to check at the specified level.
java.lang.String[] generateCodes(byte pLevel, int pNum, java.lang.Object... pParams)
Object...
argument is supplied for implementations to use as required and must be specified in the documentation!
pLevel
- The AUTH_ level constant for the desired codes.pNum
- The number of codes to generate.pParams
- Implementation-specific parameters for generating the codes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |