Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.compoze.exchange
Class Folder

    java.lang.Object
      com.compoze.exchange.AbstractItem
          com.compoze.exchange.Folder

All Implemented Interfaces:
  java.io.Serializable

public class Folder
extends AbstractItem
implements java.io.Serializable

This class is an Exchange folder. Folder instances are obtained from the `Folders`. Methods that access properites on the class require that the properties were loaded beforehand, when the folder was initially retrieved. Any methods in this class that begin with the string `server` make a query to the server, and require that the `PropertyKey.FOLDER_ID` property be loaded beforehand. Any additional property requirements are indicated on each individual method.

See Also:
  Serialized Form

Field Summary
`static PropertyKey[]` | `ALL_PROPS` Contains an array of all of the properties available on a folder.

Fields inherited from class com.compoze.exchange.AbstractItem
`m_props, m_session`

Method Summary
`java.lang.String` | `getAbsoluteName()` Gets the absolute name of the folder (including its full path relative to the top of the information store).
`FolderType` | `getFolderType()` Gets the type of the folder.
`java.lang.String` | `getID()` Gets the ID of the folder.
`int` | `getMessageCount()` Gets the number of messages in the folder.
`java.lang.String` | `getName()` Gets the folder name.
`int` | `getRelativeDepth()` Gets the depth of the folder relative to the query that was made to retrieve it.
`int` | `getSubFolderCount()` Gets the number of subfolders.
`int` | `getUnreadMessageCount()` Gets the number of unread messages in the folder.
`boolean` | `hasSubFolders()` Determines if a folder has subfolders.
`void` | `serverCopyTo(java.lang.String sFolderID, java.lang.String sNewName, boolean bRecursive)` Hits the server to copy the folder to another folder.
`Contact` | `serverCreateContact(PropertyValue[] values)` Hits the server to create a contact.
`Folder` | `serverCreateFolder(java.lang.String sName, PropertyValue[] values, PropertyKey[] keys)` Hits the server to add a folder below the current folder.
`Journal` | `serverCreateJournal(PropertyValue[] values)` Hits the server to create a journal.
`java.lang.String` | `serverCreateMessage(PropertyValue[] values)` Hits the server to create a message.
`java.lang.String` | `serverCreateMessage(PropertyValue[] values, Recipient[] recipients)` Hits the server to create a message.
`Task` | `serverCreateTask(PropertyValue[] values)` Hits the server to create a task.
`void` | `serverDelete()` Hits the server to delete the folder (the folder is removed permanently, and not moved into deleted items).
`void` | `serverDelete(boolean bDeletedItems)` Hits the server to delete the folder.
`Contact[]` | `serverGetContacts(int iStartIndex, int iEndIndex, int iDepth, PropertyKey[] keys, SortProperty[] sortProps, PropertyValue[] filterProps, boolean bOr, boolean bNot, boolean bHidden)` Queries the server to get contacts.
`Contact[]` | `serverGetContacts(int iStartIndex, int iEndIndex, PropertyKey[] keys)` Queries the server to get contacts from the server between the specified `iStartIndex` and `iEndIndex` starting at 1.
`int` | `serverGetMessageCount()` Queries the server to get a count of messages at a depth of 1 off this folder.
`int` | `serverGetMessageCount(int iDepth, PropertyValue[] filterProps, boolean bOr, boolean bNot, boolean bHidden)` Queries the server to get a count of messages.
`Message[]` | `serverGetMessages(int iStartIndex, int iEndIndex, int iDepth, PropertyKey[] keys, SortProperty[] sortProps, PropertyValue[] filterProps, boolean bOr, boolean bNot, boolean bHidden)` Queries the server to get messages from the server between the specified `iStartIndex` and `iEndIndex` starting at 1.
`Message[]` | `serverGetMessages(int iStartIndex, int iEndIndex, PropertyKey[] keys)` Queries the server to get messages from the server between the specified `iStartIndex` and `iEndIndex` starting at 1.
`Folder` | `serverGetParentFolder(PropertyKey[] props)` Queries the server to get the parent folder.
`Folder[]` | `serverGetSubFolders(PropertyKey[] keys)` Queries the server to get all subfolders at a depth of 1 off of this folder.
`Folder[]` | `serverGetSubFolders(PropertyKey[] keys, int iDepth)` Queries the server to get subfolders off of this folder.
`Task[]` | `serverGetTasks(int iStartIndex, int iEndIndex, int iDepth, PropertyKey[] keys, SortProperty[] sortProps, PropertyValue[] filterProps, boolean bOr, boolean bNot, boolean bHidden)` Queries the server to get tasks.
`Task[]` | `serverGetTasks(int iStartIndex, int iEndIndex, PropertyKey[] keys)` Queries the server to get tasks from the server between the specified `iStartIndex` and `iEndIndex` starting at 1.
`boolean` | `serverIsDefaultFolderType(DefaultFolderType type)` Queries the server to determine if this folder is the specified default folder type.
`void` | `serverMoveTo(java.lang.String sFolderID)` Hits the server to move the folder to another folder.
`void` | `serverUpdate()` Hits the server to update any changed properties.
`void` | `setFolderType(java.lang.String sName)` Sets the type of the folder (container class).
`void` | `setName(java.lang.String sName)` Sets the folder name.
`java.lang.String` | `toString()` Returns the string representation of the folder.

