Oracle® Mail Java API Reference
10g Release 1 (10.1.1)

B14492-01

oracle.mail.sdk.esmail
Class OracleFolder

java.lang.Object
  |
  +--javax.mail.Folder
        |
        +--oracle.mail.sdk.esmail.OracleFolder
Direct Known Subclasses:
DefaultFolder, OracleSharedFolder

public class OracleFolder
extends javax.mail.Folder
implements javax.mail.UIDFolder

This class implements an Oracle folder.

When a folder is opened, a messageCache (Vector) and a uidMap (Hashtable) is created. The messageCache contains a list of Message objects with only a small set of information filled in. The uidMap provides quick access to the Message object using the message UID.

When information is needed from the store, a database connection is retrieved from the database pool (OracleDBPool) and then released back to the pool when the operation is complete.


Inner Class Summary
static class OracleFolder.OracleFlag

Inner classes inherited from class javax.mail.UIDFolder
javax.mail.UIDFolder.FetchProfileItem

Fields inherited from class javax.mail.Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE

Fields inherited from interface javax.mail.UIDFolder
LASTUID

Method Summary
javax.mail.Message[] _doSearch(java.lang.String criteria)
void addACI(java.lang.String aUser, java.lang.String aAci)
Takes in a user_address, ACI string and calls an LDAP api to set the ACI for the user.
void addACI(java.lang.String aUser, java.lang.String aAci, boolean fullACISupport)
Deprecated.
void addACI(java.lang.String aUser, java.lang.String aAci, int mode)
Takes in a user_address, ACI string and an integer with the approporate flag bit set to indicate whether the full ACI list is supported and whether to apply the ACI rights recursively down the folder hierarchy.
void addACI(java.lang.String aUserType, java.lang.String aUser, java.lang.String aAci)
addACI method takes in a user type, user_address, aci string and calls ldap api to set the aci for the user.
void addACI(java.lang.String aUserType, java.lang.String aUser, java.lang.String aAci, boolean fullACISupport)
Deprecated.
void addACI(java.lang.String aUserType, java.lang.String aUser, java.lang.String aAci, int mode)
Takes in a user_address, ACI string and a flag to determine if the full ACI list is supported or not and calls a LDAP api to set the ACI for the user.
void appendMessages(javax.mail.Message[] msgs)
Appends messages to this folder.
void appendMessages(javax.mail.Message[] msgs, java.lang.String migrationID_header)
Appends messages to this folder.
void appendMessages(javax.mail.Message[] msgs, java.lang.String dateStr, boolean rflag)
void close(boolean expunge)
Closes the folder and expunges the folder if requested.
static int convertFlag(javax.mail.Flags flag)
static javax.mail.Flags convertFlag(int flags)
long convertUsrFlag(javax.mail.Flags flag)
void copyMessages(javax.mail.Message[] msgs, javax.mail.Folder folder)
Copies the specified messages from this folder to the specified destination folder.
boolean create(int type)
If type doesn't have HOLDS_MESSAGES, it implies /NOSELECT.
boolean delete(boolean recurse)
Deletes this folder.
boolean exists()
Checks if the folder exists on the store.
javax.mail.Message[] expunge()
Expunges messages marked \DELETED.
void fetch(javax.mail.Message[] msgs, javax.mail.FetchProfile fp)
Prefetches the items specified in the FetchProfile for the given messages.
int[][] getCounts()
This method returns the counts for the folder as a 2-D array.
OracleFilteredMsgHdrs[] getFilteredHeaders(long[] msgUids)
Returns a list of .
javax.mail.Folder getFolder(java.lang.String name)
Returns the folder object corresponding to the given name.
int getFolderExpiry()
Gets the expiry limit for the folder.
long getFolderId()
Returns the internal folder id for this folder.
long getFolderSize()
Returns the sum total of the sizes of all the messages in a folder.
long getFolderSize(boolean recurse)
Returns the sum total of the sizes of all the messages in a folder.
java.lang.String getFullName()
Returns the current folder's full name which DOES NOT contain the namespace
java.lang.String getFullPath()
Returns the full folder name with the namespace.
java.util.Vector getGranteeACI()
Returns a vector of OracleGranteeACI objects.
javax.mail.Message getMessage(int msgnum)
Returns the message object corresponding to the given message number.
javax.mail.Message[] getMessageByType(int type)
Returns the message object that corresponds to the given message type.
javax.mail.Message getMessageByUID(long uid)
Returns the Message object that corresponds to the given message uid.
int getMessageCount()
Returns the total number of messages in a folder.
javax.mail.Message[] getMessagesByUID(long[] uids)
Returns the messages specified in the UID array.
javax.mail.Message[] getMessagesByUID(long start, long end)
Returns the messages specified in the range (inclusively).
java.lang.String getName()
Returns the cannonical name of the folder.
int getNewMessageCount()
Returns the number of messages with \RECENT flag in this folder.
javax.mail.Folder getParent()
Returns a new folder object that represents the parent of this folder.
javax.mail.Flags getPermanentFlags()
Returns the list of permanent flags.
char getSeparator()
Returns the folder delimiter character.
int getType()
Returns the folder type - HOLDS_FOLDER, HOLDS_MESSAGE.
long getUID(javax.mail.Message message)
Returns the msg UID for the specified message.
long getUIDValidity()
Returns the uid validity information for the folder.
int getUnreadMessageCount()
Returns the total number of unread messages in a folder.
javax.mail.URLName getURLName()
Returns the URL name reprensenting this folder.
boolean hasNewMessages()
Checks whether the folder has messages with the \RECENT flag set.
boolean isInheritedACI(java.lang.String aUser)
Takes in an user_address and check if the rights is inherited from parent folder.
boolean isOpen()
Returns the opened flag.
boolean isShared()
Checks if the folder is shared.
boolean isSubscribed()
Returns true if this folder is subscribed.
javax.mail.Folder[] list(java.lang.String pattern)
Returns a list of folder objects that match the pattern.
javax.mail.Folder[] listSubscribed(java.lang.String pattern)
Returns a list subscribed of folder objects that match the pattern.
void modifyACI(java.lang.String aUser, java.lang.String aACI)
Deprecated.
void modifyACI(java.lang.String aUserType, java.lang.String aUser, java.lang.String aACI)
Deprecated.
void moveMessages(javax.mail.Message[] msgs, javax.mail.Folder folder)
Moves messages to other folders.
void open(int mode)
Returns the folder information and then fetches all the messages in the folder.
void openInternal(int mode)
void removeACI(java.lang.String aUser)
Takes in a user_address and removes folder access for the user.
void removeACI(java.lang.String aUser, int mode)
Takes in a user_address and removes folder access for the user.
void removeACI(java.lang.String aUserType, java.lang.String aUser)
Takes in a user type, user_address and removes access for the user.
void removeACI(java.lang.String aUserType, java.lang.String aUser, int mode)
Takes in a user type, user_address and removes access for the user.
boolean renameTo(javax.mail.Folder f)
Renames this folder and notifies the RenameListeners.
javax.mail.Message[] search(javax.mail.search.SearchTerm term)
Constructs the IMAP4 search string and calls the PL/SQL search.
javax.mail.Message[] search(javax.mail.search.SearchTerm term, javax.mail.Message[] msgs)
Constructs the IMAP4 search string and calls the PL/SQL search.
void setFlags(int[] msgnums, javax.mail.Flags flag, boolean value)
Set flags for the folder.
void setFlags(int start, int end, javax.mail.Flags flag, boolean value)
Sets flags for the folder.
void setFlags(javax.mail.Message[] msgs, javax.mail.Flags flag, boolean value)
Set flags
void setFolderExpiry(int daysKept)
Sets the expiry limit for the folder.
void setSubscribed(boolean subscribe)
Subscribes or unsubscribes the folder.
long[] sortMessages(java.util.Vector aSortCriteriaVector)
Sorts the messages in the folder according to the specified order, returning a list of message UIDs.

Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, getMessages, getMessages, getMessages, getMode, getStore, list, listSubscribed, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, toString

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

