// Path: asadmin-java/src/main/java/org/n0pe/asadmin/AsAdminCmdList.java
// public class AsAdminCmdList
//     extends ArrayList<IAsAdminCmd>
// {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public AsAdminCmdList()
//     {
//         super();
//     }
// 
// }
// 
// Path: asadmin-java/src/main/java/org/n0pe/asadmin/IAsAdminConfig.java
// public interface IAsAdminConfig
// {
// 
//     /**
//      * @return A map of environment to use when forking the asadmin process.
//      */
//     Map<String, String> getEnvironmentVariables();
// 
//     /**
//      * @return The glassfish home path.
//      */
//     String getGlassfishHome();
// 
//     /**
//      * @return The username to use with asadmin.
//      */
//     String getUser();
// 
//     /**
//      * @return The file where credentials are stored.
//      */
//     String getPasswordFile();
// 
//     /**
//      * @return The glassfish host.
//      */
//     String getHost();
// 
//     /**
//      * @return The glassfish port.
//      */
//     String getPort();
// 
//     /**
//      * @return True if gf admin connection is secure.
//      */
//     boolean isSecure();
// 
// }
// 
// Path: asadmin-java/src/main/java/org/n0pe/asadmin/commands/Uptime.java
// public class Uptime
//     extends AbstractAsAdminCmd
// {
// 
//     boolean requiresCredentials = false;
// 
//     @Override
//     public boolean needCredentials()
//     {
//         return true;
//     }
// 
//     @Override
//     public String getActionCommand()
//     {
//         return "uptime";
//     }
// 
//     @Override
//     public String[] getParameters()
//     {
//         return EMPTY_ARRAY;
//     }
// 
// }


import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.n0pe.asadmin.AsAdminCmdList;
import org.n0pe.asadmin.IAsAdminConfig;
import org.n0pe.asadmin.commands.Uptime;

/*
 * Copyright (c) 2011, J. Francis.
 *
 * 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.
 *
 */
package org.n0pe.mojo.asadmin;


/**
 * @goal uptime
 * @description AsAdmin uptime mojo
 */
public class UptimeMojo
    extends AbstractAsadminMojo
    implements IAsAdminConfig
{

    @Override
    protected AsAdminCmdList getAsCommandList()
        throws MojoExecutionException,
               MojoFailureException
    {
        getLog().info( "Checking server uptime" );
        final AsAdminCmdList list = new AsAdminCmdList();

// Path: asadmin-java/src/main/java/org/n0pe/asadmin/AsAdminCmdList.java
// public class AsAdminCmdList
//     extends ArrayList<IAsAdminCmd>
// {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public AsAdminCmdList()
//     {
//         super();
//     }
// 
// }
// 
// Path: asadmin-java/src/main/java/org/n0pe/asadmin/IAsAdminConfig.java
// public interface IAsAdminConfig
// {
// 
//     /**
//      * @return A map of environment to use when forking the asadmin process.
//      */
//     Map<String, String> getEnvironmentVariables();
// 
//     /**
//      * @return The glassfish home path.
//      */
//     String getGlassfishHome();
// 
//     /**
//      * @return The username to use with asadmin.
//      */
//     String getUser();
// 
//     /**
//      * @return The file where credentials are stored.
//      */
//     String getPasswordFile();
// 
//     /**
//      * @return The glassfish host.
//      */
//     String getHost();
// 
//     /**
//      * @return The glassfish port.
//      */
//     String getPort();
// 
//     /**
//      * @return True if gf admin connection is secure.
//      */
//     boolean isSecure();
// 
// }
// 
// Path: asadmin-java/src/main/java/org/n0pe/asadmin/commands/Uptime.java
// public class Uptime
//     extends AbstractAsAdminCmd
// {
// 
//     boolean requiresCredentials = false;
// 
//     @Override
//     public boolean needCredentials()
//     {
//         return true;
//     }
// 
//     @Override
//     public String getActionCommand()
//     {
//         return "uptime";
//     }
// 
//     @Override
//     public String[] getParameters()
//     {
//         return EMPTY_ARRAY;
//     }
// 
// }


// Path: asadmin-maven-plugin/src/main/java/org/n0pe/mojo/asadmin/UptimeMojo.java
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.n0pe.asadmin.AsAdminCmdList;
import org.n0pe.asadmin.IAsAdminConfig;
import org.n0pe.asadmin.commands.Uptime;

/*
 * Copyright (c) 2011, J. Francis.
 *
 * 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.
 *
 */
package org.n0pe.mojo.asadmin;


/**
 * @goal uptime
 * @description AsAdmin uptime mojo
 */
public class UptimeMojo
    extends AbstractAsadminMojo
    implements IAsAdminConfig
{

    @Override
    protected AsAdminCmdList getAsCommandList()
        throws MojoExecutionException,
               MojoFailureException
    {
        getLog().info( "Checking server uptime" );
        final AsAdminCmdList list = new AsAdminCmdList();

        Uptime uptimeCmd = new Uptime();
