com.openexchange.messaging
Interface MessagingFolder

All Known Implementing Classes:
DefaultMessagingFolder

public interface MessagingFolder

MessagingFolder - Represents a messaging folder.

Since:
Open-Xchange v6.16
Author:
Thorben Betten

Nested Class Summary
static class MessagingFolder.DefaultFolderType
          The default folder type.
 
Field Summary
static java.lang.String CAPABILITY_PERMISSIONS
          The capability identifier for permissions support.
static java.lang.String CAPABILITY_QUOTA
          The capability identifier for quota support.
static java.lang.String CAPABILITY_SORT
          The capability identifier for sort support.
static java.lang.String CAPABILITY_SUBSCRIPTION
          The capability identifier for subscription support.
static java.lang.String CAPABILITY_USER_FLAGS
          The capability identifier for user flags support.
static java.lang.String ROOT_FULLNAME
          The constant for full name of an account's root folder.
 
Method Summary
 boolean containsDefaultFolderType()
          Checks if default folder type was applied to this messaging folder.
 java.util.Set<java.lang.String> getCapabilities()
          Gets the capabilities of this folder; e.g "QUOTA", "PERMISSIONS", etc.
 MessagingFolder.DefaultFolderType getDefaultFolderType()
          Gets the default folder type.
 int getDeletedMessageCount()
          Gets the number of messages marked for deletion in this folder
 java.lang.String getId()
          Gets the identifier.
 int getMessageCount()
          Gets the number of messages.
 java.lang.String getName()
          Gets the name.
 int getNewMessageCount()
          Gets the number of new messages (since last time this folder was accessed).
 MessagingPermission getOwnPermission()
          Gets the permission for currently logged-in user accessing this folder The returned permission should reflect user's permission regardless if messaging system supports permissions or not.
 java.lang.String getParentId()
          Gets the parent identifier or null if this messaging folder denotes the root folder.
 java.util.List<MessagingPermission> getPermissions()
          Gets the permissions associated with this messaging folder.
 char getSeparator()
          Gets the separator character.
 int getUnreadMessageCount()
          Gets the number of unread messages.
 boolean hasSubfolders()
          Checks if this messaging folder has subfolders.
 boolean hasSubscribedSubfolders()
          Checks if this messaging folder has subscribed subfolders.
 boolean isDefaultFolder()
          Checks if this folder denotes a default folder (Drafts, Sent, Trash, etc.)
 boolean isHoldsFolders()
          Checks if this folder is able to hold folders.
 boolean isHoldsMessages()
          Checks if this folder is able to hold messages.
 boolean isRootFolder()
          Checks if this folder denotes the root folder
 boolean isSubscribed()
          Checks whether the denoted messaging folder is subscribed or not.
 

Field Detail

ROOT_FULLNAME

static final java.lang.String ROOT_FULLNAME
The constant for full name of an account's root folder.

See Also:
Constant Field Values

CAPABILITY_PERMISSIONS

static final java.lang.String CAPABILITY_PERMISSIONS
The capability identifier for permissions support.

See Also:
Constant Field Values

CAPABILITY_QUOTA

static final java.lang.String CAPABILITY_QUOTA
The capability identifier for quota support.

See Also:
Constant Field Values

CAPABILITY_SORT

static final java.lang.String CAPABILITY_SORT
The capability identifier for sort support.

See Also:
Constant Field Values

CAPABILITY_SUBSCRIPTION

static final java.lang.String CAPABILITY_SUBSCRIPTION
The capability identifier for subscription support.

See Also:
Constant Field Values

CAPABILITY_USER_FLAGS

static final java.lang.String CAPABILITY_USER_FLAGS
The capability identifier for user flags support.

See Also:
Constant Field Values
Method Detail

getCapabilities

java.util.Set<java.lang.String> getCapabilities()
Gets the capabilities of this folder; e.g "QUOTA", "PERMISSIONS", etc.

Returns:
The list of capabilities

getId

java.lang.String getId()
Gets the identifier.

Returns:
The identifier

getName

java.lang.String getName()
Gets the name.

Returns:
The name

getSeparator

char getSeparator()
Gets the separator character.

Returns:
The separator character.

getOwnPermission

MessagingPermission getOwnPermission()
Gets the permission for currently logged-in user accessing this folder

The returned permission should reflect user's permission regardless if messaging system supports permissions or not. An instance of DefaultMessagingPermission is supposed to be returned on missing permissions support except for the root folder. The root folder should indicate no object permissions in any case, but the folder permission varies if messaging system allows subfolder creation below root folder or not. The returned permission must reflect the allowed behavior.

Returns:
The own permission

getParentId

java.lang.String getParentId()
Gets the parent identifier or null if this messaging folder denotes the root folder.

Returns:
The parent identifier or null if this messaging folder denotes the root folder

getPermissions

java.util.List<MessagingPermission> getPermissions()
Gets the permissions associated with this messaging folder.

Returns:
The permissions as a collection of MessagingPermission

hasSubfolders

boolean hasSubfolders()
Checks if this messaging folder has subfolders.

Returns:
true if this messaging folder has subfolders; otherwise false

hasSubscribedSubfolders

boolean hasSubscribedSubfolders()
Checks if this messaging folder has subscribed subfolders.

Returns:
true if this messaging folder has subscribed subfolders; otherwise false

isSubscribed

boolean isSubscribed()
Checks whether the denoted messaging folder is subscribed or not.

If messaging system does not support subscription, true is supposed to be returned.

Returns:
Whether the denoted messaging folder is subscribed or not

isHoldsFolders

boolean isHoldsFolders()
Checks if this folder is able to hold folders.

Returns:
true if this folder is able to hold folders; otherwise false

isHoldsMessages

boolean isHoldsMessages()
Checks if this folder is able to hold messages.

Returns:
true if this folder is able to hold messages; otherwise false

isRootFolder

boolean isRootFolder()
Checks if this folder denotes the root folder

Returns:
true if this folder denotes the root folder; otherwise false

isDefaultFolder

boolean isDefaultFolder()
Checks if this folder denotes a default folder (Drafts, Sent, Trash, etc.)

Returns:
true if this folder denotes a default folder; otherwise false

getMessageCount

int getMessageCount()
Gets the number of messages.

Returns:
The number of messages or -1 if this messaging folder does not hold messages
See Also:
isHoldsMessages()

getNewMessageCount

int getNewMessageCount()
Gets the number of new messages (since last time this folder was accessed).

Returns:
The number of new messages or -1 if this messaging folder does not hold messages.
See Also:
isHoldsMessages()

getUnreadMessageCount

int getUnreadMessageCount()
Gets the number of unread messages.

Returns:
The number of unread messages or -1 if this messaging folder does not hold messages
See Also:
isHoldsMessages()

getDeletedMessageCount

int getDeletedMessageCount()
Gets the number of messages marked for deletion in this folder

Returns:
The number of messages marked for deletion in this folder or -1 if this messaging folder does not hold messages
See Also:
isHoldsMessages()

getDefaultFolderType

MessagingFolder.DefaultFolderType getDefaultFolderType()
Gets the default folder type.

Returns:
The default folder type or MessagingFolder.DefaultFolderType.NONE if not available

containsDefaultFolderType

boolean containsDefaultFolderType()
Checks if default folder type was applied to this messaging folder.

Returns:
true if default folder type is applied; otherwise false