appendMessages

public void appendMessages(javax.mail.Message[] msgs)
                    throws javax.mail.MessagingException
Appends messages to this folder.
Overrides:
appendMessages in class javax.mail.Folder
Parameters:
msgs - Message objects to append into this folder
See Also:
Folder.appendMessages

appendMessages

public void appendMessages(javax.mail.Message[] msgs,
                           java.lang.String migrationID_header)
                    throws javax.mail.MessagingException
Appends messages to this folder.
Parameters:
msgs - Message objects to append into this folder
migrationID_header - Message header where the migration ID is store
See Also:
javax.mail.Folder.appendMessages

appendMessages

public void appendMessages(javax.mail.Message[] msgs,
                           java.lang.String dateStr,
                           boolean rflag)
                    throws javax.mail.MessagingException

close

public void close(boolean expunge)
           throws javax.mail.MessagingException
Closes the folder and expunges the folder if requested.
Overrides:
close in class javax.mail.Folder
Parameters:
expunge - Flag to indicate if expunge is required
See Also:
Folder.close()

copyMessages

public void copyMessages(javax.mail.Message[] msgs,
                         javax.mail.Folder folder)
                  throws javax.mail.MessagingException
Copies the specified messages from this folder to the specified destination folder. Message objects MUST belong to this Folder.
Overrides:
copyMessages in class javax.mail.Folder
See Also:
javax.mail.Folder.copyMessages

