public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
if (callbacks.length > 0) {
for (Callback callback : callbacks) {
if (callback instanceof CallerPrincipalCallback) {
CallerPrincipalCallback callerCallback = (CallerPrincipalCallback) callback;
if (callerCallback.getPrincipal() != null)
this.callerPrincipalCallback = new CallerPrincipalCallback(callerCallback.getSubject(),
callerCallback.getPrincipal());
else
this.callerPrincipalCallback = new CallerPrincipalCallback(callerCallback.getSubject(),
callerCallback.getName());
} else if (callback instanceof PasswordValidationCallback) {
PasswordValidationCallback passCallback = (PasswordValidationCallback) callback;
this.passwordValidationCallback = new PasswordValidationCallback(passCallback.getSubject(),
passCallback.getUsername(), passCallback.getPassword());
} else if (callback instanceof GroupPrincipalCallback) {