Jive Forums API (5.5.20.2-oracle) Web Services Client Javadocs

com.jivesoftware.forum.webservices
Interface AttachmentManagerService


public interface AttachmentManagerService

A web service to manage attachment settings. Modeled after the CacheableService. This interface is a direct copy of the com.jivesoftware.forum.AttachmentManager interface, tailored for web service deployment. The main difference is rather than return Iterators or Collections, sets of data are returned as arrays. Method comments are copied from the original interface.


Method Summary
 void addAllowedType(java.lang.String contentType)
          Adds a content type to the list of explicitly allowed types.
 void addDisallowedType(java.lang.String contentType)
          Adds a content type to the list of explicitly disallowed types.
 java.lang.String[] allowedTypes()
          Returns a String[] for the list of explicitly allowed types.
 java.lang.String[] disallowedTypes()
          Returns an Iterator for the list of explicitly disallowed types.
 boolean getAllowAllByDefault()
          Returns true if in the "allow all content types by default" mode.
 long getAttachmentDirectorySize()
          Returns the size (in bytes) of the attachment directory on the file system.
 int getImagePreviewMaxSize()
          Returns the max dimension of generated thumbnails (ie, the max value for the width or height).
 int getMaxAttachmentSize()
          Returns the maximum size of an individual attachment in kilobytes.
 int getMaxAttachmentsPerMessage()
          Returns the maximum number of attachments per message.
 long getMaxFilesystemCacheSize()
          Returns the maximum amount of storage (in bytes) that will be used by the file system cache when database attachment mode is enabled.
 boolean isDatabaseModeEnabled()
          Returns true if the binary attachment data is stored in the database.
 boolean isImagePreviewEnabled()
          Returns true if image preview support is enabled.
 boolean isImagePreviewRatioEnabled()
          Returns true if the aspect ratio of thumbnails should be preserved.
 boolean isValidType(java.lang.String contentType)
          Returns true if the content type is valid based on the current settings of the allowAllByDefault flag and the allowed and disallowed types list.
 void removeAllowedType(java.lang.String contentType)
          Removes a content type fromt he list of explicitly allowed types.
 void removeDisallowedType(java.lang.String contentType)
          Removes a content type from the list of explicitly disallowed types.
 void setAllowAllByDefault(boolean allowAllByDefault)
          Sets the default allowed content types mode.
 void setDatabaseModeEnabled(boolean enabled)
          Enables or disables storage of binary attachment data in the database.
 void setImagePreviewEnabled(boolean imagePreviewEnabled)
          Toggles whether image preview support is enabled.
 void setImagePreviewMaxSize(int imagePreviewMaxSize)
          Sets the max dimension of generated thumbnails (ie, the max value for the width or height).
 void setImagePreviewRatioEnabled(boolean imagePreviewRatioEnabled)
          Toggles whether the aspect ratio of thumbnails should be preserved.
 void setMaxAttachmentSize(int maxAttachmentSize)
          Sets the maximum size of an individual attachment in kilobytes.
 void setMaxAttachmentsPerMessage(int maxAttachmentsPerMessage)
          Sets the maximum number of attachments per message.
 void setMaxFilesystemCacheSize(long maxSize)
          Sets the maximum amount of storage (in bytes) that will be used by the file system cache when database attachment mode is enabled.
 

Method Detail

isDatabaseModeEnabled

boolean isDatabaseModeEnabled()
Returns true if the binary attachment data is stored in the database. If false, attachments are stored on the file system. Not all databases may support storing attachment data in the database, so the mode is disabled by default. Those using clustering, or a database that does work with database attachments may wish to turn this mode on.

When database attachment mode is enabled, attachment data will be cached on the file system in the attachment directory in order to relieve load on the database.

Returns:
true if database attachment mode is enabled.

setDatabaseModeEnabled

void setDatabaseModeEnabled(boolean enabled)
                            throws UnauthorizedException