create

public boolean create(int type)
               throws javax.mail.MessagingException
If type doesn't have HOLDS_MESSAGES, it implies /NOSELECT. This means you cannot open the folder. If type doesn't have HOLDS_FOLDER, it implies /NOINFERIORS. This means you cannot create subfolders. NOTE: The INBOX is case-sensitive, all capital letters. In addition, creation of any folder with the name inbox is not allowed.
Overrides:
create in class javax.mail.Folder
See Also:
javax.mail.Folder.create()

delete

public boolean delete(boolean recurse)
               throws javax.mail.MessagingException
Deletes this folder. If recurse is true, delete all the sub-folders. as well. Notifies the listeners of the DELETE event. NOTE: The INBOX is case-sensitive, all capital letters. In addition, creation or deletion of any folder with the name inbox is not allowed.
Overrides:
delete in class javax.mail.Folder
See Also:
Folder.delete

exists

public boolean exists()
               throws javax.mail.MessagingException
Checks if the folder exists on the store.
Overrides:
exists in class javax.mail.Folder
See Also:
javax.mail.Folder.exists

moveMessages

public void moveMessages(javax.mail.Message[] msgs,
                         javax.mail.Folder folder)
                  throws javax.mail.MessagingException
Moves messages to other folders. This is an extended api. To use this api cast to OracleFolder. In OCS version 2, it is possible to use this api to copy between shared folders.

expunge

public javax.mail.Message[] expunge()
                             throws javax.mail.MessagingException
Expunges messages marked \DELETED. Returns an array containing the expunged message objects.
Overrides:
expunge in class javax.mail.Folder
See Also:
Folder.expunge()

fetch

public void fetch(javax.mail.Message[] msgs,
                  javax.mail.FetchProfile fp)
           throws javax.mail.MessagingException
Prefetches the items specified in the FetchProfile for the given messages.
Overrides:
fetch in class javax.mail.Folder
See Also:
javax.mail.Folder.fetch

getFolder

public javax.mail.Folder getFolder(java.lang.String name)
                            throws javax.mail.MessagingException
Returns the folder object corresponding to the given name. It doesn't have to physically exist in the Store. NOTE: The INBOX is case-sensitive, all capital letters. In addition, creation or deletion of any folder with the name inbox is not allowed. Assume that the folder name is relative to the current folder; absolute path is NOT supported.
Overrides:
getFolder in class javax.mail.Folder
See Also:
javax.mail.Folder.getFolder

getFullName

public java.lang.String getFullName()
Returns the current folder's full name which DOES NOT contain the namespace
Overrides:
getFullName in class javax.mail.Folder
See Also:
javax.mail.Folder.getFullName

getMessage

public javax.mail.Message getMessage(int msgnum)
                              throws javax.mail.MessagingException
Returns the message object corresponding to the given message number.
Overrides:
getMessage in class javax.mail.Folder
See Also:
javax.mail.Folder.getMessage

getMessageCount

public int getMessageCount()
                    throws javax.mail.MessagingException
Returns the total number of messages in a folder. NOTE: For optimization, we can just use the cached number, but it may be out of sync with what is in the store.
Overrides:
getMessageCount in class javax.mail.Folder
See Also:
javax.mail.Folder.getMessageCount

getName

public java.lang.String getName()
Returns the cannonical name of the folder.
Overrides:
getName in class javax.mail.Folder
See Also:
javax.mail.Folder.getName

getNewMessageCount

public int getNewMessageCount()
                       throws javax.mail.MessagingException
