if (callback instanceof TextOutputCallback) { TextOutputCallback toc = (TextOutputCallback) callback; switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println("INFO: " + toc.getMessage()); break; default: throw new IOException("Unsupported message type: " + toc.getMessageType());
if (callbacks[i] instanceof TextOutputCallback) { TextOutputCallback toc = (TextOutputCallback)callbacks[i]; switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println("INFO: " + toc.getMessage()); break; default: throw new IOException("Unsupported message type: " + toc.getMessageType());
final TextOutputCallback textOutputCallback = (TextOutputCallback) callback; final String kind; switch (textOutputCallback.getMessageType()) { case TextOutputCallback.ERROR: kind = "ERROR"; break; case TextOutputCallback.INFORMATION: kind = "INFORMATION"; break;
if (callbacks[i] instanceof TextOutputCallback) { TextOutputCallback toc = (TextOutputCallback)callbacks[i]; switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println("INFO: " + toc.getMessage()); break; default: throw new IOException("Unsupported message type: " + toc.getMessageType());
if (callbacks[i] instanceof TextOutputCallback) { TextOutputCallback toc = (TextOutputCallback)callbacks[i]; switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println("INFO: " + toc.getMessage()); break; default: throw new IOException("Unsupported message type: " + toc.getMessageType());
if (callbacks[i] instanceof TextOutputCallback) { TextOutputCallback toc = (TextOutputCallback)callbacks[i]; switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println("INFO: " + toc.getMessage());//$NON-NLS-1$ break; default: throw new IOException("Unsupported message type: " + toc.getMessageType()); //$NON-NLS-1$
protected void processCallback(Callback callback) throws IOException, UnsupportedCallbackException { if (callback instanceof NameCallback) { NameCallback namecb = (NameCallback)callback; namecb.setName(context.getValue(SecurityContext.USER_NAME)); } else if (callback instanceof PasswordCallback) { PasswordCallback passcb = (PasswordCallback)callback; passcb.setPassword(context.getValue(SecurityContext.PASSWORD)); } else if (callback instanceof RealmCallback) { RealmCallback realmcb = (RealmCallback)callback; realmcb.setText(context.getValue(SecurityContext.REALM)); } else if (callback instanceof TextOutputCallback) { TextOutputCallback textcb = (TextOutputCallback)callback; if (textcb.getMessageType() == TextOutputCallback.INFORMATION) { logger.info(textcb.getMessage()); } else if (textcb.getMessageType() == TextOutputCallback.WARNING) { logger.warn(textcb.getMessage()); } else if (textcb.getMessageType() == TextOutputCallback.ERROR) { logger.error(textcb.getMessage()); } else { logger.debug("Auth message type {}, message {}", textcb.getMessageType(), textcb.getMessage()); } } else { throw new UnsupportedCallbackException(callback); } } }
if (callbacks[i] instanceof TextOutputCallback) { TextOutputCallback toc = (TextOutputCallback)callbacks[i]; switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println("INFO: " + toc.getMessage());//$NON-NLS-1$ break; default: throw new IOException("Unsupported message type: " + toc.getMessageType()); //$NON-NLS-1$
private ULCIcon getIcon(TextOutputCallback callback) throws UnsupportedCallbackException { switch (callback.getMessageType()) { case TextOutputCallback.INFORMATION: return iconFactory.getInfoIcon(IIconFactory.SMALL_ICON_SIZE); case TextOutputCallback.WARNING: return iconFactory.getWarningIcon(IIconFactory.SMALL_ICON_SIZE); case TextOutputCallback.ERROR: return iconFactory.getErrorIcon(IIconFactory.SMALL_ICON_SIZE); default: throw new UnsupportedCallbackException(callback, "Unrecognized message type"); } }
private Icon getIcon(TextOutputCallback callback) throws UnsupportedCallbackException { switch (callback.getMessageType()) { case TextOutputCallback.INFORMATION: return iconFactory.getInfoIcon(IIconFactory.SMALL_ICON_SIZE); case TextOutputCallback.WARNING: return iconFactory.getWarningIcon(IIconFactory.SMALL_ICON_SIZE); case TextOutputCallback.ERROR: return iconFactory.getErrorIcon(IIconFactory.SMALL_ICON_SIZE); default: throw new UnsupportedCallbackException(callback, "Unrecognized message type"); } }
switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println(toc.getMessage()); default: throw new IOException("Unsupported message type: " + toc.getMessageType());
switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println(toc.getMessage()); break; default: throw new IOException("Unsupported message type: " + toc.getMessageType());
switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println(toc.getMessage()); default: throw new IOException("Unsupported message type: " + toc.getMessageType());
switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println(toc.getMessage()); default: throw new IOException("Unsupported message type: " + toc.getMessageType());
switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println(toc.getMessage()); break; default: throw new IOException("Unsupported message type: " + toc.getMessageType());
} else if (callbacks[i] instanceof TextOutputCallback) { TextOutputCallback outputCallback = (TextOutputCallback) callbacks[i]; switch (outputCallback.getMessageType()) { case TextOutputCallback.INFORMATION: log.info(outputCallback.getMessage()); break; default: log.debug("Unsupported message type : {} - Message:", outputCallback.getMessageType(), outputCallback.getMessage());
switch (tc.getMessageType()) { case TextOutputCallback.INFORMATION: text = "";
switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println(toc.getMessage()); break; default: final String message = ExceptionManager.getInstance().getFullMessage("buc_SCH_1", toc.getMessageType()); throw new IOException(message);
switch (toc.getMessageType()) { case TextOutputCallback.INFORMATION: System.out.println(toc.getMessage()); break; default: final String message = ExceptionManager.getInstance().getFullMessage("buc_SCH_1", toc.getMessageType()); throw new IOException(message);
private Icon getIcon(TextOutputCallback callback) throws UnsupportedCallbackException { switch (callback.getMessageType()) { case TextOutputCallback.INFORMATION: return iconFactory.getInfoIcon(iconFactory.getSmallIconSize()); case TextOutputCallback.WARNING: return iconFactory.getWarningIcon(iconFactory.getSmallIconSize()); case TextOutputCallback.ERROR: return iconFactory.getErrorIcon(iconFactory.getSmallIconSize()); default: throw new UnsupportedCallbackException(callback, "Unrecognized message type"); } }