com.bea.content.manager
Class RepositoryConfig

java.lang.Object
  extended by com.bea.content.federated.RepositoryConfig
      extended by com.bea.content.manager.RepositoryConfig
All Implemented Interfaces
IRepositoryConfig, Serializable, Cloneable

Deprecated Replaced by IRepositoryConfig

public class RepositoryConfig
extends RepositoryConfig

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 WLP 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 WLP 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();
     // This is deprecated now.
     // bytes = nodeOps.getPropertyBytes(nodeId, propertyId);
     bytes = INodeManager.getStream(context, 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;
         }
     }
 }
 

An example of creating a default RepositoryConfig (which can also be done via new RepositoryConfig("repoName")) is:

     RepositoryConfig repoConfig = new RepositoryConfig("repoName", DEFAULT_CLASS_NAME, new Properties());
 

Repository properties may be set when constructing the configuration. Property names and values are unique to the repository being configured. Well-known repository properties are represented by constants in this class with the naming convention *_KEY. Set the property on the properties object used by the RepositoryConfig such as:

     Properties props = new Properties();
     props.setProperty(FILESYSTEM_DIRECTORY_KEY, "/path/to/files");
 

The configuration may be persisted using the IVirtualRepositoryManager.createRepositoryConfig(com.bea.content.ContentContext, com.bea.content.federated.IRepositoryConfig) and IVirtualRepositoryManager.updateRepositoryConfig(com.bea.content.ContentContext, com.bea.content.federated.IRepositoryConfig) methods. Such as:

     IVirtualRepositoryManager repoManager = COntentManagerFactory.getVirtualRepositoryManager();
     repoManager.createRepositoryConfig(context, repoConfig);
 

There is one other way to specify repository configuration details. This is accomplished using the content-config.xml descriptor and is documented with the WLP documentation on edocs. This is done for a repository configuration specific to an application and that configuration is deployed with the application. The API to create a configuration is provided when dynamic creation is appropriate for the application. The API to update a configuration will work against both configurations created by the API and present in the content-config.xml deployment descriptor. Changes made to a configuration present in the descriptor will be altered using a deployment plan (see the WLS documentation for details on this process) and will not be directly reflected in the content-config.xml deployment descriptor file in your application.

See Also
Serialized Form

Field Summary
 