Returns the number of messages with \RECENT flag in this folder. If opened, do a NOOP and return the number of recent messages. If closed, do a STATUS and return the number of recent messages.
Overrides:
getNewMessageCount in class javax.mail.Folder
See Also:
javax.mail.Folder.getNewMessageCount()

getParent

public javax.mail.Folder getParent()
                            throws javax.mail.MessagingException
Returns a new folder object that represents the parent of this folder.
Overrides:
getParent in class javax.mail.Folder
See Also:
javax.mail.Folder.getParent

getPermanentFlags

public javax.mail.Flags getPermanentFlags()
Returns the list of permanent flags.
Overrides:
getPermanentFlags in class javax.mail.Folder
See Also:
javax.mail.Folder.getPermanentFlags

getSeparator

public char getSeparator()
Returns the folder delimiter character.
Overrides:
getSeparator in class javax.mail.Folder
See Also:
javax.mail.Folder.getSeparator

getType

public int getType()
            throws javax.mail.MessagingException
Returns the folder type - HOLDS_FOLDER, HOLDS_MESSAGE. This information is from the cache; may be out of sync with the store.
Overrides:
getType in class javax.mail.Folder
See Also:
javax.mail.Folder.getType

getUnreadMessageCount

public int getUnreadMessageCount()
                          throws javax.mail.MessagingException
Returns the total number of unread messages in a folder. NOTE: in the opened state, returning a cached unread number; it may be out of sync with what is in the store.
Overrides:
getUnreadMessageCount in class javax.mail.Folder
See Also:
javax.mail.Folder.getUnreadMessageCount

getURLName

public javax.mail.URLName getURLName()
                              throws javax.mail.MessagingException
Returns the URL name reprensenting this folder.
Overrides:
getURLName in class javax.mail.Folder
See Also:
javax.mail.Folder.getURLName

hasNewMessages

public boolean hasNewMessages()
                       throws javax.mail.MessagingException
Checks whether the folder has messages with the \RECENT flag set. If folder is open, already know the number of recent msgs. If folder is closed, check for recent messages.
Overrides:
hasNewMessages in class javax.mail.Folder
See Also:
javax.mail.Folder.hasNewMessages

isOpen

public boolean isOpen()
Returns the opened flag.
Overrides:
isOpen in class javax.mail.Folder
See Also:
javax.mail.Folder.isOpen

isSubscribed

public boolean isSubscribed()
Returns true if this folder is subscribed.
Overrides:
isSubscribed in class javax.mail.Folder
See Also:
javax.mail.Folder.isSubscribed

list

public javax.mail.Folder[] list(java.lang.String pattern)
                         throws javax.mail.MessagingException
Returns a list of folder objects that match the pattern.
Overrides:
list in class javax.mail.Folder
See Also:
javax.mail.Folder.list

listSubscribed

public javax.mail.Folder[] listSubscribed(java.lang.String pattern)
                                   throws javax.mail.MessagingException
Returns a list subscribed of folder objects that match the pattern.
Overrides:
listSubscribed in class javax.mail.Folder
See Also:
javax.mail.Folder.listSubscribed

open

public void open(int mode)
          throws javax.mail.MessagingException
Returns the folder information and then fetches all the messages in the folder. Creates light weight message objects.
Overrides:
open in class javax.mail.Folder
See Also:
javax.mail.Folder.open

openInternal

public void openInternal(int mode)
                  throws javax.mail.MessagingException

renameTo

public boolean renameTo(javax.mail.Folder f)
                 throws javax.mail.MessagingException
Renames this folder and notifies the RenameListeners.
Overrides:
renameTo in class javax.mail.Folder
See Also:
javax.mail.Folder.renameTo

_doSearch

public javax.mail.Message[] _doSearch(java.lang.String criteria)
                               throws javax.mail.MessagingException

search

public javax.mail.Message[] search(javax.mail.search.SearchTerm term)
                            throws javax.mail.MessagingException
Constructs the IMAP4 search string and calls the PL/SQL search.
Overrides:
search in class javax.mail.Folder
See Also:
javax.mail.Folder.search

search

public javax.mail.Message[] search(javax.mail.search.SearchTerm term,
                                   javax.mail.Message[] msgs)
                            throws javax.mail.MessagingException
Constructs the IMAP4 search string and calls the PL/SQL search.
Overrides:
search in class javax.mail.Folder
See Also:
javax.mail.Folder.search

