com.bea.content.federated
Interface IVirtualRepositoryManager


public interface IVirtualRepositoryManager

Interface to manage repositories and user credentials while honoring DA rights on the repositories.

For a each repository, credentials can be configured on both a per-user and per-repository basis. Each user can also select whether to use their own repository credentials or the global repository credentials configured on the IRepositoryConfig.

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 Oracle Weblogic Portal. Oracle 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 Oracle Weblogic Portal.

Field Summary
static int AUTHENTICATED
          The Credentials were successfully authenticated against the Repository.
static int AUTHENTICATION_ERROR
          An error occurred that did not permit authentication of the Credentials against the Repository.
static int AUTHENTICATION_FAILED
          The Credentials failed authentication against the Repository.
static int NOT_AUTHENTICATED
          The Credentials have not been successfully authenticated against the Repository.
 
Method Summary
 void createRepositoryConfig(ContentContext context, IRepositoryConfig config)
          Persist a given repository configuration.
 void createRepositoryConfig(ContentContext context, RepositoryConfig config)
          Deprecated  
 RepositoryCredential getActiveCredential(ContentContext context, String repositoryName)
          For the current user and the specified repository, retrieve the currently active credential.
 RepositoryCredentialScope getActiveCredentialScope(ContentContext context, String repositoryName)
          For the current user and specified repository, identify which is the currently active credential.
 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 VirtualRepositoryCapability#MANAGE capability on
 Map<String,String> getRepositoryDescription(ContentContext context, String repositoryName)
          Retrieve a map of repository description data.
 List<String> getRepositoryNames(ContentContext context)
          Return a list of names for all repositories defined in the system.
 RepositoryCredential getUserCredential(ContentContext context, String repositoryName)
          For the current user and the specified repository, retrieve the personal repository credential, if it exists.
 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 removeUserCredential(ContentContext context, String repositoryName)
          For the current user and the specified repository, remove a personal repository credential, if one exists for the specified repository.
 void setActiveCredentialScope(ContentContext context, String repositoryName, RepositoryCredentialScope scope)
          For the current user and the specified repository, specify which credential should be used.
 void setUserCredential(ContentContext context, String repositoryName, RepositoryCredential credential)
          For the current user and the specified repository, persist a personal repository credential.
 void updateRepositoryConfig(ContentContext context, IRepositoryConfig config)
          Update the repository config.
 void updateRepositoryConfig(ContentContext context, RepositoryConfig config)
          Deprecated  
 

Field Detail

AUTHENTICATED

static final int AUTHENTICATED
The Credentials were successfully authenticated against the Repository.

See Also
Constants Summary

NOT_AUTHENTICATED

static final int NOT_AUTHENTICATED
The Credentials have not been successfully authenticated against the Repository.

See Also
Constants Summary

AUTHENTICATION_FAILED

static final int AUTHENTICATION_FAILED
The Credentials failed authentication against the Repository.

See Also
Constants Summary

AUTHENTICATION_ERROR

static final int AUTHENTICATION_ERROR
An error occurred that did not permit authentication of the Credentials against the Repository.

See Also
Constants Summary
Method Detail

getRepositoryNames

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

This method does not require VirtualRepositoryCapability#MANAGE capability on the repositories.

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 AUTHENTICATED or any one of the other statuses defined in this interface.
Throws
NoSuchRepositoryConfigException - If the repository config does not exist
RepositoryException - If an error happens during ping
NoSuchRepositoryConfigException

getRepositoryConfigMap

Map<String,RepositoryConfig> getRepositoryConfigMap(ContentContext context)
                                                    throws RepositoryException,
                                                           AuthorizationException
Return repository configurations for repositories that the context has VirtualRepositoryCapability#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,
                            IRepositoryConfig config)
                            throws AuthorizationException,
                                   RepositoryConfigExistsException,
                                   RepositoryException
Persist a given repository configuration. See IRepositoryConfig for available constructors.

Parameters
context - The content context.
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.
RepositoryConfigExistsException

createRepositoryConfig

@Deprecated
void createRepositoryConfig(ContentContext context,
                                       RepositoryConfig config)
                            throws AuthorizationException,
                                   RepositoryConfigExistsException,
                                   RepositoryException
Deprecated 

Persist a given repository configuration. See IRepositoryConfig for available constructors.

Parameters
context - The content context.
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.
RepositoryConfigExistsException

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 IRepositoryConfig.
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.
NoSuchRepositoryConfigException

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 IRepositoryConfig 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 IRepositoryConfig, without the password or repository properties populated.
Throws
RepositoryException - If this operation fails.
NoSuchRepositoryConfigException - If this repository is not configured for this application.
NoSuchRepositoryConfigException

updateRepositoryConfig

void updateRepositoryConfig(ContentContext context,
                            IRepositoryConfig 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.
NoSuchRepositoryConfigException

updateRepositoryConfig

@Deprecated
void updateRepositoryConfig(ContentContext context,
                                       RepositoryConfig config)
                            throws AuthorizationException,
                                   RepositoryException,
                                   NoSuchRepositoryConfigException
Deprecated 

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.
NoSuchRepositoryConfigException

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.
NoSuchRepositoryConfigException

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.

setUserCredential

void setUserCredential(ContentContext context,
                       String repositoryName,
                       RepositoryCredential credential)
                       throws AuthorizationException,
                              NoSuchRepositoryConfigException,
                              RepositoryException
For the current user and the specified repository, persist a personal repository credential. The repository must support the RepositoryMultipleUsers capability. The user must be authenticated. This will not work for an anonymous user.

Note the user credential may exist without being active -- call setActiveCredentialScope(ContentContext,String,RepositoryCredentialScope) to activate the credential.

Parameters
context - The ContentContext object
repositoryName - the repository these credential applies to.
credential - the repository credential
Throws
AuthorizationException - If the caller is not authorized
NoSuchRepositoryConfigException - If the repository config does not exist
RepositoryException - if this operation fails
NoSuchRepositoryConfigException

getUserCredential

RepositoryCredential getUserCredential(ContentContext context,
                                       String repositoryName)
                                       throws AuthorizationException,
                                              NoSuchRepositoryConfigException,
                                              RepositoryException
For the current user and the specified repository, retrieve the personal repository credential, if it exists. Returns NULL if the current user has no personal repository credential for the specified repository. The repository must support the RepositoryMultipleUsers capability.

Note a user credential may exist without being active -- call setActiveCredentialScope(ContentContext,String,RepositoryCredentialScope) to activate the credential.

Parameters
context - The ContentContext object
repositoryName - the repository to retrieve personal repository credential for.
Returns
the personal repository credential for this user, or NULL if none exist.
Throws
AuthorizationException - If the caller is not authorized
NoSuchRepositoryConfigException - If the repository config does not exist
RepositoryException - if this operation fails
NoSuchRepositoryConfigException

removeUserCredential

void removeUserCredential(ContentContext context,
                          String repositoryName)
                          throws AuthorizationException,
                                 NoSuchRepositoryConfigException,
                                 RepositoryException
For the current user and the specified repository, remove a personal repository credential, if one exists for the specified repository. The repository must support the RepositoryMultipleUsers capability.

The credential scope for this user will be set to repository scope.

Note the user credential may exist without being active -- call setActiveCredentialScope(ContentContext,String,RepositoryCredentialScope) to activate the credential.

Parameters
context - The ContentContext object
repositoryName - the repository to remove the personal repository credential for.
Throws
AuthorizationException - If the caller is not authorized
NoSuchRepositoryConfigException - If the repository config does not exist
RepositoryException - if this operation fails
NoSuchRepositoryConfigException

getActiveCredential

RepositoryCredential getActiveCredential(ContentContext context,
                                         String repositoryName)
                                         throws AuthorizationException,
                                                NoSuchRepositoryConfigException,
                                                RepositoryException
For the current user and the specified repository, retrieve the currently active credential.

Parameters
context - The ContentContext object
repositoryName - the repository to retrieve the repository credential for.
Returns
the currently active repository credential for this user.
Throws
AuthorizationException - If the caller is not authorized
NoSuchRepositoryConfigException - If the repository config does not exist
RepositoryException - if this operation fails
NoSuchRepositoryConfigException

setActiveCredentialScope

void setActiveCredentialScope(ContentContext context,
                              String repositoryName,
                              RepositoryCredentialScope scope)
                              throws AuthorizationException,
                                     NoSuchRepositoryConfigException,
                                     RepositoryException
For the current user and the specified repository, specify which credential should be used. For example, both a repository and user credential may exist. This method can be called to specify that the repository credential should be used anytime this user accesses this repository. The repository must support the RepositoryMultipleUsers capability.

It is not valid to specify a user credential scope if a user credential has not been set.

Parameters
context - The ContentContext object
repositoryName - the repository to set the scope for
scope - the scope to set
Throws
AuthorizationException - If the caller is not authorized
NoSuchRepositoryConfigException - If the repository config does not exist
RepositoryException - if this operation fails
NoSuchRepositoryConfigException

getActiveCredentialScope

RepositoryCredentialScope getActiveCredentialScope(ContentContext context,
                                                   String repositoryName)
                                                   throws AuthorizationException,
                                                          NoSuchRepositoryConfigException,
                                                          RepositoryException
For the current user and specified repository, identify which is the currently active credential. For example, both a repository and user credential may exist. This method indicates which credential is currently active.

Parameters
context - The ContentContext object
repositoryName - the repository to retrieve the scope for
Returns
the currently active scope
Throws
AuthorizationException - If the caller is not authorized
NoSuchRepositoryConfigException - If the repository config does not exist
RepositoryException - if this operation fails
NoSuchRepositoryConfigException

getRepositoryDescription

Map<String,String> getRepositoryDescription(ContentContext context,
                                            String repositoryName)
                                            throws AuthenticationException
Retrieve a map of repository description data. The results are represented as a map of string keys and string values. The keys may be a combination of well-known keys specified in the SPIDescriptionKeys class and keys provided by the repository author.

Parameters
context - The ContentContext object
repositoryName - The name of the repository
Returns
The repository description data.
Throws
AuthenticationException - If the repository is not connected.


Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.