© 2004 BEA Systems, Inc.

com.bea.content.manager
Class RepositoryConfig

java.lang.Object
  extended bycom.bea.content.manager.RepositoryConfig

public class RepositoryConfig
extends Object

Represents the configuration of a content repository. Each Repository may have specific properties that are necessary in order to be properly configured. Please see the specific repositories documentation for configuration information.

****************WARNING****************

When getting binaries from the BEA Repository (including both a binary Node Property and also a binary PropertyChoice) the default is to return the InputStream as a ByteArrayInputStream, thus consuming server memory until the bytes are released. If your application will be reading in very large files, you may switch to streaming mode. This means that the InputStream returned may read directly from a database resource, depending on the database or driver. This is accomplished by creating a property on the RepositoryConfig called "STREAMING_ENABLED" with the value set to "true". To disable streaming you must remove the "STREAMING_ENABLED" property entirely. Switching to streaming mode must be done with caution as it places additional requirements on developers using the api. The issue is that the InputStream through a BLOB, may be attached to a database connection (or other transactional resource). The use of this stream must therefore be within the context of a transaction to ensure that it is isolated from uses by other threads, etc. If you don't begin a UserTransaction before calling this method and then either commit or rollback the tx after you close the InputStream, the connection may go back to the WLS connection Pool and will be reused by another thread. This will lead to deadlocking the server. All of the BEA code that uses the api (tags, servlets, portlets and admin tools) are all protected through the use of a transaction. For those that are calling the API directly, here is an example of wrapping the call in a tx with exception handling left out

 try {
     Context initCtx = new InitialContext();
     tx = (UserTransaction)initCtx.lookup( "java:comp/UserTransaction" );
     tx.setTransactionTimeout( transactionTimeout );
     tx.begin();
     bytes = nodeOps.getPropertyBytes(nodeId, propertyId);
     // empty the bytes
 }
 finally {
     // make sure to close InputStream
     if ( bytes != null ) {
         bytes.close();
     }
     if ( tx != null ) {
         switch ( tx.getStatus() ) {
             case Status.STATUS_ACTIVE:
                 tx.commit();
                 break;
             case Status.STATUS_MARKED_ROLLBACK:
                 tx.rollback();
                 break;
             default:
                 // this is bad - an unexpected status
                 // throw exception
                 break;
         }
    }
 }
 


Field Summary
static boolean DEFAULT_BINARY_CACHE_IS_ENABLED
           
static int DEFAULT_BINARY_CACHE_MAX_ENTRIES
           
static long DEFAULT_BINARY_CACHE_MAX_ENTRY_SIZE
           
static long DEFAULT_BINARY_CACHE_TTL
           
static String DEFAULT_CLASS_NAME
           
static boolean DEFAULT_NODE_CACHE_IS_ENABLED
           
static int DEFAULT_NODE_CACHE_MAX_ENTRIES
           
static long DEFAULT_NODE_CACHE_TTL
           
static String DEFAULT_NODE_OPS_HOME
           
static String DEFAULT_OBJECT_CLASS_OPS_HOME
           
static boolean DEFAULT_READ_ONLY
           
static String DEFAULT_SEARCH_OPS_HOME
           
static String FILESYSTEM_CLASS_NAME
           
static String FILESYSTEM_DIRECTORY_KEY
           
static String FILESYSTEM_IS_LINKED
           
static String FILESYSTEM_NIO
           
static String FILESYSTEM_WEBAPP_KEY
           
static String MANAGEMENT_ENABLED_KEY
           
static String STREAMING_ENABLED_KEY
           
 
Constructor Summary
RepositoryConfig(String name)
          Constructs an instance with just name using the defined DEFAULTS for other attributes.
RepositoryConfig(String name, String className, Properties properties)
          Constructs an instance with just name, className and properties using the defined DEFAULTS for other attributes.
RepositoryConfig(String name, String className, Properties properties, String userName, String password, boolean readOnly, int nodeCacheMaxEntries, long nodeCacheTtl, boolean nodeCacheIsEnabled, int binaryCacheMaxEntries, long binaryCacheMaxEntrySize, long binaryCacheTtl, boolean binaryCacheIsEnabled)
          Constructs an instance using all attributes.
 
Method Summary
 boolean getBinaryCacheIsEnabled()
          Gets the active state for the binary cache of a repository.
 int getBinaryCacheMaxEntries()
          Gets the max entries for the binary cache of a repository.
 long getBinaryCacheMaxEntrySize()
          Gets the max size for the binary cache of a repository.
 long getBinaryCacheTtl()
          Gets the time-to-live for entries in a binary cache of a repository.
 String getClassName()
          The class that implements com.bea.content.repostiory.Repository.
 String getName()
          The name of the Repository.
 boolean getNodeCacheIsEnabled()
          Gets the active state for the node cache of a repository.
 int getNodeCacheMaxEntries()
          Gets the max entries for the node cache of a repository.
 long getNodeCacheTtl()
          Gets the time-to-live for entries in a node cache of a repository.
 String getPassword()
          Gets the password for the repository.
 Properties getProperties()
          Gets the configuration properties for the repository.
 boolean getReadOnly()
          Gets the read-only attribute for the repository.
 String getUserName()
          Gets the username for the repository.
 boolean isManaged()
          True if this repository is versionable, false otherwise.
 boolean isStreamable()
          True if this repository is versionable, false otherwise.
 String toString()
          Gets attributes as String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_BINARY_CACHE_IS_ENABLED

