com.adventnet.nms.provisioning.server
Interface TemplateFilter
- public interface TemplateFilter
The TemplateFilter is an interface implemented for custom template
processing, so that special rules can be applied to specific
templates. The configured filters are applied when the template
has been initialized and just before it is sent to the client
from the ProvisioningAPI.getTemplate(String, String)
method or ProvisioningAPI.getTemplate(String) method.
The first Stage element present in the template will be the initialization stage.
This Stage element should initialize the requirements of provisioning operation.
The elements in the first Stage will be executed one by one in the order specified.
If the child element is Initialization, then the database connection will be created as specified in it.
If the child element is NEInput, then network data will be collected as specified in it.
If the child element is InventoryInput, then data will be collected from database as specified in it.
When the child element is other than InventoryInput and NEInput, TemplateFilters will
be applied.
The implementation of this interface must be specified in the
<Provisioning Home>/conf/ProvisioningFilters.xml
file under TemplateFilters tag as follows:
<TemplateFilter>
template=template-name to which this filter is applied
class=full class path of the implementation
</TemplateFilter>
in order to filter the specified template before it is sent to the client.
Format of TemplateFilter is available in ProvisioningFilters.dtd under
<Provisioning Home>/conf directory.
The filter implementation must have a no-argument constructor.
A single instance of this filter will be used for every execution of
template to which it is associated, so it is the responsibility of the filter to
ensure it is thread safe.
For example, implement this class to check specific conditions,
or verify whether the usage of this template should be permitted.
Special cases of this kind of filter will read rules from
XML configuration files or the database, to make it easier to
add and change rules dynamically.
A template can have any number of TemplateFilters
and each will be invoked one by one in the order it is specified
in the <Provisioning Home>/conf/ProvisioningFilters.xml file.
- Since:
- 2.3
filterTemplate
public Template filterTemplate(Template template)
throws InvalidTemplateException
- Process the template and return the processed template
to be sent to the client.
- Parameters:
template - template to be filtered- Returns:
- filtered template
- Throws:
InvalidTemplateException - if an error occurs or if template should not be sent to the client