com.ibm.portal.outbound.config
Interface PolicyRule

All Superinterfaces:
Administrable
All Known Subinterfaces:
ModifiablePolicyRule

public interface PolicyRule
extends Administrable

This object encapsulates a policy rule.
Policy rules define settings that control the outbound connection to a URL that matches with its URL pattern. Note that multiple URL patterns can apply. In that case, the Outbound connection service chooses that policy rule that matches best. For example, given that here are two PolicyRule items:"rule1" for the url pattern "http://www.myserver.com/test/*", and and "rule2" for the url pattern "http://www.myserver.com/*". If a connection to http://www.myserver.com/test/testme.html is established, then "rule1" is applied, where a connection to http://www.myserver.com/anotherpage.html would select "rule1"
The following code locates a policy rule that is associated with the URL pattern "http://www.myserver.com/test/*":

OutboundConnectionModel model;
PolicyMapping theMappingRule;
PolicyRule pol = model.getPolicyRuleLocator(theMappingRule).findByName("rule1");
System.out.println("The url pattern is "+pol.getUrlPattern());

Since:
8.5.0
See Also:
OutboundConnectionModel, PolicyMapping, PolicyRuleLocator

Method Summary
 java.lang.String[] getAllowedMethods()
          Return an array of allowed HTTP methods.
 java.util.Collection<CustomFilterItem> getFilterChain()
          return if a custom filter chain is registered at the policy
 java.lang.String[] getHeaders()
          Return an array of headers that are supported.
 java.util.Map<java.lang.String,java.lang.String> getMetaData()
          Return the object meta data
 java.lang.String[] getMimeTypes()
          Return the list of supported mime types, if present
 java.lang.String getUrlPattern()
          Return the URL pattern for which the policy type applies
 boolean hasAllowedMethods()
          return if there is a list of allowed methods.
 boolean hasFilterChain()
          return if a custom filter chain is registered at the policy
 boolean hasHeaders()
          Return if the policy has a list of supported headers.
 boolean hasMimeType()
          return if a mime type is in the list of supported mime types
 boolean isActive()
          get the active flag
 boolean isBasicAuth()
          get the basic-auth flag
 
Methods inherited from interface com.ibm.portal.outbound.config.Administrable
getName, isReadOnly
 

Method Detail

getUrlPattern

java.lang.String getUrlPattern()
Return the URL pattern for which the policy type applies

Returns:
URLPattern the URL pattern. Never null.

getAllowedMethods

java.lang.String[] getAllowedMethods()
Return an array of allowed HTTP methods. Policy rules may specify a list of allowed methods, which restricts the rule for certain methods, such as "GET", or "GET" and "POST". If no such list is specified, then the rule is not restricted to certain methods.

Returns:
an array of allowed actions. Null means, all actions are allowed. An empty array means, no actions are allowed.

hasAllowedMethods

boolean hasAllowedMethods()
return if there is a list of allowed methods.

Returns:
true if the method list is present, false if not. If no list is present, then the policy rule is not restricted to a certain set of HTTP methods.

hasHeaders

boolean hasHeaders()
Return if the policy has a list of supported headers. This restricts the headers that are passed by the filter.

Returns:
true if the policy has a list of supported headers.

getHeaders

java.lang.String[] getHeaders()
Return an array of headers that are supported.

Returns:
the supported headers, or null if the policy does not have a list of supported headers

getMimeTypes

java.lang.String[] getMimeTypes()
Return the list of supported mime types, if present

Returns:
a collection of supported mime types, or null if there is no list of suppoted mime types

hasMimeType

boolean hasMimeType()
return if a mime type is in the list of supported mime types

Returns:
true if the mime type is in the list, false if not

hasFilterChain

boolean hasFilterChain()
return if a custom filter chain is registered at the policy

Returns:
true if there is an IP Filter, false if not.

getFilterChain

java.util.Collection<CustomFilterItem> getFilterChain()
return if a custom filter chain is registered at the policy

Returns:
List a chain of custom filters, or an immutable empty list if there are no custom filters.

getMetaData

java.util.Map<java.lang.String,java.lang.String> getMetaData()
Return the object meta data

Returns:
the meta data that are associated for this model.

isActive

boolean isActive()
get the active flag

Returns:
true if the mapping is active, false if not

isBasicAuth

boolean isBasicAuth()
get the basic-auth flag

Returns:
true if the mapping is requires basic authentication, false if not (default)