com.openexchange.messaging
Class DefaultMessagingPermission

java.lang.Object
  extended by com.openexchange.messaging.DefaultMessagingPermission
All Implemented Interfaces:
MessagingPermission, java.lang.Cloneable

public class DefaultMessagingPermission
extends java.lang.Object
implements MessagingPermission

DefaultMessagingPermission - The default messaging permission granting full access.

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

Field Summary
 
Fields inherited from interface com.openexchange.messaging.MessagingPermission
CREATE_OBJECTS_IN_FOLDER, CREATE_SUB_FOLDERS, DELETE_ALL_OBJECTS, DELETE_OWN_OBJECTS, MAX_PERMISSION, NO_PERMISSIONS, READ_ALL_OBJECTS, READ_FOLDER, READ_OWN_OBJECTS, WRITE_ALL_OBJECTS, WRITE_OWN_OBJECTS
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 int getDeletePermission()
          Gets the delete permission.
 int getEntity()
          Gets this folder permission's entity identifier.
 int getFolderPermission()
          Gets the folder permission.
 int getReadPermission()
          Gets the read permission.
 int getSystem()
          Gets this folder permission's system bit mask.
 int getWritePermission()
          Gets the write permission.
 int hashCode()
           
 boolean isAdmin()
          Checks if this folder permission denotes its entity as a folder administrator.
 boolean isGroup()
          Checks if this folder permission's entity is a group.
static DefaultMessagingPermission newInstance()
          Creates a new instance of DefaultMessagingPermission with setMaxPermissions() invoked.
 void setAdmin(boolean admin)
          Sets if this folder permission denotes its entity as a folder administrator.
 void setAllPermissions(int folderPermission, int readPermission, int writePermission, int deletePermission)
          Convenience method to set all permissions at once.
 void setDeletePermission(int permission)
          Sets the delete permission.
 void setEntity(int entity)
          Sets this folder permission's entity identifier.
 void setFolderPermission(int permission)
          Sets the folder permission.
 void setGroup(boolean group)
          Sets if this folder permission's entity is a group.
 void setMaxPermissions()
          Convenience method which passes MessagingPermission.MAX_PERMISSION to all permissions and sets folder administrator flag to true.
 void setNoPermissions()
          Convenience method which passes MessagingPermission.NO_PERMISSIONS to all permissions and sets folder administrator flag to false.
 void setReadPermission(int permission)
          Sets the read permission.
 void setSystem(int system)
          Sets this folder permission's system bit mask.
 void setWritePermission(int permission)
          Sets the write permission.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static DefaultMessagingPermission newInstance()
Creates a new instance of DefaultMessagingPermission with setMaxPermissions() invoked.

Returns:
A new instance of DefaultMessagingPermission with setMaxPermissions() invoked

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: MessagingPermission
Indicates whether some other object is "equal to" this one.

Specified by:
equals in interface MessagingPermission
Overrides:
equals in class java.lang.Object

getDeletePermission

public int getDeletePermission()
Description copied from interface: MessagingPermission
Gets the delete permission.

Returned value is one of:

Specified by:
getDeletePermission in interface MessagingPermission
Returns:
The delete permission

getEntity

public int getEntity()
Description copied from interface: MessagingPermission
Gets this folder permission's entity identifier.

Specified by:
getEntity in interface MessagingPermission
Returns:
This folder permission's entity identifier

getFolderPermission

public int getFolderPermission()
Description copied from interface: MessagingPermission
Gets the folder permission.

Returned value is one of:

Specified by:
getFolderPermission in interface MessagingPermission
Returns:
The folder permission

getReadPermission

public int getReadPermission()
Description copied from interface: MessagingPermission
Gets the read permission.

Returned value is one of:

Specified by:
getReadPermission in interface MessagingPermission
Returns:
The read permission

getSystem

public int getSystem()
Description copied from interface: MessagingPermission
Gets this folder permission's system bit mask.

Specified by:
getSystem in interface MessagingPermission
Returns:
This folder permission's system bit mask

getWritePermission

