View Javadoc

1   /**
2    * Copyright 2005-2006 the original author or authors.
3    *
4    * Licensed under the Gnu General Pubic License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    *
8    *      http://www.opensource.org/licenses/gpl-license.php
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   * See the Gnu General Public License for more details.
14   */
15  package org.figure8.join.businessfacades.environment;
16  
17  import org.figure8.join.businessobjects.environment.Parameter;
18  import org.figure8.join.businessobjects.environment.ParameterValue;
19  
20  import java.util.List;
21  /**
22   * This is a sevrice interface defining methods for managing deployment
23   * parameters and their values according to the physical environment they
24   * allpy to and their deployment targets.<br/>
25   * Implementation should define how parameter and parameter values are
26   * created, updated and retrieved.
27   * @author  <a href="mailto:jerome.evrard@gmail.com">Jerome Evrard</a>
28   * @version $Revision: 1.2 $
29   */
30  public interface ParameterManager{
31  
32     // Public -------------------------------------------------------------------
33  
34     /**
35      * Save a parameter within datastore.
36      * @param parameter The parameter to save
37      */
38     public abstract void saveParameter(Parameter parameter);
39  
40     /**
41      * Search all the defined parameter instances.
42      * @return A list of {@code org.figure8.join.businessobjects.environment.Parameter}
43      */
44     public abstract List getAllParameters();
45  
46     /**
47      * Get a parameter by its name.
48      * @param name The parameter name to get
49      * @return The parameter instance or null
50      */
51     public abstract Parameter getParameter(String name);
52  
53     /**
54      * Remove a parameter from datastore.
55      * @param parameter The parameter to remove.
56      */
57     public abstract void removeParameter(Parameter parameter);
58  
59     /**
60      * Save a parameter value wrapper within datastore.
61      * @param value The parameter value to save
62      */
63     public abstract void saveParameterValue(ParameterValue value);
64  
65     /**
66      * Retrieve the list of current parameter values for a given environment and a given target.
67      * @param environmentKey The key of the physical environment to retrieve values for
68      * @param targetName The name of the deployment target to retrieve values for
69      * @return A list of {@code org.figure8.join.businessobjects.environment.ParameterValue}
70      */
71     public abstract List getParameterValues(String environmentKey, String targetName);
72  
73     /**
74      * Retrieve and render the list of current parameter values for a given environment and a
75      * given target. Rendering consist in tranforming values expressed with meta-language.
76      * @param environmentKey The key of the physical environment to retrieve values for
77      * @param targetName The name of the deployment target to retrieve values for
78      * @return A list of {@code org.figure8.join.businessobjects.environment.ParameterValue}
79      */
80     public abstract List renderParameterValues(String environmentKey, String targetName);
81  
82     /**
83      * Retrieve the ParameterValue having this unique identifier
84      * @param id The unique identifier of value ot retrieve
85      * @return The ParameterValue having this identifier or null if no one matches
86      */
87     public abstract ParameterValue getParameterValue(long id);
88     
89     /**
90      * Remove a parameter value.
91      * @param value The parameter value to remove.
92      */
93     public abstract void removeParameterValue(ParameterValue value);
94  }