change the way the waker works: let others register to be called by it
[saartuer.git] / JavaTuer / src / de / hacksaar / javatuer / InteractiveLogin.java
1 package de.hacksaar.javatuer;
2
3 import com.jcraft.jsch.UserInfo;
4
5 public abstract class InteractiveLogin implements UserInfo {
6         private String password;
7         private String passphrase;
8
9         @Override
10         public String getPassphrase() {
11                 return passphrase;
12         }
13
14         @Override
15         public String getPassword() {
16                 return password;
17         }
18
19         public abstract String promptKeyPassphrase(String question);
20
21         @Override
22         public boolean promptPassphrase(String s) {
23                 passphrase = promptKeyPassphrase(s);
24                 return passphrase != null;
25         }
26
27         @Override
28         public boolean promptPassword(String s) {
29                 password = promptUserPassword(s);
30                 return password != null;
31         }
32
33         public abstract String promptUserPassword(String question);
34 }