setFlags

public void setFlags(int[] msgnums,
                     javax.mail.Flags flag,
                     boolean value)
              throws javax.mail.MessagingException
Set flags for the folder.
Overrides:
setFlags in class javax.mail.Folder
See Also:
javax.mail.Folder.setFlags

setFlags

public void setFlags(int start,
                     int end,
                     javax.mail.Flags flag,
                     boolean value)
              throws javax.mail.MessagingException
Sets flags for the folder.
Overrides:
setFlags in class javax.mail.Folder
See Also:
javax.mail.Folder.setFlags

setFlags

public void setFlags(javax.mail.Message[] msgs,
                     javax.mail.Flags flag,
                     boolean value)
              throws javax.mail.MessagingException
Set flags
Overrides:
setFlags in class javax.mail.Folder
See Also:
javax.mail.Folder.setFlags

setSubscribed

public void setSubscribed(boolean subscribe)
                   throws javax.mail.MessagingException
Subscribes or unsubscribes the folder.
Overrides:
setSubscribed in class javax.mail.Folder
See Also:
javax.mail.Folder.setSubscribed

getMessageByUID

public javax.mail.Message getMessageByUID(long uid)
                                   throws javax.mail.MessagingException
Returns the Message object that corresponds to the given message uid. If not such message exists, null is returned.
Specified by:
getMessageByUID in interface javax.mail.UIDFolder
See Also:
javax.mail.UIDFolder.getMessageByUID

getMessagesByUID

public javax.mail.Message[] getMessagesByUID(long[] uids)
                                      throws javax.mail.MessagingException
Returns the messages specified in the UID array. If any uid in the array is invalid, a null entry is returned for that element.
Specified by:
getMessagesByUID in interface javax.mail.UIDFolder
See Also:
javax.mail.UIDFolder.getMessagesByUID

getMessagesByUID

public javax.mail.Message[] getMessagesByUID(long start,
                                             long end)
                                      throws javax.mail.MessagingException
Returns the messages specified in the range (inclusively). If any uid in the range is invalid, a null entry is returned for that element.
Specified by:
getMessagesByUID in interface javax.mail.UIDFolder
See Also:
javax.mail.UIDFolder.getMessagesByUID

getUID

public long getUID(javax.mail.Message message)
            throws javax.mail.MessagingException
Returns the msg UID for the specified message.
Specified by:
getUID in interface javax.mail.UIDFolder
See Also:
javax.mail.UIDFolder.getUID

getUIDValidity

public long getUIDValidity()
                    throws javax.mail.MessagingException
Returns the uid validity information for the folder.
Specified by:
getUIDValidity in interface javax.mail.UIDFolder
See Also:
javax.mail.UIDFolder.getUIDValidity

getFullPath

public java.lang.String getFullPath()
Returns the full folder name with the namespace.

getFolderId

public long getFolderId()
                 throws javax.mail.MessagingException
Returns the internal folder id for this folder.

convertFlag

public static int convertFlag(javax.mail.Flags flag)

convertUsrFlag

public long convertUsrFlag(javax.mail.Flags flag)
                    throws javax.mail.MessagingException

convertFlag

public static javax.mail.Flags convertFlag(int flags)

addACI

public void addACI(java.lang.String aUser,
                   java.lang.String aAci)
            throws javax.mail.MessagingException
Takes in a user_address, ACI string and calls an LDAP api to set the ACI for the user. The user type defaults to mailuser(ESDSConstants.DS_MAILUSER). In OCS version 1, no grouping of ACIs was done. The only supported acis were i(write) and r(read). In OCS version 2, this api will continue to be supported However, the ACIs will be grouped as follows for backward compatibility reasons:
If you give only the "r" ACI, the following ACIs are also granted: l - list/lookup, r - read, s - set seen/unseen flags,
If you give only the "i" ACI, the following ACIs will also be granted: l - list/lookup, w - set other flags, i - insert, d - set delete flag
If you choose to use the OCS version 2 method use: addACI (String aUser, String aACI, OracleACI.FULL_ACI_SUPPORT) OR addACI (String aUserType, String aUser, String aCI, OracleACI.FULL_ACI_SUPPORT)

Parameters:
aUser - user, dl, domain, etc to be granted access to shared folder
aAci - user's ACI
Throws:
javax.mail.MessagingException - IOException

addACI

