|
|
Table Of Contents
ADS Bladelets Reference
Revised: March, 2007, OL-11798-01A Bladelet is an operation that is performed on a message. It is a user defined software component that implements certain interfaces and provides a useful unit of functions. For example, Authentication bladelet provides authentication against various authentication schemes such as, LDAP, Kerberos, and Netegrity; it will not do anything else.
Cisco AON Development Studio (ADS) provides a repository of standard Bladelets that are organized by category—for example, logic, message handling, security, transformation, and so on. This chapter presents detailed reference information that you need to choose and use ADS Bladelets.
Note
For more information on implementing an AON network, see the following:
•
Other chapters in this guide:
–
Getting Started with Cisco ADS
–
Setting Bladelet Properties, Variables, and Rules
–
ADS PEP Attributes Reference
•
Other guides in the AON library:
–
AON Installation and Administration Guide (for information on the AMC server and nodes)
–
AON Programming Guide (for information on custom Bladelets, custom adapters, and application program interfaces)
Contents
Information About Bladelets
Bladelets are used in the construction of Policy Execution Plans (PEPs). You construct a PEP with the graphical-user-interface (GUI) ADS tool, which enables you to drag and drop icons representing Bladelets onto a canvas. You then "connect" the Bladelets, thus forming a PEP.
Bladelets are highly configurable. Using ADS, you configure Bladelets during normal PEP construction by setting their properties, which are grouped hierarchically into three levels:
<configuration-group>
<configuration-subgroup>
<parameter-group> and <parameter>
Figure 3-1 shows the various components of a Bladelet. (The example shown below is an Access DB Bladelet.)
Figure 3-1 ADS Bladelet
Bladelet Choices
This section describes the predefined Bladelets that ADS displays in its Task Pane, in Getting Started with Cisco ADS. It also describes any Bladelet properties that you need to set in order for the Bladelet to function properly.
ADS provides the following Bladelet categories:
Note
Many of the following windows allow you to specify values in one or more of the following ways:
•
By typing them in directly
•
By selecting them from a drop-down list
•
By binding the parameter to a specific value
PEP Markers Category
In the PEP Markers category, there are two markers:
Exception-PEP Marker
Use the Exception-PEP marker for tracking and recording exceptions in the PEP. It is a good way to create instances that you can store as database records to audit exceptions as information is routed through the PEP.
There are no properties to set for this marker.
Break Marker
Use the Break marker only inside loops. It is only allowed in a Loop and cannot be used elsewhere. You cannot place any other bladelets after the Break marker. The Break marker is used to exit out of the loops. For details, see the Loop Bladelet.
There are no properties to set for this marker.
External Access Category
In the External Access Category, there are two Bladelets:
Access HTTP
Summary
The Access HTTP Bladelet makes an outgoing HTTP call using the GET or POST method in either the Componentized or Normal URL Configuration groups.
Prerequisites, Dependencies, and Restrictions
AccessHTTP is synchronous, and thus cannot be used to execute a PEP running on the same node.
Details
Figure 3-2 to Figure 3-4 show required, optional, and advanced settings for the Componentized URL Configuration group.
Figure 3-5 to Figure 3-7 show required, optional, and advanced settings for the Normal URL Configuration group.
Figure 3-2 Access HTTP Properties Window—Input Parameters, Componentized URL, Required Tab
Figure 3-3 Access HTTP Properties Window—Input Parameters, Componentized URL, Optional Tab
Figure 3-4 Access HTTP Properties Window—Input Parameters, Componentized URL, Advanced Tab
Figure 3-5 Access HTTP Properties Window—Input Parameters, Normal URL, Required Tab
1Configuration Group
Configuration group, set here to Normal URL.
2Method
Method. Choices: POST or Get.
3URL
Complete URL.
Figure 3-6 Access HTTP Properties Window—Input Parameters, Normal URL, Optional Tab
Figure 3-7 Access HTTP Properties Window—Input Parameters, Normal URL, Advanced Tab
Figure 3-8 Access HTTP Properties Window—Export Parameters
1Response
Response from the HTTP call (string type).
2Result
Response from the HTTP call (AON content type).
3Status
Status HTTP call (integer type m).
Outcome
None.
Exceptions
•
Malformed URL: Connection cannot be established to the HTTP server host.
•
Host Inaccessible: The URL (composed URL in case componentized URL is specified) is not correct.
Access DB
Summary
Use this Bladelet to make a SQL call out to a database.
Prerequisites, Dependencies, and Restrictions
Access DB does not work with binary objects; it only works with basic types, for example string, int, and so on.
Details
Figure 3-9 Access DB Properties Window—Data Source
Figure 3-10 Access DB Properties Window—SQL
Figure 3-11 Access DB Properties Window—Export Parameters
Outcome
None.
Exceptions
•
Database Failure: Database cannot be connected to.
•
SQL Failure: The input SQL statement could not be executed properly.
Note
The SQL interface does not support stored procedures.
General Category
In the General Category, there are three Bladelets:
•
Log
Log
Summary
The Log Bladelet allows you to log message contents, PEP variables and other important data related to the message, message class, source, destination, time stamps, and PEP name.
Prerequisites and Dependencies
None.
Details
Figure 3-12 Log Properties Window—Input Parameters
Figure 3-13 Log Properties Window—Variables
Outcome
None.
Exceptions
•
Log Write Failure: A failure occurred during the database write. These are failures that are typically not recoverable. For example, data does not conform to the log schema, or the log policy is disabled for the database.
Timeout: Timeout occurred. This applies only to synchronous mode. For example, this can happen when the database is not available or is extremely slow.
Retrieve Cache
Summary
This Bladelet retrieves data from two named caches configured on an AON node. The named caches are response and variable. The response cache caches arbitrary messages and server responses. The variable cache caches PEP variables. The response cache is distributed and the variable cache is node local. Populate these named caches by using the CacheData Bladelet.
Prerequisites and Dependencies
•
Ensure that the cache on the AON node on which the PEP executes has bootstrapped without errors.
Details
Figure 3-14 Retrieve Cache Properties Window—Input Parameters
Figure 3-15 Retrieve Cache Properties Window—Export Parameters
Outcome
•
A cache hit or "Success" path indicates that the requested data was found in the cache.
•
A cache miss or "Fail" path indicates that the requested data was not found in the cache.
The Bladelet exports the cache key that was used for the lookup operation, the result of the operation (0 indicates a miss; 1 indicates a hit) as follows:
•
On success, it also exports the cached object, which can be bound to a PEP variable of the appropriate data type. For response type object retrieved from the "response" named cache, the Bladelet also binds the object to the "RESPONSE_MESSAGE" PEP variable.
•
On miss, the exported cache key can be used by a CacheData Bladelet further in the PEP execution to cache data to the cache.
Exceptions
None.
Cache Data
Summary
This Bladelet should be used to set data into the named caches configured on an AON node. The named caches are "response" and "variable". The "response" cache caches arbitrary messages and server responses. The "variable" cache caches PEP variables. The response cache is distributed and the variable cache is node local. You can retrieve data from the named caches by using the RetrieveCache Bladelet. You can also set and retrieve data from the named and "variable" caches by using the Caching Service API exposed to Custom Bladelets.
Note
Objects are put into the response cache asynchronously and the variable cache synchronously with PEP execution.
Prerequisites and Dependencies
•
Ensure that the cache on the AON node on which the PEP executes has bootstrapped without errors.
Details
When it is given a cache key and optionally a PEP variable, this Bladelet caches the variable or the server response message.
Figure 3-16 Cache Data Properties Window—Input Parameters
Figure 3-17 Cache Data Properties Window—Export Parameters
Outcome
•
On success, the server response elicited by the request of the PEP variable to be cached is set in the "response" and "variable" cache.
Exceptions
None.
Logic Category
In the Logic Category, there are two Bladelets:
•
Loop
•
Scope
•
Find
•
Branch
Loop
Summary
The Loop Bladelet allows you to construct a PEP and apply repeated business logic processing based on the number of items in the data types—Counter, Iterator, or Map—over which the loop is performed. This construct is identical to a loop which is found in the Java or C programming languages. The Loop Bladelet is represented as a block in which other bladelets are placed.
Figure 3-18 Loop Bladelet
Prerequisites and Dependencies
None.
Details
A PEP can be viewed as a program expressed in the PEP Description Language (PDL). PDL is a programming language and defines the variable types used in a PEP as the fundamental data types. The PDL exposes a number of data types—List, Map, and Iterator. At runtime, these data types represent a collection of other data types (List and Map) or a cursor into this collection (Iterator). When handling these data types, it is almost always required to do some kind of repeated processing (loop) for each entry in the collection.
Note
A Break marker is only allowed in a Loop Bladelet and cannot be used elsewhere.
The Loop Bladelet has three different data types—Counter, Iterator, and Map.
Counter
The Counter Loop is used when a given operation (for example, another bladelet needs to be executed) needs to be performed specific number of times. It is similar to a "for" loop with counter variable being initialized to a user specified value and incriminated by a user specified amount. The loop terminates at a user specified end value. See Figure 3-19 for the details of the Counter Loop parameters.
Iterator
The Iterator Loop must be used to loop through a list. The current object and index is available at each loop iteration and can be used by bladelets within the loop. See Figure 3-20 for the details of the Iterator Loop parameters.
Map
The Map Loop is used to iterate over a map. It exposes both the current key and current value at each loop iteration, both of which can be used by bladelets within the loop. See Figure 3-21 for the details of the Map Loop parameters.
Figure 3-19 Loop Properties Window—Counter
Figure 3-20 Loop Properties Window—Iterator
Figure 3-21 Loop Properties Window—Map
Outcome
Loops can be nested to arbitrary levels and there is no pre-defined limit to the number of loops that can be used in a PEP. For each type of data that the loop executes over, a different set of PEP variables are exported.
Exceptions
None.
Scope
Summary
The Scope Bladelet is used to define a physical block within a PEP that allow localized definition of variables and business logic.
Prerequisites and Dependencies
None.
Details
There are no properties to set for this Bladelet.
The scope construct in the PEP Description Language (PDL) allows you to define physical blocks within the PEP that allow localized definition of variables and business logic. This is similar to the {} operator in the Java or C++ programming languages where a block of execution bounded by the braces serves as a container for variables that are not visible outside the execution block.
A single scope block can only have one immediate parent scope (the scope block within which it is nested) and the global scope (always present) is the top level scope and is the root node in the tree representation of all the scopes in a PEP. There are some semantics that apply when using a scope block. In general a scope block is most useful when it is used to restrict the scope of a PEP variable ensuring that a variable defined in one part of the PEP is not available for use in other parts of the PEP. The restrictions on the variables in a Scope are dependent on the visibility of the variable in that block. A scope block can recognize those variables that are defined in its parent scope.
In Figure 3-22 the root node of the tree represents the default Global scope that is always present in a PEP. You can add additional scopes by dragging the scope construct from the palette to the canvas and including it at any point in the flow. Figure 3-22 shows a sample PEP containing two explicit scope blocks and the global scope (represented by the white background region on the canvas).
Figure 3-22 Sample Scopes within a PEP
In the first scope the Authenticate Bladelet can only use the variables defined with global and Scope. In the second scope, Scope 1, the Authorize Bladelet can only use variables defined with global or Scope 1. The Log Bladelet can only use variables defined with Global or Scope 1.
Outcome
Scopes can be nested within each other with no pre-defined limit on the number of scopes that can be included in a PEP.
Exceptions
None.
Find
Summary
The Find Bladelet queries an XML message and extracts all nodes identified by regular (for regular expressions, the message type does not need to be in XML format) and XPath expressions from the message currently being processed by the PEP. After regular and common XPath expressions are evaluated by this Bladelet, they are available for use by other Bladelets. Either XPath or Regex expressions can be evaluated; if both need to be evaluated, you must incorporate multiple instances of the Find Bladelet.
The Regex evaluation engine used by the Find bladelet uses Java Regex API from Sun Microsystems, Inc. There are several APIs to chose from, so we recommend that you use the API that matches the whole input string rather than finding only a match. You need to use the API that matches the whole input string because Find Bladelet needs to save the result of Regex evaluation.
For details of Java Regex API from Sun Microsystems, Inc., see http://java.sun.com/docs/books/tutorial/extra/regex/.
Note
You can use the Find Bladelet to get the FindResultMapListIterator and refer to the results in the Rules Wizard in Branch Bladelet.
Or
You can also use the Rules Wizard to perform Regex evaluation.Prerequisites and Dependencies
None.
Details
The Find Bladelet finds multiple items from within the message using XPath expressions (for XML messages) or Regular Expressions for Non-XML messages. It works on both MIME as well as NON-MIME data. The output of the find Bladelet is placed inside a PEP variable of type FindResultMapListIterator. This data type is a complex data type that encapsulates results that are found from all parts (> 0 if MIME) of the message that is being searched. The structure of the data type is as follows:
FindResultMapListIterator:
List of parts of the message on which the Find Bladelet operates (List of size 1 containing the results if it is Non-MIME; List of size > 1 if more than 1 MIME part is in the message)
Map of all the different expressions that were searched (recall that you enter a value on the left-hand list box in the Find Bladelet and for each of these you specify a list of expressions on the right-hand table. The map contains key-value pairs with the key being the entries on the left-hand box and the value being a list (size of this list = number of expressions entered for each key). The elements in this list are the actual search results.
Note
IMPORTANT: Today it is not possible to use the PEP variable-picker dialog to select values from the tree view. You must enter a specific value to extract the returned results.
Example:Key (Left hand side list box) XPath Expression listk1 e1e2k2 e3Assume a regular input message (NON-MIME). The way to extract the results are (assume that the output of Find is bound to a PEP variable called findResults) in the Specify Value text box of the PEP Variable Picker dialog type:findResults.elementAt(0).elementAt(k1).elementAt(0).value()This expression returns the value of the search result using expression e1 on the message whilefindResults.elementAt(0).elementAt(k1).elementAt(1).value()gives the value of the search results for e2.The value() function is used if you know your xpath result is of type boolean, string, integer; or if you want only the string value of the first node in the XPath Result (which is a nodeSet)If the XPath result of e3 is known to be a nodeset, then to get e3 result's 2nd node's string value:findResults.elementAt(0).elementAt(k2).elementAt(2).nodeValue(1).The input parameters for this Bladelet (configuration group is set to XPath) are shown in Figure 3-23. Input parameters for a Bladelet whose configuration group is set to Regex are shown in Figure 3-24.
Figure 3-23 Find Properties Window—Input Parameters, XPath
Figure 3-24 Find Properties Window—Input Parameters, Regex
Figure 3-25 Find Properties Window—Export Parameters
1Result
Result to be exported. Export parameter result to a variable such as IVar.
If no PEP variable is available in the list, add one without exiting the properties window as described in the "Managing Variables" section, in "Setting Bladelet Properties, Variables, and Rules" chapter.
Outcome
•
If all expressions in the Find Bladelet are evaluated to null, the output path is set to Fail.
•
If any expression is evaluated to other than null, the output path is set to success. On success, a PEP variable of type FindResultMapListIterator is exported for use by other Bladelets in the PEP.
Exceptions
Invalid Content Type: The content type is invalid for evaluation. This happens when expression type is XPath while the message is NOT XML documents.
Branch
Summary
This Bladelet establishes conditions for message route branching based on rules and message labels. There are two main sections in the Branch Properties window.
Prerequisites and Dependencies
None.
Details
Figure 3-26 Branch Properties Window—Input Parameters
Figure 3-27 Branch Properties Window—Export Parameters
Outcome
•
On success, the output port activated is the same as the one corresponding to the rule that evaluates to true.
•
If none of the rules evaluate to true, the default output port is activated.
Exceptions
None.
Message Handling Category
In the Message Handling Category, there are nine Bladelets:
•
Validate
•
Discard
Validate
Summary
The purpose of this Bladelet is to validate XML messages based on a schema (XSD) or DTD. The schema referred by the XML message must already be loaded into AON in an appropriate Schema Extension package using the AMC server.
Prerequisites and Dependencies
•
Load all schemas including XSD and DTD files that can be referred to by incoming XML messages into AON using the AMC server's Extension-Uploading and Deployment mechanism.
•
Configure any Schema Validation policies, if required, and deploy them from the AMC server.
Details
The Validate Bladelet has two main parts in its properties window: input parameters and advanced input parameters.
Figure 3-28 Validate Properties Window—Input Parameters, Validate
Figure 3-29 Validate Properties Window— Input Parameters, Check Well-Formedness Only
Figure 3-30 Validate Properties Window—Advanced Input Parameters 1
Figure 3-31 Validate Properties Window—Advanced Input Parameters 2
Outcome
•
The Success output path is taken when the XML message is found to be valid—that is, it conforms to the XSD or DTD used to validate the message.
•
The Failure output path is taken in the following cases:
–
The XML message is found to be invalid—that is, it does not conform to the XSD or DTD used to validate the message.
–
The input message is not a well-formed XML message and therefore could not be validated using any schema.
–
The schema referred by the XML message does not exist in AON.
Exceptions
None.
Build Composite Content
Summary
Creates multipart content from the given input message and the parts that need to be added/deleted/overwritten.
Prerequisites and Dependencies
None.
Details
The Build Composite Content Bladelet's properties are, as with some other Bladelets, dependent on the type of configuration group that is used. If the index in the configuration group Attach is null, the Bladelet attaches the parts to the end of the input content. If the index specified is blank in the configuration group Overwrite, it overwrites the Input Content based on the Content-Id of the parts. In configuration group Delete, index and parts are mutually exclusive. Both cannot be specified. If the index is blank, the parts are deleted based on the Content-Id.
Figure 3-32 Build Composite Content Properties Window—Input Parameters, Attach
Figure 3-33 Build Composite Content Properties Window—Input Parameters, Overwrite
Figure 3-34 Build Composite Content Properties Window—Input Parameters, Delete
Figure 3-35 Build Composite Content Properties Window—Input Parameters, Advanced, Attach
Figure 3-36 Build Composite Content Properties Window - Input Parameters, Advanced, Overwrite/Delete
Figure 3-37 Build Composite Content Properties Window—Export Parameters
Outcome
•
On Success, the BuildCompositeContentBladelet exports a Content that is built from the inputs and other parameters specified.
Exceptions
ParsingException: Exception thrown when input data is not MIME or when the data could not be parsed.
Discard
Summary
The Discard Bladelet discards a message based on whether it meets certain policies or message requirements established in the PEP and has no user-configurable input parameters.
Prerequisites and Dependencies
None.
Details
There are no properties to set for this Bladelet.
Outcome
•
On success, PEP processing stops and connection to the client is lost. In case of Queue based messages (JMS/MQ), the adapter transfers the message to dead letter queue, if one is configured.
Exceptions
None.
Send Reply
Summary
The Send Reply Bladelet sends a reply from the PEP before the end of the flow is reached.
Prerequisites and Dependencies
There should be a Send or a Create Response preceding this bladelet so that a response message is available to be sent out.
Details
The Bladelet takes the message to be sent as reply as input. The exception SendReplyFailed is generated if sending the reply out fails. If the Bladelet is used in a one-way PEP, a generic bladelet exception is given. If two Send reply bladelets are used in the same path of a two-way PEP, the second bladelet is ignored and a notice-level log message is printed.
In the normal usage scenario, the bladelet would cause the response message to be sent back to the client. Once the response is sent out, the PEP starts executing again starting with the bladelet after the send reply bladelet. If no Send Reply bladelet is added to the PEP path, then the response is sent back to the client at the end of the PEP (default behavior).
Figure 3-38 Send Reply Properties Window