Jive API (3.0.13) Core Javadocs

com.jivesoftware.community
Interface StorageManager

All Superinterfaces:
JiveManager

public interface StorageManager
extends JiveManager

Manages the storage of binary objects and determines whether binary object data is stored on the file system or in the database.


Method Summary
 long getAttachmentDirectorySize()
          Returns the size (in bytes) of the attachment directory on the file system.
 long getBinaryBodyDirectorySize()
          Returns the size (in bytes) of the documentbody directory on the file system.
 long getImageDirectorySize()
          Returns the size (in bytes) of the image directory on the file system.
 long getMaxFileSystemCacheSize()
          Returns the maximum amount of storage (in bytes) that will be used by the file system cache when database binary object mode is enabled.
 boolean isDatabaseModeEnabled()
          Returns true if binary data such as attachments, images or binary document bodies is stored in the database.
 boolean isFileSystemCacheEnabled()
          Returns true if the binary object data is stored in the database and object data is cached on the file system in a directory within the jiveHome in order to relieve load on the database.
 void setDatabaseModeEnabled(boolean enabled)
          Enables or disables storage of binary object data in the database.
 void setFileSystemCacheEnabled(boolean enabled)
          Enables or disables storage of cached binary object data on the file system when in database mode.
 void setMaxFileSystemCacheSize(long maxSize)
          Sets the maximum amount of storage (in bytes) that will be used by the file system cache when database binary object mode is enabled.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

isDatabaseModeEnabled

boolean isDatabaseModeEnabled()
Returns true if binary data such as attachments, images or binary document bodies is stored in the database. If false, binary objects are stored on the file system. Note that not all databases may support storing binary data in the database. Those using clustering, or a database that does work with binary objects may wish to turn this mode on.

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

Returns:
true if binary objects will be stored in the database, false if they will be stored on the filesystem.

setDatabaseModeEnabled

void setDatabaseModeEnabled(boolean enabled)
                            throws UnauthorizedException
Enables or disables storage of binary object data in the database. If false, binary objects are stored on the file system. Note that not all databases may support storing binary data in the database. Those using clustering, or a database that does work with binary objects may wish to turn this mode on.

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

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

isFileSystemCacheEnabled

boolean isFileSystemCacheEnabled()
Returns true if the binary object data is stored in the database and object data is cached on the file system in a directory within the jiveHome in order to relieve load on the database. This mode is enabled by default when the database mode is enabled.

Returns:
true if binary objects are stored in the database and cached on the file system.

setFileSystemCacheEnabled

void setFileSystemCacheEnabled(boolean enabled)
                               throws UnauthorizedException
Enables or disables storage of cached binary object data on the file system when in database mode. If false, binary objects are always loaded from the database which can incur a higher load on the database. However, some corporate policies require that binary objects are never stored on the file system.

Parameters:
enabled - true if binary object data should be cached on the file system.
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 binary object 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 binary object 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 binary object 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 binary object data (in bytes).
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.

getBinaryBodyDirectorySize

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

The size of the documentbody 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 documentbody directory in bytes, or -1 if the size of the directory is not known.
Throws:
UnauthorizedException - if not a system administrator.

getImageDirectorySize

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

The size of the image 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 image directory in bytes, or -1 if the size of the directory is not known.
Throws:
UnauthorizedException - if not a system administrator.

Jive Product Page

Copyright © 1999-2007 Jive Software.