Enables or disables storage of binary attachment data in the database. If false, attachments are stored on the file system. Not all databases may support storing attachment data in the database, so the mode is disabled by default. Those using clustering, or a database that does work with database attachments may wish to turn this mode on.

When database attachment mode is enabled, attachment data will be cached on the file system in the attachment directory in order to relieve load on the database.

Parameters:
enabled - true if attachment data should be stored in the database.
Throws:
UnauthorizedException - if not a system administrator.

getAttachmentDirectorySize

long getAttachmentDirectorySize()
                                throws UnauthorizedException
Returns the size (in bytes) of the attachment directory on the file system. When in file system storage mode, the attachment directory is where all binary data is stored. In database attachment mode, the attachment directory is used as a cache for attachment data in order to relieve load on the database.

The size of the attachment directory is computed asynchronously at system startup. Therefore, when the the size of the directory is not known, this method will return -1.

Returns:
the size of the attachment directory in bytes, or -1 if the size of the directory is not known..
Throws:
UnauthorizedException - if not a system administrator.

getMaxFilesystemCacheSize

long getMaxFilesystemCacheSize()
                               throws UnauthorizedException
Returns the maximum amount of storage (in bytes) that will be used by the file system cache when database attachment mode is enabled. The default maximum size is 512 MB. When the cache size is exceeded, files will be deleted until at least 10% of the cache is free.

Returns:
the max size of the file system cache for attachment data (in bytes).
Throws:
UnauthorizedException - if not a system administrator.

setMaxFilesystemCacheSize

void setMaxFilesystemCacheSize(long maxSize)
                               throws UnauthorizedException
Sets the maximum amount of storage (in bytes) that will be used by the file system cache when database attachment mode is enabled. The default maximum size is 512 MB. When the cache size is exceeded, files will be deleted until at least 10% of the cache is free.

Parameters:
maxSize - the max size of the file system cache for attachment data (in bytes).
Throws:
UnauthorizedException - if not a system administrator.

getMaxAttachmentSize

int getMaxAttachmentSize()
Returns the maximum size of an individual attachment in kilobytes. Trying to create an attachment larger than the max size will fail with an exception. The default maximum attachment size is 1 megabyte, or 1,024 K.

Returns:
the max size in kilobytes of any single attachment.

setMaxAttachmentSize

void setMaxAttachmentSize(int maxAttachmentSize)
                          throws UnauthorizedException
Sets the maximum size of an individual attachment in kilobytes. Trying to create an attachment larger than the max size will fail with an exception. The default maximum attachment size is 1 megabyte, or 1024 K.

Parameters:
maxAttachmentSize - the max size in kilobytes of any single attachment.
Throws:
UnauthorizedException - if not an administrator.

getMaxAttachmentsPerMessage

int getMaxAttachmentsPerMessage()
Returns the maximum number of attachments per message. The default is 5 attachments.

Returns:
the max number of attachments allowed per message.

setMaxAttachmentsPerMessage

void setMaxAttachmentsPerMessage(int maxAttachmentsPerMessage)
                                 throws UnauthorizedException
Sets the maximum number of attachments per message. The default is 5 attachments.

Parameters:
maxAttachmentsPerMessage - the max number of attachments allowed per message.
Throws:
UnauthorizedException - if not an administrator.

isValidType

boolean isValidType(java.lang.String contentType)
Returns true if the content type is valid based on the current settings of the allowAllByDefault flag and the allowed and disallowed types list.

Parameters:
contentType - the content type to test.
Returns:
true if the content type is valid.

addAllowedType

void addAllowedType(java.lang.String contentType)
                    throws UnauthorizedException
Adds a content type to the list of explicitly allowed types.

Parameters:
contentType - a content type to add to the explicitly allowed types list.
Throws:
UnauthorizedException - if not an administrator.

removeAllowedType

void removeAllowedType(java.lang.String contentType)
                       throws UnauthorizedException