public void addACI(java.lang.String aUser,
                   java.lang.String aAci,
                   boolean fullACISupport)
            throws javax.mail.MessagingException
Deprecated.
Takes in a user_address, ACI string and a flag to determine if the full ACI list is supported or not and calls a LDAP api to set the ACI for the user. The user type defaults to mailuser(ESDSConstants.DS_MAILUSER). This method is deprecated. Please use addACI (String aUser, String aAci, OracleACI.FULL_ACI_SUPPORT) to use the fully supported ACI list.
The full ACI list supported in OCS version 2 is : l - list/lookup, r - read, s - set seen/unseen flags, w - set other flags, i - insert, d - set delete flag, a - admin
No grouping of acis is done in OCS version 2. Each aci has to be explicitly granted including l. However, OJMA implicitly allows lookup/listing for backward compatibility.

Parameters:
aUser - user, dl, domain, etc to be granted access to shared folder
aAci - user's aci
Throws:
javax.mail.MessagingException - IOException

addACI

public void addACI(java.lang.String aUser,
                   java.lang.String aAci,
                   int mode)
            throws javax.mail.MessagingException
Takes in a user_address, ACI string and an integer with the approporate flag bit set to indicate whether the full ACI list is supported and whether to apply the ACI rights recursively down the folder hierarchy. The user type defaults to mailuser(ESDSConstants.DS_MAILUSER)
The full ACI list supported in OCS version 2 is : l - list/lookup, r - read, s - set seen/unseen flags, w - set other flags, i - insert, d - set delete flag, a - admin
The available mode to specify is : OracleACI.FULL_ACI_SUPPORT - support the full ACI list OracleACI.RECURSE_REPLACE - recursively apply the ACI rights
No grouping of acis is done in OCS version 2. Each aci has to be explicitly granted including l. However, OJMA implicitly allows lookup/listing for backward compatibility.

Parameters:
aUser - user, dl, domain, etc to be granted access to shared folder
aAci - user's aci
mode - the way to process and apply the aci
Throws:
javax.mail.MessagingException - IOException

addACI

public void addACI(java.lang.String aUserType,
                   java.lang.String aUser,
                   java.lang.String aAci,
                   boolean fullACISupport)
            throws javax.mail.MessagingException
Deprecated.
Takes in a user_address, ACI string and a flag to determine if the full ACI list is supported or not and calls a LDAP api to set the ACI for the user. The user type defaults to mailuser(ESDSConstants.DS_MAILUSER). This method is deprecated. Please use addACI (String aUserType, String aUser, String aAci, OracleACI.FULL_ACI_SUPPORT) to use the fully supported ACI list.
The full ACL list supported in OCS version 2 is : l - list/lookup, r - read, s - set seen/unseen flags, w - set other flags, i - insert, d - set delete flag, a - admin
No grouping of ACIs is done in OCS version 2. Each ACI has to be explicitly granted including l. Set the fullACISupport to true to use v2 style ACI support.
For backward compatibility reasons, OJMA implicitly allows lookup/listing even though the ACI is not present in the ACI list.

Parameters:
aUserType - user - ESDSConstants.DS_MAILUSER, dl - ESDSConstants.DS_DISTRIBUTION_LIST, domain - ESDSConstants.DS_DOMAIN
aUser - user, dl, domain, etc to be granted access to shared folder
aAci - user's aci
fullACISupport - flag for full aci vs r,i only
Throws:
javax.mail.MessagingException - IOException

addACI

public void addACI(java.lang.String aUserType,
                   java.lang.String aUser,
                   java.lang.String aAci,
                   int mode)
            throws javax.mail.MessagingException
Takes in a user_address, ACI string and a flag to determine if the full ACI list is supported or not and calls a LDAP api to set the ACI for the user. The user type defaults to mailuser(ESDSConstants.DS_MAILUSER)
The full ACL list supported in OCS version 2 is : l - list/lookup, r - read, s - set seen/unseen flags, w - set other flags, i - insert, d - set delete flag, a - admin
The available mode to specify is : OracleACI.FULL_ACI_SUPPORT - support the full ACI list OracleACI.RECURSE_REPLACE - recursively apply the ACI rights
No grouping of ACIs is done in OCS version 2. Each ACI has to be explicitly granted including l. Specify OracleACI.FULL_ACI_SUPPORT to use v2 style ACI support.
For backward compatibility reasons, OJMA implicitly allows lookup/listing even though the ACI is not present in the ACI list.