Methods inherited from class com.compoze.exchange.AbstractItem
`get, getBoolean, getByteArray, getDate, getDouble, getInt, getInvalidPropertyValues, getPropertyKeys, getString, getStringArray, getUpdatedPropertyValues, set, setBoolean, setByteArray, setDate, setDouble, setInt, setString, setStringArray`

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

Field Detail

### ALL_PROPS

    public static final PropertyKey[] ALL_PROPS

  Contains an array of all of the properties available on a folder. Although this can be used when specifying property keys to retrieve, it's preferable to only specify the keys that are required as the number of properties that are pulled back has a direct impact on performance.

Method Detail

### serverCreateMessage

    public java.lang.String serverCreateMessage(PropertyValue[] values)
                                         throws ExchangeException

  Hits the server to create a message.

  Parameters:
    `values` - any initial property values to set
  Returns:
    the new message ID
  Throws:
    `ExchangeException` - if a problem occurs while connecting to or interacting with Exchange

### serverCreateMessage

    public java.lang.String serverCreateMessage(PropertyValue[] values,
                                                Recipient[] recipients)
                                         throws ExchangeException

  Hits the server to create a message.

  Parameters:
    `values` - any initial property values to set
    `recipients` - the initial recipients to add to the message (`null` for no initial recipients)
  Returns:
    the new message ID
  Throws:
    `ExchangeException` - if a problem occurs while connecting to or interacting with Exchange

### serverCreateContact

    public Contact serverCreateContact(PropertyValue[] values)
                                throws ExchangeException

  Hits the server to create a contact.

  Parameters:
    `values` - any initial property values to set
  Returns:
    the newly created contact
  Throws:
    `ExchangeException`

### serverCreateTask

    public Task serverCreateTask(PropertyValue[] values)
                          throws ExchangeException

  Hits the server to create a task.

  Parameters:
    `values` - any initial property values to set
  Returns:
    the newly created task
  Throws:
    `ExchangeException`

### serverCreateJournal

    public Journal serverCreateJournal(PropertyValue[] values)
                                throws ExchangeException

  Hits the server to create a journal.

  Parameters:
    `values` - any initial property values to set
  Returns:
    the newly created journal
  Throws:
    `ExchangeException`

### serverGetSubFolders

    public Folder[] serverGetSubFolders(PropertyKey[] keys)
                                 throws ExchangeException

  Queries the server to get all subfolders at a depth of 1 off of this folder.

  Parameters:
    `keys` - the properties to fetch for each folder, or `null` for all of the default properties
  Returns:
    an array of folders (an empty array if there are no folders)
  Throws:
    `ExchangeException`

