com.ibm.portal.outbound.config
Interface ModifiablePolicyRule

All Superinterfaces:
Administrable, Modifiable, ModifiableNode, PolicyRule

public interface ModifiablePolicyRule
extends PolicyRule, ModifiableNode


The interface is provided by OutboundConnectionModelController#getModifiableNode(). It contains functions to modify outbound connection policy rules. Note that the settings are immediately effective in the model, but they are not stored in the database unless commit() has been applied on the OutboundConnectionModelController object.

The following code excerpt changes policy rules settings:

OutboundConnectionModelController ctrl;
OutboundConnectionModel model;
PolicyMapping mapping;
˙˙˙
PolicyMapping mapping = model.getPolicyRuleLocator(profile).getDefaultMapping();
PolicyRule rule = model.getPolicyRuleLocator(mapping).findByName("rule2");
ModifiablePolicyRule mrule = ctrl.getModifiableNode(rule);

mrules.setAllowedMethods (new String[] {"GET","POST"} );
mrules.setBasicAuth(false);
mrules.setUrlPattern("http://the.new.server/myserver");

ctrl.commit();


Since:
8.5.0
See Also:
OutboundConnectionModel, OutboundConnectionModelController, PolicyRule

Method Summary
 void setActive(boolean active)
          Set the policy rule active or inactive
 void setAllowedMethods(java.lang.String[] allowedMethods)
          Override the set of allowed methods.
 void setBasicAuth(boolean isBasicAuth)
          set the basicauth flag
 void setFilterChain(java.util.Collection<CustomFilterItem> filterChain)
          Override the custom filter chain setting.
 void setHeaders(java.lang.String[] headers)
          Override the set of custom headers.
 void setMetaData(java.util.Map<java.lang.String,java.lang.String> metaData)
          Replace the metadata settings with the given map.
 void setMimeTypes(java.lang.String[] mimeTypes)
          Override the set of supported mime types.
 void setUrlPattern(java.lang.String urlPattern)
          Set a new URL pattern
 
Methods inherited from interface com.ibm.portal.outbound.config.PolicyRule
getAllowedMethods, getFilterChain, getHeaders, getMetaData, getMimeTypes, getUrlPattern, hasAllowedMethods, hasFilterChain, hasHeaders, hasMimeType, isActive, isBasicAuth
 
Methods inherited from interface com.ibm.portal.outbound.config.Administrable
getName, isReadOnly
 
Methods inherited from interface com.ibm.portal.outbound.config.ModifiableNode
setName
 

Method Detail

setUrlPattern

void setUrlPattern(java.lang.String urlPattern)
                   throws CannotModifyPropertyException
Set a new URL pattern

Parameters:
urlPattern - The new URL pattern. Never null.
Throws:
CannotModifyPropertyException - Invalid URL pattern specified.

setAllowedMethods

void setAllowedMethods(java.lang.String[] allowedMethods)
                       throws CannotModifyPropertyException
Override the set of allowed methods. Note that this parameter replaces existing settings.

Parameters:
allowedMethods - An array that contains the new set of allowed methods. May be null or empty. In that case, all existing allowed methods will be removed
Throws:
CannotModifyPropertyException - Invalid array specified

setHeaders

void setHeaders(java.lang.String[] headers)
                throws CannotModifyPropertyException
Override the set of custom headers. Note that this parameter replaces existing settings.

Parameters:
headers - An array that contains the new set of headers. May be null or empty. In that case, all existing custom header settings will be removed
Throws:
CannotModifyPropertyException - Invalid array specified

setMimeTypes

void setMimeTypes(java.lang.String[] mimeTypes)
                  throws CannotModifyPropertyException
Override the set of supported mime types. Note that this parameter replaces existing settings.

Parameters:
mimeTypes - An array that contains the new set of supported mime types. May be null or empty. In that case, all existing mime type settings will be removed
Throws:
CannotModifyPropertyException - Invalid array specified

setFilterChain

void setFilterChain(java.util.Collection<CustomFilterItem> filterChain)
                    throws CannotModifyPropertyException
Override the custom filter chain setting. Note that this parameter replaces existing settings.

Parameters:
filterChain - The new custom filter chain. May be null or empty. In that case, the existing custom filter chain will be removed
Throws:
CannotModifyPropertyException - Invalid collection specified

setMetaData

void setMetaData(java.util.Map<java.lang.String,java.lang.String> metaData)
                 throws CannotModifyPropertyException
Replace the metadata settings with the given map.

Parameters:
metaData - The new metadata. null or an empty map deletes the existing metadata.
Throws:
CannotModifyPropertyException

setBasicAuth

void setBasicAuth(boolean isBasicAuth)
                  throws CannotModifyPropertyException
set the basicauth flag

Parameters:
isBasicAuth - true if the policy rule assumes that this connection is basicauth protected, False if not
Throws:
CannotModifyPropertyException

setActive

void setActive(boolean active)
               throws CannotModifyPropertyException
Set the policy rule active or inactive

Parameters:
active - set true to activate the policy rule, false to set the policy rule inactive.
Throws:
CannotModifyPropertyException