Parameters:
aUserType - user - ESDSConstants.DS_MAILUSER, dl - ESDSConstants.DS_DISTRIBUTION_LIST, domain - ESDSConstants.DS_DOMAIN
aUser - user, dl, domain, etc to be granted access to shared folder
aAci - user's aci
mode - the way to process and apply the aci
Throws:
javax.mail.MessagingException - IOException

addACI

public void addACI(java.lang.String aUserType,
                   java.lang.String aUser,
                   java.lang.String aAci)
            throws javax.mail.MessagingException
addACI method takes in a user type, user_address, aci string and calls ldap api to set the aci for the user. The full ACL list supported in OCS v2 is : l - list/lookup, r - read, s - set seen/unseen flags, w - set other flags, i - insert, d - set delete flag No grouping of acis is done in OCS v2. Each aci has to be explicitly granted including l. Set the fullACISupport to true to use v2 style aci support. For backward compatibility reasons, OJMA implicitly allows lookup/listing even though the aci is not present in the aci list.

Parameters:
aUserType - user - ESDSConstants.DS_MAILUSER, dl - ESDSConstants.DS_DISTRIBUTION_LIST, domain - ESDSConstants.DS_DOMAIN
aUser - user, dl, domain, etc to be granted access to shared folder
aAci - user's aci
Throws:
javax.mail.MessagingException - IOException

removeACI

public void removeACI(java.lang.String aUser)
               throws javax.mail.MessagingException
Takes in a user_address and removes folder access for the user. Calls an LDAP api to remove shared folder ACI for the user. User type defaults to mailuser(ESDSConstants.DS_MAILUSER).
Parameters:
aUser - user, dl, domain, oid group to be granted access to shared folder
Throws:
javax.mail.MessagingException -

removeACI

public void removeACI(java.lang.String aUser,
                      int mode)
               throws javax.mail.MessagingException
Takes in a user_address and removes folder access for the user. Also takes an integer to indicate whether to remove the aci rights recursively. Calls an LDAP api to remove shared folder ACI for the user. User type defaults to mailuser(ESDSConstants.DS_MAILUSER).

The available mode to specify is : OracleACI.FULL_ACI_SUPPORT - support the full ACI list OracleACI.RECURSE_REPLACE - recursively apply the ACI rights

Parameters:
aUser - user, dl, domain, oid group to be granted access to shared folder
mode - the way to process and apply the aci
Throws:
javax.mail.MessagingException -

removeACI

public void removeACI(java.lang.String aUserType,
                      java.lang.String aUser,
                      int mode)
               throws javax.mail.MessagingException
Takes in a user type, user_address and removes access for the user. Also takes an integer to indicate whether to remove the aci rights recursively. Calls an LDAP api to remove the shared folder ACI for the user.

The available mode to specify is : OracleACI.FULL_ACI_SUPPORT - support the full ACI list OracleACI.RECURSE_REPLACE - recursively apply the ACI rights

Parameters:
aUserType - user - ESDSConstants.DS_MAILUSER, dl - ESDSConstants.DS_DISTRIBUTION_LIST, domain - ESDSConstants.DS_DOMAIN
aUser - user, dl, domain, oid group to be granted access to shared folder
mode - the way to process and apply the aci
Throws:
javax.mail.MessagingException -

removeACI

public void removeACI(java.lang.String aUserType,
                      java.lang.String aUser)
               throws javax.mail.MessagingException
Takes in a user type, user_address and removes access for the user. Calls an LDAP api to remove the shared folder ACI for the user.
Parameters:
aUserType - user - ESDSConstants.DS_MAILUSER, dl - ESDSConstants.DS_DISTRIBUTION_LIST, domain - ESDSConstants.DS_DOMAIN
aUser - user, dl, domain, oid group to be granted access to shared folder
Throws:
javax.mail.MessagingException -

isInheritedACI

public boolean isInheritedACI(java.lang.String aUser)
                       throws javax.mail.MessagingException
Takes in an user_address and check if the rights is inherited from parent folder.
Parameters:
aUser - user, dl, domain, oid group to be granted access to shared folder
Throws:
javax.mail.MessagingException -

modifyACI

public void modifyACI(java.lang.String aUser,
                      java.lang.String aACI)
               throws javax.mail.MessagingException
