org.ogf.graap.wsag.api.pattern
Class ChoosableComputeApplicationPattern

java.lang.Object
  extended by org.ogf.graap.wsag.api.pattern.AbstractPattern
      extended by org.ogf.graap.wsag.api.pattern.ChoosableComputeApplicationPattern
All Implemented Interfaces:
IPattern

public class ChoosableComputeApplicationPattern
extends AbstractPattern

ChoosableComputeApplicationPattern The term compositor contains a set of compute applications, where the client must choose on application out of the set.

The protocol of this pattern is as follows. First one must select an application using selectApplication(ApplicationType) or selectApplication(String, String). This service selection is instantly registered in the underlying term compositor.

Subsequent modifications to the selected applications are possible by using functions such as getSelectedApplication() or getSelectedJobDefinition(). These modifications are not registered in the term compositor until updateSelectedApplication() is executed.

 <wsag:Template wsag:TemplateId="1"
     xmlns:wsag="http://schemas.ggf.org/graap/2007/03/ws-agreement">
     <wsag:Name>ComputeApplicationTemplate</wsag:Name>
     <wsag:Context>
         <wsag:ServiceProvider>AgreementResponder</wsag:ServiceProvider>
         <wsag:TemplateId>1</wsag:TemplateId>
         <wsag:TemplateName>ComputeApplicationTemplate</wsag:TemplateName>
     </wsag:Context>
     <wsag:Terms>
         <wsag:All>
             <wsag:ServiceDescriptionTerm wsag:Name="SDT_1"
                 wsag:ServiceName="SERVICE_1">
                 (Put your service description terms here ...)
             </wsag:ServiceDescriptionTerm>
             ...
             <wsag:ExactlyOne>
                 <wsag:ServiceDescriptionTerm wsag:Name="APPLICATION_SDT"
                    wsag:ServiceName="CHANGE_ME">
                     <jsdl:JobDefinition xmlns:jsdl="http://schemas.ggf.org/jsdl/2005/11/jsdl">
                         <jsdl:JobDescription>
                             <jsdl:Application>
                                 <jsdl:ApplicationName>MyApp</jsdl:ApplicationName>
                                 <jsdl:ApplicationVersion></jsdl:ApplicationVersion>
                                 <jsdl:Description>Description</jsdl:Description>
                             </jsdl:Application>
                         </jsdl:JobDescription>
                     </jsdl:JobDefinition>
                 </wsag:ServiceDescriptionTerm>
                 <wsag:ServiceDescriptionTerm wsag:Name="APPLICATION_SDT"
                     wsag:ServiceName="CHANGE_ME">
                     <jsdl:JobDefinition xmlns:jsdl="http://schemas.ggf.org/jsdl/2005/11/jsdl">
                         <jsdl:JobDescription>
                             <jsdl:Application>
                                 <jsdl:ApplicationName></jsdl:ApplicationName>
                                 <jsdl:ApplicationVersion></jsdl:ApplicationVersion>
                                 <jsdl:Description>Description</jsdl:Description>
                             </jsdl:Application>
                         </jsdl:JobDescription>
                     </jsdl:JobDefinition>
                 </wsag:ServiceDescriptionTerm>
             </wsag:ExactlyOne>
         </wsag:All>
     </wsag:Terms>
     <wsag:CreationConstraints />
 </wsag:Template>
 
 

Author:
Oliver Waeldrich, Dominic Battre

Constructor Summary
ChoosableComputeApplicationPattern(TermCompositorType termCompositor)
          Instantiates the pattern for the given term compositor.
 
Method Summary
 String getAppliationDescXPath()
           
 String getAppliationXPath()
           
 ApplicationType getSelectedApplication()
           
 JobDefinitionType getSelectedJobDefinition()
           
 ApplicationType[] listApplications()
          Lists all applications in the term compositor.
 boolean selectApplication(ApplicationType application)
          Selects the application in the term compositor.
 boolean selectApplication(String name, String version)
          Selects the application wit the given name and version in the term compositor.
 void setAppliationDescXPath(String appliationDescXPath)
           
 void setAppliationXPath(String appliationXPath)
           
 void updateSelectedApplication()
          Updates the selected application in the term compositor.
 
Methods inherited from class org.ogf.graap.wsag.api.pattern.AbstractPattern
getTermCompositor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChoosableComputeApplicationPattern

public ChoosableComputeApplicationPattern(TermCompositorType termCompositor)
Instantiates the pattern for the given term compositor.

Parameters:
termCompositor - the term compositor
Method Detail

getSelectedJobDefinition

public JobDefinitionType getSelectedJobDefinition()
Returns:
the job definition of the selected application SDT

getSelectedApplication

public ApplicationType getSelectedApplication()
Returns:
the selected application

selectApplication

public boolean selectApplication(ApplicationType application)
Selects the application in the term compositor.

Parameters:
application - the application to select
Returns:
true, if the application was selected, otherwise false.

selectApplication

public boolean selectApplication(String name,
                                 String version)
Selects the application wit the given name and version in the term compositor.

Parameters:
name - the application name
version - the application version
Returns:
true, if the application was selected, otherwise false.

updateSelectedApplication

public void updateSelectedApplication()
Updates the selected application in the term compositor. This method actually updates the XML document referenced by the term compositor.


listApplications

public ApplicationType[] listApplications()
Lists all applications in the term compositor.

Returns:
the applications contained in the term compositor.

setAppliationDescXPath

public void setAppliationDescXPath(String appliationDescXPath)
Parameters:
appliationDescXPath - the appliationDescXPath to set

getAppliationDescXPath

public String getAppliationDescXPath()
Returns:
the appliationDescXPath

setAppliationXPath

public void setAppliationXPath(String appliationXPath)
Parameters:
appliationXPath - the appliationXPath to set

getAppliationXPath

public String getAppliationXPath()
Returns:
the appliationXPath


Copyright © 2008-2012. All Rights Reserved.