Package net.messagevortex.transport.imap
Class ImapPassthruServer
java.lang.Object
net.messagevortex.transport.imap.ImapPassthruServer
-
Constructor Summary
ConstructorsConstructorDescriptionImapPassthruServer(InetSocketAddress listeningAddress, SecurityContext context, Credentials listeningCredentials, InetSocketAddress forwardingServer, Credentials forwardingCredentials) Create an IMAP passthru proxy server. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetPasswordFromUrl(String url) Retrieves the password from an IMAPUrl string.static intgetPortFromUrl(String url) retrieves the port number from an IMAPUrl string.static StringgetProtocolFromUrl(String url) retrieves the protocol string from an IMAPUrl string.static InetSocketAddressConvert an imap URL to a scket address with apropriate port.static StringgetUsernameFromUrl(String url) Retrieves the username from an IMAPUrl string.voidshutdown()
-
Constructor Details
-
ImapPassthruServer
public ImapPassthruServer(InetSocketAddress listeningAddress, SecurityContext context, Credentials listeningCredentials, InetSocketAddress forwardingServer, Credentials forwardingCredentials) throws IOException Create an IMAP passthru proxy server.
- Parameters:
listeningAddress- listening address for the incomming proxy portcontext- the security context for the proxy severlisteningCredentials- credentials for the listening proxyforwardingServer- IMAP address of the proxied serverforwardingCredentials- credentials for the proxied IMAP server- Throws:
IOException- if start of proxy fails
-
-
Method Details
-
shutdown
- Throws:
IOException
-
getUsernameFromUrl
Retrieves the username from an IMAPUrl string.
- Parameters:
url- the URL to extract the port- Returns:
- the username or null if none
- Throws:
ParseException- if URL does not follow specificationNullPointerException- if url is null
-
getPasswordFromUrl
Retrieves the password from an IMAPUrl string.
- Parameters:
url- the URL to extract the port- Returns:
- the encoded password or null if none
- Throws:
ParseException- if URL does not follow specificationNullPointerException- if url is null
-
getProtocolFromUrl
retrieves the protocol string from an IMAPUrl string.
- Parameters:
url- the URL to extract the port- Returns:
- the protocol string
- Throws:
ParseException- if URL does not follow specificationNullPointerException- if url is null
-
getPortFromUrl
retrieves the port number from an IMAPUrl string.
- Parameters:
url- the URL to extract the port- Returns:
- the port number
- Throws:
ParseException- if URL does not follow specificationNullPointerException- if url is null
-
getSocketAddressFromUrl
Convert an imap URL to a scket address with apropriate port.
- Parameters:
url- the URL to be cconvertde- Returns:
- An equivalent socket address
- Throws:
ParseException- if the pattern doeas not match a regular imap urlNullPointerException- if the URL is null
-