2424import java .io .FileNotFoundException ;
2525import java .io .IOException ;
2626import org .apache .airavata .common .exception .ApplicationSettingsException ;
27- import org .apache .airavata .common .utils .DBUtil ;
2827import org .apache .airavata .credential .store .credential .impl .ssh .SSHCredential ;
2928import org .apache .airavata .credential .store .store .CredentialStoreException ;
3029import org .apache .airavata .credential .store .store .impl .SSHCredentialWriter ;
3332public class SSHCredentialTest {
3433
3534 public static void main (String [] args ) {
36- String jdbcURL = "jdbc:mysql://gw85.iu.xsede.org:3306/airavata_gw119" ;
37- String jdbcDriver = "com.mysql.jdbc.Driver" ;
38- String userName = "gtaDevUser" ;
39- String password = "gtaDevPWD" ;
4035 String gatewayId = "phasta" ;
4136 String privateKeyPath = "/Users/chathuri/Desktop/ssh_gw111/id_rsa" ;
4237 String pubKeyPath = "/Users/chathuri/Desktop/ssh_gw111/id_rsa.pub" ;
4338
4439 try {
45- DBUtil dbUtil = new DBUtil (jdbcURL , userName , password , jdbcDriver );
46- SSHCredentialWriter writer = new SSHCredentialWriter (dbUtil );
40+ SSHCredentialWriter writer = new SSHCredentialWriter ();
4741 SSHCredential sshCredential = new SSHCredential ();
4842 sshCredential .setGateway (gatewayId );
4943 String token = TokenGenerator .generateToken (gatewayId , null );
@@ -65,12 +59,6 @@ public static void main(String[] args) {
6559 sshCredential .setPassphrase ("ultrascan" );
6660 writer .writeCredentials (sshCredential );
6761 System .out .println (token );
68- } catch (ClassNotFoundException e ) {
69- e .printStackTrace ();
70- } catch (InstantiationException e ) {
71- e .printStackTrace ();
72- } catch (IllegalAccessException e ) {
73- e .printStackTrace ();
7462 } catch (ApplicationSettingsException e ) {
7563 e .printStackTrace ();
7664 } catch (CredentialStoreException e ) {
0 commit comments