Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java?rev=760328&r1=760327&r2=760328&view=diff ============================================================================== --- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java (original) +++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java Tue Mar 31 04:55:00 2009 @@ -22,10 +22,10 @@ import java.util.List; import java.util.Map; +import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult; import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration; import org.apache.continuum.xmlrpc.repository.LocalRepository; import org.apache.continuum.xmlrpc.repository.RepositoryPurgeConfiguration; -import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult; import org.apache.maven.continuum.xmlrpc.project.AddingResult; import org.apache.maven.continuum.xmlrpc.project.BuildDefinition; import org.apache.maven.continuum.xmlrpc.project.BuildDefinitionTemplate; @@ -64,17 +64,18 @@ List getProjects( int projectGroupId ) throws Exception; - - /** - * Same method but compatible with standard XMLRPC - * - * @param projectGroupId The project group Id - * @return List of {@link ProjectSummary} as RPC value - * @throws Exception - */ - List getProjectsRPC(int projectGroupId)throws Exception; - - + + /** + * Same method but compatible with standard XMLRPC + * + * @param projectGroupId The project group Id + * @return List of {@link ProjectSummary} as RPC value + * @throws Exception + */ + List getProjectsRPC( int projectGroupId ) + throws Exception; + + /** * Get a project. * @@ -87,13 +88,14 @@ /** * Same method but compatible with standard XMLRPC - * + * * @param projectId the project id * @return The project summary as RPC value * @throws Exception */ - Map getProjectSummaryRPC(int projectId)throws Exception; - + Map getProjectSummaryRPC( int projectId ) + throws Exception; + /** * Get a project with all details. * @@ -106,13 +108,14 @@ /** * Same method but compatible with standard XMLRPC - * + * * @param projectId the project id * @return The project as RPC value * @throws Exception */ - Map getProjectWithAllDetailsRPC(int projectId)throws Exception; - + Map getProjectWithAllDetailsRPC( int projectId ) + throws Exception; + /** * Remove a project. * @@ -133,34 +136,37 @@ /** * Same method but compatible with standard XMLRPC - * + * * @param project The project to update * @return The project as RPC value * @throws Exception */ - Map updateProjectRPC(Map project)throws Exception; + Map updateProjectRPC( Map project ) + throws Exception; // ---------------------------------------------------------------------- // Projects Groups // ---------------------------------------------------------------------- /** * Get a project groups. - * + * * @param projectGroupId the id * @return project group * @throws Exception */ - ProjectGroup getProjectGroup(int projectGroupId) throws Exception; - + ProjectGroup getProjectGroup( int projectGroupId ) + throws Exception; + /** * Same method but compatible with standard XMLRPC - * + * * @param projectGroupId the id * @return project group as RPC value * @throws Exception */ - Map getProjectGroupRPC(int projectGroupId) throws Exception; - + Map getProjectGroupRPC( int projectGroupId ) + throws Exception; + /** * Get all project groups. * @@ -172,12 +178,13 @@ /** * Same method but compatible with standard XMLRPC - * + * * @return List of {@link ProjectGroupSummary} as RPC value * @throws Exception */ - List getAllProjectGroupsRPC()throws Exception; - + List getAllProjectGroupsRPC() + throws Exception; + /** * Get all project groups with all details (project summaries, notifiers, build definitions). * @@ -189,12 +196,13 @@ /** * Same method but compatible with standard XMLRPC - * + * * @return List of {@link ProjectGroup} as RPC value * @throws Exception */ - List getAllProjectGroupsWithAllDetailsRPC()throws Exception; - + List getAllProjectGroupsWithAllDetailsRPC() + throws Exception; + /** * Get all project groups with all details. * @@ -217,13 +225,14 @@ /** * Same method but compatible with standard XMLRPC - * + * * @param projectGroupId The project group id * @return The project group summary as RPC value * @throws Exception */ - Map getProjectGroupSummaryRPC(int projectGroupId)throws Exception; - + Map getProjectGroupSummaryRPC( int projectGroupId ) + throws Exception; + /** * Get a project group with all details. * @@ -236,13 +245,14 @@ /** * Same method but compatible with standard XMLRPC - * + * * @param projectGroupId The project group id * @return The project group as RPC value * @throws Exception */ - Map getProjectGroupWithProjectsRPC(int projectGroupId)throws Exception; - + Map getProjectGroupWithProjectsRPC( int projectGroupId ) + throws Exception; + /** * Remove a project group. * @@ -263,13 +273,14 @@ /** * Same method but compatible with standard XMLRPC - * + * * @param projectGroup The project group to update * @return The project group as RPC value * @throws Exception */ - Map updateProjectGroupRPC(Map projectGroup)throws Exception; - + Map updateProjectGroupRPC( Map projectGroup ) + throws Exception; + /** * Add a project Group. * @@ -281,8 +292,10 @@ */ ProjectGroupSummary addProjectGroup( String groupName, String groupId, String description ) throws Exception; - - int removeBuildDefinitionFromProjectGroup(int projectGroupId, int buildDefinitionId) throws Exception; + + int removeBuildDefinitionFromProjectGroup( int projectGroupId, int buildDefinitionId ) + throws Exception; + /** * Same method but compatible with standard XMLRPC * @@ -292,37 +305,51 @@ * @return the project group summary of the created project group as RPC value * @throws Exception */ - Map addProjectGroupRPC( String groupName, String groupId, String description ) + Map addProjectGroupRPC( String groupName, String groupId, String description ) + throws Exception; + + ProjectNotifier getNotifier( int projectid, int notifierId ) + throws Exception; + + Map getNotifierRPC( int projectid, int notifierId ) + throws Exception; + + ProjectNotifier getGroupNotifier( int projectgroupid, int notifierId ) throws Exception; - - ProjectNotifier getNotifier(int projectid, int notifierId) throws Exception; - - Map getNotifierRPC(int projectid, int notifierId) throws Exception; - - ProjectNotifier getGroupNotifier(int projectgroupid, int notifierId) throws Exception; - - Map getGroupNotifierRPC(int projectgroupid, int notifierId) throws Exception; - - ProjectNotifier updateGroupNotifier(int projectgroupid, ProjectNotifier newNotifier) throws Exception; - - Map updateGroupNotifierRPC(int projectgroupid, Map newNotifier) throws Exception; - - ProjectNotifier updateNotifier(int projectid, ProjectNotifier newNotifier) throws Exception; - - Map updateNotifierRPC(int projectid, Map newNotifier) throws Exception; - - int removeGroupNotifier(int projectgroupid, int notifierId) throws Exception; - - int removeNotifier(int projectid, int notifierId) throws Exception; - - ProjectNotifier addNotifier(int projectid, ProjectNotifier newNotifier) throws Exception; - - ProjectNotifier addGroupNotifier(int projectgroupid, ProjectNotifier newNotifier) throws Exception; - - Map addNotifierRPC(int projectid, Map newNotifier) throws Exception; - - Map addGroupNotifierRPC(int projectgroupid, Map newNotifier) throws Exception; - + + Map getGroupNotifierRPC( int projectgroupid, int notifierId ) + throws Exception; + + ProjectNotifier updateGroupNotifier( int projectgroupid, ProjectNotifier newNotifier ) + throws Exception; + + Map updateGroupNotifierRPC( int projectgroupid, Map newNotifier ) + throws Exception; + + ProjectNotifier updateNotifier( int projectid, ProjectNotifier newNotifier ) + throws Exception; + + Map updateNotifierRPC( int projectid, Map newNotifier ) + throws Exception; + + int removeGroupNotifier( int projectgroupid, int notifierId ) + throws Exception; + + int removeNotifier( int projectid, int notifierId ) + throws Exception; + + ProjectNotifier addNotifier( int projectid, ProjectNotifier newNotifier ) + throws Exception; + + ProjectNotifier addGroupNotifier( int projectgroupid, ProjectNotifier newNotifier ) + throws Exception; + + Map addNotifierRPC( int projectid, Map newNotifier ) + throws Exception; + + Map addGroupNotifierRPC( int projectgroupid, Map newNotifier ) + throws Exception; + // ---------------------------------------------------------------------- // Build Definitions // ---------------------------------------------------------------------- @@ -346,7 +373,7 @@ */ List getBuildDefinitionsForProjectRPC( int projectId ) throws Exception; - + /** * Get the build definitions list of the project group. * @@ -366,7 +393,7 @@ */ List getBuildDefinitionsForProjectGroupRPC( int projectGroupId ) throws Exception; - + /** * Update a project build definition. * @@ -386,7 +413,7 @@ * @return the updated build definition as RPC value * @throws Exception */ - Map updateBuildDefinitionForProjectRPC( int projectId, Map buildDef ) + Map updateBuildDefinitionForProjectRPC( int projectId, Map buildDef ) throws Exception; /** @@ -404,13 +431,13 @@ * Same method but compatible with standard XMLRPC * * @param projectGroupId The project group id - * @param buildDef The build defintion to update + * @param buildDef The build defintion to update * @return the updated build definition as RPC value * @throws Exception */ - Map updateBuildDefinitionForProjectGroupRPC( int projectGroupId, Map buildDef ) + Map updateBuildDefinitionForProjectGroupRPC( int projectGroupId, Map buildDef ) throws Exception; - + /** * Add a project build definition. * @@ -430,9 +457,9 @@ * @return the added build definition as RPC value * @throws Exception */ - Map addBuildDefinitionToProjectRPC( int projectId, Map buildDef ) + Map addBuildDefinitionToProjectRPC( int projectId, Map buildDef ) throws Exception; - + /** * Add a project group buildDefinition. * @@ -448,13 +475,13 @@ * Same method but compatible with standard XMLRPC * * @param projectGroupId The project group id - * @param buildDef The build defintion to update + * @param buildDef The build defintion to update * @return the added build definition as RPC value * @throws Exception */ - Map addBuildDefinitionToProjectGroupRPC( int projectGroupId, Map buildDef ) + Map addBuildDefinitionToProjectGroupRPC( int projectGroupId, Map buildDef ) throws Exception; - + /** * Get the build definition templates list. * @@ -554,9 +581,9 @@ * @return The build result as RPC value * @throws Exception */ - Map getLatestBuildResultRPC( int projectId ) + Map getLatestBuildResultRPC( int projectId ) throws Exception; - + /** * Returns the build result. * @@ -576,9 +603,9 @@ * @return The build result as RPC value * @throws Exception */ - Map getBuildResultRPC( int projectId, int buildId ) + Map getBuildResultRPC( int projectId, int buildId ) throws Exception; - + /** * Returns the project build result summary list. * @@ -598,7 +625,7 @@ */ List getBuildResultsForProjectRPC( int projectId ) throws Exception; - + /** * Remove the project build result. * @@ -616,9 +643,9 @@ * @return 0 * @throws Exception */ - int removeBuildResultRPC( Map br ) + int removeBuildResultRPC( Map br ) throws Exception; - + /** * Returns the build output. * @@ -651,9 +678,9 @@ * @return The result of the action with the list of projects created as RPC value * @throws Exception */ - Map addMavenTwoProjectRPC( String url ) + Map addMavenTwoProjectRPC( String url ) throws Exception; - + /** * Add a maven 2.x project from an url. * @@ -668,12 +695,12 @@ /** * Same method but compatible with standard XMLRPC * - * @param url The POM url + * @param url The POM url * @param projectGroupId The id of the group where projects will be stored * @return The result of the action with the list of projects created as RPC value * @throws Exception */ - Map addMavenTwoProjectRPC( String url, int projectGroupId ) + Map addMavenTwoProjectRPC( String url, int projectGroupId ) throws Exception; // ---------------------------------------------------------------------- @@ -683,26 +710,6 @@ /** * Add a maven 1.x project from an url. * - * @param url The POM url - * @return The result of the action with the list of projects created - * @throws Exception - */ - AddingResult addMavenOneProject( String url ) - throws Exception; - - /** - * Same method but compatible with standard XMLRPC - * - * @param url The POM url - * @return The result of the action with the list of projects created as RPC value - * @throws Exception - */ - Map addMavenOneProjectRPC( String url ) - throws Exception; - - /** - * Add a maven 1.x project from an url. - * * @param url The POM url * @param projectGroupId The id of the group where projects will be stored * @return The result of the action with the list of projects created @@ -714,39 +721,19 @@ /** * Same method but compatible with standard XMLRPC * - * @param url The POM url + * @param url The POM url * @param projectGroupId The id of the group where projects will be stored * @return The result of the action with the list of projects created as RPC value * @throws Exception */ - Map addMavenOneProjectRPC( String url, int projectGroupId ) + Map addMavenOneProjectRPC( String url, int projectGroupId ) throws Exception; - + // ---------------------------------------------------------------------- // Maven ANT projects // ---------------------------------------------------------------------- /** - * Add an ANT project. - * - * @param project The project to add. name, version and scm informations are required - * @return The project populated with the id. - * @throws Exception - */ - ProjectSummary addAntProject( ProjectSummary project ) - throws Exception; - - /** - * Same method but compatible with standard XMLRPC - * - * @param project The project to add. name, version and scm informations are required - * @return The project populated with the id as RPC value - * @throws Exception - */ - Map addAntProjectRPC( Map project) - throws Exception; - - /** * Add an ANT project in the specified group. * * @param project The project to add. name, version and scm informations are required @@ -765,34 +752,14 @@ * @return The project populated with the id as RPC value * @throws Exception */ - Map addAntProjectRPC( Map project, int projectGroupId ) + Map addAntProjectRPC( Map project, int projectGroupId ) throws Exception; - + // ---------------------------------------------------------------------- // Maven Shell projects // ---------------------------------------------------------------------- /** - * Add an shell project. - * - * @param project The project to add. name, version and scm informations are required - * @return The project populated with the id. - * @throws Exception - */ - ProjectSummary addShellProject( ProjectSummary project ) - throws Exception; - - /** - * Same method but compatible with standard XMLRPC - * - * @param project The project to add. name, version and scm informations are required - * @return The project populated with the id as RPC value - * @throws Exception - */ - Map addShellProjectRPC( Map project ) - throws Exception; - - /** * Add an shell project in the specified group. * * @param project The project to add. name, version and scm informations are required @@ -806,14 +773,14 @@ /** * Same method but compatible with standard XMLRPC * - * @param project The project to add. name, version and scm informations are required + * @param project The project to add. name, version and scm informations are required * @param projectGroupId The id of the group where projects will be stored * @return The project populated with the id as RPC value * @throws Exception */ - Map addShellProjectRPC( Map project, int projectGroupId ) + Map addShellProjectRPC( Map project, int projectGroupId ) throws Exception; - + // ---------------------------------------------------------------------- // ADMIN TASKS // ---------------------------------------------------------------------- @@ -839,7 +806,7 @@ */ List getSchedulesRPC() throws Exception; - + /** * Return the schedule defined by this id. * @@ -857,9 +824,9 @@ * @return The schedule as RPC value. * @throws Exception */ - Map getScheduleRPC(int scheduleId) + Map getScheduleRPC( int scheduleId ) throws Exception; - + /** * Add the schedule. * @@ -877,7 +844,7 @@ * @return The schedule as RPC value. * @throws Exception */ - Map addScheduleRPC( Map schedule ) + Map addScheduleRPC( Map schedule ) throws Exception; /** @@ -897,9 +864,9 @@ * @return The schedule as RPC value. * @throws Exception */ - Map updateScheduleRPC( Map schedule ) + Map updateScheduleRPC( Map schedule ) throws Exception; - + // ---------------------------------------------------------------------- // Profiles // ---------------------------------------------------------------------- @@ -921,7 +888,7 @@ */ List getProfilesRPC() throws Exception; - + /** * Return the profile defined by this id. * @@ -939,24 +906,24 @@ * @return The profile. * @throws Exception */ - Map getProfileRPC( int profileId ) + Map getProfileRPC( int profileId ) throws Exception; - - Profile addProfile(Profile profile) + + Profile addProfile( Profile profile ) throws Exception; - - int updateProfile(Profile profile) + + int updateProfile( Profile profile ) throws Exception; - - int deleteProfile(int profileId) + + int deleteProfile( int profileId ) throws Exception; - - Map addProfileRPC(Map profile) + + Map addProfileRPC( Map profile ) throws Exception; - - int updateProfileRPC(Map profile) + + int updateProfileRPC( Map profile ) throws Exception; - + // ---------------------------------------------------------------------- // Installations // ---------------------------------------------------------------------- @@ -978,7 +945,7 @@ */ List getInstallationsRPC() throws Exception; - + /** * Return the installation defined by this id. * @@ -996,24 +963,24 @@ * @return The installation. * @throws Exception */ - Map getInstallationRPC( int installationId ) + Map getInstallationRPC( int installationId ) throws Exception; - - Installation addInstallation(Installation installation) + + Installation addInstallation( Installation installation ) throws Exception; - - int updateInstallation(Installation installation) + + int updateInstallation( Installation installation ) throws Exception; - - int deleteInstallation(int installationId) + + int deleteInstallation( int installationId ) throws Exception; - Map addInstallationRPC(Map installation) + Map addInstallationRPC( Map installation ) throws Exception; - - int updateInstallationRPC(Map installation) + + int updateInstallationRPC( Map installation ) throws Exception; - + // ---------------------------------------------------------------------- // SystemConfiguration // ---------------------------------------------------------------------- @@ -1021,18 +988,18 @@ SystemConfiguration getSystemConfiguration() throws Exception; - Map getSystemConfigurationRPC() - throws Exception; - + Map getSystemConfigurationRPC() + throws Exception; + // ---------------------------------------------------------------------- // Queue // ---------------------------------------------------------------------- - - - /** + + + /** * Return true is the project is in building queue. * - * @param projectGroupId The project group id + * @param projectGroupId The project group id * @throws ContinuumException */ boolean isProjectInBuildingQueue( int projectId ) @@ -1044,11 +1011,11 @@ * @throws ContinuumException */ public List getProjectsInBuildQueue() - throws Exception; + throws Exception; /** * Remove projects from build queue - * + * * @param projectsId project id to be removed from the building queue * @return * @throws Exception @@ -1058,7 +1025,7 @@ /** * Cancel the current project build - * + * * @return * @throws Exception */ @@ -1082,7 +1049,7 @@ /** * Add a local repository - * + * * @param repository the local repository to add * @return * @throws Exception @@ -1092,7 +1059,7 @@ /** * Same method but compatible with the standard XMLRPC - * + * * @param repository the local repository to add * @return * @throws Exception @@ -1102,7 +1069,7 @@ /** * Update the local repository - * + * * @param repository the local repository to update * @return * @throws Exception @@ -1112,7 +1079,7 @@ /** * Same method but compatible with the standard XMLRPC - * + * * @param repository the local repository to update * @return * @throws Exception @@ -1122,7 +1089,7 @@ /** * Remove the local repository - * + * * @param repositoryId * @return * @throws Exception @@ -1132,7 +1099,7 @@ /** * Returns the local repository - * + * * @param repositoryId the local repository id * @return * @throws Exception @@ -1142,7 +1109,7 @@ /** * Same method but compatible with the standard XMLRPC - * + * * @param repositoryId * @return * @throws Exception @@ -1152,7 +1119,7 @@ /** * Returns all local repositories - * + * * @return * @throws Exception */ @@ -1161,7 +1128,7 @@ /** * Same method but compatible with the standard XMLRPC - * + * * @return * @throws Exception */ @@ -1174,7 +1141,7 @@ /** * Add a repository purge configuration - * + * * @param repoPurge the repository purge configuration * @return * @throws Exception @@ -1184,7 +1151,7 @@ /** * Same method but compatible with the standard XMLRPC - * + * * @param repoPurge the repository purge configuration * @return * @throws Exception @@ -1194,7 +1161,7 @@ /** * Update the repository purge configuration - * + * * @param repoPurge the repository purge configuration * @return * @throws Exception @@ -1204,7 +1171,7 @@ /** * Same method but compatible with the standard XMLRPC - * + * * @param repoPurge the repository purge configuration * @return * @throws Exception @@ -1214,7 +1181,7 @@ /** * Remove repository purge configuration - * + * * @param repoPurgeId the repository purge configuration id * @return * @throws Exception @@ -1224,7 +1191,7 @@ /** * Returns the repository purge configuration - * + * * @param purgeConfigId the repository purge configuration id * @return the repository purge configuration * @throws Exception @@ -1234,7 +1201,7 @@ /** * Same method but compatible with standard XMLRPC - * + * * @param purgeConfigId the repository purge configuration id * @return the repository purge configuration * @throws Exception @@ -1244,7 +1211,7 @@ /** * Returns repository purge configurations list - * + * * @return list of repository purge configurations * @throws Exception */ @@ -1253,7 +1220,7 @@ /** * Same method but compatible with standard XMLRPC - * + * * @return list of repository purge configurations * @throws Exception */ @@ -1262,7 +1229,7 @@ /** * Add a directory purge configuration - * + * * @param dirPurge the directory purge configuration * @return * @throws Exception @@ -1272,7 +1239,7 @@ /** * Same method but compatible with the standard XMLRPC - * + * * @param dirPurge the directory purge configuration * @return * @throws Exception @@ -1282,7 +1249,7 @@ /** * Update the directory purge configuration - * + * * @param dirPurge the directory purge configuration * @return * @throws Exception @@ -1292,7 +1259,7 @@ /** * Same method but compatible with the standard XMLRPC - * + * * @param dirPurge the directory purge configuration * @return * @throws Exception @@ -1302,7 +1269,7 @@ /** * Removes the directory purge configuration - * + * * @param dirPurgeId the directory purge configuration id * @return * @throws Exception @@ -1312,7 +1279,7 @@ /** * Returns the directory purge configuration - * + * * @param purgeConfigId the directory purge configuration id * @return the directory purge configuration * @throws Exception @@ -1322,7 +1289,7 @@ /** * Same method but compatible with standard XMLRPC - * + * * @param purgeConfigId the directory purge configuration id * @return the directory purge configuration * @throws Exception @@ -1332,7 +1299,7 @@ /** * Returns directory purge configurations list - * + * * @return list of directory purge configurations * @throws Exception */ @@ -1341,7 +1308,7 @@ /** * Same method but compatible with standard XMLRPC - * + * * @return list of directory purge configurations * @throws Exception */ @@ -1371,13 +1338,13 @@ /** * Same method but compatible with standard XMLRPC * - * @param releaseId The release id + * @param releaseId The release id * @return The release result as RPC value * @throws Exception */ - Map getReleaseResultRPC( int releaseId ) + Map getReleaseResultRPC( int releaseId ) throws Exception; - + /** * Returns the project group release result list. * @@ -1415,9 +1382,9 @@ * @return 0 * @throws Exception */ - int removeReleaseResultRPC( Map rr ) + int removeReleaseResultRPC( Map rr ) throws Exception; - + /** * Returns the release output. * Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java?rev=760328&r1=760327&r2=760328&view=diff ============================================================================== --- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java (original) +++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java Tue Mar 31 04:55:00 2009 @@ -19,6 +19,11 @@ * under the License. */ +import java.net.URL; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; + import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult; import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration; import org.apache.continuum.xmlrpc.repository.LocalRepository; @@ -45,11 +50,6 @@ import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; import org.apache.xmlrpc.client.util.ClientFactory; -import java.net.URL; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - /** * @author Emmanuel Venisse * @version $Id$ @@ -390,12 +390,6 @@ // Maven 1.x projects // ---------------------------------------------------------------------- - public AddingResult addMavenOneProject( String url ) - throws Exception - { - return continuum.addMavenOneProject( url ); - } - public AddingResult addMavenOneProject( String url, int projectGroupId ) throws Exception { @@ -406,12 +400,6 @@ // Maven ANT projects // ---------------------------------------------------------------------- - public ProjectSummary addAntProject( ProjectSummary project ) - throws Exception - { - return continuum.addAntProject( project ); - } - public ProjectSummary addAntProject( ProjectSummary project, int projectGroupId ) throws Exception { @@ -422,12 +410,6 @@ // Maven Shell projects // ---------------------------------------------------------------------- - public ProjectSummary addShellProject( ProjectSummary project ) - throws Exception - { - return continuum.addShellProject( project ); - } - public ProjectSummary addShellProject( ProjectSummary project, int projectGroupId ) throws Exception { @@ -679,38 +661,24 @@ return continuum.getAllLocalRepositories(); } - public Map addAntProjectRPC( Map project ) - throws Exception - { - return continuum.addAntProjectRPC( project ); - } - public Map addAntProjectRPC( Map project, int projectGroupId ) throws Exception { return continuum.addAntProjectRPC( project, projectGroupId ); } - public Map addBuildDefinitionToProjectGroupRPC( int projectGroupId, - Map buildDef ) + public Map addBuildDefinitionToProjectGroupRPC( int projectGroupId, Map buildDef ) throws Exception { return continuum.addBuildDefinitionToProjectGroupRPC( projectGroupId, buildDef ); } - public Map addBuildDefinitionToProjectRPC( int projectId, - Map buildDef ) + public Map addBuildDefinitionToProjectRPC( int projectId, Map buildDef ) throws Exception { return continuum.addBuildDefinitionToProjectRPC( projectId, buildDef ); } - public Map addMavenOneProjectRPC( String url ) - throws Exception - { - return continuum.addMavenOneProjectRPC( url ); - } - public Map addMavenOneProjectRPC( String url, int projectGroupId ) throws Exception { @@ -729,9 +697,7 @@ return continuum.addMavenTwoProjectRPC( url, projectGroupId ); } - public Map addProjectGroupRPC( String groupName, - String groupId, - String description ) + public Map addProjectGroupRPC( String groupName, String groupId, String description ) throws Exception { return continuum.addProjectGroupRPC( groupName, groupId, description ); @@ -749,12 +715,6 @@ return continuum.addShellProjectRPC( project, projectGroupId ); } - public Map addShellProjectRPC( Map project ) - throws Exception - { - return continuum.addShellProjectRPC( project ); - } - public List getAllProjectGroupsRPC() throws Exception { @@ -894,8 +854,7 @@ return continuum.updateBuildDefinitionForProjectGroupRPC( projectGroupId, buildDef ); } - public Map updateBuildDefinitionForProjectRPC( int projectId, - Map buildDef ) + public Map updateBuildDefinitionForProjectRPC( int projectId, Map buildDef ) throws Exception { return continuum.updateBuildDefinitionForProjectRPC( projectId, buildDef ); @@ -955,8 +914,7 @@ return continuum.updateGroupNotifier( projectgroupid, newNotifier ); } - public Map updateGroupNotifierRPC( int projectgroupid, - Map newNotifier ) + public Map updateGroupNotifierRPC( int projectgroupid, Map newNotifier ) throws Exception { return continuum.updateGroupNotifierRPC( projectgroupid, newNotifier ); @@ -992,8 +950,7 @@ return continuum.addGroupNotifier( projectgroupid, newNotifier ); } - public Map addGroupNotifierRPC( int projectgroupid, - Map newNotifier ) + public Map addGroupNotifierRPC( int projectgroupid, Map newNotifier ) throws Exception { return continuum.addGroupNotifierRPC( projectgroupid, newNotifier ); Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=760328&r1=760327&r2=760328&view=diff ============================================================================== --- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java (original) +++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java Tue Mar 31 04:55:00 2009 @@ -19,8 +19,15 @@ * under the License. */ -import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper; -import net.sf.dozer.util.mapping.MapperIF; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.apache.continuum.buildmanager.BuildManagerException; import org.apache.continuum.buildmanager.BuildsManager; @@ -62,15 +69,8 @@ import org.codehaus.plexus.taskqueue.Task; import org.codehaus.plexus.util.StringUtils; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper; +import net.sf.dozer.util.mapping.MapperIF; /** * @author Emmanuel Venisse @@ -96,7 +96,7 @@ * @plexus.requirement role-hint="default" */ private RoleManager roleManager; - + /** * @plexus.requirement role-hint="parallel" */ @@ -217,7 +217,8 @@ throws ContinuumException { ProjectGroup result = null; - org.apache.maven.continuum.model.project.ProjectGroup projectGroup = continuum.getProjectGroup( projectGroupId ); + org.apache.maven.continuum.model.project.ProjectGroup projectGroup = continuum.getProjectGroup( projectGroupId ) + ; try { if ( isAuthorized( ContinuumRoleConstants.CONTINUUM_VIEW_GROUP_OPERATION, projectGroup.getName() ) ) @@ -271,7 +272,8 @@ private ProjectGroupSummary getPGSummary( int projectGroupId ) throws ContinuumException { - org.apache.maven.continuum.model.project.ProjectGroup projectGroup = continuum.getProjectGroup( projectGroupId ); + org.apache.maven.continuum.model.project.ProjectGroup projectGroup = continuum.getProjectGroup( projectGroupId ) + ; checkViewProjectGroupAuthorization( projectGroup.getName() ); return populateProjectGroupSummary( projectGroup ); @@ -282,8 +284,8 @@ { checkViewProjectGroupAuthorization( getProjectGroupName( projectGroupId ) ); - org.apache.maven.continuum.model.project.ProjectGroup projectGroup = - continuum.getProjectGroup( projectGroupId ); + org.apache.maven.continuum.model.project.ProjectGroup projectGroup = continuum.getProjectGroup( projectGroupId ) + ; return populateProjectGroupSummary( projectGroup ); } @@ -348,10 +350,10 @@ pg.setDescription( projectGroup.getDescription() ); - org.apache.continuum.model.repository.LocalRepository repo = + org.apache.continuum.model.repository.LocalRepository repo = new org.apache.continuum.model.repository.LocalRepository(); pg.setLocalRepository( populateLocalRepository( projectGroup.getLocalRepository(), repo ) ); - + continuum.updateProjectGroup( pg ); return getProjectGroupSummary( projectGroup.getId() ); } @@ -379,7 +381,7 @@ { org.apache.maven.continuum.model.project.ProjectNotifier notifier = - continuum.getNotifier( projectid, newNotifier.getId() ); + continuum.getNotifier( projectid, newNotifier.getId() ); notifier.setConfiguration( newNotifier.getConfiguration() ); notifier.setFrom( newNotifier.getFrom() ); notifier.setRecipientType( newNotifier.getRecipientType() ); @@ -397,7 +399,7 @@ { org.apache.maven.continuum.model.project.ProjectNotifier notifier = - new org.apache.maven.continuum.model.project.ProjectNotifier(); + new org.apache.maven.continuum.model.project.ProjectNotifier(); notifier.setConfiguration( newNotifier.getConfiguration() ); notifier.setFrom( newNotifier.getFrom() ); notifier.setRecipientType( newNotifier.getRecipientType() ); @@ -428,7 +430,7 @@ { org.apache.maven.continuum.model.project.ProjectNotifier notifier = - continuum.getGroupNotifier( projectgroupid, newNotifier.getId() ); + continuum.getGroupNotifier( projectgroupid, newNotifier.getId() ); notifier.setConfiguration( newNotifier.getConfiguration() ); notifier.setFrom( newNotifier.getFrom() ); notifier.setRecipientType( newNotifier.getRecipientType() ); @@ -445,7 +447,7 @@ throws ContinuumException { org.apache.maven.continuum.model.project.ProjectNotifier notifier = - new org.apache.maven.continuum.model.project.ProjectNotifier(); + new org.apache.maven.continuum.model.project.ProjectNotifier(); notifier.setConfiguration( newNotifier.getConfiguration() ); notifier.setFrom( newNotifier.getFrom() ); notifier.setRecipientType( newNotifier.getRecipientType() ); @@ -738,15 +740,6 @@ // Maven 1.x projects // ---------------------------------------------------------------------- - public AddingResult addMavenOneProject( String url ) - throws ContinuumException - { - checkAddProjectGroupAuthorization(); - - ContinuumProjectBuildingResult result = continuum.addMavenOneProject( url ); - return populateAddingResult( result ); - } - public AddingResult addMavenOneProject( String url, int projectGroupId ) throws ContinuumException { @@ -760,26 +753,14 @@ // Maven ANT projects // ---------------------------------------------------------------------- - public ProjectSummary addAntProject( ProjectSummary project ) - throws ContinuumException - { - checkAddProjectGroupAuthorization(); - org.apache.maven.continuum.model.project.Project newProject = - new org.apache.maven.continuum.model.project.Project(); - int projectId = - continuum.addProject( populateProject( project, newProject ), ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR ); - return getProjectSummary( projectId ); - } - public ProjectSummary addAntProject( ProjectSummary project, int projectGroupId ) throws ContinuumException { checkAddProjectGroupAuthorization(); org.apache.maven.continuum.model.project.Project newProject = - new org.apache.maven.continuum.model.project.Project(); - int projectId = - continuum.addProject( populateProject( project, newProject ), - ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR, projectGroupId ); + new org.apache.maven.continuum.model.project.Project(); + int projectId = continuum.addProject( populateProject( project, newProject ), + ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR, projectGroupId ); return getProjectSummary( projectId ); } @@ -787,27 +768,14 @@ // Maven Shell projects // ---------------------------------------------------------------------- - public ProjectSummary addShellProject( ProjectSummary project ) - throws ContinuumException - { - checkAddProjectGroupAuthorization(); - org.apache.maven.continuum.model.project.Project newProject = - new org.apache.maven.continuum.model.project.Project(); - int projectId = - continuum.addProject( populateProject( project, newProject ), - ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR ); - return getProjectSummary( projectId ); - } - public ProjectSummary addShellProject( ProjectSummary project, int projectGroupId ) throws ContinuumException { checkAddProjectGroupAuthorization(); org.apache.maven.continuum.model.project.Project newProject = - new org.apache.maven.continuum.model.project.Project(); - int projectId = - continuum.addProject( populateProject( project, newProject ), - ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR, projectGroupId ); + new org.apache.maven.continuum.model.project.Project(); + int projectId = continuum.addProject( populateProject( project, newProject ), + ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR, projectGroupId ); return getProjectSummary( projectId ); } @@ -905,7 +873,7 @@ throws ContinuumException { org.apache.maven.continuum.model.system.Profile newProfile = - new org.apache.maven.continuum.model.system.Profile(); + new org.apache.maven.continuum.model.system.Profile(); return populateProfile( continuum.getProfileService().addProfile( populateProfile( profile, newProfile ) ) ); } @@ -914,7 +882,7 @@ throws ContinuumException { org.apache.maven.continuum.model.system.Profile newProfile = - continuum.getProfileService().getProfile( profile.getId() ); + continuum.getProfileService().getProfile( profile.getId() ); continuum.getProfileService().updateProfile( populateProfile( profile, newProfile ) ); return 0; @@ -976,9 +944,9 @@ try { org.apache.maven.continuum.model.system.Installation newInstallation = - new org.apache.maven.continuum.model.system.Installation(); - return populateInstallation( continuum.getInstallationService().add( - populateInstallation( installation, newInstallation ) ) ); + new org.apache.maven.continuum.model.system.Installation(); + return populateInstallation( + continuum.getInstallationService().add( populateInstallation( installation, newInstallation ) ) ); } catch ( InstallationException e ) { @@ -992,7 +960,7 @@ try { final org.apache.maven.continuum.model.system.Installation newInst = - continuum.getInstallationService().getInstallation( installation.getInstallationId() ); + continuum.getInstallationService().getInstallation( installation.getInstallationId() ); continuum.getInstallationService().update( populateInstallation( installation, newInst ) ); return 0; } @@ -1008,7 +976,7 @@ try { org.apache.maven.continuum.model.system.Installation installationTODelete = - continuum.getInstallationService().getInstallation( installationId ); + continuum.getInstallationService().getInstallation( installationId ); continuum.getInstallationService().delete( installationTODelete ); return 0; } @@ -1060,21 +1028,21 @@ throws ContinuumException { try - { + { Map> buildTasks = parallelBuildsManager.getProjectsInBuildQueues(); Set keys = buildTasks.keySet(); List convertedTasks = new ArrayList(); - - for( String key : keys ) + + for ( String key : keys ) { List tasks = buildTasks.get( key ); - for( Task task : tasks ) + for ( Task task : tasks ) { - convertedTasks.add( ( org.apache.continuum.taskqueue.BuildProjectTask ) task ); + convertedTasks.add( (org.apache.continuum.taskqueue.BuildProjectTask) task ); } } - + return populateBuildProjectTaskList( convertedTasks ); } catch ( BuildManagerException e ) @@ -1087,9 +1055,9 @@ throws ContinuumException { checkManageQueuesAuthorization(); - + parallelBuildsManager.removeProjectsFromBuildQueue( projectsId ); - + return 0; } @@ -1114,7 +1082,8 @@ public ContinuumReleaseResult getReleaseResult( int releaseId ) throws ContinuumException { - org.apache.continuum.model.release.ContinuumReleaseResult releaseResult = continuum.getContinuumReleaseResult( releaseId ); + org.apache.continuum.model.release.ContinuumReleaseResult releaseResult = + continuum.getContinuumReleaseResult( releaseId ); checkViewProjectGroupAuthorization( getProjectGroupName( releaseResult.getProjectGroup().getId() ) ); return populateReleaseResult( releaseResult ); } @@ -1124,7 +1093,7 @@ { checkViewProjectGroupAuthorization( getProjectGroupName( projectGroupId ) ); Collection releaseResults = continuum.getContinuumReleaseResultsByProjectGroup( projectGroupId ); - + List r = new ArrayList(); for ( Object releaseResult : releaseResults ) { @@ -1144,7 +1113,8 @@ public String getReleaseOutput( int releaseId ) throws ContinuumException { - org.apache.continuum.model.release.ContinuumReleaseResult releaseResult = continuum.getContinuumReleaseResult( releaseId ); + org.apache.continuum.model.release.ContinuumReleaseResult releaseResult = + continuum.getContinuumReleaseResult( releaseId ); checkViewProjectGroupAuthorization( getProjectGroupName( releaseResult.getProjectGroup().getId() ) ); return continuum.getReleaseOutput( releaseId ); @@ -1158,13 +1128,13 @@ throws ContinuumException { checkManagePurgingAuthorization(); - + try { - org.apache.continuum.model.repository.RepositoryPurgeConfiguration newPurge = + org.apache.continuum.model.repository.RepositoryPurgeConfiguration newPurge = new org.apache.continuum.model.repository.RepositoryPurgeConfiguration(); return populateRepositoryPurgeConfiguration( continuum.getPurgeConfigurationService(). - addRepositoryPurgeConfiguration( populateRepositoryPurgeConfiguration( repoPurge, newPurge ) ) ); + addRepositoryPurgeConfiguration( populateRepositoryPurgeConfiguration( repoPurge, newPurge ) ) ); } catch ( RepositoryServiceException e ) { @@ -1180,12 +1150,13 @@ throws ContinuumException { checkManagePurgingAuthorization(); - + try { - org.apache.continuum.model.repository.RepositoryPurgeConfiguration purge = + org.apache.continuum.model.repository.RepositoryPurgeConfiguration purge = new org.apache.continuum.model.repository.RepositoryPurgeConfiguration(); - continuum.getPurgeConfigurationService().updateRepositoryPurgeConfiguration( populateRepositoryPurgeConfiguration( repoPurge, purge ) ); + continuum.getPurgeConfigurationService().updateRepositoryPurgeConfiguration( + populateRepositoryPurgeConfiguration( repoPurge, purge ) ); return 0; } catch ( RepositoryServiceException e ) @@ -1205,7 +1176,7 @@ try { - org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurge = + org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurge = continuum.getPurgeConfigurationService().getRepositoryPurgeConfiguration( repoPurgeId ); continuum.getPurgeConfigurationService().removeRepositoryPurgeConfiguration( repoPurge ); return 0; @@ -1223,7 +1194,7 @@ try { - org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig = + org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig = continuum.getPurgeConfigurationService().getRepositoryPurgeConfiguration( repoPurgeId ); return populateRepositoryPurgeConfiguration( repoPurgeConfig ); } @@ -1238,11 +1209,12 @@ { checkManagePurgingAuthorization(); Collection repoPurgeConfigs = continuum.getPurgeConfigurationService().getAllRepositoryPurgeConfigurations(); - + List r = new ArrayList(); for ( Object repoPurgeConfig : repoPurgeConfigs ) { - r.add( populateRepositoryPurgeConfiguration( ( org.apache.continuum.model.repository.RepositoryPurgeConfiguration ) repoPurgeConfig ) ); + r.add( populateRepositoryPurgeConfiguration( + (org.apache.continuum.model.repository.RepositoryPurgeConfiguration) repoPurgeConfig ) ); } return r; } @@ -1257,7 +1229,7 @@ org.apache.continuum.model.repository.DirectoryPurgeConfiguration newPurge = new org.apache.continuum.model.repository.DirectoryPurgeConfiguration(); return populateDirectoryPurgeConfiguration( continuum.getPurgeConfigurationService(). - addDirectoryPurgeConfiguration( populateDirectoryPurgeConfiguration( dirPurge, newPurge ) ) ); + addDirectoryPurgeConfiguration( populateDirectoryPurgeConfiguration( dirPurge, newPurge ) ) ); } catch ( RepositoryServiceException e ) { @@ -1278,7 +1250,8 @@ { org.apache.continuum.model.repository.DirectoryPurgeConfiguration purge = new org.apache.continuum.model.repository.DirectoryPurgeConfiguration(); - continuum.getPurgeConfigurationService().updateDirectoryPurgeConfiguration( populateDirectoryPurgeConfiguration( dirPurge, purge ) ); + continuum.getPurgeConfigurationService().updateDirectoryPurgeConfiguration( + populateDirectoryPurgeConfiguration( dirPurge, purge ) ); return 0; } catch ( RepositoryServiceException e ) @@ -1295,7 +1268,7 @@ throws ContinuumException { checkManagePurgingAuthorization(); - + try { org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurge = @@ -1316,7 +1289,8 @@ try { - org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig = continuum.getPurgeConfigurationService().getDirectoryPurgeConfiguration( dirPurgeId ); + org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig = + continuum.getPurgeConfigurationService().getDirectoryPurgeConfiguration( dirPurgeId ); return populateDirectoryPurgeConfiguration( dirPurgeConfig ); } catch ( PurgeConfigurationServiceException e ) @@ -1334,11 +1308,12 @@ List d = new ArrayList(); for ( Object dirPurgeConfig : dirPurgeConfigs ) { - d.add( populateDirectoryPurgeConfiguration( ( org.apache.continuum.model.repository.DirectoryPurgeConfiguration ) dirPurgeConfig ) ); + d.add( populateDirectoryPurgeConfiguration( + (org.apache.continuum.model.repository.DirectoryPurgeConfiguration) dirPurgeConfig ) ); } return d; } - + public void purgeLocalRepository( int repoPurgeId ) throws ContinuumException { @@ -1346,7 +1321,8 @@ try { - org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig = continuum.getPurgeConfigurationService().getRepositoryPurgeConfiguration( repoPurgeId ); + org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig = + continuum.getPurgeConfigurationService().getRepositoryPurgeConfiguration( repoPurgeId ); continuum.getPurgeManager().purgeRepository( repoPurgeConfig ); } catch ( PurgeConfigurationServiceException e ) @@ -1366,7 +1342,8 @@ try { - org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig = continuum.getPurgeConfigurationService().getDirectoryPurgeConfiguration( dirPurgeId ); + org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig = + continuum.getPurgeConfigurationService().getDirectoryPurgeConfiguration( dirPurgeId ); continuum.getPurgeManager().purgeDirectory( dirPurgeConfig ); } catch ( PurgeConfigurationServiceException e ) @@ -1391,9 +1368,9 @@ try { org.apache.continuum.model.repository.LocalRepository newRepository = - new org.apache.continuum.model.repository.LocalRepository(); + new org.apache.continuum.model.repository.LocalRepository(); return populateLocalRepository( continuum.getRepositoryService().addLocalRepository( - populateLocalRepository( repository, newRepository ) ) ); + populateLocalRepository( repository, newRepository ) ) ); } catch ( RepositoryServiceException e ) { @@ -1409,7 +1386,7 @@ try { final org.apache.continuum.model.repository.LocalRepository newRepo = - continuum.getRepositoryService().getLocalRepository( repository.getId() ); + continuum.getRepositoryService().getLocalRepository( repository.getId() ); continuum.getRepositoryService().updateLocalRepository( populateLocalRepository( repository, newRepo ) ); return 0; } @@ -1429,7 +1406,7 @@ continuum.getRepositoryService().removeLocalRepository( repositoryId ); return 0; } - catch ( RepositoryServiceException e) + catch ( RepositoryServiceException e ) { throw new ContinuumException( "Can't delete repository", e ); } @@ -1439,14 +1416,14 @@ throws ContinuumException { checkManageRepositoriesAuthorization(); - + try { return populateLocalRepository( continuum.getRepositoryService().getLocalRepository( repositoryId ) ); } catch ( RepositoryServiceException e ) { - throw new ContinuumException( "Error while retrieving repository.", e); + throw new ContinuumException( "Error while retrieving repository.", e ); } } @@ -1509,7 +1486,7 @@ if ( projectSummary.getProjectGroup() != null ) { org.apache.maven.continuum.model.project.ProjectGroup g = - continuum.getProjectGroup( projectSummary.getProjectGroup().getId() ); + continuum.getProjectGroup( projectSummary.getProjectGroup().getId() ); project.setProjectGroup( populateProjectGroupSummary( projectSummary.getProjectGroup(), g ) ); } else @@ -1532,13 +1509,14 @@ return (ProjectNotifier) mapper.map( notifier, ProjectNotifier.class ); } - private ProjectGroupSummary populateProjectGroupSummary( org.apache.maven.continuum.model.project.ProjectGroup group ) + private ProjectGroupSummary populateProjectGroupSummary( + org.apache.maven.continuum.model.project.ProjectGroup group ) { return (ProjectGroupSummary) mapper.map( group, ProjectGroupSummary.class ); } - private org.apache.maven.continuum.model.project.ProjectGroup populateProjectGroupSummary( ProjectGroupSummary group, - org.apache.maven.continuum.model.project.ProjectGroup g ) + private org.apache.maven.continuum.model.project.ProjectGroup populateProjectGroupSummary( + ProjectGroupSummary group, org.apache.maven.continuum.model.project.ProjectGroup g ) { if ( group == null ) { @@ -1555,12 +1533,14 @@ return g; } - private ProjectGroup populateProjectGroupWithAllDetails( org.apache.maven.continuum.model.project.ProjectGroup group ) + private ProjectGroup populateProjectGroupWithAllDetails( + org.apache.maven.continuum.model.project.ProjectGroup group ) { return (ProjectGroup) mapper.map( group, ProjectGroup.class ); } - private BuildResultSummary populateBuildResultSummary( org.apache.maven.continuum.model.project.BuildResult buildResult ) + private BuildResultSummary populateBuildResultSummary( + org.apache.maven.continuum.model.project.BuildResult buildResult ) { return (BuildResultSummary) mapper.map( buildResult, BuildResultSummary.class ); } @@ -1644,8 +1624,8 @@ } if ( buildDef.getSchedule() != null ) { - bd.setSchedule( populateSchedule( buildDef.getSchedule(), continuum.getSchedule( buildDef.getSchedule() - .getId() ) ) ); + bd.setSchedule( + populateSchedule( buildDef.getSchedule(), continuum.getSchedule( buildDef.getSchedule().getId() ) ) ); } else { @@ -1655,7 +1635,8 @@ return bd; } - private BuildDefinitionTemplate populateBuildDefinitionTemplate( org.apache.maven.continuum.model.project.BuildDefinitionTemplate bdt ) + private BuildDefinitionTemplate populateBuildDefinitionTemplate( + org.apache.maven.continuum.model.project.BuildDefinitionTemplate bdt ) { return (BuildDefinitionTemplate) mapper.map( bdt, BuildDefinitionTemplate.class ); } @@ -1702,8 +1683,7 @@ if ( profile.getBuilder() != null ) { final org.apache.maven.continuum.model.system.Installation newBuilder = - continuum.getInstallationService().getInstallation( - profile.getBuilder().getInstallationId() ); + continuum.getInstallationService().getInstallation( profile.getBuilder().getInstallationId() ); newProfile.setBuilder( populateInstallation( profile.getBuilder(), newBuilder ) ); } @@ -1714,8 +1694,7 @@ if ( profile.getJdk() != null ) { final org.apache.maven.continuum.model.system.Installation newJdk = - continuum.getInstallationService().getInstallation( - profile.getJdk().getInstallationId() ); + continuum.getInstallationService().getInstallation( profile.getJdk().getInstallationId() ); newProfile.setJdk( populateInstallation( profile.getJdk(), newJdk ) ); } @@ -1731,7 +1710,7 @@ final Installation varEnv = (Installation) it.next(); final org.apache.maven.continuum.model.system.Installation newInst = - continuum.getInstallationService().getInstallation( varEnv.getInstallationId() ); + continuum.getInstallationService().getInstallation( varEnv.getInstallationId() ); newProfile.getEnvironmentVariables().add( populateInstallation( varEnv, newInst ) ); } @@ -1769,23 +1748,27 @@ return (Installation) mapper.map( install, Installation.class ); } - private SystemConfiguration populateSystemConfiguration( org.apache.maven.continuum.model.system.SystemConfiguration sysConf ) + private SystemConfiguration populateSystemConfiguration( + org.apache.maven.continuum.model.system.SystemConfiguration sysConf ) { return (SystemConfiguration) mapper.map( sysConf, SystemConfiguration.class ); } - private ContinuumReleaseResult populateReleaseResult( org.apache.continuum.model.release.ContinuumReleaseResult releaseResult ) + private ContinuumReleaseResult populateReleaseResult( + org.apache.continuum.model.release.ContinuumReleaseResult releaseResult ) { return (ContinuumReleaseResult) mapper.map( releaseResult, ContinuumReleaseResult.class ); } - private RepositoryPurgeConfiguration populateRepositoryPurgeConfiguration( org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig ) + private RepositoryPurgeConfiguration populateRepositoryPurgeConfiguration( + org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig ) { return (RepositoryPurgeConfiguration) mapper.map( repoPurgeConfig, RepositoryPurgeConfiguration.class ); } - private org.apache.continuum.model.repository.RepositoryPurgeConfiguration populateRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurgeConfig, - org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurge ) + private org.apache.continuum.model.repository.RepositoryPurgeConfiguration populateRepositoryPurgeConfiguration( + RepositoryPurgeConfiguration repoPurgeConfig, + org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurge ) throws RepositoryServiceException, ContinuumException { if ( repoPurgeConfig == null ) @@ -1802,8 +1785,9 @@ repoPurge.setRetentionCount( repoPurgeConfig.getRetentionCount() ); if ( repoPurgeConfig.getRepository() != null ) { - repoPurge.setRepository( populateLocalRepository( repoPurgeConfig.getRepository(), continuum.getRepositoryService(). - getLocalRepository( repoPurgeConfig.getRepository().getId() ) ) ); + repoPurge.setRepository( + populateLocalRepository( repoPurgeConfig.getRepository(), continuum.getRepositoryService(). + getLocalRepository( repoPurgeConfig.getRepository().getId() ) ) ); } else { @@ -1811,8 +1795,8 @@ } if ( repoPurgeConfig.getSchedule() != null ) { - repoPurge.setSchedule( populateSchedule( repoPurgeConfig.getSchedule(), continuum.getSchedule( repoPurgeConfig.getSchedule() - .getId() ) ) ); + repoPurge.setSchedule( populateSchedule( repoPurgeConfig.getSchedule(), + continuum.getSchedule( repoPurgeConfig.getSchedule().getId() ) ) ); } else { @@ -1822,13 +1806,15 @@ return repoPurge; } - private DirectoryPurgeConfiguration populateDirectoryPurgeConfiguration( org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig ) + private DirectoryPurgeConfiguration populateDirectoryPurgeConfiguration( + org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig ) { return (DirectoryPurgeConfiguration) mapper.map( dirPurgeConfig, DirectoryPurgeConfiguration.class ); } - private org.apache.continuum.model.repository.DirectoryPurgeConfiguration populateDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurgeConfig, - org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurge ) + private org.apache.continuum.model.repository.DirectoryPurgeConfiguration populateDirectoryPurgeConfiguration( + DirectoryPurgeConfiguration dirPurgeConfig, + org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurge ) throws RepositoryServiceException, ContinuumException { if ( dirPurgeConfig == null ) @@ -1853,13 +1839,13 @@ { path = continuum.getConfiguration().getBuildOutputDirectory().getAbsolutePath(); } - + dirPurge.setLocation( path ); dirPurge.setRetentionCount( dirPurgeConfig.getRetentionCount() ); if ( dirPurgeConfig.getSchedule() != null ) { - dirPurge.setSchedule( populateSchedule( dirPurgeConfig.getSchedule(), continuum.getSchedule( dirPurgeConfig.getSchedule() - .getId() ) ) ); + dirPurge.setSchedule( populateSchedule( dirPurgeConfig.getSchedule(), + continuum.getSchedule( dirPurgeConfig.getSchedule().getId() ) ) ); } else { @@ -1869,7 +1855,8 @@ return dirPurge; } - private LocalRepository populateLocalRepository( org.apache.continuum.model.repository.LocalRepository localRepository ) + private LocalRepository populateLocalRepository( + org.apache.continuum.model.repository.LocalRepository localRepository ) { return (LocalRepository) mapper.map( localRepository, LocalRepository.class ); } @@ -1888,7 +1875,7 @@ return repo; } - private Map serializeObject( Object o, final String ... ignore ) + private Map serializeObject( Object o, final String... ignore ) { if ( o != null ) { @@ -1900,7 +1887,7 @@ } } - private Map serializeObject( Object o, Class clasz, final String ... ignore ) + private Map serializeObject( Object o, Class clasz, final String... ignore ) { final List ignoreList = ignore == null ? new ArrayList() : Arrays.asList( ignore ); @@ -2089,22 +2076,22 @@ private String serializeObject( Byte o ) { - return (o == null ? null : o.toString()); + return ( o == null ? null : o.toString() ); } private String serializeObject( Character o ) { - return (o == null ? null : o.toString()); + return ( o == null ? null : o.toString() ); } private Double serializeObject( Long o ) { - return (o == null ? null : o.doubleValue()); + return ( o == null ? null : o.doubleValue() ); } private Double serializeObject( Float o ) { - return (o == null ? null : o.doubleValue()); + return ( o == null ? null : o.doubleValue() ); } private Double serializeObject( Double o ) @@ -2287,12 +2274,6 @@ return o; } - public Map addAntProjectRPC( Map project ) - throws Exception - { - return serializeObject( this.addAntProject( (ProjectSummary) unserializeObject( project ) ) ); - } - public Map addAntProjectRPC( Map project, int projectGroupId ) throws Exception { @@ -2302,21 +2283,15 @@ public Map addBuildDefinitionToProjectGroupRPC( int projectGroupId, Map buildDef ) throws Exception { - return serializeObject( this.addBuildDefinitionToProjectGroup( projectGroupId, - (BuildDefinition) unserializeObject( buildDef ) ) ); + return serializeObject( + this.addBuildDefinitionToProjectGroup( projectGroupId, (BuildDefinition) unserializeObject( buildDef ) ) ); } public Map addBuildDefinitionToProjectRPC( int projectId, Map buildDef ) throws Exception { - return serializeObject( this.addBuildDefinitionToProject( projectId, - (BuildDefinition) unserializeObject( buildDef ) ) ); - } - - public Map addMavenOneProjectRPC( String url ) - throws Exception - { - return serializeObject( this.addMavenOneProject( url ) ); + return serializeObject( + this.addBuildDefinitionToProject( projectId, (BuildDefinition) unserializeObject( buildDef ) ) ); } public Map addMavenOneProjectRPC( String url, int projectGroupId ) @@ -2355,12 +2330,6 @@ return serializeObject( this.addShellProject( (ProjectSummary) unserializeObject( project ), projectGroupId ) ); } - public Map addShellProjectRPC( Map project ) - throws Exception - { - return serializeObject( this.addShellProject( (ProjectSummary) unserializeObject( project ) ) ); - } - public List getAllProjectGroupsRPC() throws Exception { @@ -2493,18 +2462,20 @@ return serializeObject( this.removeBuildResult( (BuildResult) unserializeObject( br ) ) ); } - public Map updateBuildDefinitionForProjectGroupRPC( int projectGroupId, Map buildDef ) + public Map updateBuildDefinitionForProjectGroupRPC( int projectGroupId, + Map buildDef ) throws Exception { return serializeObject( this.updateBuildDefinitionForProjectGroup( projectGroupId, - (BuildDefinition) unserializeObject( buildDef ) ) ); + (BuildDefinition) unserializeObject( + buildDef ) ) ); } public Map updateBuildDefinitionForProjectRPC( int projectId, Map buildDef ) throws Exception { - return serializeObject( this.updateBuildDefinitionForProject( projectId, - (BuildDefinition) unserializeObject( buildDef ) ) ); + return serializeObject( + this.updateBuildDefinitionForProject( projectId, (BuildDefinition) unserializeObject( buildDef ) ) ); } public Map updateProjectRPC( Map project ) @@ -2540,8 +2511,8 @@ public Map updateGroupNotifierRPC( int projectgroupid, Map newNotifier ) throws Exception { - return serializeObject( this.updateGroupNotifier( projectgroupid, - (ProjectNotifier) unserializeObject( newNotifier ) ) ); + return serializeObject( + this.updateGroupNotifier( projectgroupid, (ProjectNotifier) unserializeObject( newNotifier ) ) ); } public Map updateNotifierRPC( int projectid, Map newNotifier ) @@ -2553,8 +2524,8 @@ public Map addGroupNotifierRPC( int projectgroupid, Map newNotifier ) throws Exception { - return serializeObject( this.addGroupNotifier( projectgroupid, - (ProjectNotifier) unserializeObject( newNotifier ) ) ); + return serializeObject( + this.addGroupNotifier( projectgroupid, (ProjectNotifier) unserializeObject( newNotifier ) ) ); } public Map addNotifierRPC( int projectid, Map newNotifier ) @@ -2587,7 +2558,7 @@ return this.updateProfile( (Profile) unserializeObject( profile ) ); } - public Map getReleaseResultRPC( int releaseId ) + public Map getReleaseResultRPC( int releaseId ) throws Exception { return serializeObject( this.getReleaseResult( releaseId ) ); @@ -2608,13 +2579,15 @@ public Map addRepositoryPurgeConfigurationRPC( Map repoPurge ) throws Exception { - return serializeObject( this.addRepositoryPurgeConfiguration( (RepositoryPurgeConfiguration) unserializeObject( repoPurge ) ) ); + return serializeObject( + this.addRepositoryPurgeConfiguration( (RepositoryPurgeConfiguration) unserializeObject( repoPurge ) ) ); } public int updateRepositoryPurgeConfigurationRPC( Map repoPurge ) throws Exception { - return serializeObject( this.updateRepositoryPurgeConfiguration( (RepositoryPurgeConfiguration) unserializeObject( repoPurge ) ) ); + return serializeObject( + this.updateRepositoryPurgeConfiguration( (RepositoryPurgeConfiguration) unserializeObject( repoPurge ) ) ); } public Map getRepositoryPurgeConfigurationRPC( int repoPurgeId ) @@ -2632,13 +2605,15 @@ public Map addDirectoryPurgeConfigurationRPC( Map dirPurge ) throws Exception { - return serializeObject( this.addDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) unserializeObject( dirPurge ) ) ); + return serializeObject( + this.addDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) unserializeObject( dirPurge ) ) ); } public int updateDirectoryPurgeConfigurationRPC( Map dirPurge ) throws Exception { - return serializeObject( this.updateDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) unserializeObject( dirPurge ) ) ); + return serializeObject( + this.updateDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) unserializeObject( dirPurge ) ) ); } public Map getDirectoryPurgeConfigurationRPC( int dirPurgeId ) Modified: continuum/trunk/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractAddProject.java URL: http://svn.apache.org/viewvc/continuum/trunk/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractAddProject.java?rev=760328&r1=760327&r2=760328&view=diff ============================================================================== --- continuum/trunk/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractAddProject.java (original) +++ continuum/trunk/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AbstractAddProject.java Tue Mar 31 04:55:00 2009 @@ -119,14 +119,7 @@ } else { - if ( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR.equals( getProjectType() ) ) - { - getClient().addAntProject( project ); - } - else - { - getClient().addShellProject( project ); - } + throw new Exception( "Can't add a project with an empty project group." ); } } catch ( Exception e ) Modified: continuum/trunk/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenOneProject.java URL: http://svn.apache.org/viewvc/continuum/trunk/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenOneProject.java?rev=760328&r1=760327&r2=760328&view=diff ============================================================================== --- continuum/trunk/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenOneProject.java (original) +++ continuum/trunk/maven-continuum-plugin/src/main/java/org/apache/maven/continuum/plugin/AddMavenOneProject.java Tue Mar 31 04:55:00 2009 @@ -58,7 +58,7 @@ } else { - getClient().addMavenOneProject( projectUrl ); + throw new Exception( "Can't add a project with an empty project group." ); } } catch ( Exception e )