@Override public final UnsupportedCallbackException unableToHandleCallback(final Callback callback, final String callbackHandler, final String callbackType) { final UnsupportedCallbackException result = new UnsupportedCallbackException(callback, String.format(unableToHandleCallback$str(), callbackHandler, callbackType)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidSecurityAnnotationConfig = "PBOX00015: Invalid annotation configuration: either @SecurityConfig or @Authentication is needed";
@Override public final UnsupportedCallbackException unableToHandleCallback(final Callback callback, final String callbackHandler, final String callbackType) { final UnsupportedCallbackException result = new UnsupportedCallbackException(callback, String.format(unableToHandleCallback$str(), callbackHandler, callbackType)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidSecurityAnnotationConfig = "PBOX00015: Invalid annotation configuration: either @SecurityConfig or @Authentication is needed";
@Override public final UnsupportedCallbackException unableToHandleCallback(final Callback callback, final String callbackHandler, final String callbackType) { final UnsupportedCallbackException result = new UnsupportedCallbackException(callback, String.format(unableToHandleCallback$str(), callbackHandler, callbackType)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidSecurityAnnotationConfig = "PBOX00015: Invalid annotation configuration: either @SecurityConfig or @Authentication is needed";
@Override public final UnsupportedCallbackException realmNotSupported(final Callback callback) { final UnsupportedCallbackException result = new UnsupportedCallbackException(callback, String.format(getLoggingLocale(), realmNotSupported$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unableToLoadProperties = "WFLYDM0017: Unable to load properties";
@Override public final UnsupportedCallbackException realmNotSupported(final Callback callback) { final UnsupportedCallbackException result = new UnsupportedCallbackException(callback, String.format(getLoggingLocale(), realmNotSupported$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unableToLoadProperties = "WFLYDM0017: Unable to load properties";
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { WSPasswordCallback pc = null; try { pc = (WSPasswordCallback) callbacks[0]; } catch (ClassCastException ce) { UnsupportedCallbackException exception = new UnsupportedCallbackException(pc, "callback method is not of type " + WSPasswordCallback.class.getName()); exception.setStackTrace(ce.getStackTrace()); // stack trace is preserved throw exception; } String username = pc.getIdentifier(); if (passwordCache.get(username) == null) { throw new UnsupportedCallbackException(pc, "Password not set in client. Call static method " + ProgrammedPasswordCallback.class.getName() + ".addUserNameAndPassword(\"<your username>\", \"<your password>\")"); } setPassword(pc, username); }