### serverGetSubFolders

    public Folder[] serverGetSubFolders(PropertyKey[] keys,
                                        int iDepth)
                                 throws ExchangeException

  Queries the server to get subfolders off of this folder.

  Parameters:
    `keys` - the properties to fetch for each folder, or `null` for all of the default properties
    `iDepth` - the depth of folders to retrieve (0 for only starting folder, N for depth of N, -1 for infinite depth)
  Returns:
    an array of folders (an empty array if there are no folders)
  Throws:
    `ExchangeException`

### serverCreateFolder

    public Folder serverCreateFolder(java.lang.String sName,
                                     PropertyValue[] values,
                                     PropertyKey[] keys)
                              throws ExchangeException

  Hits the server to add a folder below the current folder.

  Parameters:
    `sName` - the name of the new folder
    `values` - any initial property values to set
    `keys` - the properties to bring back from the new folder
  Throws:
    `ExchangeException`

### serverDelete

    public void serverDelete()
                      throws ExchangeException

  Hits the server to delete the folder (the folder is removed permanently, and not moved into deleted items).

  Throws:
    `ExchangeException`

### serverDelete

    public void serverDelete(boolean bDeletedItems)
                      throws ExchangeException

  Hits the server to delete the folder.

  Parameters:
    `bDeletedItems` - if `true`, move the folder into deleted items
  Throws:
    `ExchangeException`

