|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jscape.inet.pop.Pop
com.jscape.inet.popssh.PopSsh
public class PopSsh
Implements the basic functionality of a POP3 client tunnelling all data through a secure SSH connection.
Example Usage:
// connection parameters for SSH server String sshHostname = "pop3.myserver.com"; String sshUsername = "jsmith"; String sshPassword = "secret"; // create new SshParameters instance SshParameters sshParams = new SshParameters(sshHostname,sshUsername,sshPassword); // new instance with SSH parameters, hostname, username and password PopSsh pop = new PopSsh(sshParams, "pop3.myserver.com","jsmith","secret"); try { // connect to POP3 server pop.connect(); // get messages Enumeration e = pop.getMessages(); while(e.hasMoreElements()) { EmailMessage em = (EmailMessage)e.nextElement(); } // disconnect pop.disconnect(); } catch(Exception e) { System.out.println(e); }
Field Summary |
---|
Fields inherited from class com.jscape.inet.pop.Pop |
---|
AUTH_APOP, AUTH_LOGIN, AUTH_PASS |
Constructor Summary | |
---|---|
PopSsh()
Constructs a new Pop instance. |
|
PopSsh(SshParameters sshParameters,
java.lang.String hostname,
java.lang.String username,
java.lang.String password)
Constructs a new PopSsh instance. |
|
PopSsh(java.lang.String hostname,
java.lang.String username,
java.lang.String password)
Constructs a new PopSsh instance. |
Method Summary | |
---|---|
void |
connect()
Connects to POP3 server tunelling data through SSH server and performs login with POP3 server. |
void |
disconnect()
Disconnects from POP3 server. |
SshParameters |
getSshParameters()
Gets SSH parameters used in establishing connection with SSH server. |
void |
setSshParameters(SshParameters parameters)
Sets SSH parameters used in establishing connection with SSH server. |
Methods inherited from class com.jscape.inet.pop.Pop |
---|
addPopListener, clearProxySettings, deleteMessage, getAuthMode, getConnectTimeout, getDebugStream, getHostname, getMessage, getMessageCount, getMessageReader, getMessages, getMessageSize, getPort, getReadTimeout, getTimeout, getTop, getUid, getUsername, isConnected, isDebug, isDelete, issueCommand, issueCommand, issueCommandMultiLine, removePopListener, setAuthMode, setConnectTimeout, setDebug, setDebugStream, setDelete, setHostname, setPassword, setPort, setProxyAuthentication, setProxyHost, setProxyType, setReadTimeout, setTimeout, setUsername |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PopSsh()
public PopSsh(java.lang.String hostname, java.lang.String username, java.lang.String password)
hostname
- the hostname of POP3 serverusername
- the username of POP3 userpassword
- the password of POP3 userpublic PopSsh(SshParameters sshParameters, java.lang.String hostname, java.lang.String username, java.lang.String password)
hostname
- the hostname of POP3 serverusername
- the username of POP3 userpassword
- the password of POP3 usersshParameters
- the SSH parameters used in establishing a secure connectionMethod Detail |
---|
public void connect() throws PopException
connect
in class Pop
PopException
- if I/O or POP3 related error occurspublic void disconnect() throws PopException
disconnect
in class Pop
PopException
- if I/O or POP3 related error occurspublic SshParameters getSshParameters()
SshParameters
public void setSshParameters(SshParameters parameters)
parameters
- the SSH parametersSshParameters
|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |