Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.4.0)
E15995-03


oracle.wcps.connection
Interface IAnnotatedConnectionService


public interface IAnnotatedConnectionService

Interface for connection configuration persistence.

This service leverages annotated classes for persistence and retrieval of connection configurations. In addition, classes can be annotated for localization (see L10n, L10nName, L10nDesc) for localized metadata about the connections.

The following code is an example of an annotated class:

 package test.connection;
 
 import oracle.wcps.l10n.annotation.L10n;
 import oracle.wcps.l10n.annotation.L10nName;
 import oracle.wcps.l10n.annotation.L10nDesc;
 
 import oracle.wcps.connection.configuration.RemoteHttpAnnotatedConfiguration;
 
 @L10n(bundle="test.connection.ConfigurationResources")
 @ConnectionConfiguration
 public class MyProxyConnectionConfiguration
 extends RemoteHttpAnnotatedConfiguration
 {
      @L10nDesc(key="ProxyHost.description")
      // Uses default "ProxyHost" as the property name by the backing store.
      @ConnectionProperty
      public String ProxyHost;
      
      @L10nDesc(key="ProxyPort.description")
      // Uses "proxy.port" as the property name by the backing store.
      @ConnectionProperty (propertyname="proxy_port")
      public Integer ProxyPort;
 }
 

Field Summary
static java.lang.String GLOBAL_NAMESPACE_NAME
          Represents the namespace that indicates that the connection applies globally.

 

Method Summary
<T> T
getConnection(java.lang.String namespace, java.lang.Class<T> configClass, java.lang.String name)
          Retrieves an existing connection based on the provided namespace, configuration class and name.
<T> java.util.List<T>
getConnections(java.lang.Class<T> configClass)
          Retrieves existing connections based on the provided configuration class.
<T> java.util.List<T>
getConnections(java.lang.String namespace, java.lang.Class<T> configClass)
          Retrieves existing connections based on the provided configuration class.
<T> void
removeConnection(java.lang.Class<T> configClass, java.lang.String name)
          Removes a connection by name from the global connections namespace.
<T> void
removeConnection(java.lang.String namespace, java.lang.Class<T> configClass, java.lang.String name)
          Removes a connection by name.
<T> T
saveConnection(java.lang.String namespace, T configuration)
          Persists a connection with the configured backing store.
<T> T
saveConnection(T configuration)
          Persists a connection with the configured backing store.

 

Field Detail

GLOBAL_NAMESPACE_NAME

static final java.lang.String GLOBAL_NAMESPACE_NAME
Represents the namespace that indicates that the connection applies globally.
See Also:
Constant Field Values

Method Detail

getConnections

<T> java.util.List<T> getConnections(java.lang.String namespace,
                                     java.lang.Class<T> configClass)
Retrieves existing connections based on the provided configuration class.
Parameters:
namespace - The namespace used to isolate connections for tennancy.
configClass - The annotated configuration class used to represent each connection.
Returns:
A list of connections that match the specified configuration class, or a zero-length list if none exist.

getConnections

<T> java.util.List<T> getConnections(java.lang.Class<T> configClass)
Retrieves existing connections based on the provided configuration class.

This method returns all connections (both namespaced and global) for a given connection type.

Parameters:
configClass - The annotated configuration class used to represent each connection.
Returns:
A list of connections that match the specified configuration class, or a zero-length list if none exist.

getConnection

<T> T getConnection(java.lang.String namespace,
                    java.lang.Class<T> configClass,
                    java.lang.String name)
Retrieves an existing connection based on the provided namespace, configuration class and name.
Parameters:
namespace - The namespace used to isolate connections for tennancy.
configClass - The annotated configuration class used to represent each connection.
name - The named connection to retrieve
Returns:
The connection if the connection exists, null otherwise.

saveConnection

<T> T saveConnection(java.lang.String namespace,
                     T configuration)
Persists a connection with the configured backing store.
Parameters:
namespace - The namespace used to isolate connections for tennancy.
configuration - Instance of the annotated configuration class used to represent each connection.
Returns:
The resulting persisting connection.

saveConnection

<T> T saveConnection(T configuration)
Persists a connection with the configured backing store.

Connections persisted using this method will be globally accessible to all namespaces.

Parameters:
configuration - Instance of the annotated configuration class used to represent each connection.
Returns:
The resulting persisting connection.

removeConnection

<T> void removeConnection(java.lang.String namespace,
                          java.lang.Class<T> configClass,
                          java.lang.String name)
Removes a connection by name.
Parameters:
namespace - The namespace used to isolate connections for tenancy.
configClass - The annotated configuration class used to represent each connection.
name - The connection name to remove.

removeConnection

<T> void removeConnection(java.lang.Class<T> configClass,
                          java.lang.String name)
Removes a connection by name from the global connections namespace.
Parameters:
configClass - The annotated configuration class used to represent each connection.
name - The connection name to remove.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.4.0)
E15995-03


Copyright © 2009, 2011, Oracle and/or its affiliates. All rights reserved.