public int getWritePermission()
Description copied from interface: MessagingPermission
Gets the write permission.

Returned value is one of:

Specified by:
getWritePermission in interface MessagingPermission
Returns:
The write permission

isAdmin

public boolean isAdmin()
Description copied from interface: MessagingPermission
Checks if this folder permission denotes its entity as a folder administrator.

Specified by:
isAdmin in interface MessagingPermission
Returns:
true if this folder permission's entity is a folder administrator; otherwise false

isGroup

public boolean isGroup()
Description copied from interface: MessagingPermission
Checks if this folder permission's entity is a group.

Specified by:
isGroup in interface MessagingPermission
Returns:
true if this folder permission's entity is a group; otherwise false

setAdmin

public void setAdmin(boolean admin)
Description copied from interface: MessagingPermission
Sets if this folder permission denotes its entity as a folder administrator.

Specified by:
setAdmin in interface MessagingPermission
Parameters:
admin - true if this folder permission's entity is a folder administrator; otherwise false

setAllPermissions

public void setAllPermissions(int folderPermission,
                              int readPermission,
                              int writePermission,
                              int deletePermission)
Description copied from interface: MessagingPermission
Convenience method to set all permissions at once.

Specified by:
setAllPermissions in interface MessagingPermission
Parameters:
folderPermission - The folder permission
readPermission - The read permission
writePermission - The write permission
deletePermission - The delete permission
See Also:
MessagingPermission.setFolderPermission(int), MessagingPermission.setReadPermission(int), MessagingPermission.setWritePermission(int), MessagingPermission.setDeletePermission(int)

setDeletePermission

public void setDeletePermission(int permission)
Description copied from interface: MessagingPermission
Sets the delete permission.

Passed value is one of:

Specified by:
setDeletePermission in interface MessagingPermission
Parameters:
permission - The delete permission

setEntity

public void setEntity(int entity)
Description copied from interface: MessagingPermission
Sets this folder permission's entity identifier.

Specified by:
setEntity in interface MessagingPermission
Parameters:
entity - The entity identifier

setFolderPermission

public void setFolderPermission(int permission)
Description copied from interface: MessagingPermission
Sets the folder permission.

Passed value is one of:

Specified by:
setFolderPermission in interface MessagingPermission
Parameters:
permission - The folder permission

setGroup

public void setGroup(boolean group)
Description copied from interface: MessagingPermission
Sets if this folder permission's entity is a group.

Specified by:
setGroup in interface MessagingPermission
Parameters:
group - true if this folder permission's entity is a group; otherwise false

setMaxPermissions

public void setMaxPermissions()
Description copied from interface: MessagingPermission
Convenience method which passes MessagingPermission.MAX_PERMISSION to all permissions and sets folder administrator flag to true.

Specified by:
setMaxPermissions in interface MessagingPermission

setNoPermissions

public void setNoPermissions()
Description copied from interface: MessagingPermission
Convenience method which passes MessagingPermission.NO_PERMISSIONS to all permissions and sets folder administrator flag to false.

Specified by:
setNoPermissions in interface MessagingPermission

setReadPermission

public void setReadPermission(int permission)
Description copied from interface: MessagingPermission
Sets the read permission.

Passed value is one of:

Specified by:
setReadPermission in interface MessagingPermission
Parameters:
permission - The read permission

setSystem

public void setSystem(int system)
Description copied from interface: MessagingPermission
Sets this folder permission's system bit mask.

Specified by:
setSystem in interface MessagingPermission
Parameters:
system - This folder permission's system bit mask

setWritePermission

public void setWritePermission(int permission)
Description copied from interface: MessagingPermission
Sets the write permission.

Passed value is one of:

Specified by:
setWritePermission in interface MessagingPermission
Parameters:
permission - The write permission

clone

public java.lang.Object clone()
Description copied from interface: MessagingPermission
Creates and returns a copy of this object.

Specified by:
clone in interface MessagingPermission
Overrides:
clone in class java.lang.Object
Returns:
A clone of this instance.