View Javadoc

1   package org.apache.maven.continuum.web.action.notifier;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.continuum.model.project.Project;
23  import org.apache.maven.continuum.model.project.ProjectNotifier;
24  import org.apache.maven.continuum.notification.AbstractContinuumNotifier;
25  
26  import java.util.HashMap;
27  import java.util.Map;
28  
29  /**
30   * Action that edits a {@link ProjectNotifier} of type 'MSN' from the
31   * specified {@link Project}.
32   *
33   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
34   * @version $Id: MsnProjectNotifierEditAction.java 1372260 2012-08-13 04:29:09Z brett $
35   * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="msnProjectNotifierEdit"
36   * @since 1.1
37   */
38  public class MsnProjectNotifierEditAction
39      extends AbstractProjectNotifierEditAction
40  {
41      private String login;
42  
43      private String password;
44  
45      private String address;
46  
47      protected void initConfiguration( Map<String, String> configuration )
48      {
49          login = configuration.get( "login" );
50  
51          password = configuration.get( "password" );
52  
53          address = configuration.get( AbstractContinuumNotifier.ADDRESS_FIELD );
54      }
55  
56      protected void setNotifierConfiguration( ProjectNotifier notifier )
57      {
58          HashMap<String, String> configuration = new HashMap<String, String>();
59  
60          configuration.put( "login", login );
61  
62          configuration.put( "password", password );
63  
64          configuration.put( AbstractContinuumNotifier.ADDRESS_FIELD, address );
65  
66          notifier.setConfiguration( configuration );
67      }
68  
69      public String getLogin()
70      {
71          return login;
72      }
73  
74      public void setLogin( String login )
75      {
76          this.login = login;
77      }
78  
79      public String getPassword()
80      {
81          return password;
82      }
83  
84      public void setPassword( String password )
85      {
86          this.password = password;
87      }
88  
89      public String getAddress()
90      {
91          return address;
92      }
93  
94      public void setAddress( String address )
95      {
96          this.address = address;
97      }
98  }