Package ca.eandb.jdcp.remote

Examples of ca.eandb.jdcp.remote.AuthenticationService.authenticate()


  public JobService getJobService() {
    if (service == null) {
      try {
        Registry registry = LocateRegistry.getRegistry(host, JdcpUtil.DEFAULT_PORT);
        AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
        service = auth.authenticate(username, password, JdcpUtil.PROTOCOL_VERSION_ID);
      } catch (NotBoundException e) {
        System.err.println("Job service not found at remote host.");
        System.exit(1);
      } catch (RemoteException e) {
        System.err.println("Could not connect to job service.");
View Full Code Here


  private JobService connect(String host, String username, String password) {
    JobService service = null;
    try {
      Registry registry = LocateRegistry.getRegistry(host, JdcpUtil.DEFAULT_PORT);
      AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
      service = auth.authenticate(username, password, JdcpUtil.PROTOCOL_VERSION_ID);
    } catch (NotBoundException e) {
      logger.error("Job service not found at remote host.", e);
    } catch (RemoteException e) {
      logger.error("Could not connect to job service.", e);
    } catch (LoginException e) {
View Full Code Here

  public static JobService connect(String host, String username,
      String password) throws RemoteException, NotBoundException,
      LoginException, ProtocolVersionException {
    Registry registry = LocateRegistry.getRegistry(host, DEFAULT_PORT);
    AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
    return auth.authenticate(username, password, PROTOCOL_VERSION_ID);
  }

  /**
   * Submits a job to a server for processing.
   * @param job The <code>ParallelizableJob</code> to be processed.
View Full Code Here

        logger.info("Locating registry");
        Registry registry = LocateRegistry.getRegistry(host, JdcpUtil.DEFAULT_PORT);
        logger.info("Looking up AuthenticationService");
        AuthenticationService auth = (AuthenticationService) registry.lookup("AuthenticationService");
        logger.info("Authenticating");
        return auth.authenticate(username, password, JdcpUtil.PROTOCOL_VERSION_ID);
      } catch (Exception e) {
        logger.error("Job service not found at remote host.", e);
        throw new DelegationException("Could not connect to remote host", e);
      }
    } else {
View Full Code Here

  private JobService connect(String host, String user, String password, boolean showMessageDialog) {
    try {
      Registry registry = LocateRegistry.getRegistry(host, JdcpUtil.DEFAULT_PORT);
      AuthenticationService authService = (AuthenticationService) registry.lookup("AuthenticationService");
      return authService.authenticate(user, password, JdcpUtil.PROTOCOL_VERSION_ID);
    } catch (LoginException e) {
      logger.error("Authentication failed.", e);
      JOptionPane.showMessageDialog(this, "Authentication failed.  Please check your user name and password.", "Connection Failed", JOptionPane.WARNING_MESSAGE);
    } catch (RemoteException e) {
      logger.error("Could not connect to remote host.", e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.