public static final boolean DEFAULT_BINARY_CACHE_IS_ENABLED
See Also:
Constant Field Values

DEFAULT_BINARY_CACHE_MAX_ENTRIES

public static final int DEFAULT_BINARY_CACHE_MAX_ENTRIES
See Also:
Constant Field Values

DEFAULT_BINARY_CACHE_MAX_ENTRY_SIZE

public static final long DEFAULT_BINARY_CACHE_MAX_ENTRY_SIZE
See Also:
Constant Field Values

DEFAULT_BINARY_CACHE_TTL

public static final long DEFAULT_BINARY_CACHE_TTL
See Also:
Constant Field Values

DEFAULT_CLASS_NAME

public static final String DEFAULT_CLASS_NAME
See Also:
Constant Field Values

DEFAULT_NODE_CACHE_IS_ENABLED

public static final boolean DEFAULT_NODE_CACHE_IS_ENABLED
See Also:
Constant Field Values

DEFAULT_NODE_CACHE_MAX_ENTRIES

public static final int DEFAULT_NODE_CACHE_MAX_ENTRIES
See Also:
Constant Field Values

DEFAULT_NODE_CACHE_TTL

public static final long DEFAULT_NODE_CACHE_TTL
See Also:
Constant Field Values

DEFAULT_NODE_OPS_HOME

public static final String DEFAULT_NODE_OPS_HOME
See Also:
Constant Field Values

DEFAULT_OBJECT_CLASS_OPS_HOME

public static final String DEFAULT_OBJECT_CLASS_OPS_HOME
See Also:
Constant Field Values

DEFAULT_READ_ONLY

public static final boolean DEFAULT_READ_ONLY
See Also:
Constant Field Values

DEFAULT_SEARCH_OPS_HOME

public static final String DEFAULT_SEARCH_OPS_HOME
See Also:
Constant Field Values

FILESYSTEM_CLASS_NAME

public static final String FILESYSTEM_CLASS_NAME
See Also:
Constant Field Values

FILESYSTEM_DIRECTORY_KEY

public static final String FILESYSTEM_DIRECTORY_KEY
See Also:
Constant Field Values

FILESYSTEM_IS_LINKED

public static final String FILESYSTEM_IS_LINKED
See Also:
Constant Field Values

FILESYSTEM_NIO

public static final String FILESYSTEM_NIO
See Also:
Constant Field Values

FILESYSTEM_WEBAPP_KEY

public static final String FILESYSTEM_WEBAPP_KEY
See Also:
Constant Field Values

MANAGEMENT_ENABLED_KEY

public static final String MANAGEMENT_ENABLED_KEY
See Also:
Constant Field Values

STREAMING_ENABLED_KEY

public static final String STREAMING_ENABLED_KEY
See Also:
Constant Field Values
Constructor Detail

RepositoryConfig

public RepositoryConfig(String name)
Constructs an instance with just name using the defined DEFAULTS for other attributes.


RepositoryConfig

public RepositoryConfig(String name,
                        String className,
                        Properties properties)
Constructs an instance with just name, className and properties using the defined DEFAULTS for other attributes.


RepositoryConfig

public RepositoryConfig(String name,
                        String className,
                        Properties properties,
                        String userName,
                        String password,
                        boolean readOnly,
                        int nodeCacheMaxEntries,
                        long nodeCacheTtl,
                        boolean nodeCacheIsEnabled,
                        int binaryCacheMaxEntries,
                        long binaryCacheMaxEntrySize,
                        long binaryCacheTtl,
                        boolean binaryCacheIsEnabled)
Constructs an instance using all attributes.

Method Detail

getBinaryCacheIsEnabled

public boolean getBinaryCacheIsEnabled()
Gets the active state for the binary cache of a repository.


getBinaryCacheMaxEntries

public int getBinaryCacheMaxEntries()
Gets the max entries for the binary cache of a repository.


getBinaryCacheMaxEntrySize

public long getBinaryCacheMaxEntrySize()
Gets the max size for the binary cache of a repository.


getBinaryCacheTtl

public long getBinaryCacheTtl()
Gets the time-to-live for entries in a binary cache of a repository.


getClassName

public String getClassName()
The class that implements com.bea.content.repostiory.Repository.


getName

public String getName()
The name of the Repository.


getNodeCacheIsEnabled

public boolean getNodeCacheIsEnabled()
Gets the active state for the node cache of a repository.


getNodeCacheMaxEntries

public int getNodeCacheMaxEntries()
Gets the max entries for the node cache of a repository.


getNodeCacheTtl

public long getNodeCacheTtl()
Gets the time-to-live for entries in a node cache of a repository.


getPassword

public String getPassword()
Gets the password for the repository.


getProperties

public Properties getProperties()
Gets the configuration properties for the repository.


getReadOnly

public boolean getReadOnly()
Gets the read-only attribute for the repository.


getUserName

public String getUserName()
Gets the username for the repository.


isManaged

public boolean isManaged()
True if this repository is versionable, false otherwise.


isStreamable

public boolean isStreamable()
True if this repository is versionable, false otherwise.


toString

public String toString()
Gets attributes as String.


© 2004 BEA Systems, Inc.

Copyright © 2004 BEA Systems, Inc. All Rights Reserved