|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.security.impl.PassiveCallbackHandler
public class PassiveCallbackHandler
PassiveCallbackHandler has constructor that takes a username and password so its handle() method does not have to prompt the user for input.
Useful for server-side applications.
This code was inspired from an article from:
*
Field Summary | |
---|---|
(package private) char[] |
password
|
private String |
username
|
Constructor Summary | |
---|---|
PassiveCallbackHandler(String username,
String password)
Creates a callback handler with the give username and password. |
Method Summary | |
---|---|
void |
clearPassword()
Clears out password state. |
void |
handle(Callback[] callbacks)
Handles the specified set of Callbacks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String username
char[] password
Constructor Detail |
---|
public PassiveCallbackHandler(String username, String password)
Creates a callback handler with the give username and password.
username
- The username.password
- The password.Method Detail |
---|
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
Handles the specified set of Callbacks. Uses the username and password that were supplied to our constructor to popluate the Callbacks.
This class supports NameCallback and PasswordCallback.
handle
in interface CallbackHandler
callbacks
- the callbacks to handle
IOException
- if an input or output error occurs.
UnsupportedCallbackException
- if the callback is not an
instance of NameCallback or PasswordCallbackpublic void clearPassword()
Clears out password state.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |