Package javax.security.auth.callback

Examples of javax.security.auth.callback.TextOutputCallback


        }
        // successful log in
        setSucceeded(true);
        return true;
      } else {
        TextOutputCallback toc = new TextOutputCallback(TextOutputCallback.WARNING, "Ok, try again then..");
        cb = createCallbackArray(toc);
        getCallbackHandler().handle(cb);
        return false;
      }
    } catch (IOException e) {
View Full Code Here


        }
        // successful log in
        setSucceeded(true);
        return true;
      } else {
        TextOutputCallback toc = new TextOutputCallback(TextOutputCallback.WARNING, "Ok, try again then..");
        cb = createCallbackArray(toc);
        getCallbackHandler().handle(cb);
        return false;
      }
    } catch (IOException e) {
View Full Code Here

        }
        if (cp.getAction().equals(ActionCallback.EXISTS_ACTION)) {
          cp.setMudObject(getLoggedInPlayer(cp.getObjectName()));
        }
      } else if (callbacks[x] instanceof TextOutputCallback) {
        TextOutputCallback cb = (TextOutputCallback) callbacks[x];
        getExtendedTerminalIO().writeln(cb.getMessage());
      } else {
        throw new UnsupportedCallbackException(callbacks[x]);
      }
    }
View Full Code Here

        }
        if (cp.getAction().equals(ActionCallback.EXISTS_ACTION)) {
          cp.setMudObject(getLoggedInPlayer(cp.getObjectName()));
        }
      } else if (callbacks[x] instanceof TextOutputCallback) {
        TextOutputCallback cb = (TextOutputCallback) callbacks[x];
        getExtendedTerminalIO().writeln(cb.getMessage());
      } else {
        throw new UnsupportedCallbackException(callbacks[x]);
      }
    }
View Full Code Here

  }
    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
      for (int i = 0; i < callbacks.length; i++) {
          if (callbacks[i] instanceof TextOutputCallback) {
           // display the message according to the specified type
          TextOutputCallback toc = (TextOutputCallback)callbacks[i];
          switch (toc.getMessageType()) {
            case TextOutputCallback.INFORMATION:
                System.out.println(toc.getMessage());
                break;
            case TextOutputCallback.ERROR:
                System.out.println("ERROR: " + toc.getMessage());
                break;
            case TextOutputCallback.WARNING:
                System.out.println("WARNING: " + toc.getMessage());
                break;
            default:
                throw new IOException("Unsupported message type: " +
                  toc.getMessageType());
          }
          } else if (callbacks[i] instanceof NameCallback) {
           NameCallback nc = (NameCallback)callbacks[i];
           nc.setName(userName);
          } else if (callbacks[i] instanceof PasswordCallback) {
View Full Code Here

TOP

Related Classes of javax.security.auth.callback.TextOutputCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.