org.ogf.graap.wsag.server.engine
Class TemplateRegistry

java.lang.Object
  extended by org.ogf.graap.wsag.server.engine.TemplateRegistry

public class TemplateRegistry
extends Object

The template registry is the central store of factory actions. An AgreementFactoryAction implements the required functionality to create templates, negotiate offer, and create agreement. Each factory action is identified by the agreement template, which is generated by the factory action.

Author:
Oliver Waeldrich
See Also:
AgreementFactoryAction, AbstractGetTemplateAction, AbstractNegotiationAction, AbstractCreateAgreementAction

Constructor Summary
TemplateRegistry()
           
 
Method Summary
 void add(AgreementFactoryAction action)
          Adds a new factory action to the registry
 AgreementFactoryAction findAction(String name)
          Finds the factory action for a template with a given name.
 AgreementFactoryAction findAction(String name, String version)
          Finds the factory action for a template with a given name.
 AgreementTemplateType findTemplate(String name)
          Finds a template with a given name.
 AgreementTemplateType findTemplate(String name, String version)
          Finds a template with a given name and version.
 AgreementTemplateType[] getAllTemplates()
          Returns the template entries of this registry in the same order in which they were added.
 AgreementTemplateType[] getNegotiableTemplates()
          Returns a set of templates that support SLA negotiation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateRegistry

public TemplateRegistry()
Method Detail

add

public void add(AgreementFactoryAction action)
Adds a new factory action to the registry

Parameters:
action - the action to add

findTemplate

public AgreementTemplateType findTemplate(String name)
Finds a template with a given name.

Parameters:
name - the name of the requested template
Returns:
the agreement template, or null if not found

findTemplate

public AgreementTemplateType findTemplate(String name,
                                          String version)
Finds a template with a given name and version.

Parameters:
name - the name of the requested template
version - the version of the requested template
Returns:
the agreement template, or null if not found

findAction

public AgreementFactoryAction findAction(String name)
Finds the factory action for a template with a given name.

Parameters:
name - the template name of the requested action
Returns:
the factory, or null if not found

findAction

public AgreementFactoryAction findAction(String name,
                                         String version)
Finds the factory action for a template with a given name.

Parameters:
name - the template name of the requested action
version - the template version of the requested action
Returns:
the factory, or null if a factory with the given name was not found.

getAllTemplates

public AgreementTemplateType[] getAllTemplates()
Returns the template entries of this registry in the same order in which they were added.

Returns:
the registered templates

getNegotiableTemplates

public AgreementTemplateType[] getNegotiableTemplates()
Returns a set of templates that support SLA negotiation. Negotiation is supported for each action that implements a negotiation strategy, e.g. that registers different action than NegotiationUnsupportedAction.

Returns:
the registered negotiable templates
See Also:
AgreementFactoryAction.isNegotiationSupported()


Copyright © 2008-2012. All Rights Reserved.