Removes a content type fromt he list of explicitly allowed types. If the given content type does not exist in the list, this method does nothing.

Parameters:
contentType - a content type to remove from the explicitly allowed types list.
Throws:
UnauthorizedException - if not an administrator.

allowedTypes

java.lang.String[] allowedTypes()
Returns a String[] for the list of explicitly allowed types.

Returns:
a String[] for the list of all explicitly allowed types.

addDisallowedType

void addDisallowedType(java.lang.String contentType)
                       throws UnauthorizedException
Adds a content type to the list of explicitly disallowed types.

Parameters:
contentType - a content type to add to the explicitly disallowed types list.
Throws:
UnauthorizedException - if not an administrator.

removeDisallowedType

void removeDisallowedType(java.lang.String contentType)
                          throws UnauthorizedException
Removes a content type from the list of explicitly disallowed types.

Parameters:
contentType - a content type to remove from the explicitly disallowed types list.
Throws:
UnauthorizedException - if not an administrator.

disallowedTypes

java.lang.String[] disallowedTypes()
Returns an Iterator for the list of explicitly disallowed types.

Returns:
an iterator for the list of all explicitly disallowed types.

getAllowAllByDefault

boolean getAllowAllByDefault()
Returns true if in the "allow all content types by default" mode. The alternative is that all content types are disallowed unless they're on the "allowed" list.

Returns:
true if all content types are allowed by default.

setAllowAllByDefault

void setAllowAllByDefault(boolean allowAllByDefault)
                          throws UnauthorizedException
Sets the default allowed content types mode. The value true means that all content types will be allowed unless they're on the "disallowed list". If false, no content types will be allowed unless on the "allowed list".

Parameters:
allowAllByDefault - true if all content types should be allowed by default.
Throws:
UnauthorizedException

isImagePreviewEnabled

boolean isImagePreviewEnabled()
Returns true if image preview support is enabled. When enabled, the JiveServlet will generate thumbnails for image attachments. False by default.

Returns:
true if thumbnail support is enabled.

setImagePreviewEnabled

void setImagePreviewEnabled(boolean imagePreviewEnabled)
                            throws UnauthorizedException
Toggles whether image preview support is enabled. When enabled, the JiveServlet will generate thumbnails for image attachments. False by default.

Parameters:
imagePreviewEnabled - true if thumbnail support should be enabled.
Throws:
UnauthorizedException - if not a system administrator.

getImagePreviewMaxSize

int getImagePreviewMaxSize()
Returns the max dimension of generated thumbnails (ie, the max value for the width or height). The default value is 25.

Returns:
the max dimension of a thumbnail.

setImagePreviewMaxSize

void setImagePreviewMaxSize(int imagePreviewMaxSize)
                            throws UnauthorizedException
Sets the max dimension of generated thumbnails (ie, the max value for the width or height). The default value is 25.

Parameters:
imagePreviewMaxSize - the max dimension of a thumbnail.
Throws:
UnauthorizedException - if not a system administrator.

isImagePreviewRatioEnabled

boolean isImagePreviewRatioEnabled()
Returns true if the aspect ratio of thumbnails should be preserved. When enabled, the aspect ratio of the original image will be preserved when generating the thumbnail. When false, the thumbnail will always be a square (which may distort the image). The default is true..

Returns:
true if the aspect ration should be preserved.

setImagePreviewRatioEnabled

void setImagePreviewRatioEnabled(boolean imagePreviewRatioEnabled)
                                 throws UnauthorizedException
Toggles whether the aspect ratio of thumbnails should be preserved. When enabled, the aspect ratio of the original image will be preserved when generating the thumbnail. When false, the thumbnail will always be a square (which may distort the image). The default is true..

Parameters:
imagePreviewRatioEnabled - true if the aspect ration should be preserved.
Throws:
UnauthorizedException - if not a system administrator.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.