com.bea.content.federated
Interface IVirtualRepositoryManager


public interface IVirtualRepositoryManager

Interface to manage repositories while honoring DA rights on the repositories. Note: new methods may be added to this interface periodically -- therefore, this not a good CM extension point. The recommended extension point is at the Service Provider Interface, in package com.bea.content.spi

This interface is intended to be implemented only by BEA Weblogic Portal.BEA Systems reserves the right to add abstract methods to this interface without notice. Implementations of this interface by other parties must not be expected to compile without change in future versions of BEA Weblogic Portal.

Method Summary
 void createRepositoryConfig(ContentContext context, RepositoryConfig config)
          Create repository config
 RepositoryConfig getPublicRepositoryConfig(ContentContext context, String name)
          Get the named repository config, without the password populated.
 RepositoryConfig getRepositoryConfig(ContentContext context, String name)
          Get the named repository config.
 Map<String,RepositoryConfig> getRepositoryConfigMap(ContentContext context)
          Return repository configurations for repositories that the context has CAN_MANAGE capability on
 List<String> getRepositoryNames(ContentContext context)
          Return a list of names for all repositories defined in the system.
 boolean hasCapability(ContentContext context, String repositoryName, VirtualRepositoryCapability capability)
          Check to see if the caller has the specified security capability on a virtual repository
 boolean isLibraryServiceEnabled(ContentContext context, String repositoryName)
          Checks whether or not the specified repository has library services enabled.
 boolean isRemovable(ContentContext context, String name)
          Determine if the given repository can be removed.
 int pingRepository(String repositoryName)
          Pings a repository to check if it is available or not.
 void removeRepositoryConfig(ContentContext context, String name)
          Remove the repository config.
 void updateRepositoryConfig(ContentContext context, RepositoryConfig config)
          Update the repository config.
 

Method Detail

getRepositoryNames

List<String> getRepositoryNames(ContentContext context)
                                throws RepositoryException
Return a list of names for all repositories defined in the system.

Parameters
context - The content context.
Returns
A list of repository names defined in this application.
Throws
RepositoryException - If an error occurs while retrieving the repository names.

pingRepository

int pingRepository(String repositoryName)
                   throws NoSuchRepositoryConfigException,
                          RepositoryException
Pings a repository to check if it is available or not. This method tries to connect to that specific repository to check for it's availability. It does not persist the connection information.

Parameters
repositoryName - The name of the repository
Returns
an integer specifying the connection status of the repository. If the repository can be pinged successfully it will return a status of RepositorySession.AUTHENTICATED or any one of the other statuses defined in RepositorySession.
Throws
NoSuchRepositoryConfigException - If the repository config does not exist
RepositoryException - If an error happens during ping

getRepositoryConfigMap

Map<String,RepositoryConfig> getRepositoryConfigMap(ContentContext context)
                                                    throws RepositoryException,
                                                           AuthorizationException
Return repository configurations for repositories that the context has CAN_MANAGE capability on

Parameters
context - The content context.
Returns
The map of repository configs.
Throws
RepositoryException - If an error occurs while retrieving the repository configurations.
AuthorizationException - If the caller does not have the VirtualRepositoryCapability.MANAGE capability.

createRepositoryConfig

void createRepositoryConfig(ContentContext context,
                            RepositoryConfig config)
                            throws AuthorizationException,
                                   RepositoryConfigExistsException,
                                   RepositoryException
Create repository config

Parameters
context - The content dontext.
config - The configuraton to create.
Throws
AuthorizationException - If the caller does not have the VirtualRepositoryCapability.MANAGE capability.
RepositoryConfigExistsException - If the supplied configuration already exists for this application.
RepositoryException - If this operation fails.

getRepositoryConfig

RepositoryConfig getRepositoryConfig(ContentContext context,
                                     String name)
                                     throws AuthorizationException,
                                            RepositoryException,
                                            NoSuchRepositoryConfigException
Get the named repository config.

Parameters
context - The content context.
name - The repository name.
Returns
The RepositoryConfig.
Throws
AuthorizationException - If the caller does not have the VirtualRepositoryCapability.MANAGE capability.
RepositoryException - If this operation fails.
NoSuchRepositoryConfigException - If this repository is not configured for this application.

getPublicRepositoryConfig

RepositoryConfig getPublicRepositoryConfig(ContentContext context,
                                           String name)
                                           throws RepositoryException,
                                                  NoSuchRepositoryConfigException
Get the named repository config, without the password populated. Only system properties as defined in the RepositoryConfig object will be defined on the resulting RepositoryConfig object. This allows public access to repository configuration data without requiring the VirtualRepositoryCapability.MANAGE capability.

Parameters
context - The content context.
name - The repository name.
Returns
The RepositoryConfig, without the password or repository properties populated.
Throws
RepositoryException - If this operation fails.
NoSuchRepositoryConfigException - If this repository is not configured for this application.

updateRepositoryConfig

void updateRepositoryConfig(ContentContext context,
                            RepositoryConfig config)
                            throws AuthorizationException,
                                   RepositoryException,
                                   NoSuchRepositoryConfigException
Update the repository config.

Parameters
context - The content context.
config - The repository configuration.
Throws
AuthorizationException - If the caller does not have the VirtualRepositoryCapability.MANAGE capability.
RepositoryException - If this operation fails.
NoSuchRepositoryConfigException - If the supplied repository configuration is not present for this application.

removeRepositoryConfig

void removeRepositoryConfig(ContentContext context,
                            String name)
                            throws AuthorizationException,
                                   RepositoryException,
                                   NoSuchRepositoryConfigException
Remove the repository config.

Parameters
context - The content context.
name - The repository name.
Throws
AuthorizationException - If the caller does not have the VirtualRepositoryCapability.MANAGE capability.
RepositoryException - If this operation fails.
NoSuchRepositoryConfigException - If the supplied repository name is not configured for this application.

isLibraryServiceEnabled

boolean isLibraryServiceEnabled(ContentContext context,
                                String repositoryName)
                                throws RepositoryException
Checks whether or not the specified repository has library services enabled.

Parameters
context - The ContentContext object
repositoryName - The name of the repository
Returns
True if library services are enabled for the given repository.
Throws
RepositoryException - If this operation fails.

hasCapability

boolean hasCapability(ContentContext context,
                      String repositoryName,
                      VirtualRepositoryCapability capability)
                      throws AuthorizationException
Check to see if the caller has the specified security capability on a virtual repository

Parameters
context - The ContentContext object
repositoryName - The name of the repository
capability - The capability to check for.
Returns
true or false depending on whether the caller has the capability on the virtual repository or not.
Throws
AuthorizationException - If an error occurs while performaing the capability check.

isRemovable

boolean isRemovable(ContentContext context,
                    String name)
                    throws RepositoryException
Determine if the given repository can be removed. This is possible through the API when the configuration is not defined in the application's content-config.xml.

Parameters
context - The ContentContext object
name - THe name of the repository
Returns
true or false depending on whether the repository is defined in the application's content-config.xml.
Throws
RepositoryException - If this operation fails.


Copyright © 2006 BEA Systems, Inc. All Rights Reserved