Fields inherited from interface com.bea.content.federated.IRepositoryConfig
DEFAULT_BINARY_CACHE_IS_ENABLED, DEFAULT_BINARY_CACHE_MAX_ENTRIES, DEFAULT_BINARY_CACHE_MAX_ENTRY_SIZE, DEFAULT_BINARY_CACHE_TTL, DEFAULT_CLASS_NAME, DEFAULT_EXPLICIT_CACHE_IS_ENABLED, DEFAULT_EXPLICIT_CACHE_MAX_ENTRIES, DEFAULT_EXPLICIT_CACHE_TTL, DEFAULT_FULLTEXT_SEARCH_IS_ENABLED, DEFAULT_NODE_CACHE_IS_ENABLED, DEFAULT_NODE_CACHE_MAX_ENTRIES, DEFAULT_NODE_CACHE_TTL, DEFAULT_NODE_OPS_HOME, DEFAULT_OBJECT_CLASS_OPS_HOME, DEFAULT_READ_ONLY, DEFAULT_REPO_BINARY_CACHE_IS_ENABLED, DEFAULT_REPO_BINARY_CACHE_MAX_ENTRIES, DEFAULT_REPO_BINARY_CACHE_MAX_ENTRY_SIZE, DEFAULT_REPO_BINARY_CACHE_TTL, DEFAULT_REPO_NODE_CACHE_IS_ENABLED, DEFAULT_REPO_NODE_CACHE_MAX_ENTRIES, DEFAULT_REPO_NODE_CACHE_TTL, DEFAULT_REPO_TYPE_CACHE_IS_ENABLED, DEFAULT_REPO_TYPE_CACHE_MAX_ENTRIES, DEFAULT_REPO_TYPE_CACHE_TTL, DEFAULT_SEARCH_CACHE_ENABLED, DEFAULT_SEARCH_CACHE_IS_ENABLED, DEFAULT_SEARCH_CACHE_MAX_ENTRIES, DEFAULT_SEARCH_CACHE_TTL, DEFAULT_SEARCH_INDEXING_IS_ENABLED, DEFAULT_SEARCH_IS_ENABLED, DEFAULT_SEARCH_OPS_HOME, DEFAULT_TYPE_CACHE_IS_ENABLED, DEFAULT_TYPE_CACHE_MAX_ENTRIES, DEFAULT_TYPE_CACHE_TTL, EXPLICIT_CACHE_IS_ENABLED_KEY, EXPLICIT_CACHE_MAX_ENTRIES_KEY, EXPLICIT_CACHE_TTL_KEY, FEDERATED_EVENTS_ENABLED_KEY, FILESYSTEM_CLASS_NAME, FILESYSTEM_DIRECTORY_KEY, FILESYSTEM_IS_LINKED, FILESYSTEM_NIO, FILESYSTEM_WEBAPP_KEY, FOLDER_BADGES_KEY, FULLTEXT_SEARCH_INDEX_LANGUAGE_TYPE_KEY, FULLTEXT_SEARCH_QUERY_ANY_LANGUAGE_KEY, FULLTEXT_SEARCH_QUERY_LANGUAGE_TYPE_KEY, MANAGEMENT_ENABLED_KEY, PUBLIC_PROPERTY_PREFIX, REPO_BINARY_CACHE_IS_ENABLED_KEY, REPO_BINARY_CACHE_MAX_ENTRIES_KEY, REPO_BINARY_CACHE_MAX_ENTRY_SIZE_KEY, REPO_BINARY_CACHE_TTL_KEY, REPO_NODE_CACHE_IS_ENABLED_KEY, REPO_NODE_CACHE_MAX_ENTRIES_KEY, REPO_NODE_CACHE_TTL_KEY, REPO_TYPE_CACHE_IS_ENABLED_KEY, REPO_TYPE_CACHE_MAX_ENTRIES_KEY, REPO_TYPE_CACHE_TTL_KEY, REPO_VALIDATION_KEY, REPOSITORY_EVENTS_ENABLED_KEY, SEARCH_ENGINE_MANAGER_KEY, SEARCH_VALIDATION_KEY, STREAMING_ENABLED_KEY, SUPPORTS_LIKE_ESCAPE_CLAUSE_KEY, SYSTEM_PROPERTY_KEYS, USE_NATIVE_SECURITY, USE_RANGE_QUERIES, VCR_VALIDATION_KEY, WEBDAV_DREAMWEAVER_SUPPORT
 
Constructor Summary
RepositoryConfig(String name)
          Deprecated Constructs an instance with just the given name using the defined DEFAULTS for other attributes.
RepositoryConfig(String name, String className, Properties properties)
          Deprecated 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)
          Deprecated  
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, boolean searchIsEnabled)
          Deprecated Constructs an instance using all 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, boolean searchIsEnabled, boolean searchIndexingEnabled, boolean fullTextSearchIsEnabled)
          Deprecated Construct a repository config.
 
Method Summary
 
