com.ibm.portal.outbound.config.impl
Class OutboundConnectionCreationContextBuilderFactory

java.lang.Object
  extended by com.ibm.portal.outbound.config.impl.OutboundConnectionCreationContextBuilderFactory

public class OutboundConnectionCreationContextBuilderFactory
extends java.lang.Object

This utility class is a factory for CreationContext Objects that are needed to create new outbound configuration settings. The factory provides method that creates CreationContext objects for the following Outbound Connection settings:


These CreationContext objects are passed to the method OutboundConnectionModelController#create(Class, CreationContext)) to create a new configuration setting. The following code example creates a new Connection profile which is scoped to a web module which has the application context "/portal/PA_MY_APPLICATION".

String applicationScope = "/portal/PA_MY_APPLICATION"; // the application context

javax.naming.Context ctx = new javax.naming.InitialContext();
OutboundConnectionModelHome home = (OutboundConnectionModelHome) ctx.lookup("portal:service/model/OutboundConnectionModel");
OutboundConnectionModel model = home.getOutboundConnectionModelProvider().getOutboundConnectionModel();
OutboundConnectionModelController ctrl = getController(model);

CreationContext cc = OutboundConnectionCreationContextBuilderFactory.getInstance().
getOutboundConnectionProfileCreationContext(applicationScope);

ModifiableOutboundConnectionProfile theNewProfile = ctrl.create(ModifiableOutboundConnectionProfile.class, cc);
*

Since:
8.5.0
See Also:
CreationContext, OutboundConnectionModelController

Constructor Summary
protected OutboundConnectionCreationContextBuilderFactory()
           
 
Method Summary
 CookieRuleCreationContext getCookieRuleCreationContext(PolicyRule parent, java.lang.String name)
          Get a creation context for a new cookie rule.
static OutboundConnectionCreationContextBuilderFactory getInstance()
          Get the singleton object of a OutboundConnectionCreationContextBuilderFactory.
 OutboundConnectionProfileCreationContext getOutboundConnectionProfileCreationContext()
          Get a creation context for the global connection profile.
 OutboundConnectionProfileCreationContext getOutboundConnectionProfileCreationContext(java.lang.String scopeRef)
          Get a creation context for a new application-scoped connection profile.
 PolicyMappingCreationContext getPolicyMappingCreationContext(OutboundConnectionProfile parent, java.lang.String name, java.lang.String contextPath)
          Get a creation context for a new policy mapping.
 PolicyRuleCreationContext getPolicyRuleCreationContext(PolicyMapping mapping, java.lang.String name, java.lang.String urlPattern)
          Get a creation context for a new policy rule.
 PolicyVariableCreationContext getPolicyVariableCreationContext(OutboundConnectionProfile parent, java.lang.String name, PolicyVariable.VariableType typ)
          Get a creation context for a new policy variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutboundConnectionCreationContextBuilderFactory

protected OutboundConnectionCreationContextBuilderFactory()
Method Detail

getInstance

public static OutboundConnectionCreationContextBuilderFactory getInstance()
Get the singleton object of a OutboundConnectionCreationContextBuilderFactory.

Returns:
The singleton instance. Never null.

getCookieRuleCreationContext

public CookieRuleCreationContext getCookieRuleCreationContext(PolicyRule parent,
                                                              java.lang.String name)
Get a creation context for a new cookie rule.

Parameters:
parent - The PolicyRule Object which is the parent of the new cookie rule. Must not be null.
name - The administrative name of the new cookie rule. If this value is null, then an administrative name will be created, when the cookie rule is created.
Returns:
CookieRuleCreationContext the creation context that can be used to create a new CookieRule object. Never null.

getPolicyMappingCreationContext

public PolicyMappingCreationContext getPolicyMappingCreationContext(OutboundConnectionProfile parent,
                                                                    java.lang.String name,
                                                                    java.lang.String contextPath)
Get a creation context for a new policy mapping.

Parameters:
parent - The OutboundConnectionProfile Object which is the parent of the new mapping. Must not be null.
name - The administrative name of the new mapping. If this value is null, then an administrative name will be created, when the mapping is created.
context - The mapping context. For example, the context "/myproxy" defines a mapping that are associated with the context "/myproxy".
Returns:
PolicyMappingCreationContext the creation context that can be used to create a new PolicyMapping object. Never null.

getOutboundConnectionProfileCreationContext

public OutboundConnectionProfileCreationContext getOutboundConnectionProfileCreationContext(java.lang.String scopeRef)
Get a creation context for a new application-scoped connection profile.

Parameters:
scopeRef - The application scope of the new profile. The scope is the URL context of the webmodule for which this connection profile applies. For example, a given scope reference "/wps/PA_Welcome" scopes the new connection profile to the webmodule with the URL context "/wps/PA_Welcome"
Returns:
OutboundConnectionProfileCreationContext the creation context that can be used to create a new OutboundConnectionProfile object. Never null.

getOutboundConnectionProfileCreationContext

public OutboundConnectionProfileCreationContext getOutboundConnectionProfileCreationContext()
Get a creation context for the global connection profile. Note that the global connection profile can exist only once. That is, if a global outbound connection profile already exists, further OutboundConnectionProfile objects cannot be created any more.

Returns:
OutboundConnectionProfileCreationContext the creation context that can be used to create a new OutboundConnectionProfile object. Never null.

getPolicyRuleCreationContext

public PolicyRuleCreationContext getPolicyRuleCreationContext(PolicyMapping mapping,
                                                              java.lang.String name,
                                                              java.lang.String urlPattern)
Get a creation context for a new policy rule.

Parameters:
parent - The PolicyMapping Object which is the parent of the new policy rule. Must not be null.
name - The administrative name of the new policy rule. If this value is null, then an administrative name will be created, when the rule is created.
urlPattern - The URL pattern for which this policy rule applies. For example, use the url pattern "http://www.testserver.com/myerver/*" to create a policy rule that applies to outbound connections to URLs that start with "http://www.testserver.com/myerver/". The parameter must not be null. The urlPattern can create policy variables which are resolved by policy variable resolution.
Returns:
PolicyRuleCreationContext the creation context that can be used to create a new PolicyRule object. Never null.

getPolicyVariableCreationContext

public PolicyVariableCreationContext getPolicyVariableCreationContext(OutboundConnectionProfile parent,
                                                                      java.lang.String name,
                                                                      PolicyVariable.VariableType typ)
Get a creation context for a new policy variable.

Parameters:
parent - The OutboundConnectionProfile Object which is the parent of the new policy variable. Must not be null.
name - The administrative name of the new policy rule. The variable name must not be null.
typ - the Variable type. VariableType.Endpoint denotes an endpoint, VariableType.DynamicPolicy is for a multi-value dynamic policy.
Returns:
PolicyVariableCreationContext the creation context that can be used to create a new PolicyVariable object. Never null.