View Javadoc

1   /*
2    * Copyright (c) 2007, Ounce Labs, Inc.
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions are met:
7    *     * Redistributions of source code must retain the above copyright
8    *       notice, this list of conditions and the following disclaimer.
9    *     * Redistributions in binary form must reproduce the above copyright
10   *       notice, this list of conditions and the following disclaimer in the
11   *       documentation and/or other materials provided with the distribution.
12   *     * Neither the name of the <organization> nor the
13   *       names of its contributors may be used to endorse or promote products
14   *       derived from this software without specific prior written permission.
15   *
16   * THIS SOFTWARE IS PROVIDED BY OUNCE LABS, INC. ``AS IS'' AND ANY
17   * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19   * DISCLAIMED. IN NO EVENT SHALL OUNCE LABS, INC. BE LIABLE FOR ANY
20   * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26   */
27  package org.codehaus.mojo.ounce.core;
28  
29  import java.util.List;
30  import java.util.Map;
31  
32  import org.apache.maven.plugin.logging.Log;
33  
34  /**
35   * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
36   * @plexus.component role="org.codehaus.mojo.ounce.core.OunceCore" role-hint="console"
37   */
38  public class OunceCoreConsole
39      implements OunceCore
40  {
41      /*
42       * (non-Javadoc)
43       * 
44       * @see com.ouncelabs.plugins.OunceCoreInterface#createApplication(java.lang.String, java.io.File, java.util.List,
45       *      boolean, boolean)
46       */
47      public void createApplication( String baseDir, String theName, String theApplicationRoot, List theProjects,
48                                     Map ounceOptions, Log log )
49          throws OunceCoreException
50      {
51          System.out.println( "Create Application Params:" );
52          System.out.println( "Basedir: " + baseDir );
53          System.out.println( "Name: " + theName );
54          System.out.println( "Root: " + theApplicationRoot );
55          System.out.println( "Projects: " + theProjects );
56          System.out.println( "OunceOptions: " + ounceOptions );
57      }
58  
59      /*
60       * (non-Javadoc)
61       * 
62       * @see com.ouncelabs.plugins.OunceCoreInterface#createProject(java.lang.String, java.io.File, java.util.List,
63       *      java.io.File, java.lang.String, java.lang.String, boolean, com.ouncelabs.plugins.CompilerOptions)
64       */
65      public void createProject( String baseDir, String theName, String theProjectRoot, List theSourceRoots,
66                                 String theWebRoot, String theClassPath, String theJdkName, String theCompilerOptions,
67                                 String packaging, Map ounceOptions, 
68                                 boolean analyzeStrutsFramework, boolean importStrutsValidation, Log log )
69          throws OunceCoreException
70      {
71          System.out.println( "Create Project Params:" );
72          System.out.println( "Basedir: " + baseDir );
73          System.out.println( "Name: " + theName );
74          System.out.println( "Root: " + theProjectRoot );
75          System.out.println( "JDK Name: " + theJdkName );
76          System.out.println( "SourceRoots: " + theSourceRoots );
77          System.out.println( "ClassPath: " + theClassPath );
78          System.out.println( "Webroot: " + theWebRoot );
79          System.out.println( "Packaging: " + packaging );
80          System.out.println( "CompilerOptions: " + theCompilerOptions );
81          System.out.println( "OunceOptions: " + ounceOptions );
82      }
83  
84      /*
85       * (non-Javadoc)
86       * 
87       * @see com.ouncelabs.plugins.OunceCoreInterface#scan()
88       */
89      public void scan( String applicationFile, String assessmentName, String assessmentOutput, String caller,
90                        String reportType, String reportOutputType, String reportOutputLocation, boolean publish,
91                        Map ounceOptions, String installDir, boolean wait, Log log )
92          throws OunceCoreException
93      {
94          System.out.println( "ApplicationFile: " + applicationFile );
95          System.out.println( "AssessmentName: " + assessmentName );
96          System.out.println( "AssessmentOutput: " + assessmentOutput );
97          System.out.println( "Caller: " + caller );
98          System.out.println( "ReportType: " + reportType );
99          System.out.println( "ReportOutputType: " + reportOutputType );
100         System.out.println( "ReportOutputLocation: " + reportOutputLocation );
101         System.out.println( "Publish:" + publish );
102         System.out.println( "OunceOptions: " + ounceOptions );
103         System.out.println( "OunceInstallDir: " + installDir );
104         System.out.println( "Wait: " + wait );
105     }
106 
107     /*
108      * (non-Javadoc)
109      * 
110      * @see org.codehaus.mojo.ounce.core.OunceCore#readApplication(java.lang.String)
111      */
112     public OunceCoreApplication readApplication( String thePath, Log log )
113         throws OunceCoreException
114     {
115         log.info( "Read Application: Method not supported." );
116         return null;
117     }
118 
119     /*
120      * (non-Javadoc)
121      * 
122      * @see org.codehaus.mojo.ounce.core.OunceCore#readProject(java.lang.String)
123      */
124     public OunceCoreProject readProject( String thePath, Log log )
125         throws OunceCoreException
126     {
127         log.info( "Read Project: Method not supported." );
128         return null;
129     }
130 
131     public void report( Log log )
132         throws OunceCoreException
133     {
134         log.info( "Report: Method not supproted." );
135     }
136 
137     public void createPathVariables( Map pathVariableMap, String installDir, Log log )
138         throws OunceCoreException
139     {
140         log.info( "Create Path Variables: Method not supported." );
141     }
142 
143 }