org.iids.aos.util
Class TemplateInfo

java.lang.Object
  extended by org.iids.aos.util.TemplateInfo

public class TemplateInfo
extends java.lang.Object

TemplateInfo is a wrapper class to make interaction with templates a little easier. It allows querying a template directly for all its SDTs and restrictions that are described in the template, without the need to know anything about the structure of the template.

Author:
rjtimmer

Constructor Summary
TemplateInfo(Template template)
          Create a new TemplateInfo wrapper on a single template.
 
Method Summary
 java.util.List<Restriction> getRestrictions()
           
 java.util.List<Restriction> getRestrictions(java.lang.String serviceName)
           
 java.util.List<ServiceDescriptionTerm> getSDTs()
          Obtain a list of all the ServiceDescriptionTerm terms in the template.
 java.util.List<java.lang.String> getServiceNames()
          List the names of all the services that are described in this template.
static void main(java.lang.String[] args)
           
 boolean provides(java.lang.String serviceName)
          Query the template to see if it provides a certain service.
static Template readTemplate(java.io.File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateInfo

public TemplateInfo(Template template)
Create a new TemplateInfo wrapper on a single template. The resulting TemplateInfo can be used to query the template for information.

Method Detail

getServiceNames

public java.util.List<java.lang.String> getServiceNames()
List the names of all the services that are described in this template. This means that all the ServiceDescriptionTerm terms are queried for the name of the service they provide.

Returns:
A list of all the service names described in this template.

provides

public boolean provides(java.lang.String serviceName)
Query the template to see if it provides a certain service.

Parameters:
serviceName - Name of the service to look for.
Returns:
true if the service name is defined in the template, otherwise false.

getSDTs

public java.util.List<ServiceDescriptionTerm> getSDTs()
Obtain a list of all the ServiceDescriptionTerm terms in the template.


getRestrictions

public java.util.List<Restriction> getRestrictions()

getRestrictions

public java.util.List<Restriction> getRestrictions(java.lang.String serviceName)

readTemplate

public static Template readTemplate(java.io.File file)

main

public static void main(java.lang.String[] args)


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.