package org.apache.maven.continuum.web.action;

/*
 * Copyright 2004-2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import org.apache.maven.continuum.model.project.ProjectNotifier;

import java.util.HashMap;
import java.util.Map;

/**
 * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
 * @version $Id$
 */
public class JabberNotifierEditAction
    extends AbstractNotifierEditAction
{
    private String host;

    private int port = 5222;

    private String login;

    private String password;

    private String domainName;

    private String address;

    private boolean sslConnection;

    private boolean group;

    protected void initConfiguration( Map configuration )
    {
        host = (String) configuration.get( "host" );

        if ( configuration.get( "port" ) != null )
        {
            port = Integer.parseInt( (String) configuration.get( "port" ) );
        }

        login = (String) configuration.get( "login" );

        password = (String) configuration.get( "password" );

        domainName = (String) configuration.get( "domainName" );

        address = (String) configuration.get( "address" );

        sslConnection = Boolean.parseBoolean( (String) configuration.get( "sslConnection" ) );

        group = Boolean.parseBoolean( (String) configuration.get( "isGroup" ) );
    }

    protected void setNotifierConfiguration( ProjectNotifier notifier )
    {
        HashMap configuration = new HashMap();

        configuration.put( "host", host );

        configuration.put( "port", String.valueOf( port ) );

        configuration.put( "login", login );

        configuration.put( "password", password );

        configuration.put( "domainName", domainName );

        configuration.put( "address", address );

        configuration.put( "sslConnection", String.valueOf( sslConnection ) );

        configuration.put( "isGroup", String.valueOf( group ) );

        notifier.setConfiguration( configuration );
    }

    public String getHost()
    {
        return host;
    }

    public void setHost( String host )
    {
        this.host = host;
    }

    public int getPort()
    {
        return port;
    }

    public void setPort( int port )
    {
        this.port = port;
    }

    public String getLogin()
    {
        return login;
    }

    public void setLogin( String login )
    {
        this.login = login;
    }

    public String getPassword()
    {
        return password;
    }

    public void setPassword( String password )
    {
        this.password = password;
    }

    public String getDomainName()
    {
        return domainName;
    }

    public void setDomainName( String domainName )
    {
        this.domainName = domainName;
    }

    public String getAddress()
    {
        return address;
    }

    public void setAddress( String address )
    {
        this.address = address;
    }

    public boolean isSslConnection()
    {
        return sslConnection;
    }

    public void setSslConnection( boolean sslConnection )
    {
        this.sslConnection = sslConnection;
    }

    public boolean isGroup()
    {
        return group;
    }

    public void setGroup( boolean group )
    {
        this.group = group;
    }
}

@@ -1728,36 +1728,31 @@
 n = Boolean.
-parseBoolean
+valueOf
 ( (String) c
@@ -1787,16 +1787,31 @@
 tion%22 ) 
+).booleanValue(
 );%0A%0A    
@@ -1834,20 +1834,15 @@
 ean.
-parseBoolean
+valueOf
 ( (S
@@ -1875,24 +1875,39 @@
 %22isGroup%22 ) 
+).booleanValue(
 );%0A    %7D%0A%0A  

Remove 1.5 code.