View Javadoc

1   /*
2    * Copyright 2012 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.maven.issue.command;
17  
18  /**
19   * Factory interface to create commands.
20   */
21  public interface CommandFactory
22  {
23    // ********************************* Fields *********************************
24  
25    // --- constants ------------------------------------------------------------
26  
27    // ****************************** Initializer *******************************
28  
29    // ****************************** Inner Classes *****************************
30  
31    // ********************************* Methods ********************************
32  
33    // --- get&set --------------------------------------------------------------
34  
35    // --- business -------------------------------------------------------------
36  
37    /**
38     * Creates a command to navigate in the context of a selected classification.
39     *
40     * @param service the service on the command target to call.
41     * @param classification the classification that defines the context.
42     * @return the command instance.
43     */
44    ClassificationNavigationCommand createClassificationNavigationCommand(
45        String service,
46        CommandArgument<ClassificationNavigationCommand> classification);
47  
48    /**
49     * Creates a command to navigate in the context of a selected product using
50     * <code>add</code> action.
51     *
52     * @param service the service on the command target to call.
53     * @param product the product that defines the context.
54     * @return the command instance.
55     */
56    ProductNavigationCommand createProductNavigationCommand(String service,
57        CommandArgument<ProductNavigationCommand> product);
58  
59    /**
60     * Creates a command to navigate in the context of a selected product.
61     *
62     * @param service the service on the command target to call.
63     * @param action the action to execute.
64     * @param product the product that defines the context.
65     * @return the command instance.
66     */
67    ProductNavigationCommand createProductNavigationCommand(String service,
68        CommandArgument<ProductNavigationCommand> action,
69        CommandArgument<ProductNavigationCommand> product);
70  
71    /**
72     * Creates a command instance to add a new version to the issue management
73     * system.
74     *
75     * @param product the product to add the version to.
76     * @param version the version to add.
77     * @param token the token from the previous command to help the browser to
78     *          secure the request.
79     * @return the command instance.
80     */
81    AddVersionCommand createAddVersionCommand(
82        CommandArgument<AddVersionCommand> product,
83        CommandArgument<AddVersionCommand> version,
84        CommandArgument<AddVersionCommand> token);
85  
86    /**
87     * Creates a command instance to add a new milestone to the issue management
88     * system.
89     *
90     * @param product the product to add the version to.
91     * @param milestone the milestone to add.
92     * @param sortkey the sortkey for the milestone.
93     * @param token the token from the previous command to help the browser to
94     *          secure the request.
95     * @return the command instance.
96     */
97    AddMilestoneCommand createAddMilestoneCommand(
98        CommandArgument<AddMilestoneCommand> product,
99        CommandArgument<AddMilestoneCommand> milestone,
100       CommandArgument<AddMilestoneCommand> sortkey,
101       CommandArgument<AddMilestoneCommand> token);
102 
103   // CHECKSTYLE:OFF
104   /**
105    * Creates a command instance to add a new product to the issue management
106    * system.
107    *
108    * @param classification the classification for the product.
109    * @param product the product to add the version to.
110    * @param description the description to the product.
111    * @param defaultMilestone the initial default milestone of the product.
112    * @param version the first version of the product.
113    * @param token the token from the previous command to help the browser to
114    *          secure the request.
115    * @return the command instance.
116    */
117   AddProductCommand createAddProductCommand( // NOPMD
118       CommandArgument<AddProductCommand> classification,
119       CommandArgument<AddProductCommand> product,
120       CommandArgument<AddProductCommand> description,
121       CommandArgument<AddProductCommand> defaultMilestone,
122       CommandArgument<AddProductCommand> version,
123       CommandArgument<AddProductCommand> token);
124 
125   // CHECKSTYLE:ON
126 
127   // CHECKSTYLE:OFF
128   /**
129    * Creates a command instance to update an existing product to the issue
130    * management system.
131    *
132    * @param oldProduct the current name of the product.
133    * @param product the product to add the version to.
134    * @param description the description to the product.
135    * @param defaultMilestone the initial default milestone of the product.
136    * @param token the token from the previous command to help the browser to
137    *          secure the request.
138    * @return the command instance.
139    */
140   UpdateProductCommand createUpdateProductCommand(// NOPMD
141       CommandArgument<UpdateProductCommand> oldProduct,
142       CommandArgument<UpdateProductCommand> product,
143       CommandArgument<UpdateProductCommand> description,
144       CommandArgument<UpdateProductCommand> defaultMilestone,
145       CommandArgument<UpdateProductCommand> token);
146 
147   // CHECKSTYLE:ON
148 
149   /**
150    * Creates a command instance to add a new component to a product to the issue
151    * management system.
152    *
153    * @param product the product to add the version to.
154    * @param component the name of the component to add to the product.
155    * @param description the description to the product.
156    * @param initialOwner the initial owner for issues to this component.
157    * @param token the token from the previous command to help the browser to
158    *          secure the request.
159    * @return the command instance.
160    */
161   AddComponentCommand createAddComponentCommand(
162       CommandArgument<AddComponentCommand> product,
163       CommandArgument<AddComponentCommand> component,
164       CommandArgument<AddComponentCommand> description,
165       CommandArgument<AddComponentCommand> initialOwner,
166       CommandArgument<AddComponentCommand> token);
167 
168   /**
169    * Creates a command instance to authenticate against the issue management
170    * system.
171    *
172    * @param login the login name for authentication.
173    * @param password the password for authentication.
174    * @return the command instance.
175    */
176   LoginCommand createLoginCommand(CommandArgument<LoginCommand> login,
177       CommandArgument<LoginCommand> password);
178 
179   /**
180    * Creates a command instance to logout from the issue management system.
181    *
182    * @return the command instance.
183    */
184   LogoutCommand createLogoutCommand();
185 
186   // --- object basics --------------------------------------------------------
187 
188 }