Deprecated.
modifyACI method takes in a user_address and aci string and calls ldap api to modify the aci for the user. User type defaults to mailuser(ESDSConstants.DS_MAILUSER). Deprecated in 904 due to multiple entries in OID if MODIFY_ADD is used. If MODIFY_REPLACE is used then the original aci is lost. Use a combination of delete and add aci instead of modify

Parameters:
aUser - user, dl, domain, etc to be granted access to shared folder
aACI - new aci for the user
Throws:
javax.mail.MessagingException -

modifyACI

public void modifyACI(java.lang.String aUserType,
                      java.lang.String aUser,
                      java.lang.String aACI)
               throws javax.mail.MessagingException
Deprecated.
modifyACI method takes in a user type, user_address and aci string and calls ldap api to modify the aci for the user. Deprecated in 904 due to multiple entries in OID if MODIFY_ADD is used. If MODIFY_REPLACE is used then the original aci is lost. Use a combination of delete and add aci instead of modify

Parameters:
aUserType - user - ESDSConstants.DS_MAILUSER, dl - ESDSConstants.DS_DISTRIBUTION_LIST, domain - ESDSConstants.DS_DOMAIN
aUser - user, dl, domain, etc to be granted access to shared folder
aACI - new aci for the user
Throws:
javax.mail.MessagingException -

getGranteeACI

public java.util.Vector getGranteeACI()
                               throws javax.mail.MessagingException

Returns a vector of OracleGranteeACI objects. The complete list of grantee aci(s) on shared folders can be obtained by using the OracleGranteeACI objects.

Throws:
javax.mail.MessagingException -

isShared

public boolean isShared()
                 throws javax.mail.MessagingException
Checks if the folder is shared.
Returns:
boolean true/false

getFolderSize

public long getFolderSize()
                   throws javax.mail.MessagingException
Returns the sum total of the sizes of all the messages in a folder. The sum total may exceed value contained in int.
Returns:
Message size. Changing from int to long.

getFolderSize

public long getFolderSize(boolean recurse)
                   throws javax.mail.MessagingException
Returns the sum total of the sizes of all the messages in a folder. The sum total may exceed value contained in int. If you want to calcualte the size of subfolders, set recurse to true.
Returns:
Message size.

sortMessages

public long[] sortMessages(java.util.Vector aSortCriteriaVector)
                    throws javax.mail.MessagingException
Sorts the messages in the folder according to the specified order, returning a list of message UIDs.

Parameters:
aSortCriteriaVector - Construct a vector with all the sort criteria
Returns:
array of msg_uid(s)

getMessageByType

public javax.mail.Message[] getMessageByType(int type)
                                      throws javax.mail.MessagingException
Returns the message object that corresponds to the given message type. If not such message exists, null is returned. NOTE: this method does NOT update the message cache. To update the message cache, user can call getMessages(), getMessageCount(), getNewMessageCount() methods.

getFilteredHeaders

public OracleFilteredMsgHdrs[] getFilteredHeaders(long[] msgUids)
                                           throws javax.mail.MessagingException
Returns a list of . If not such message exists, null is returned. NOTE: this method does NOT update the message cache. To update the message cache, user can call getMessages(), getMessageCount(), getNewMessageCount() methods.

getCounts

public int[][] getCounts()
                  throws java.lang.Exception

This method returns the counts for the folder as a 2-D array. The columns of the 2-D array contain the following information: 1 - msg_type (values correspond to the types defined in OracleMessage) EMAIL_TYPE, VOICE_TYPE, FAX_TYPE, NEWS_TYPE, TD_TYPE 2 - total messages of type in folder 3 - total unseen(unread) 4 - total recent

Returns:
int[][] - 2-D array organized as explained above

getFolderExpiry

public int getFolderExpiry()
                    throws javax.mail.MessagingException
Gets the expiry limit for the folder. By default the value is 0, i.e, the messages in the folder will not expire.

Parameters:
none -
Returns:
int - number of days after which messages expire

setFolderExpiry

public void setFolderExpiry(int daysKept)
                     throws javax.mail.MessagingException
Sets the expiry limit for the folder. By default the value is 0, i.e, the messages in the folder will not expire.

Parameters:
daysKept - - the number of days after which messages expire
Returns:
none

Oracle® Mail Java API Reference
10g Release 1 (10.1.1)

B14492-01

Copyright © 1988, 2005, Oracle. All rights reserved.