### serverCopyTo

    public void serverCopyTo(java.lang.String sFolderID,
                             java.lang.String sNewName,
                             boolean bRecursive)
                      throws ExchangeException

  Hits the server to copy the folder to another folder.

  Parameters:
    `sFolderID` - the ID of the target folder
    `sNewName` - the name for the new folder (or `null` to keep the same name
    `bRecursive` - if `true`, also copy subfolders
  Throws:
    `ExchangeException`

### serverMoveTo

    public void serverMoveTo(java.lang.String sFolderID)
                      throws ExchangeException

  Hits the server to move the folder to another folder.

  Parameters:
    `sFolderID` - the ID of the target folder
  Throws:
    `ExchangeException`

### serverUpdate

    public void serverUpdate()
                      throws ExchangeException

  Hits the server to update any changed properties.

  Specified by:
    `serverUpdate` in class `AbstractItem`
  Throws:
    `ExchangeException`

### serverGetParentFolder

    public Folder serverGetParentFolder(PropertyKey[] props)
                                 throws ExchangeException

  Queries the server to get the parent folder. Additional required properties:

  - `PropertyKey.FOLDER_FOLDERID`

  Parameters:
    `props` - the properties to retrieve
  Returns:
    the parent folder or `null` if no parent exists
  Throws:
    `ExchangeException`

### serverGetMessages

    public Message[] serverGetMessages(int iStartIndex,
                                       int iEndIndex,
                                       PropertyKey[] keys)
                                throws ExchangeException

  Queries the server to get messages from the server between the specified `iStartIndex` and `iEndIndex` starting at 1.

  Parameters:
    `iStartIndex` - the start index endpoint (inclusive) or -1 for all
    `iEndIndex` - the end index highpoint (exclusive) or -1 for all
    `keys` - the properties to bring back from the message
  Throws:
    `ExchangeException`

### serverGetMessages

    public Message[] serverGetMessages(int iStartIndex,
                                       int iEndIndex,
                                       int iDepth,
                                       PropertyKey[] keys,
                                       SortProperty[] sortProps,
                                       PropertyValue[] filterProps,
                                       boolean bOr,
                                       boolean bNot,
                                       boolean bHidden)
                                throws ExchangeException

  Queries the server to get messages from the server between the specified `iStartIndex` and `iEndIndex` starting at 1.

  Parameters:
    `iStartIndex` - the start index endpoint (inclusive) or -1 for all
    `iEndIndex` - the end index highpoint (exclusive) or -1 for all
    `iDepth` - the depth of folders to use when calculating message count (0 for only starting folder, N for depth of N, -1 for infinite depth)
    `keys` - the properties to bring back from the message
    `sortProps` - the properties to sort by
    `filterProps` - the properties to filter by
    `bOr` - if `true`, or the filter properties together
    `bNot` - if `true`, the condition is opposite
    `bHidden` - if `true`, get hidden messages rather than visible ones
  Throws:
    `ExchangeException`

### serverGetMessageCount

    public int serverGetMessageCount()
                              throws ExchangeException

  Queries the server to get a count of messages at a depth of 1 off this folder.

  Returns:
    the number of messages
  Throws:
    `ExchangeException`

### serverGetMessageCount

    public int serverGetMessageCount(int iDepth,
                                     PropertyValue[] filterProps,
                                     boolean bOr,
                                     boolean bNot,
                                     boolean bHidden)
                              throws ExchangeException

  Queries the server to get a count of messages.

  Parameters:
    `iDepth` - the depth of folders to use when calculating message count (0 for only starting folder, N for depth of N, -1 for infinite depth)
    `filterProps` - the properties to filter by; passing `null` in this parameter will not traverse subfolders, even if -1 is specified for `iDepth`
    `bOr` - if `true`, or the filter properties together
    `bNot` - if `true`, the condition is opposite
    `bHidden` - if `true`, get hidden messages rather than visible ones
  Returns:
    the number of messages
  Throws:
    `ExchangeException`

### serverIsDefaultFolderType

    public boolean serverIsDefaultFolderType(DefaultFolderType type)
                                      throws ExchangeException

  Queries the server to determine if this folder is the specified default folder type.

  Parameters:
    `type` - the default folder type to check (may not be `null`)
  Returns:
    `true` if the folder is the specified default folder type; `false` otherwise
  Throws:
    `ExchangeException`

### serverGetContacts

    public Contact[] serverGetContacts(int iStartIndex,
                                       int iEndIndex,
                                       PropertyKey[] keys)
                                throws ExchangeException

  Queries the server to get contacts from the server between the specified `iStartIndex` and `iEndIndex` starting at 1.

  Parameters:
    `iStartIndex` - the start index endpoint (inclusive) or -1 for all
    `iEndIndex` - the end index highpoint (exclusive) or -1 for all
    `keys` - the properties to bring back from the contact
  Returns:
    an array of contacts
  Throws:
    `ExchangeException`

### serverGetContacts

    public Contact[] serverGetContacts(int iStartIndex,
                                       int iEndIndex,
                                       int iDepth,
                                       PropertyKey[] keys,
                                       SortProperty[] sortProps,
                                       PropertyValue[] filterProps,
                                       boolean bOr,
                                       boolean bNot,
                                       boolean bHidden)
                                throws ExchangeException

  Queries the server to get contacts.

  Parameters:
    `iStartIndex` - the start index endpoint (inclusive) or -1 for all
    `iEndIndex` - the end index highpoint (exclusive) or -1 for all
    `iDepth` - the depth of folders to use when calculating message count (0 for only starting folder, N for depth of N, -1 for infinite depth)
    `keys` - the properties to fetch for each contact
    `sortProps` - the properties to sort by
    `filterProps` - the properties to filter by
    `bOr` - if `true`, or the filter properties together
    `bNot` - if `true`, the condition is opposite
    `bHidden` - if `true`, get hidden messages rather than visible ones
  Returns:
    an array of contacts
  Throws:
    `ExchangeException`

### serverGetTasks

    public Task[] serverGetTasks(int iStartIndex,
                                 int iEndIndex,
                                 PropertyKey[] keys)
                          throws ExchangeException

  Queries the server to get tasks from the server between the specified `iStartIndex` and `iEndIndex` starting at 1.

  Parameters:
    `iStartIndex` - the start index endpoint (inclusive) or -1 for all
    `iEndIndex` - the end index highpoint (exclusive) or -1 for all
    `keys` - the properties to bring back from the task
  Returns:
    an array of tasks
  Throws:
    `ExchangeException`

### serverGetTasks

    public Task[] serverGetTasks(int iStartIndex,
                                 int iEndIndex,
                                 int iDepth,
                                 PropertyKey[] keys,
                                 SortProperty[] sortProps,
                                 PropertyValue[] filterProps,
                                 boolean bOr,
                                 boolean bNot,
                                 boolean bHidden)
                          throws ExchangeException

  Queries the server to get tasks.

  Parameters:
    `iStartIndex` - the start index endpoint (inclusive) or -1 for all
    `iEndIndex` - the end index highpoint (exclusive) or -1 for all
    `iDepth` - the depth of folders to use when calculating message count (0 for only starting folder, N for depth of N, -1 for infinite depth)
    `keys` - the properties to fetch for each task
    `sortProps` - the properties to sort by
    `filterProps` - the properties to filter by
    `bOr` - if `true`, or the filter properties together
    `bNot` - if `true`, the condition is opposite
    `bHidden` - if `true`, get hidden messages rather than visible ones
  Returns:
    an array of tasks
  Throws:
    `ExchangeException`

### getID

    public java.lang.String getID()
                           throws ExchangeException

  Gets the ID of the folder.

  Returns:
    the ID
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_ID`

### getName

    public java.lang.String getName()
                             throws ExchangeException

  Gets the folder name.

  Returns:
    the folder name
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_NAME`

### setName

    public void setName(java.lang.String sName)
                 throws ExchangeException

  Sets the folder name.

  Parameters:
    `sName` - the folder name
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_NAME`

### getRelativeDepth

    public int getRelativeDepth()
                         throws ExchangeException

  Gets the depth of the folder relative to the query that was made to retrieve it.

  Returns:
    the depth
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_RELATIVE_DEPTH`

### getAbsoluteName

    public java.lang.String getAbsoluteName()
                                     throws ExchangeException

  Gets the absolute name of the folder (including its full path relative to the top of the information store).

  Returns:
    the absolute name
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_ABSOLUTE_NAME`

### getSubFolderCount

    public int getSubFolderCount()
                          throws ExchangeException

  Gets the number of subfolders.

  Returns:
    the subfolder count
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_SUBFOLDER_COUNT`

### getMessageCount

    public int getMessageCount()
                        throws ExchangeException

  Gets the number of messages in the folder.

  Returns:
    the number of messages in the folder
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_MESSAGE_COUNT`

### getUnreadMessageCount

    public int getUnreadMessageCount()
                              throws ExchangeException

  Gets the number of unread messages in the folder.

  Returns:
    the number of unread messages in the folder
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_MESSAGE_UNREAD_COUNT`

### getFolderType

    public FolderType getFolderType()
                             throws ExchangeException

  Gets the type of the folder.

  Returns:
    the type of the folder or `null` if type is not available
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.CONTAINER_CLASS`, `FolderType`

### hasSubFolders

    public boolean hasSubFolders()
                          throws ExchangeException

  Determines if a folder has subfolders.

  Returns:
    `true` if the folder has subfolders
  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.FOLDER_SUBFOLDER_COUNT`

### setFolderType

    public void setFolderType(java.lang.String sName)
                       throws ExchangeException

  Sets the type of the folder (container class).

  Throws:
    `ExchangeException`
  See Also:
    `PropertyKey.CONTAINER_CLASS`

### toString

    public java.lang.String toString()

  Returns the string representation of the folder.

  Returns:
    the string representation of the folder
  See Also:
    `PropertyKey.FOLDER_NAME`, `PropertyKey.FOLDER_ID`, `PropertyKey.CONTAINER_CLASS`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.