Methods inherited from class com.bea.content.federated.RepositoryConfig
clone, getBinaryCacheIsEnabled, getBinaryCacheMaxEntries, getBinaryCacheMaxEntrySize, getBinaryCacheTtl, getClassName, getFolderBadges, getFulltextSearchIndexLanguageType, getFulltextSearchIsEnabled, getFulltextSearchQueryAnyLanguage, getFulltextSearchQueryLanguageType, getName, getNodeCacheIsEnabled, getNodeCacheMaxEntries, getNodeCacheTtl, getPassword, getProperties, getReadOnly, getSearchCacheIsEnabled, getSearchCacheMaxEntries, getSearchCacheTtl, getSearchIndexingIsEnabled, getSearchIsEnabled, getSystemPropertyKeys, getTypeCacheIsEnabled, getTypeCacheMaxEntries, getTypeCacheTtl, getUserName, isBeaRepository, isDeprecatedBEA, isExtended, isManaged, isStreamable, isUcmRepository, setBinaryCacheIsEnabled, setBinaryCacheMaxEntries, setBinaryCacheMaxEntrySize, setBinaryCacheTtl, setClassName, setFulltextSearchIsEnabled, setNodeCacheIsEnabled, setNodeCacheMaxEntries, setNodeCacheTtl, setPassword, setProperties, setReadOnly, setSearchIndexingIsEnabled, setSearchIsEnabled, setUserName, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepositoryConfig

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

Parameters
name - The name of the repository configuration.

RepositoryConfig

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

Parameters
name - The name of the repository configuration.
className - The class name for the repository connection.
properties - The properties for this configuration.

RepositoryConfig

@Deprecated
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)
Deprecated 

Constructs an instance using all attributes.

Parameters
name - The name of the repository configuration.
className - The class name for the repository connection.
properties - The properties for this configuration.
userName - The username to use when connecting to this repository.
password - The password to use when connecting to this repository.
readOnly - True if this repository is read-only.
nodeCacheMaxEntries - The maximum number of entries in the node cache for this repository.
nodeCacheTtl - The time-to-live value for this repository's node cache.
nodeCacheIsEnabled - True if the node cache is enabled for this repository.
binaryCacheMaxEntries - The maximum number of entries in the binary cache for this repository.
binaryCacheMaxEntrySize - The maximum size of a binary value in the binary cache for this repository.
binaryCacheTtl - The time-to-live value for this repository's binary cache.
binaryCacheIsEnabled - True if the binary cache is enabled for this repository.

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,
                        boolean searchIsEnabled)
Deprecated 
Constructs an instance using all attributes.

Parameters
name - The name of the repository configuration.
className - The class name for the repository connection.
properties - The properties for this configuration.
userName - The username to use when connecting to this repository.
password - The password to use when connecting to this repository.
readOnly - True if this repository is read-only.
nodeCacheMaxEntries - The maximum number of entries in the node cache for this repository.
nodeCacheTtl - The time-to-live value for this repository's node cache.
nodeCacheIsEnabled - True if the node cache is enabled for this repository.
binaryCacheMaxEntries - The maximum number of entries in the binary cache for this repository.
binaryCacheMaxEntrySize - The maximum size of a binary value in the binary cache for this repository.
binaryCacheTtl - The time-to-live value for this repository's binary cache.
binaryCacheIsEnabled - True if the binary cache is enabled for this repository.
searchIsEnabled - True if search (metadata) is enabled for this repository.

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,
                        boolean searchIsEnabled,
                        boolean searchIndexingEnabled,
                        boolean fullTextSearchIsEnabled)
Deprecated 
Construct a repository config.

Parameters
name - The name of the repository configuration.
className - The class name for the repository connection.
properties - The properties for this configuration.
userName - The username to use when connecting to this repository.
password - The password to use when connecting to this repository.
readOnly - True if this repository is read-only.
nodeCacheMaxEntries - The maximum number of entries in the node cache for this repository.
nodeCacheTtl - The time-to-live value for this repository's node cache.
nodeCacheIsEnabled - True if the node cache is enabled for this repository.
binaryCacheMaxEntries - The maximum number of entries in the binary cache for this repository.
binaryCacheMaxEntrySize - The maximum size of a binary value in the binary cache for this repository.
binaryCacheTtl - The time-to-live value for this repository's binary cache.
binaryCacheIsEnabled - True if the binary cache is enabled for this repository.
searchIsEnabled - True if search (metadata) is enabled for this repository.
searchIndexingEnabled - True if search indexing (for full-text search) is enabled for this repository.
fullTextSearchIsEnabled - True if full-text search is enabled for this repository.


Copyright © 2011, Oracle. All rights reserved.