View Javadoc

1   package fr.in2p3.jsaga.adaptor.data.impl;
2   
3   import fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer;
4   import fr.in2p3.jsaga.adaptor.schema.data.emulator.ServerType;
5   import fr.in2p3.jsaga.adaptor.security.impl.UserPassSecurityCredential;
6   import org.ogf.saga.error.*;
7   
8   /* ***************************************************
9   * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
10  * ***             http://cc.in2p3.fr/             ***
11  * ***************************************************
12  * File:   DataEmulatorConnectionSecure
13  * Author: Sylvain Reynaud (sreynaud@in2p3.fr)
14  * Date:   26 juin 2007
15  * ***************************************************
16  * Description:                                      */
17  /**
18   *
19   */
20  public class DataEmulatorConnectionSecure extends DataEmulatorConnectionAbstract {
21      private SecureServer m_serverRoot;
22  
23      public DataEmulatorConnectionSecure(String protocol, String host, int port, UserPassSecurityCredential security) throws AuthenticationFailedException, AuthorizationFailedException, TimeoutException, NoSuccessException {
24          super();
25          m_serverRoot = m_grid.connect(protocol, host, port, security);
26          if (m_serverRoot == null) {
27              throw new TimeoutException("Failed to connect to host: "+host);
28          }
29      }
30  
31      public void destroy() {
32          m_grid.disconnect(m_serverRoot);
33      }
34  
35      protected ServerType getServerRoot() {
36          return m_serverRoot;
37      }
38  }