Package com.sun.mail.gimap.protocol
Class GmailProtocol
- java.lang.Object
-
- com.sun.mail.iap.Protocol
-
- com.sun.mail.imap.protocol.IMAPProtocol
-
- com.sun.mail.gimap.protocol.GmailProtocol
-
public class GmailProtocol extends IMAPProtocol
Extend IMAP support to handle Gmail-specific protocol extensions.- Since:
- JavaMail 1.4.6
- Author:
- Bill Shannon
-
-
Field Summary
Fields Modifier and Type Field Description static FetchItem
LABELS_ITEM
static FetchItem
MSGID_ITEM
static FetchItem
THRID_ITEM
-
Fields inherited from class com.sun.mail.imap.protocol.IMAPProtocol
enabled, searchCharsets, searchSequence
-
-
Constructor Summary
Constructors Constructor Description GmailProtocol(java.lang.String name, java.lang.String host, int port, java.util.Properties props, boolean isSSL, MailLogger logger)
Connect to Gmail.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FetchItem[]
getFetchItems()
Return the additional fetch items supported by the Gmail protocol.protected SearchSequence
getSearchSequence()
Return a GmailSearchSequence.void
storeLabels(int start, int end, java.lang.String[] labels, boolean set)
Set the specified labels on this message.void
storeLabels(int msg, java.lang.String[] labels, boolean set)
Set the specified labels on this message.void
storeLabels(MessageSet[] msgsets, java.lang.String[] labels, boolean set)
Set the specified labels on this message.-
Methods inherited from class com.sun.mail.imap.protocol.IMAPProtocol
append, appenduid, appenduid, authlogin, authntlm, authoauth2, authplain, capability, check, close, compress, copy, copy, copyuid, copyuid, create, createFlagList, delete, deleteACL, disconnect, doList, enable, examine, examine, expunge, fetch, fetch, fetch, fetchBody, fetchBody, fetchBody, fetchBody, fetchBody, fetchBodyStructure, fetchFlags, fetchMODSEQ, fetchRFC822, fetchSectionBody, fetchSequenceNumber, fetchSequenceNumbers, fetchSequenceNumbers, fetchUID, getACL, getCapabilities, getCopyUID, getProxyAuthUser, getQuota, getQuotaRoot, getResponseBuffer, handleCapabilityResponse, handleLoginResult, hasCapability, id, id, idleAbort, idleStart, isAuthenticated, isEnabled, isREV1, list, listRights, login, logout, lsub, move, move, moveuid, moveuid, myRights, namespace, noop, parseCapabilities, peekBody, peekBody, peekBody, processGreeting, processIdleResponse, proxyauth, readIdleResponse, readResponse, rename, sasllogin, search, search, select, select, setACL, setCapabilities, setQuota, sort, startTLS, status, storeFlags, storeFlags, storeFlags, subscribe, supportsNonSyncLiterals, supportsUtf8, uidexpunge, uidfetchChangedSince, unauthenticate, unselect, unsubscribe, writeMailboxName
-
Methods inherited from class com.sun.mail.iap.Protocol
addResponseHandler, command, finalize, getChannel, getInetAddress, getInputStream, getLocalHost, getOutputStream, getTimestamp, handleResult, hasResponse, isSSL, isTracing, notifyResponseHandlers, removeResponseHandler, resumeTracing, simpleCommand, startCompression, startTLS, suspendTracing, writeCommand
-
-
-
-
Constructor Detail
-
GmailProtocol
public GmailProtocol(java.lang.String name, java.lang.String host, int port, java.util.Properties props, boolean isSSL, MailLogger logger) throws java.io.IOException, ProtocolException
Connect to Gmail.- Parameters:
name
- the protocol namehost
- host to connect toport
- portnumber to connect toprops
- Properties object used by this protocolisSSL
- use SSL?logger
- for log messages- Throws:
java.io.IOException
- for I/O errorsProtocolException
- for protocol failures
-
-
Method Detail
-
getFetchItems
public FetchItem[] getFetchItems()
Return the additional fetch items supported by the Gmail protocol. Combines our fetch items with those supported by the superclass.- Overrides:
getFetchItems
in classIMAPProtocol
- Returns:
- an array of FetchItem objects
-
storeLabels
public void storeLabels(MessageSet[] msgsets, java.lang.String[] labels, boolean set) throws ProtocolException
Set the specified labels on this message.- Parameters:
msgsets
- the message setslabels
- the labelsset
- true to set, false to clear- Throws:
ProtocolException
- for protocol failures- Since:
- JavaMail 1.5.5
-
storeLabels
public void storeLabels(int start, int end, java.lang.String[] labels, boolean set) throws ProtocolException
Set the specified labels on this message.- Parameters:
start
- the first message numberend
- the last message numberlabels
- the labelsset
- true to set, false to clear- Throws:
ProtocolException
- for protocol failures- Since:
- JavaMail 1.5.5
-
storeLabels
public void storeLabels(int msg, java.lang.String[] labels, boolean set) throws ProtocolException
Set the specified labels on this message.- Parameters:
msg
- the message numberlabels
- the labelsset
- true to set, false to clear- Throws:
ProtocolException
- for protocol failures- Since:
- JavaMail 1.5.5
-
getSearchSequence
protected SearchSequence getSearchSequence()
Return a GmailSearchSequence.- Overrides:
getSearchSequence
in classIMAPProtocol
- Returns:
- the SearchSequence
-
-