org.codehaus.mojo.weblogic.util
Class WeblogicMojoUtilities

java.lang.Object
  extended by org.codehaus.mojo.weblogic.util.WeblogicMojoUtilities

public class WeblogicMojoUtilities
extends Object

This class contains some utilities that are useful during use of the Weblogic Mojo.

Version:
$Id: WeblogicMojoUtilities.java 7025 2008-05-21 01:50:58Z jonnio $
Author:
Scott Ryan, Jon Osborn

Method Summary
static String getAdminUrl(String inProtocol, String inServerName, String inServerPort)
          This method will contstruct the Admin URL to the given server.
static String getDependencies(Set inArtifacts)
          This method will get the dependencies from the pom and construct a classpath string to be used to run a mojo where a classpath is required.
static String getDependencies(Set artifacts, List pluginArtifacts)
          This method will get the PLUGIN dependencies from the pom and construct a classpath string to be used to run a mojo where a classpath is required.
static File getEarFileName(Set inArtifacts)
          Returns the fully qualified path to an ear file int the artifact list.
static File getEjbJarFileName(Set inArtifacts)
          Returns the ejb file type from the artifact list
static File getWarFileName(Set inArtifacts)
          Returns the fully qualified path to a war file in the artifact list.
static File getWarFileName(Set inArtifacts, String fileName)
          Returns the fully qualified path to an war file in the artifact list.
static String updateArtifactName(String inName, String inProjectPackaging)
          This method will make sure there is a type appended to the file name and if it is the appropriate type for the project packaging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAdminUrl

public static String getAdminUrl(String inProtocol,
                                 String inServerName,
                                 String inServerPort)
This method will contstruct the Admin URL to the given server.

Parameters:
inProtocol - The protocol to contact the server with (i.e. t3 or http)
inServerName - The name of the server to contact.
inServerPort - The listen port for the server to contact.
Returns:
The value of admin url.

updateArtifactName

public static String updateArtifactName(String inName,
                                        String inProjectPackaging)
This method will make sure there is a type appended to the file name and if it is the appropriate type for the project packaging. If the project packaging is ear the artifact must end in .ear. If the project packaging is war then the artifact must end in .war. If the project packaging is ejb then the artifact must end in .jar.

Parameters:
inName - The name of the artifact.
inProjectPackaging - The type of packaging for this project.
Returns:
The updated artifact name.

getDependencies

public static String getDependencies(Set inArtifacts)
This method will get the dependencies from the pom and construct a classpath string to be used to run a mojo where a classpath is required.

Parameters:
inArtifacts - The Set of artifacts for the pom being run.
Returns:
A string representing the current classpath for the pom.

getEarFileName

public static File getEarFileName(Set inArtifacts)
Returns the fully qualified path to an ear file int the artifact list.

Parameters:
inArtifacts - - the set of artifacts
Returns:
the fully qualified path to an ear file int the artifact list.

getWarFileName

public static File getWarFileName(Set inArtifacts)
Returns the fully qualified path to a war file in the artifact list.

Parameters:
inArtifacts - - the set of artifacts
Returns:
the fully qualified path to an war file in the artifact list.
Throws:
IllegalArgumentException - - when a war is not found

getWarFileName

public static File getWarFileName(Set inArtifacts,
                                  String fileName)
Returns the fully qualified path to an war file in the artifact list.

Parameters:
inArtifacts - - the set of artifacts
fileName - - the file name we are looking for in the aftifact list
Returns:
the fully qualified path to an war file in the artifact list.

getEjbJarFileName

public static File getEjbJarFileName(Set inArtifacts)
Returns the ejb file type from the artifact list

Parameters:
inArtifacts - - the dependency artifacts
Returns:
the File object corresponding to the ejb jar type from the artifact list

getDependencies

public static String getDependencies(Set artifacts,
                                     List pluginArtifacts)
This method will get the PLUGIN dependencies from the pom and construct a classpath string to be used to run a mojo where a classpath is required.

The plugin dependencies are placed after the project dependencies in the classpath.

Parameters:
artifacts - The Set of artifacts for the pom being run.
pluginArtifacts - the plugin artifacts
Returns:
A string representing the current classpath for the pom.


Copyright © 2005-2008 Codehaus. All Rights Reserved.