index
int64
0
0
repo_id
stringlengths
9
205
file_path
stringlengths
31
246
content
stringlengths
1
12.2M
__index_level_0__
int64
0
10k
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/initialization/ContinuumInitializationException.java
package org.apache.maven.continuum.initialization; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> */ public class ContinuumInitializationException extends Exception { private static final long serialVersionUID = 7629046230318917696L; public ContinuumInitializationException( String message ) { super( message ); } public ContinuumInitializationException( Throwable cause ) { super( cause ); } public ContinuumInitializationException( String message, Throwable cause ) { super( message, cause ); } }
5,300
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/initialization/ContinuumInitializer.java
package org.apache.maven.continuum.initialization; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> */ public interface ContinuumInitializer { String DEFAULT_PROJECT_GROUP_GROUP_ID = "default"; String ROLE = ContinuumInitializer.class.getName(); void initialize() throws ContinuumInitializationException; }
5,301
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/project
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilder.java
package org.apache.maven.continuum.project.builder; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.BuildDefinitionTemplate; import java.net.URL; /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public interface ContinuumProjectBuilder { String ROLE = ContinuumProjectBuilder.class.getName(); ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException; ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password, boolean recursiveProjects, boolean checkoutInSingleDirectory ) throws ContinuumProjectBuilderException; ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password, boolean recursiveProjects, BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory ) throws ContinuumProjectBuilderException; ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password, boolean recursiveProjects, BuildDefinitionTemplate buildDefinitionTemplate, boolean checkoutInSingleDirectory, int projectGroupId ) throws ContinuumProjectBuilderException; BuildDefinitionTemplate getDefaultBuildDefinitionTemplate() throws ContinuumProjectBuilderException; }
5,302
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/project
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
package org.apache.maven.continuum.project.builder; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.Project; import org.apache.maven.continuum.model.project.ProjectGroup; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Holder for results of adding projects to Continuum. Contains added projects, project groups * and errors that happened during the add. * * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a> */ public class ContinuumProjectBuildingResult { public static final String ERROR_MALFORMED_URL = "add.project.malformed.url.error"; public static final String ERROR_UNKNOWN_HOST = "add.project.unknown.host.error"; public static final String ERROR_CONNECT = "add.project.connect.error"; public static final String ERROR_XML_PARSE = "add.project.xml.parse.error"; public static final String ERROR_EXTEND = "add.project.extend.error"; public static final String ERROR_MISSING_GROUPID = "add.project.missing.groupid.error"; public static final String ERROR_MISSING_ARTIFACTID = "add.project.missing.artifactid.error"; public static final String ERROR_POM_NOT_FOUND = "add.project.missing.pom.error"; public static final String ERROR_MISSING_VERSION = "add.project.missing.version.error"; public static final String ERROR_MISSING_NAME = "add.project.missing.name.error"; public static final String ERROR_MISSING_REPOSITORY = "add.project.missing.repository.error"; public static final String ERROR_MISSING_SCM = "add.project.missing.scm.error"; public static final String ERROR_MISSING_SCM_CONNECTION = "add.project.missing.scm.connection.error"; public static final String ERROR_MISSING_NOTIFIER_TYPE = "add.project.missing.notifier.type.error"; public static final String ERROR_MISSING_NOTIFIER_CONFIGURATION = "add.project.missing.notifier.configuration.error"; public static final String ERROR_METADATA_TRANSFER = "add.project.metadata.transfer.error"; public static final String ERROR_VALIDATION = "add.project.validation.error"; public static final String ERROR_UNAUTHORIZED = "add.project.unauthorized.error"; public static final String ERROR_PROTOCOL_NOT_ALLOWED = "add.project.validation.protocol.not_allowed"; public static final String ERROR_ARTIFACT_NOT_FOUND = "add.project.artifact.not.found.error"; public static final String ERROR_PROJECT_BUILDING = "add.project.project.building.error"; public static final String ERROR_UNKNOWN = "add.project.unknown.error"; public static final String ERROR_DUPLICATE_PROJECTS = "add.project.duplicate.error"; private final List<Project> projects = new ArrayList<Project>(); private final List<ProjectGroup> projectGroups = new ArrayList<ProjectGroup>(); private final Map<String, String> errors = new HashMap<String, String>(); private static final String LS = System.getProperty( "line.separator" ); private Project rootProject; public void addProject( Project project ) { projects.add( project ); } public void addProjectGroup( ProjectGroup projectGroup ) { projectGroups.add( projectGroup ); } public void addProject( Project project, String executorId ) { project.setExecutorId( executorId ); projects.add( project ); } public List<Project> getProjects() { return projects; } public List<ProjectGroup> getProjectGroups() { return projectGroups; } /** * Add a warning that happened during adding the project to Continuum. * * @param warningKey warning id (so it can be internationalized later) * @deprecated Use {@link #addError(String)} instead */ public void addWarning( String warningKey ) { addError( warningKey ); } /** * Add an error that happened during adding the project to Continuum. * * @param errorKey error id (so it can be internationalized later) */ public void addError( String errorKey ) { errors.put( errorKey, "" ); } /** * Add an error that happened during adding the project to Continuum. * * @param errorKey error id (so it can be internationalized later) */ public void addError( String errorKey, Object param ) { errors.put( errorKey, param == null ? "" : param.toString() ); } /** * Add an error that happened during adding the project to Continuum. * * @param errorKey error id (so it can be internationalized later) */ public void addError( String errorKey, Object params[] ) { if ( params != null ) { errors.put( errorKey, Arrays.asList( params ).toString() ); } } /** * Get the warnings that happened during adding the project to Continuum. * There is an entry with the warning key (so it can be internationalized later) for each warning. * * @return {@link List} &lt; {@link String} > * @deprecated Use {@link #getErrors()} instead */ public List<String> getWarnings() { return getErrors(); } /** * Get the errors that happened during adding the project to Continuum. * There is an entry with the error key (so it can be internationalized later) for each error. * * @return {@link List} &lt; {@link String} > */ public List<String> getErrors() { return new ArrayList<String>( errors.keySet() ); } public Map<String, String> getErrorsWithCause() { return errors; } /** * Quick check to see if there are any errors. * * @return boolean indicating if there are any errors. */ public boolean hasErrors() { return ( errors != null ) && ( !errors.isEmpty() ); } /** * Returns a string representation of the errors. * * @return a string representation of the errors. */ public String getErrorsAsString() { if ( !hasErrors() ) { return null; } StringBuilder message = new StringBuilder(); for ( String key : errors.keySet() ) { message.append( errors.get( key ) ); message.append( LS ); } return message.toString(); } public Project getRootProject() { return rootProject; } public void setRootProject( Project rootProject ) { this.rootProject = rootProject; } }
5,303
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/project
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuilderException.java
package org.apache.maven.continuum.project.builder; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class ContinuumProjectBuilderException extends Exception { private static final long serialVersionUID = 2666582644236201183L; public ContinuumProjectBuilderException( String message ) { super( message ); } public ContinuumProjectBuilderException( String message, Throwable cause ) { super( message, cause ); } }
5,304
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileService.java
package org.apache.maven.continuum.profile; import org.apache.maven.continuum.model.system.Installation; import org.apache.maven.continuum.model.system.Profile; import java.util.List; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:olamy@codehaus.org">olamy</a> * @since 15 juin 07 */ public interface ProfileService { String ROLE = ProfileService.class.getName(); public Profile getProfile( int profileId ) throws ProfileException; public void deleteProfile( int profileId ) throws ProfileException; /** * @param profile * @throws ProfileException * @throws AlreadyExistsProfileException if a profile with the same name already exists */ public void updateProfile( Profile profile ) throws ProfileException, AlreadyExistsProfileException; /** * <b>Add an empty profile without builder, jdk and envVars</b> * * @param profile * @return * @throws ProfileException * @throws AlreadyExistsProfileException if a profile with the same name already exists */ public Profile addProfile( Profile profile ) throws ProfileException, AlreadyExistsProfileException; public List<Profile> getAllProfiles() throws ProfileException; public void setJdkInProfile( Profile profile, Installation jdk ) throws ProfileException; public void setBuilderInProfile( Profile profile, Installation builder ) throws ProfileException; public void addEnvVarInProfile( Profile profile, Installation envVar ) throws ProfileException; public void addInstallationInProfile( Profile profile, Installation installation ) throws ProfileException; /** * @param profile * @param installation * @throws ProfileException * @since 1.1-beta-4 */ public void removeInstallationFromProfile( Profile profile, Installation installation ) throws ProfileException; public Profile getProfileWithName( String profileName ) throws ProfileException; public boolean alreadyExistsProfileName( Profile profile ) throws ProfileException; }
5,305
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileException.java
package org.apache.maven.continuum.profile; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.ContinuumException; /** * @author <a href="mailto:olamy@codehaus.org">olamy</a> * @since 15 juin 07 */ public class ProfileException extends ContinuumException { private static final long serialVersionUID = 7775067763191224320L; public ProfileException( String message, Throwable throwable ) { super( message, throwable ); } public ProfileException( String message ) { super( message ); } }
5,306
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/profile/AlreadyExistsProfileException.java
package org.apache.maven.continuum.profile; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.ContinuumException; /** * @author <a href="mailto:olamy@apache.org">olamy</a> * @since 1.2 */ public class AlreadyExistsProfileException extends ContinuumException { private static final long serialVersionUID = -3827218055154032672L; /** * @param message */ public AlreadyExistsProfileException( String message ) { super( message ); } /** * @param message * @param cause */ public AlreadyExistsProfileException( String message, Throwable cause ) { super( message, cause ); } }
5,307
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildCancelledException.java
package org.apache.maven.continuum.execution; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class ContinuumBuildCancelledException extends ContinuumBuildExecutorException { private static final long serialVersionUID = 6658199253278756183L; public ContinuumBuildCancelledException( String message ) { super( message ); } public ContinuumBuildCancelledException( String message, Throwable cause ) { super( message, cause ); } }
5,308
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
package org.apache.maven.continuum.execution; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:olamy at apache.org">olamy</a> * @since 11 sept. 07 */ public class ContinuumBuildExecutorConstants { public static final String MAVEN_TWO_BUILD_EXECUTOR = "maven2"; public static final String MAVEN_ONE_BUILD_EXECUTOR = "maven-1"; public static final String ANT_BUILD_EXECUTOR = "ant"; public static final String SHELL_BUILD_EXECUTOR = "shell"; /** * Determines whether the executor type is an m1 or m2 build. * * @param type * @return true if the excutor type will result in a maven 1 or 2+ build. */ public static boolean isMaven( String type ) { return MAVEN_ONE_BUILD_EXECUTOR.equals( type ) || MAVEN_TWO_BUILD_EXECUTOR.equals( type ); } }
5,309
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/execution/ExecutorConfigurator.java
package org.apache.maven.continuum.execution; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:olamy@codehaus.org">olamy</a> * @since 19 juin 07 */ public class ExecutorConfigurator { private String executable; private String relativePath; private String envVar; private String versionArgument; public ExecutorConfigurator() { // nothing } public ExecutorConfigurator( String executable, String relativePath, String envVar, String versionArgument ) { this.executable = executable; this.relativePath = relativePath; this.envVar = envVar; this.versionArgument = versionArgument; } /** * @return mvn for maven2 ExecutorConfigurator */ public String getExecutable() { return executable; } public void setExecutable( String executable ) { this.executable = executable; } /** * @return bin for maven2 ExecutorConfigurator */ public String getRelativePath() { return relativePath; } public void setRelativePath( String relativePath ) { this.relativePath = relativePath; } /** * @return M2_HOME for maven2 ExecutorConfigurator */ public String getEnvVar() { return envVar; } public void setEnvVar( String envVar ) { this.envVar = envVar; } /** * @return the versionArgument */ public String getVersionArgument() { return versionArgument; } /** * @param versionArgument the versionArgument to set */ public void setVersionArgument( String versionArgument ) { this.versionArgument = versionArgument; } }
5,310
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
package org.apache.maven.continuum.execution; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.artifact.Artifact; import org.apache.maven.continuum.model.project.BuildDefinition; import org.apache.maven.continuum.model.project.Project; import org.apache.maven.continuum.model.scm.ChangeSet; import org.apache.maven.continuum.model.scm.ScmResult; import java.io.File; import java.util.List; /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public interface ContinuumBuildExecutor { String ROLE = ContinuumBuildExecutor.class.getName(); // TODO: stream the build output ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput, List<Project> projectsWithCommonScmRoot, String projectScmRootUrl ) throws ContinuumBuildExecutorException; // TODO: rename to be clearer void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition, ScmResult scmResult ) throws ContinuumBuildExecutorException; boolean isBuilding( Project project ); void killProcess( Project project ); // TODO: are these part of the builder interface, or a separate project/build definition interface? List<Artifact> getDeployableArtifacts( Project project, File workingDirectory, BuildDefinition buildDefinition ) throws ContinuumBuildExecutorException; //TODO: Move as a plugin void backupTestFiles( Project project, int buildId, String projectScmRootUrl, List<Project> projectsWithCommonScmRoot ); boolean shouldBuild( List<ChangeSet> changes, Project continuumProject, File workingDirectory, BuildDefinition buildDefinition ) throws ContinuumBuildExecutorException; }
5,311
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorException.java
package org.apache.maven.continuum.execution; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class ContinuumBuildExecutorException extends Exception { private static final long serialVersionUID = 8536807061085844707L; public ContinuumBuildExecutorException( String message ) { super( message ); } public ContinuumBuildExecutorException( String message, Throwable cause ) { super( message, cause ); } }
5,312
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutionResult.java
package org.apache.maven.continuum.execution; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 java.io.File; /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class ContinuumBuildExecutionResult { private final File output; private final int exitCode; public ContinuumBuildExecutionResult( File output, int exitCode ) { this.output = output; this.exitCode = exitCode; } public File getOutput() { return output; } public int getExitCode() { return exitCode; } }
5,313
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/execution/SettingsConfigurationException.java
package org.apache.maven.continuum.execution; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * If there was an error in the settings file. * * @author <a href="mailto:brett@apache.org">Brett Porter</a> */ public class SettingsConfigurationException extends Exception { private int lineNumber; private int columnNumber; public SettingsConfigurationException( String message ) { super( message ); } public SettingsConfigurationException( String message, Throwable cause ) { super( message, cause ); } public SettingsConfigurationException( String message, Throwable cause, int lineNumber, int columnNumber ) { super( message + ( lineNumber > 0 ? "\n Line: " + lineNumber : "" ) + ( columnNumber > 0 ? "\n Column: " + columnNumber : "" ), cause ); this.lineNumber = lineNumber; this.columnNumber = columnNumber; } public int getColumnNumber() { return columnNumber; } public int getLineNumber() { return lineNumber; } }
5,314
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionUpdatePolicyConstants.java
package org.apache.maven.continuum.builddefinition; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author Jose Morales Martinez */ public class BuildDefinitionUpdatePolicyConstants { public static final int UPDATE_DESCRIPTION_ALWAYS = 0; public static final int UPDATE_DESCRIPTION_NEVER = 1; public static final int UPDATE_DESCRIPTION_ONLY_FOR_NEW_POM = 2; }
5,315
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionServiceException.java
package org.apache.maven.continuum.builddefinition; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:olamy@apache.org">olamy</a> * @since 15 sept. 07 */ public class BuildDefinitionServiceException extends Exception { private static final long serialVersionUID = -399833410192238226L; /** * */ public BuildDefinitionServiceException() { // nothing } /** * @param message */ public BuildDefinitionServiceException( String message ) { super( message ); } /** * @param cause */ public BuildDefinitionServiceException( Throwable cause ) { super( cause ); } /** * @param message * @param cause */ public BuildDefinitionServiceException( String message, Throwable cause ) { super( message, cause ); } }
5,316
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/builddefinition/BuildDefinitionService.java
package org.apache.maven.continuum.builddefinition; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.BuildDefinition; import org.apache.maven.continuum.model.project.BuildDefinitionTemplate; import org.apache.maven.continuum.model.project.Project; import org.apache.maven.continuum.model.project.ProjectGroup; import org.apache.maven.continuum.store.ContinuumObjectNotFoundException; import java.util.List; /** * @author <a href="mailto:olamy@apache.org">olamy</a> * @since 15 sept. 07 */ public interface BuildDefinitionService { /** * @param buildDefinitionId * @return null if not in store * @throws BuildDefinitionServiceException * */ BuildDefinition getBuildDefinition( int buildDefinitionId ) throws BuildDefinitionServiceException; /** * @return List<BuildDefinition> all build defintions * @throws BuildDefinitionServiceException * */ List<BuildDefinition> getAllBuildDefinitions() throws BuildDefinitionServiceException; BuildDefinition addBuildDefinition( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException; void removeBuildDefinition( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException; void updateBuildDefinition( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException; List<BuildDefinition> getAllTemplates() throws BuildDefinitionServiceException; /** * @param buildDefinition * @return clone of {@link BuildDefinition} template/continuumDefault set to false */ BuildDefinition cloneBuildDefinition( BuildDefinition buildDefinition ); boolean isBuildDefinitionInUse( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException; // ------------------------------------------------------ // BuildDefinitionTemplate // ------------------------------------------------------ void addTemplateInProject( int buildDefinitionTemplateId, Project project ) throws BuildDefinitionServiceException; List<BuildDefinitionTemplate> getAllBuildDefinitionTemplate() throws BuildDefinitionServiceException; BuildDefinitionTemplate getBuildDefinitionTemplate( int id ) throws BuildDefinitionServiceException; BuildDefinitionTemplate addBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate ) throws BuildDefinitionServiceException; BuildDefinitionTemplate updateBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate ) throws BuildDefinitionServiceException; void removeBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate ) throws BuildDefinitionServiceException; public BuildDefinitionTemplate addBuildDefinitionInTemplate( BuildDefinitionTemplate buildDefinitionTemplate, BuildDefinition buildDefinition, boolean template ) throws BuildDefinitionServiceException; BuildDefinitionTemplate removeBuildDefinitionFromTemplate( BuildDefinitionTemplate buildDefinitionTemplate, BuildDefinition buildDefinition ) throws BuildDefinitionServiceException; public BuildDefinitionTemplate getDefaultAntBuildDefinitionTemplate() throws BuildDefinitionServiceException; public BuildDefinitionTemplate getDefaultMavenOneBuildDefinitionTemplate() throws BuildDefinitionServiceException; public BuildDefinitionTemplate getDefaultMavenTwoBuildDefinitionTemplate() throws BuildDefinitionServiceException; public BuildDefinitionTemplate getDefaultShellBuildDefinitionTemplate() throws BuildDefinitionServiceException; public BuildDefinitionTemplate getContinuumDefaultWithType( String type ) throws BuildDefinitionServiceException; public List<BuildDefinitionTemplate> getBuildDefinitionTemplatesWithType( String type ) throws BuildDefinitionServiceException; public ProjectGroup addBuildDefinitionTemplateToProjectGroup( int projectGroupId, BuildDefinitionTemplate buildDefinitionTemplate ) throws BuildDefinitionServiceException, ContinuumObjectNotFoundException; public List<BuildDefinitionTemplate> getContinuumBuildDefinitionTemplates() throws BuildDefinitionServiceException; }
5,317
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/build/BuildException.java
package org.apache.maven.continuum.build; import org.apache.maven.continuum.ContinuumException; import java.util.MissingResourceException; import java.util.ResourceBundle; /** * Represents an exceptional build condition. */ public class BuildException extends ContinuumException { private String key; public BuildException( String message, String key ) { super( message ); this.key = key; } @Override public String getLocalizedMessage() { try { return ResourceBundle.getBundle( "localization/Continuum" ).getString( key ); } catch ( MissingResourceException mre ) { return getMessage(); } } }
5,318
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/build
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/build/settings/SchedulesActivationException.java
package org.apache.maven.continuum.build.settings; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> */ public class SchedulesActivationException extends Exception { /** * */ private static final long serialVersionUID = -7901082128754563858L; public SchedulesActivationException( String message ) { super( message ); } public SchedulesActivationException( Throwable cause ) { super( cause ); } public SchedulesActivationException( String message, Throwable cause ) { super( message, cause ); } }
5,319
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/build
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/build/settings/SchedulesActivator.java
package org.apache.maven.continuum.build.settings; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.Continuum; import org.apache.maven.continuum.model.project.Schedule; /** * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> */ public interface SchedulesActivator { String ROLE = SchedulesActivator.class.getName(); /** * Grab all the stored {@link org.apache.maven.continuum.model.project.Schedule} objects * and activate them by looking at the scheduling information contained within and submitting a * Job to the scheduler. * * @throws SchedulesActivationException */ void activateSchedules( Continuum continuum ) throws SchedulesActivationException; /** * Activate schedule by looking at the scheduling information contained within and submitting a * Job to the scheduler. * * @throws SchedulesActivationException */ void activateSchedule( Schedule schedule, Continuum continuum ) throws SchedulesActivationException; /** * Activate schedule only for PurgeConfiguration associated. * * @throws SchedulesActivationException */ void activatePurgeSchedule( Schedule schedule, Continuum continuum ) throws SchedulesActivationException; /** * Activate schedule only for BuildDefinitions associated. * * @throws SchedulesActivationException */ void activateBuildSchedule( Schedule schedule, Continuum continuum ) throws SchedulesActivationException; /** * Unactivate schedule by looking at the scheduling information contained within. * * @throws SchedulesActivationException */ void unactivateSchedule( Schedule schedule, Continuum continuum ) throws SchedulesActivationException; /** * Unactivate schedule purgeConfigurations if it is not in a purgeConfiguration. */ void unactivateOrphanPurgeSchedule( Schedule schedule ) throws SchedulesActivationException; /** * Unactivate schedule buildDefinitions if it is not in a buildDefinition. * * @throws SchedulesActivationException */ void unactivateOrphanBuildSchedule( Schedule schedule ) throws SchedulesActivationException; }
5,320
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStoreException.java
package org.apache.maven.continuum.store; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class ContinuumStoreException extends Exception { private static final long serialVersionUID = 5183507100399672781L; public ContinuumStoreException( String msg ) { super( msg ); } public ContinuumStoreException( String msg, Exception ex ) { super( msg, ex ); } }
5,321
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumObjectNotFoundException.java
package org.apache.maven.continuum.store; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class ContinuumObjectNotFoundException extends ContinuumStoreException { private static final long serialVersionUID = 6022595625968612620L; public ContinuumObjectNotFoundException( String message ) { super( message ); } public ContinuumObjectNotFoundException( String type, String id ) { this( "Could not find object. Type '" + type + "'. Id: '" + id + "'." ); } }
5,322
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java
package org.apache.continuum.taskqueue; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.utils.build.BuildTrigger; import org.codehaus.plexus.taskqueue.TaskQueue; import org.codehaus.plexus.taskqueue.TaskQueueException; import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor; import java.util.List; /** * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a> */ public interface OverallBuildQueue { /** * Returns the id of the "overall" build queue * * @return */ int getId(); void setId( int id ); /** * Returns the name of the "overall" build queue * * @return */ String getName(); void setName( String name ); /* Checkout Queue */ /** * Returns the checkout queue. * * @return */ TaskQueue getCheckoutQueue(); /** * Add checkout task to checkout queue. * * @param checkoutTask * @throws TaskQueueException TODO */ void addToCheckoutQueue( CheckOutTask checkoutTask ) throws TaskQueueException; /** * Add checkout tasks to checkout queue. * * @param checkoutTasks * @throws TaskQueueException TODO */ void addToCheckoutQueue( List<CheckOutTask> checkoutTasks ) throws TaskQueueException; /** * Get all checkout tasks in checkout queue. * * @return * @throws TaskQueueException TODO */ List<CheckOutTask> getProjectsInCheckoutQueue() throws TaskQueueException; /** * Check if the project is in the checkout queue. * * @param projectId * @return * @throws TaskQueueException TODO */ boolean isInCheckoutQueue( int projectId ) throws TaskQueueException; /** * Cancel checkout of project. * * @param projectId * @throws TaskQueueException */ void cancelCheckoutTask( int projectId ) throws TaskQueueException; /** * Cancel current checkout. * * @return TODO */ boolean cancelCurrentCheckout(); /** * Remove project from checkout queue. * * @param projectId * @return * @throws TaskQueueException TODO */ boolean removeProjectFromCheckoutQueue( int projectId ) throws TaskQueueException; /** * Remove the specified projects in the checkout queue. * * @param projectId * @return * @throws TaskQueueException TODO */ boolean removeProjectsFromCheckoutQueue( int[] projectId ) throws TaskQueueException; /** * @param hashCodes * @throws TaskQueueException TODO */ void removeTasksFromCheckoutQueueWithHashCodes( int[] hashCodes ) throws TaskQueueException; /* Prepare Build Queue */ /** * Returns the prepare build queue. * * @return */ TaskQueue getPrepareBuildQueue(); /** * Add the prepare build task to the prepare build queue. * * @param prepareBuildTask * @throws Exception */ void addToPrepareBuildQueue( PrepareBuildProjectsTask prepareBuildTask ) throws TaskQueueException; /** * Add the prepare build tasks to the prepare build queue. * * @param prepareBuildTasks * @throws TaskQueueException TODO */ void addToPrepareBuildQueue( List<PrepareBuildProjectsTask> prepareBuildTasks ) throws TaskQueueException; /** * Returns the prepare build tasks in the prepare build queue. * * @return * @throws TaskQueueException TODO */ List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue() throws TaskQueueException; /** * Checks if the specified project is in the prepare build queue. * * @param projectId * @return * @throws TaskQueueException TODO */ boolean isInPrepareBuildQueue( int projectId ) throws TaskQueueException; /** * Checks if the specified project group and scm root is in the prepare build queue. * * @param projectGroupId * @param scmRootId * @return * @throws TaskQueueException */ boolean isInPrepareBuildQueue( int projectGroupId, int scmRootId ) throws TaskQueueException; /** * Checks if the specified project group and scm root is in the prepare build queue. * * @param projectGroupId * @param scmRootAddress * @return * @throws TaskQueueException */ boolean isInPrepareBuildQueue( int projectGroupId, String scmRootAddress ) throws TaskQueueException; /** * Cancel the prepare build task of the corresponding project group and scm root. * * @param projectId * @param scmRootId */ void cancelPrepareBuildTask( int projectGroupId, int scmRootId ); /** * Cancel the prepare build task of the corresponding project * * @param projectId */ void cancelPrepareBuildTask( int projectId ); /** * Cancel the current prepare build. * * @return */ boolean cancelCurrentPrepareBuild(); /** * Remove the project group matching the specified id, and scm root id from the prepare build queue. * * @param projectGroupId * @param scmRootId * @return * @throws TaskQueueException TODO */ boolean removeProjectFromPrepareBuildQueue( int projectGroupId, int scmRootId ) throws TaskQueueException; /** * Remove the project group matching the specified id and scm root address from the prepare build queue. * * @param projectId * @param scmRootAddress * @return * @throws TaskQueueException TODO */ boolean removeProjectFromPrepareBuildQueue( int projectGroupId, String scmRootAddress ) throws TaskQueueException; /** * Remove the projects matching the specified hashcodes from the prepare build queue. * * @param hashCodes * @throws TaskQueueException TODO */ void removeProjectsFromPrepareBuildQueueWithHashCodes( int[] hashCodes ) throws TaskQueueException; /* Build Queue */ /** * Returns the build queue. * * @return */ TaskQueue getBuildQueue(); /** * Add the build task to the build queue. * * @param buildTask * @throws Exception */ void addToBuildQueue( BuildProjectTask buildTask ) throws TaskQueueException; /** * Add the build tasks to the build queue. * * @param buildTasks * @throws TaskQueueException TODO */ void addToBuildQueue( List<BuildProjectTask> buildTasks ) throws TaskQueueException; /** * Returns the build tasks in the build queue. * * @return * @throws TaskQueueException TODO */ List<BuildProjectTask> getProjectsInBuildQueue() throws TaskQueueException; /** * Checks if the specified project is in the build queue. * * @param projectId * @return * @throws TaskQueueException TODO */ boolean isInBuildQueue( int projectId ) throws TaskQueueException; /** * Checks if the specified project with the specified build definition is in the build queue. * * @param projectId * @param buildDefinitionId * @return * @throws TaskQueueException TODO */ boolean isInBuildQueue( int projectId, int buildDefinitionId ) throws TaskQueueException; /** * Cancel the build task of the corresponding project. * * @param projectId */ void cancelBuildTask( int projectId ); /** * Cancel the current build. * * @return */ boolean cancelCurrentBuild(); /** * Remove the project matching the specified id, name, build definition and trigger from the build queue. * * @param projectId * @param buildDefinitionId * @param buildTrigger * @param projectName * @param projectGroupId * @return * @throws TaskQueueException TODO */ boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, String projectName, int projectGroupId ) throws TaskQueueException; /** * Remove the specified project from the build queue. * * @param projectId * @return * @throws TaskQueueException TODO */ boolean removeProjectFromBuildQueue( int projectId ) throws TaskQueueException; /** * Remove the specified projects from the build queue. * * @param projectIds * @return * @throws TaskQueueException TODO */ boolean removeProjectsFromBuildQueue( int[] projectIds ) throws TaskQueueException; /** * Remove the projects matching the specified hashcodes from the build queue. * * @param hashCodes * @throws TaskQueueException TODO */ void removeProjectsFromBuildQueueWithHashCodes( int[] hashCodes ) throws TaskQueueException; /** * Returns the build task queue executor used. * * @return */ TaskQueueExecutor getBuildTaskQueueExecutor(); /** * Returns the checkout task queue executor used. * * @return */ TaskQueueExecutor getCheckoutTaskQueueExecutor(); /** * Returns the prepare build task queue executor used. * * @return */ TaskQueueExecutor getPrepareBuildTaskQueueExecutor(); }
5,323
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java
package org.apache.continuum.taskqueue; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.utils.build.BuildTrigger; import org.apache.maven.continuum.model.scm.ScmResult; import org.codehaus.plexus.taskqueue.Task; import java.io.Serializable; /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class BuildProjectTask implements Task, Serializable { private static final long serialVersionUID = 3647734422022017812L; private final int projectId; private final int buildDefinitionId; private final long timestamp; private BuildTrigger buildTrigger; private long maxExecutionTime; private final String projectName; private final String buildDefinitionLabel; private ScmResult scmResult; int projectGroupId; public BuildProjectTask( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, String projectName, String buildDefinitionLabel, ScmResult scmResult, int projectGroupId ) { this.projectId = projectId; this.buildDefinitionId = buildDefinitionId; this.timestamp = System.currentTimeMillis(); this.buildTrigger = buildTrigger; this.projectName = projectName; this.buildDefinitionLabel = buildDefinitionLabel; this.scmResult = scmResult; this.projectGroupId = projectGroupId; } public int getProjectId() { return projectId; } public int getBuildDefinitionId() { return buildDefinitionId; } public long getTimestamp() { return timestamp; } public BuildTrigger getBuildTrigger() { return buildTrigger; } public void setBuildTrigger( BuildTrigger buildTrigger ) { this.buildTrigger = buildTrigger; } public void setMaxExecutionTime( long maxExecutionTime ) { this.maxExecutionTime = maxExecutionTime; } public long getMaxExecutionTime() { return maxExecutionTime; } public String getProjectName() { return projectName; } public String getBuildDefinitionLabel() { return buildDefinitionLabel; } public ScmResult getScmResult() { return scmResult; } public int getProjectGroupId() { return projectGroupId; } public boolean equals( Object obj ) { if ( obj == null ) { return false; } if ( obj == this ) { return true; } if ( !( obj instanceof BuildProjectTask ) ) { return false; } BuildProjectTask buildProjectTask = (BuildProjectTask) obj; return buildProjectTask.getBuildDefinitionId() == this.getBuildDefinitionId() && buildProjectTask.getProjectId() == this.getProjectId() && buildProjectTask.getBuildTrigger().getTrigger() == this.buildTrigger.getTrigger(); } public int hashCode() { return this.getBuildDefinitionId() + this.getProjectId() + this.buildTrigger.getTrigger(); } public int getHashCode() { return this.hashCode(); } }
5,324
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallDistributedBuildQueue.java
package org.apache.continuum.taskqueue; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.builder.distributed.executor.DistributedBuildTaskQueueExecutor; import org.codehaus.plexus.taskqueue.Task; import org.codehaus.plexus.taskqueue.TaskQueue; import org.codehaus.plexus.taskqueue.TaskQueueException; import java.util.List; public interface OverallDistributedBuildQueue { String getBuildAgentUrl(); void setBuildAgentUrl( String buildAgentUrl ); TaskQueue getDistributedBuildQueue(); void addToDistributedBuildQueue( Task distributedBuildTask ) throws TaskQueueException; List<PrepareBuildProjectsTask> getProjectsInQueue() throws TaskQueueException; boolean isInDistributedBuildQueue( int projectGroupId, int scmRootId ) throws TaskQueueException; void removeFromDistributedBuildQueue( int projectGroupId, int scmRootId ) throws TaskQueueException; void removeFromDistributedBuildQueue( int[] hashCodes ) throws TaskQueueException; void removeFromDistributedBuildQueueByHashCode( int hashCode ) throws TaskQueueException; DistributedBuildTaskQueueExecutor getDistributedBuildTaskQueueExecutor(); }
5,325
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue/ThreadedTaskQueueExecutor.java
package org.apache.continuum.taskqueue; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 edu.emory.mathcs.backport.java.util.concurrent.CancellationException; import edu.emory.mathcs.backport.java.util.concurrent.ExecutionException; import edu.emory.mathcs.backport.java.util.concurrent.ExecutorService; import edu.emory.mathcs.backport.java.util.concurrent.Executors; import edu.emory.mathcs.backport.java.util.concurrent.Future; import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit; import edu.emory.mathcs.backport.java.util.concurrent.TimeoutException; import org.apache.continuum.utils.ThreadNames; import org.codehaus.plexus.component.annotations.Configuration; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable; import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException; import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException; import org.codehaus.plexus.taskqueue.Task; import org.codehaus.plexus.taskqueue.TaskQueue; import org.codehaus.plexus.taskqueue.execution.TaskExecutionException; import org.codehaus.plexus.taskqueue.execution.TaskExecutor; import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor; import org.codehaus.plexus.util.StringUtils; /** * Modified plexus ThreadedTaskQueueExecutor */ public class ThreadedTaskQueueExecutor extends AbstractLogEnabled implements TaskQueueExecutor, Initializable, Startable, Disposable { private static final int SHUTDOWN = 1; private static final int CANCEL_TASK = 2; @Requirement private TaskQueue queue; @Requirement private TaskExecutor executor; @Configuration( "" ) private String name; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private ExecutorRunnable executorRunnable; private ExecutorService executorService; private Task currentTask; private class ExecutorRunnable extends Thread { private volatile int command; private boolean done; public ExecutorRunnable() { super( ThreadNames.formatNext( "%s-executor", name ) ); } public void run() { while ( command != SHUTDOWN ) { final Task task; currentTask = null; try { task = queue.poll( 100, TimeUnit.MILLISECONDS ); } catch ( InterruptedException e ) { getLogger().info( "Executor thread interrupted, command: " + ( command == SHUTDOWN ? "Shutdown" : command == CANCEL_TASK ? "Cancel task" : "Unknown" ) ); continue; } if ( task == null ) { continue; } currentTask = task; Future future = executorService.submit( new Runnable() { public void run() { try { executor.executeTask( task ); } catch ( TaskExecutionException e ) { getLogger().error( "Error executing task", e ); } } } ); try { waitForTask( task, future ); } catch ( ExecutionException e ) { getLogger().error( "Error executing task", e ); } } currentTask = null; getLogger().info( "Executor thread '" + name + "' exited." ); done = true; synchronized ( this ) { notifyAll(); } } private void waitForTask( Task task, Future future ) throws ExecutionException { boolean stop = false; while ( !stop ) { try { if ( task.getMaxExecutionTime() == 0 ) { getLogger().debug( "Waiting indefinitely for task to complete" ); future.get(); return; } else { getLogger().debug( "Waiting at most " + task.getMaxExecutionTime() + "ms for task completion" ); future.get( task.getMaxExecutionTime(), TimeUnit.MILLISECONDS ); getLogger().debug( "Task completed within " + task.getMaxExecutionTime() + "ms" ); return; } } catch ( InterruptedException e ) { switch ( command ) { case SHUTDOWN: { getLogger().info( "Shutdown command received. Cancelling task." ); cancel( future ); return; } case CANCEL_TASK: { command = 0; getLogger().info( "Cancelling task" ); cancel( future ); return; } default: // when can this thread be interrupted, and should we ignore it if shutdown = false? getLogger().warn( "Interrupted while waiting for task to complete; ignoring", e ); break; } } catch ( TimeoutException e ) { getLogger().warn( "Task " + task + " didn't complete within time, cancelling it." ); cancel( future ); return; } catch ( CancellationException e ) { getLogger().warn( "The task was cancelled", e ); return; } } } private void cancel( Future future ) { if ( !future.cancel( true ) ) { if ( !future.isDone() && !future.isCancelled() ) { getLogger().warn( "Unable to cancel task" ); } else { getLogger().warn( "Task not cancelled (Flags: done: " + future.isDone() + " cancelled: " + future.isCancelled() + ")" ); } } else { getLogger().debug( "Task successfully cancelled" ); } } public synchronized void shutdown() { getLogger().debug( "Signalling executor thread to shutdown" ); command = SHUTDOWN; interrupt(); } public synchronized boolean cancelTask( Task task ) { if ( !task.equals( currentTask ) ) { getLogger().debug( "Not cancelling task - it is not running" ); return false; } if ( command != SHUTDOWN ) { getLogger().debug( "Signalling executor thread to cancel task" ); command = CANCEL_TASK; interrupt(); } else { getLogger().debug( "Executor thread already stopping; task will be cancelled automatically" ); } return true; } public boolean isDone() { return done; } } // ---------------------------------------------------------------------- // Component lifecycle // ---------------------------------------------------------------------- public void initialize() throws InitializationException { if ( StringUtils.isEmpty( name ) ) { throw new IllegalArgumentException( "'name' must be set." ); } } public void start() throws StartingException { getLogger().info( "Starting task executor, thread name '" + name + "'." ); this.executorService = Executors.newSingleThreadExecutor(); executorRunnable = new ExecutorRunnable(); executorRunnable.setDaemon( true ); executorRunnable.start(); } public void stop() throws StoppingException { executorRunnable.shutdown(); int maxSleep = 10 * 1000; // 10 seconds int interval = 1000; long endTime = System.currentTimeMillis() + maxSleep; while ( !executorRunnable.isDone() && executorRunnable.isAlive() ) { if ( System.currentTimeMillis() > endTime ) { getLogger().warn( "Timeout waiting for executor thread '" + name + "' to stop, aborting" ); break; } getLogger().info( "Waiting until task executor '" + name + "' is idling..." ); try { synchronized ( executorRunnable ) { executorRunnable.wait( interval ); } } catch ( InterruptedException ex ) { // ignore } // notify again, just in case. executorRunnable.shutdown(); } } public void dispose() { executorRunnable.shutdown(); } public Task getCurrentTask() { return currentTask; } public synchronized boolean cancelTask( Task task ) { return executorRunnable.cancelTask( task ); } }
5,326
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
package org.apache.continuum.taskqueue; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.utils.build.BuildTrigger; import org.codehaus.plexus.taskqueue.Task; import java.util.Map; public class PrepareBuildProjectsTask implements Task { private final Map<Integer, Integer> projectsBuildDefinitionsMap; private BuildTrigger buildTrigger; private final int projectGroupId; private final String projectGroupName; private final String scmRootAddress; private final int projectScmRootId; public PrepareBuildProjectsTask( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId, String projectGroupName, String scmRootAddress, int projectScmRootId ) { this.projectsBuildDefinitionsMap = projectsBuildDefinitionsMap; this.buildTrigger = buildTrigger; this.projectGroupId = projectGroupId; this.projectGroupName = projectGroupName; this.scmRootAddress = scmRootAddress; this.projectScmRootId = projectScmRootId; } public long getMaxExecutionTime() { // TODO Auto-generated method stub return 0; } public Map<Integer, Integer> getProjectsBuildDefinitionsMap() { return projectsBuildDefinitionsMap; } public BuildTrigger getBuildTrigger() { return buildTrigger; } public int getHashCode() { return this.hashCode(); } public int getProjectGroupId() { return projectGroupId; } public String getProjectGroupName() { return projectGroupName; } public String getScmRootAddress() { return scmRootAddress; } public int getProjectScmRootId() { return projectScmRootId; } public int hashCode() { return this.projectGroupId + this.projectScmRootId + this.buildTrigger.getTrigger(); } }
5,327
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
package org.apache.continuum.taskqueue; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.Project; import org.codehaus.plexus.taskqueue.Task; import java.io.File; import java.util.List; /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class CheckOutTask implements Task { private final int projectId; private final File workingDirectory; private final String projectName; private final String scmUserName; private final String scmPassword; private final String scmRootUrl; private final List<Project> projectsWithCommonScmRoot; public CheckOutTask( int projectId, File workingDirectory, String projectName, String scmUserName, String scmPassword, String scmRootUrl, List<Project> projectsWithCommonScmRoot ) { this.projectId = projectId; this.workingDirectory = workingDirectory; this.projectName = projectName; this.scmUserName = scmUserName; this.scmPassword = scmPassword; this.scmRootUrl = scmRootUrl; this.projectsWithCommonScmRoot = projectsWithCommonScmRoot; } public int getProjectId() { return projectId; } public File getWorkingDirectory() { return workingDirectory; } public long getMaxExecutionTime() { return 0; } public String getProjectName() { return projectName; } public String getScmUserName() { return scmUserName; } public String getScmPassword() { return scmPassword; } public int getHashCode() { return this.hashCode(); } public String getScmRootUrl() { return scmRootUrl; } public List<Project> getProjectsWithCommonScmRoot() { return projectsWithCommonScmRoot; } }
5,328
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
package org.apache.continuum.taskqueue.manager; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.codehaus.plexus.taskqueue.TaskQueue; /** * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a> */ public interface TaskQueueManager { String ROLE = TaskQueueManager.class.getName(); TaskQueue getPurgeQueue(); boolean isInPurgeQueue( int purgeConfigurationId ) throws TaskQueueManagerException; /** * Check if the repository is already in the purging queue * * @param repositoryId the id of the repository purge configuration * @return true if the repository is in the purging queue, otherwise false * @throws TaskQueueManagerException */ boolean isRepositoryInPurgeQueue( int repositoryId ) throws TaskQueueManagerException; /** * Check if the repository is being used by a project that is currently building * * @param repositoryId the id of the local repository * @return true if the repository is in use, otherwise false * @throws TaskQueueManagerException */ boolean isRepositoryInUse( int repositoryId ) throws TaskQueueManagerException; /** * Check whether a project is in the release stage based on the given releaseId. * * @param releaseId * @return * @throws TaskQueueManagerException */ boolean isProjectInReleaseStage( String releaseId ) throws TaskQueueManagerException; boolean releaseInProgress() throws TaskQueueManagerException; /** * Remove local repository from the purge queue * * @param purgeConfigId the id of the purge configuration * @return true if the purge configuration was successfully removed from the purge queue, otherwise false * @throws TaskQueueManagerException */ boolean removeFromPurgeQueue( int purgeConfigId ) throws TaskQueueManagerException; /** * Remove local repositories from the purge queue * * @param purgeConfigIds the ids of the purge configuration * @return true if the purge configurations were successfully removed from the purge queue, otherwise false * @throws TaskQueueManagerException */ boolean removeFromPurgeQueue( int[] purgeConfigIds ) throws TaskQueueManagerException; /** * Remove local repository from the purge queue * * @param repositoryId the id of the local repository * @throws TaskQueueManagerException */ void removeRepositoryFromPurgeQueue( int repositoryId ) throws TaskQueueManagerException; }
5,329
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManagerException.java
package org.apache.continuum.taskqueue.manager; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public class TaskQueueManagerException extends Exception { public TaskQueueManagerException( String message ) { super( message ); } public TaskQueueManagerException( Throwable cause ) { super( cause ); } public TaskQueueManagerException( String message, Throwable cause ) { super( message, cause ); } }
5,330
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/configuration/ContinuumConfiguration.java
package org.apache.continuum.configuration; import java.io.File; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:olamy@apache.org">olamy</a> * @since 17 juin 2008 */ public interface ContinuumConfiguration { /** * @return an empty or a filled on but never null ! * @throws ContinuumConfigurationException * */ GeneralConfiguration getGeneralConfiguration() throws ContinuumConfigurationException; void setGeneralConfiguration( GeneralConfiguration generalConfiguration ) throws ContinuumConfigurationException; void save() throws ContinuumConfigurationException; void save( File file ) throws ContinuumConfigurationException; void reload() throws ContinuumConfigurationException; void reload( File file ) throws ContinuumConfigurationException; }
5,331
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/configuration/BuildAgentConfigurationException.java
package org.apache.continuum.configuration; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public class BuildAgentConfigurationException extends Exception { public BuildAgentConfigurationException( String message ) { super( message ); } public BuildAgentConfigurationException( Throwable cause ) { super( cause ); } public BuildAgentConfigurationException( String message, Throwable cause ) { super( message, cause ); } }
5,332
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/configuration/ProxyConfiguration.java
package org.apache.continuum.configuration; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.commons.lang.builder.ReflectionToStringBuilder; /** * @author <a href="mailto:olamy@apache.org">olamy</a> * @since 24 juin 2008 */ public class ProxyConfiguration { private String proxyHost; private int proxyPort; private String proxyUser; private String proxyPassword; public ProxyConfiguration() { // nothing here } public ProxyConfiguration( String proxyHost, String proxyPassword, int proxyPort, String proxyUser ) { super(); this.proxyHost = proxyHost; this.proxyPassword = proxyPassword; this.proxyPort = proxyPort; this.proxyUser = proxyUser; } public String getProxyHost() { return proxyHost; } public void setProxyHost( String proxyHost ) { this.proxyHost = proxyHost; } public int getProxyPort() { return proxyPort; } public void setProxyPort( int proxyPort ) { this.proxyPort = proxyPort; } public String getProxyUser() { return proxyUser; } public void setProxyUser( String proxyUser ) { this.proxyUser = proxyUser; } public String getProxyPassword() { return proxyPassword; } public void setProxyPassword( String proxyPassword ) { this.proxyPassword = proxyPassword; } @Override public String toString() { return ReflectionToStringBuilder.toString( this ); } }
5,333
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/configuration/ContinuumConfigurationException.java
package org.apache.continuum.configuration; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:olamy@apache.org">olamy</a> * @since 30 Jun 08 */ public class ContinuumConfigurationException extends Exception { public ContinuumConfigurationException( String message ) { super( message ); } public ContinuumConfigurationException( Throwable cause ) { super( cause ); } public ContinuumConfigurationException( String message, Throwable cause ) { super( message, cause ); } }
5,334
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/configuration/BuildAgentGroupConfiguration.java
package org.apache.continuum.configuration; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 java.util.ArrayList; import java.util.Iterator; import java.util.List; public class BuildAgentGroupConfiguration { private String name; private List<BuildAgentConfiguration> buildAgents = new ArrayList<BuildAgentConfiguration>(); public BuildAgentGroupConfiguration() { //nil } public BuildAgentGroupConfiguration( String name, List<BuildAgentConfiguration> buildAgents ) { this.name = name; this.buildAgents = buildAgents; } public void addBuildAgent( BuildAgentConfiguration buildAgent ) { buildAgents.add( buildAgent ); } public void removeBuildAgent( BuildAgentConfiguration buildAgent ) { Iterator<BuildAgentConfiguration> iterator = buildAgents.iterator(); while ( iterator.hasNext() ) { BuildAgentConfiguration agent = iterator.next(); if ( agent.getUrl().equals( buildAgent.getUrl() ) ) { iterator.remove(); } } } public String getName() { return name; } public void setName( String name ) { this.name = name; } public List<BuildAgentConfiguration> getBuildAgents() { return buildAgents; } public void setBuildAgents( List<BuildAgentConfiguration> buildAgents ) { this.buildAgents = buildAgents; } }
5,335
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/configuration/BuildAgentConfiguration.java
package org.apache.continuum.configuration; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public class BuildAgentConfiguration { private String url; private String description; private boolean enabled; public BuildAgentConfiguration() { // do nothing } public BuildAgentConfiguration( String url, String description, boolean enabled ) { this.url = url; this.enabled = enabled; this.description = description; } public String getUrl() { return url; } public void setUrl( String url ) { this.url = url; } public String getDescription() { return description; } public void setDescription( String description ) { this.description = description; } public boolean isEnabled() { return enabled; } public void setEnabled( boolean enabled ) { this.enabled = enabled; } }
5,336
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
package org.apache.continuum.configuration; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.commons.lang.builder.ReflectionToStringBuilder; import java.io.File; import java.util.List; /** * @author <a href="mailto:olamy@apache.org">olamy</a> * @since 17 juin 2008 */ public class GeneralConfiguration { private boolean initialized = false; private File workingDirectory; private File buildOutputDirectory; private File deploymentRepositoryDirectory; private String baseUrl; private ProxyConfiguration proxyConfiguration; private File releaseOutputDirectory; private int numberOfBuildsInParallel = 1; private List<BuildAgentConfiguration> buildAgents; private List<BuildAgentGroupConfiguration> buildAgentGroups; private boolean distributedBuildEnabled; private String sharedSecretPassword; public GeneralConfiguration() { // nothing here } public File getWorkingDirectory() { return workingDirectory; } public void setWorkingDirectory( File workingDirectory ) { this.workingDirectory = workingDirectory; } public File getBuildOutputDirectory() { return buildOutputDirectory; } public void setBuildOutputDirectory( File buildOutputDirectory ) { this.buildOutputDirectory = buildOutputDirectory; } public File getDeploymentRepositoryDirectory() { return deploymentRepositoryDirectory; } public void setDeploymentRepositoryDirectory( File deploymentRepositoryDirectory ) { this.deploymentRepositoryDirectory = deploymentRepositoryDirectory; } public String getBaseUrl() { return baseUrl; } public void setBaseUrl( String baseUrl ) { this.baseUrl = baseUrl; } public ProxyConfiguration getProxyConfiguration() { return proxyConfiguration; } public void setProxyConfiguration( ProxyConfiguration proxyConfiguration ) { this.proxyConfiguration = proxyConfiguration; } @Override public String toString() { return ReflectionToStringBuilder.toString( this ); } public File getReleaseOutputDirectory() { return releaseOutputDirectory; } public void setReleaseOutputDirectory( File releaseOutputDirectory ) { this.releaseOutputDirectory = releaseOutputDirectory; } public int getNumberOfBuildsInParallel() { return numberOfBuildsInParallel; } public void setNumberOfBuildsInParallel( int numberOfBuildsInParallel ) { this.numberOfBuildsInParallel = numberOfBuildsInParallel; } public List<BuildAgentConfiguration> getBuildAgents() { return buildAgents; } public void setBuildAgents( List<BuildAgentConfiguration> buildAgents ) { this.buildAgents = buildAgents; } public List<BuildAgentGroupConfiguration> getBuildAgentGroups() { return buildAgentGroups; } public void setBuildAgentGroups( List<BuildAgentGroupConfiguration> buildAgentGroups ) { this.buildAgentGroups = buildAgentGroups; } public boolean isDistributedBuildEnabled() { return distributedBuildEnabled; } public void setDistributedBuildEnabled( boolean distributedBuildEnabled ) { this.distributedBuildEnabled = distributedBuildEnabled; } public void setSharedSecretPassword( String sharedSecretPassword ) { this.sharedSecretPassword = sharedSecretPassword; } public String getSharedSecretPassword() { return sharedSecretPassword; } public boolean isInitialized() { return initialized; } public void setInitialized( boolean initialized ) { this.initialized = initialized; } }
5,337
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/repository/RepositoryService.java
package org.apache.continuum.repository; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.LocalRepository; import java.util.List; /** * @author Maria Catherine Tan * @since 25 jul 07 */ public interface RepositoryService { String ROLE = RepositoryService.class.getName(); // ------------------------------------------------------ // LocalRepository // ------------------------------------------------------ /** * Add the local repository * * @param repository the local repository to add * @return LocalRepository the local repository * @throws RepositoryServiceException */ LocalRepository addLocalRepository( LocalRepository repository ) throws RepositoryServiceException; /** * Update the local repository * * @param repository the local repository to update * @throws RepositoryServiceException */ void updateLocalRepository( LocalRepository repository ) throws RepositoryServiceException; /** * Remove the local repository * * @param repositoryId the id of the local repository to remove * @throws RepositoryServiceException */ void removeLocalRepository( int repositoryId ) throws RepositoryServiceException; /** * Retrieve all local repositories * * @return list of all local repositories */ List<LocalRepository> getAllLocalRepositories(); /** * Retrieve local repository * * @param location the system file path of the repository * @return LocalRepository the local repository * @throws RepositoryServiceException */ LocalRepository getLocalRepositoryByLocation( String location ) throws RepositoryServiceException; /** * Retrieve list of local repositories with the specified layout * * @param layout the layout of the repository. "default" or "legacy" * @return List of local repositories * @throws RepositoryServiceException */ List<LocalRepository> getLocalRepositoriesByLayout( String layout ); /** * Retrieve local repository * * @param repositoryId the id of the local repository * @return LocalRepository the local repository * @throws RepositoryServiceException */ LocalRepository getLocalRepository( int repositoryId ) throws RepositoryServiceException; /** * Retrieve local repository * * @param repositoryName * @return * @throws RepositoryServiceException */ LocalRepository getLocalRepositoryByName( String repositoryName ) throws RepositoryServiceException; }
5,338
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/repository/RepositoryServiceException.java
package org.apache.continuum.repository; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author Maria Catherine Tan * @since 25 jul 07 */ public class RepositoryServiceException extends Exception { public RepositoryServiceException( String message ) { super( message ); } public RepositoryServiceException( Throwable cause ) { super( cause ); } public RepositoryServiceException( String message, Throwable cause ) { super( message, cause ); } }
5,339
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/ProfileDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.system.Profile; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface ProfileDao { Profile getProfileByName( String profileName ) throws ContinuumStoreException; List<Profile> getAllProfilesByName(); Profile addProfile( Profile profile ); Profile getProfile( int profileId ) throws ContinuumStoreException; void updateProfile( Profile profile ) throws ContinuumStoreException; void removeProfile( Profile profile ); }
5,340
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/ScheduleDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.Schedule; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface ScheduleDao { List<Schedule> getAllSchedulesByName(); Schedule addSchedule( Schedule schedule ); Schedule getScheduleByName( String name ) throws ContinuumStoreException; Schedule storeSchedule( Schedule schedule ) throws ContinuumStoreException; void updateSchedule( Schedule schedule ) throws ContinuumStoreException; void removeSchedule( Schedule schedule ); Schedule getSchedule( int scheduleId ) throws ContinuumStoreException; }
5,341
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/ProjectGroupDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.Project; import org.apache.maven.continuum.model.project.ProjectGroup; import org.apache.maven.continuum.store.ContinuumObjectNotFoundException; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.Collection; import java.util.List; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface ProjectGroupDao { /** * Add the project group. * * @param group The project group * @return The project group added */ ProjectGroup addProjectGroup( ProjectGroup group ); /** * Remove the project group. * * @param projectGroup the project group to remove */ void removeProjectGroup( ProjectGroup projectGroup ); /** * Return the project group associated to the project group id parameter. * * @param projectGroupId The project group id * @return The project group * @throws org.apache.maven.continuum.store.ContinuumStoreException * if the project group can't be obtain */ ProjectGroup getProjectGroup( int projectGroupId ) throws ContinuumStoreException, ContinuumObjectNotFoundException; /** * Return the project group associated to the groupId parameter. * * @param groupId The group id * @return The project group * @throws ContinuumStoreException if the project group can't be obtain */ ProjectGroup getProjectGroupByGroupId( String groupId ) throws ContinuumStoreException; /** * Return the project group associated to the groupId parameter. * * @param groupId The group id * @return The project group * @throws ContinuumStoreException if the project group can't be obtain */ ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId ) throws ContinuumStoreException; /** * Return the project group associated to the groupId parameter. * * @param groupId The group id * @return The project group * @throws ContinuumStoreException if the project group can't be obtain */ ProjectGroup getProjectGroupByGroupIdWithProjects( String groupId ) throws ContinuumStoreException; /** * Return the project group of the project. * * @param projectId The project id * @return The project group * @throws ContinuumObjectNotFoundException * if the project group can't be obtain */ ProjectGroup getProjectGroupByProjectId( int projectId ) throws ContinuumObjectNotFoundException; /** * Return the project group of the project. * * @param project The project * @return The project group * @throws ContinuumObjectNotFoundException * if the project group can't be obtain */ ProjectGroup getProjectGroupByProject( Project project ) throws ContinuumObjectNotFoundException; /** * Save the modified project group. * * @param projectGroup The project group * @throws ContinuumStoreException if the project group can't be saved */ void updateProjectGroup( ProjectGroup projectGroup ) throws ContinuumStoreException; /** * Return the project group with projects populated. * * @param projectGroupId The project group id * @return All project groups * @throws ContinuumStoreException if the project group can't be obtain */ ProjectGroup getProjectGroupWithProjects( int projectGroupId ) throws ContinuumStoreException; /** * Return all project groups with projects populated. * * @return All project groups */ Collection<ProjectGroup> getAllProjectGroupsWithProjects(); /** * Return all project groups with build details populated. * * @return All project groups */ List<ProjectGroup> getAllProjectGroupsWithBuildDetails(); /** * Return all project groups. * * @return All project groups */ Collection<ProjectGroup> getAllProjectGroups(); /** * Return all project groups with all associated objects populated. This method return the majority of the database. * * @return all project groups */ Collection<ProjectGroup> getAllProjectGroupsWithTheLot(); /** * Return the project group with associated build details populated. * * @param projectGroupId the project group id * @return the project group * @throws ContinuumStoreException if the project group can't be obtain */ ProjectGroup getProjectGroupWithBuildDetailsByProjectGroupId( int projectGroupId ) throws ContinuumStoreException; List<ProjectGroup> getProjectGroupByRepository( int repositoryId ); }
5,342
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.BuildResult; import org.apache.maven.continuum.model.project.Project; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface BuildResultDao { BuildResult getBuildResult( int buildId ) throws ContinuumStoreException; void addBuildResult( Project project, BuildResult build ) throws ContinuumStoreException; void updateBuildResult( BuildResult build ) throws ContinuumStoreException; void removeBuildResult( BuildResult buildResult ); BuildResult getLatestBuildResultForProject( int projectId ); BuildResult getLatestBuildResultForProjectWithDetails( int projectId ); BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId ); BuildResult getPreviousBuildResultForBuildDefinition( int projectId, int buildDefinitionId, int buildResultId ); BuildResult getLatestBuildResultInSuccess( int projectId ); BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId ); /** * Marks results in the BUILDING status with a start time before the specified cutoff as CANCELLED. * * @param ageCutoff the time in milliseconds, before which a building result is considered orphaned * @return the set of ids considered orphaned, and consequently marked CANCELLED * @throws ContinuumStoreException */ Set<Integer> resolveOrphanedInProgressResults( long ageCutoff ) throws ContinuumStoreException; long getNbBuildResultsForProject( int projectId ); /** * Returns the list of build results between the fromdate and the buildResult defined by its toBuildResultId * * @param projectId The project id * @param fromResultId the from date * @param toResultId the build result id * @return the list of build results */ List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, int fromResultId, int toResultId ); /** * Returns the number of build results in success since fromDate * * @param projectId The project id * @param fromDate The from date * @return the number of build results */ long getNbBuildResultsInSuccessForProject( int projectId, long fromDate ); /** * Looks up a range of build results for a project ordered from most recent to earliest. * * @param projectId id of project to fetch results for * @param startIndex zero-based index indicating start of result interval * @param endIndex zero-based index indicating boundary of result interval * @param fullDetails whether to use a fetch plan that includes full build result details * @return a list of results in the interval [start, end) */ List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex, boolean fullDetails ); /** * @param projectId * @param startId * @return the returned list will contains all BuildResult for this project after the startId * @since 1.2 */ List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId ) throws ContinuumStoreException; Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId ); Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId ); List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId ); List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId, long startIndex, long endIndex ); List<BuildResult> getAllBuildsForAProjectByDate( int projectId ); List<BuildResult> getBuildResultsInRange( Date fromDate, Date toDate, int state, String triggeredBy, Collection<Integer> projectGroupIds, int offset, int length ); }
5,343
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/BuildQueueDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.BuildQueue; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a> */ public interface BuildQueueDao { BuildQueue addBuildQueue( BuildQueue buildQueue ) throws ContinuumStoreException; BuildQueue getBuildQueue( int buildQueueId ) throws ContinuumStoreException; BuildQueue getBuildQueueByName( String buildQueueName ) throws ContinuumStoreException; void removeBuildQueue( BuildQueue buildQueue ) throws ContinuumStoreException; BuildQueue storeBuildQueue( BuildQueue buildQueue ) throws ContinuumStoreException; List<BuildQueue> getAllBuildQueues() throws ContinuumStoreException; }
5,344
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/DistributedRepositoryPurgeConfigurationDao.java
package org.apache.continuum.dao; import org.apache.continuum.model.repository.DistributedRepositoryPurgeConfiguration; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; public interface DistributedRepositoryPurgeConfigurationDao { /** * Retrieve all DistributedDirectoryPurgeConfiguration instances. * * @return list of all DistributedDirectoryPurgeConfiguration instances */ List<DistributedRepositoryPurgeConfiguration> getAllDistributedRepositoryPurgeConfigurations(); /** * Adds a new DistributedRepositoryPurgeConfiguration instance. * * @param purgeConfiguration DistributedRepositoryPurgeConfiguration instance to be added * @return DistributedRepositoryPurgeConfiguration instance that was added * @throws ContinuumStoreException if unable to add the new instance */ DistributedRepositoryPurgeConfiguration addDistributedRepositoryPurgeConfiguration( DistributedRepositoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; /** * Removes an existing DistributedRepositoryPurgeConfiguration instance. * * @param purgeConfig */ void removeDistributedRepositoryPurgeConfiguration( DistributedRepositoryPurgeConfiguration purgeConfig ) throws ContinuumStoreException; /** * Retrieves an existing configuration object. * * @param dirPurgeId * @return * @throws ContinuumStoreException */ DistributedRepositoryPurgeConfiguration getDistributedRepositoryPurgeConfiguration( int dirPurgeId ) throws ContinuumStoreException; /** * Updates an existing configuration object. * * @param purgeConfig * @throws ContinuumStoreException */ void updateDistributedRepositoryPurgeConfiguration( DistributedRepositoryPurgeConfiguration purgeConfig ) throws ContinuumStoreException; List<DistributedRepositoryPurgeConfiguration> getEnableDistributedRepositoryPurgeConfigurationsBySchedule( int scheduleId ); }
5,345
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.release.ContinuumReleaseResult; import org.apache.maven.continuum.store.ContinuumObjectNotFoundException; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a> */ public interface ContinuumReleaseResultDao { ContinuumReleaseResult addContinuumReleaseResult( ContinuumReleaseResult releaseResult ) throws ContinuumStoreException; void removeContinuumReleaseResult( ContinuumReleaseResult releaseResult ) throws ContinuumStoreException; List<ContinuumReleaseResult> getContinuumReleaseResultsByProjectGroup( int projectGroupId ); List<ContinuumReleaseResult> getAllContinuumReleaseResults(); ContinuumReleaseResult getContinuumReleaseResult( int releaseResultId ) throws ContinuumObjectNotFoundException, ContinuumStoreException; ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal, long startTime, long endTime ) throws ContinuumStoreException; List<ContinuumReleaseResult> getContinuumReleaseResultsByProject( int projectId ); }
5,346
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/BuildDefinitionDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.BuildDefinition; import org.apache.maven.continuum.model.project.Project; import org.apache.maven.continuum.model.project.ProjectGroup; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; import java.util.Map; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface BuildDefinitionDao { BuildDefinition getBuildDefinition( int buildDefinitionId ) throws ContinuumStoreException; void removeBuildDefinition( BuildDefinition buildDefinition ) throws ContinuumStoreException; BuildDefinition storeBuildDefinition( BuildDefinition buildDefinition ) throws ContinuumStoreException; BuildDefinition addBuildDefinition( BuildDefinition buildDefinition ) throws ContinuumStoreException; List<BuildDefinition> getAllBuildDefinitions() throws ContinuumStoreException; /** * Returns the default build definition of all projects. The key is the project id and the value is the build * definition id. * * @return a map of all default build definitions */ Map<Integer, Integer> getDefaultBuildDefinitions(); /** * returns the default build definitions for the project group and there * should always be at least one declared. * * @param projectGroupId The project group id * @return The list of default build definitions * @throws ContinuumStoreException if the build definitions list can't be obtain */ List<BuildDefinition> getDefaultBuildDefinitionsForProjectGroup( int projectGroupId ) throws ContinuumStoreException; /** * returns the default build definitions for the project group and there * should always be at least one declared. * * @param projectGroup The project group * @return The list of default build definitions * @throws ContinuumStoreException if the build definitions list can't be obtain */ List<BuildDefinition> getDefaultBuildDefinitionsForProjectGroup( ProjectGroup projectGroup ) throws ContinuumStoreException; /** * returns the default build definition of the project, if the project * doesn't have on declared the default of the project group will be * returned <p/> this should be the most common usage of the default build * definition accessing methods * * @param projectId * @return * @throws ContinuumStoreException * @throws org.apache.maven.continuum.store.ContinuumObjectNotFoundException * */ BuildDefinition getDefaultBuildDefinitionForProject( int projectId ) throws ContinuumStoreException; /** * returns the default build definition for the project without consulting * the project group * * @param project * @return * @throws ContinuumStoreException * @throws org.apache.maven.continuum.store.ContinuumObjectNotFoundException * */ BuildDefinition getDefaultBuildDefinitionForProject( Project project ) throws ContinuumStoreException; /** * returns the default build definition of the project, if the project * doesn't have on declared the default of the project group will be * returned <p/> this should be the most common usage of the default build * definition accessing methods * * @param projectId * @return * @throws ContinuumStoreException * @throws org.apache.maven.continuum.store.ContinuumObjectNotFoundException * */ BuildDefinition getDefaultBuildDefinition( int projectId ) throws ContinuumStoreException; List<BuildDefinition> getAllTemplates() throws ContinuumStoreException; List<BuildDefinition> getBuildDefinitionsBySchedule( int scheduleId ); }
5,347
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/BuildDefinitionTemplateDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.BuildDefinitionTemplate; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface BuildDefinitionTemplateDao { List<BuildDefinitionTemplate> getAllBuildDefinitionTemplate() throws ContinuumStoreException; BuildDefinitionTemplate getBuildDefinitionTemplate( int id ) throws ContinuumStoreException; BuildDefinitionTemplate addBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate ) throws ContinuumStoreException; BuildDefinitionTemplate updateBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate ) throws ContinuumStoreException; void removeBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate ) throws ContinuumStoreException; public List<BuildDefinitionTemplate> getBuildDefinitionTemplatesWithType( String type ) throws ContinuumStoreException; public List<BuildDefinitionTemplate> getContinuumBuildDefinitionTemplates() throws ContinuumStoreException; /** * @param type * @return BuildDefinitionTemplate null if not found * @throws ContinuumStoreException */ BuildDefinitionTemplate getContinuumBuildDefinitionTemplateWithType( String type ) throws ContinuumStoreException; /** * the list returned will contains only continuumDefaults {@link org.apache.maven.continuum.model.project.BuildDefinition} * * @return List<BuildDefinitionTemplate> * @throws ContinuumStoreException */ List<BuildDefinitionTemplate> getContinuumDefaultdDefinitions() throws ContinuumStoreException; }
5,348
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.store.ContinuumStoreException; import java.util.Map; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface DaoUtils { void closeStore(); void rebuildStore(); void eraseDatabase(); Map<Integer, Object> getProjectIdsAndBuildDefinitionsIdsBySchedule( int scheduleId ) throws ContinuumStoreException; Map<Integer, Object> getProjectGroupIdsAndBuildDefinitionsIdsBySchedule( int scheduleId ) throws ContinuumStoreException; Map<Integer, Object> getAggregatedProjectIdsAndBuildDefinitionIdsBySchedule( int scheduleId ) throws ContinuumStoreException; }
5,349
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/LocalRepositoryDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.LocalRepository; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface LocalRepositoryDao { LocalRepository addLocalRepository( LocalRepository repository ) throws ContinuumStoreException; void updateLocalRepository( LocalRepository repository ) throws ContinuumStoreException; void removeLocalRepository( LocalRepository repository ) throws ContinuumStoreException; List<LocalRepository> getAllLocalRepositories(); List<LocalRepository> getLocalRepositoriesByLayout( String layout ); LocalRepository getLocalRepository( int repositoryId ) throws ContinuumStoreException; LocalRepository getLocalRepositoryByName( String name ) throws ContinuumStoreException; LocalRepository getLocalRepositoryByLocation( String location ) throws ContinuumStoreException; }
5,350
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/ProjectScmRootDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.project.ProjectScmRoot; import org.apache.maven.continuum.store.ContinuumObjectNotFoundException; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a> */ public interface ProjectScmRootDao { ProjectScmRoot addProjectScmRoot( ProjectScmRoot projectScmRoot ) throws ContinuumStoreException; void updateProjectScmRoot( ProjectScmRoot projectScmRoot ) throws ContinuumStoreException; void removeProjectScmRoot( ProjectScmRoot projectScmRoot ) throws ContinuumStoreException; List<ProjectScmRoot> getAllProjectScmRoots(); List<ProjectScmRoot> getProjectScmRootByProjectGroup( int projectGroupId ); ProjectScmRoot getProjectScmRoot( int projectScmRootId ) throws ContinuumObjectNotFoundException, ContinuumStoreException; ProjectScmRoot getProjectScmRootByProjectGroupAndScmRootAddress( int projectGroupId, String scmRootAddress ) throws ContinuumStoreException; }
5,351
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/SystemConfigurationDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.store.ContinuumStoreException; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface SystemConfigurationDao { org.apache.maven.continuum.model.system.SystemConfiguration addSystemConfiguration( org.apache.maven.continuum.model.system.SystemConfiguration systemConf ); void updateSystemConfiguration( org.apache.maven.continuum.model.system.SystemConfiguration systemConf ) throws ContinuumStoreException; org.apache.maven.continuum.model.system.SystemConfiguration getSystemConfiguration() throws ContinuumStoreException; }
5,352
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/NotifierDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 org.apache.maven.continuum.store.ContinuumStoreException; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface NotifierDao { void removeNotifier( ProjectNotifier notifier ) throws ContinuumStoreException; ProjectNotifier storeNotifier( ProjectNotifier notifier ) throws ContinuumStoreException; }
5,353
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.RepositoryPurgeConfiguration; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface RepositoryPurgeConfigurationDao { List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations(); List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsBySchedule( int scheduleId ); List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule( int scheduleId ); List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByLocalRepository( int repositoryId ); RepositoryPurgeConfiguration getRepositoryPurgeConfiguration( int configurationId ) throws ContinuumStoreException; RepositoryPurgeConfiguration addRepositoryPurgeConfiguration( RepositoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; void updateRepositoryPurgeConfiguration( RepositoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; void removeRepositoryPurgeConfiguration( RepositoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; }
5,354
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.DirectoryPurgeConfiguration; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface DirectoryPurgeConfigurationDao { List<DirectoryPurgeConfiguration> getAllDirectoryPurgeConfigurations(); List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsBySchedule( int scheduleId ); List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule( int scheduleId ); List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation( String location ); List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByType( String type ); DirectoryPurgeConfiguration getDirectoryPurgeConfiguration( int configurationId ) throws ContinuumStoreException; DirectoryPurgeConfiguration addDirectoryPurgeConfiguration( DirectoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; void updateDirectoryPurgeConfiguration( DirectoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; void removeDirectoryPurgeConfiguration( DirectoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; }
5,355
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/InstallationDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.system.Installation; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface InstallationDao { Installation addInstallation( Installation installation ) throws ContinuumStoreException; List<Installation> getAllInstallations() throws ContinuumStoreException; void removeInstallation( Installation installation ) throws ContinuumStoreException; void updateInstallation( Installation installation ) throws ContinuumStoreException; Installation getInstallation( int installationId ) throws ContinuumStoreException; Installation getInstallation( String installationName ) throws ContinuumStoreException; }
5,356
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/ProjectDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.project.ProjectGroupSummary; import org.apache.maven.continuum.model.project.Project; import org.apache.maven.continuum.model.project.ProjectGroup; import org.apache.maven.continuum.store.ContinuumObjectNotFoundException; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; import java.util.Map; /** * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> */ public interface ProjectDao { void removeProject( Project project ); void updateProject( Project project ) throws ContinuumStoreException; Project getProject( int projectId ) throws ContinuumStoreException; Project getProject( String groupId, String artifactId, String version ) throws ContinuumStoreException; Project getProjectByName( String name ) throws ContinuumStoreException; List<Project> getProjectsWithDependenciesByGroupId( int projectGroupId ); Project getProjectWithBuilds( int projectId ) throws ContinuumStoreException; Project getProjectWithBuildDetails( int projectId ) throws ContinuumStoreException; Project getProjectWithCheckoutResult( int projectId ) throws ContinuumStoreException; List<Project> getProjectsInGroup( int projectGroupId ) throws ContinuumStoreException; List<Project> getProjectsInGroupWithDependencies( int projectGroupId ) throws ContinuumStoreException; Project getProjectWithAllDetails( int projectId ) throws ContinuumStoreException; List<Project> getAllProjectsByName(); List<Project> getAllProjectsByNameWithDependencies(); List<Project> getAllProjectsByNameWithBuildDetails(); ProjectGroup getProjectGroupByProjectId( int projectId ) throws ContinuumObjectNotFoundException; Project getProjectWithDependencies( int projectId ) throws ContinuumStoreException; Map<Integer, ProjectGroupSummary> getProjectsSummary(); }
5,357
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/dao/DistributedDirectoryPurgeConfigurationDao.java
package org.apache.continuum.dao; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.DistributedDirectoryPurgeConfiguration; import org.apache.maven.continuum.store.ContinuumStoreException; import java.util.List; public interface DistributedDirectoryPurgeConfigurationDao { /** * Retrieve all DistributedDirectoryPurgeConfiguration instances. * * @return list of all DistributedDirectoryPurgeConfiguration instances */ List<DistributedDirectoryPurgeConfiguration> getAllDistributedDirectoryPurgeConfigurations(); /** * Retrieve all DistributedDirectoryPurgeConfiguration instances associated with the input scheduleId. * * @param scheduleId schedule id * @return list of all DistributedDirectoryPurgeConfiguration instances associated with the input scheduleId */ List<DistributedDirectoryPurgeConfiguration> getDistributedDirectoryPurgeConfigurationsBySchedule( int scheduleId ); /** * Retrieve all enabled DistributedDirectoryPurgeConfiguration instances associated with the input scheduleId. * * @param scheduleId schedule id * @return list of all enabled DistributedDirectoryPurgeConfiguration instances associated with the input scheduleId */ List<DistributedDirectoryPurgeConfiguration> getEnableDistributedDirectoryPurgeConfigurationsBySchedule( int scheduleId ); /** * Retrieve all DistributedDirectoryPurgeConfiguration instances having the specified directory type. * * @param type directory type * @return list of all DistributedDirectoryPurgeConfiguration instances having the specified directory type */ List<DistributedDirectoryPurgeConfiguration> getDistributedDirectoryPurgeConfigurationsByType( String type ); /** * Retrieve the DistributedDirectoryPurgeConfiguration instance associated with the input id. * * @param configurationId DistributedDirectoryPurgeConfiguration instance id * @return DistributedDirectoryPurgeConfiguration instance * @throws ContinuumStoreException if unable to retrieve an instance associated with the input id */ DistributedDirectoryPurgeConfiguration getDistributedDirectoryPurgeConfiguration( int configurationId ) throws ContinuumStoreException; /** * Adds a new DistributedDirectoryPurgeConfiguration instance. * * @param purgeConfiguration DistributedDirectoryPurgeConfiguration instance to be added * @return DistributedDirectoryPurgeConfiguration instance that was added * @throws ContinuumStoreException if unable to add the new instance */ DistributedDirectoryPurgeConfiguration addDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; /** * Updates the DistributedDirectoryPurgeConfiguration instance. * * @param purgeConfiguration DistributedDirectoryPurgeConfiguration instance to be updated * @throws ContinuumStoreException if unable to update the instance */ void updateDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; /** * Removes the DistributedDirectoryPurgeConfiguration instance. * * @param purgeConfiguration DistributedDirectoryPurgeConfiguration instance to be removed * @throws ContinuumStoreException if unable to remove the instance */ void removeDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration purgeConfiguration ) throws ContinuumStoreException; }
5,358
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/ProjectSorter.java
package org.apache.continuum.utils; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.Project; import org.apache.maven.continuum.model.project.ProjectDependency; import org.codehaus.plexus.util.dag.CycleDetectedException; import org.codehaus.plexus.util.dag.DAG; import org.codehaus.plexus.util.dag.TopologicalSorter; import org.slf4j.Logger; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Sort projects by dependencies. * * @author <a href="mailto:brett@apache.org">Brett Porter</a> */ public class ProjectSorter { private ProjectSorter() { // no touchy... } /** * Sort a list of projects. * <ul> * <li>collect all the vertices for the projects that we want to build.</li> * <li>iterate through the deps of each project and if that dep is within * the set of projects we want to build then add an edge, otherwise throw * the edge away because that dependency is not within the set of projects * we are trying to build. we assume a closed set.</li> * <li>do a topo sort on the graph that remains.</li> * </ul> */ public static List<Project> getSortedProjects( Collection<Project> projects, Logger logger ) { DAG dag = new DAG(); Map<String, Project> projectMap = new HashMap<String, Project>(); for ( Project project : projects ) { String id = getProjectId( project ); if ( dag.getVertex( id ) != null ) { logger.warn( "Project '" + id + "' is duplicated in the reactor." ); } dag.addVertex( id ); projectMap.put( id, project ); } for ( Project project : projects ) { String id = getProjectId( project ); String projectGroupId = "[" + project.getProjectGroup().getId() + "]"; // Dependencies for ( Object o : project.getDependencies() ) { ProjectDependency dependency = (ProjectDependency) o; String dependencyId = projectGroupId + ":" + getDependencyId( dependency ); if ( dag.getVertex( dependencyId ) != null ) { try { dag.addEdge( id, dependencyId ); } catch ( CycleDetectedException e ) { logger.warn( "Ignore cycle detected in project dependencies: " + e.getMessage() ); } } } // Parent ProjectDependency parent = project.getParent(); if ( parent != null ) { String parentId = projectGroupId + ":" + getDependencyId( parent ); if ( dag.getVertex( parentId ) != null ) { // Parent is added as an edge, but must not cause a cycle - so we remove any other edges it has in conflict if ( dag.hasEdge( parentId, id ) ) { dag.removeEdge( parentId, id ); } try { dag.addEdge( id, parentId ); } catch ( CycleDetectedException e ) { logger.warn( "Ignore cycle detected in project parent: " + e.getMessage() ); } } } } List<Project> sortedProjects = new ArrayList<Project>(); for ( Object o : TopologicalSorter.sort( dag ) ) { String id = (String) o; sortedProjects.add( projectMap.get( id ) ); } return sortedProjects; } private static String getProjectId( Project project ) { String groupId; String artifactId; if ( project.getGroupId() == null ) { groupId = project.getName(); } else { groupId = project.getGroupId(); } if ( project.getArtifactId() == null ) { artifactId = project.getName(); } else { artifactId = project.getArtifactId(); } String projectGroupId = "[" + project.getProjectGroup().getId() + "]"; return projectGroupId + ":" + groupId + ":" + artifactId + ":" + project.getVersion(); } private static String getDependencyId( ProjectDependency project ) { return project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion(); } }
5,359
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/ThreadNames.java
package org.apache.continuum.utils; import java.util.HashMap; import java.util.Map; /** * A simple utility for creating thread names uniformly. */ public class ThreadNames { private static Map<String, Integer> threadCountByName = new HashMap<String, Integer>(); public static String formatNext( String format, Object... args ) { int nextId; String baseName = String.format( format, args ); synchronized ( threadCountByName ) { if ( !threadCountByName.containsKey( baseName ) ) { nextId = 0; } else { nextId = threadCountByName.get( baseName ); } threadCountByName.put( baseName, nextId + 1 ); } return String.format( "%s-%s", baseName, nextId ); } }
5,360
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/file/DefaultFileSystemManager.java
package org.apache.continuum.utils.file; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.commons.io.IOUtils; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @Component( role = FileSystemManager.class ) public class DefaultFileSystemManager implements FileSystemManager { public void wipeDir( File dir ) throws IOException { FileUtils.cleanDirectory( dir ); } public void removeDir( File dir ) throws IOException { FileUtils.deleteDirectory( dir ); } public void copyDir( File source, File dest ) throws IOException { FileUtils.copyDirectoryStructure( source, dest ); } public void delete( File target ) throws IOException { FileUtils.forceDelete( target ); } public String fileContents( File file ) throws IOException { return FileUtils.fileRead( file ); } public byte[] fileBytes( File file ) throws IOException { return org.apache.commons.io.FileUtils.readFileToByteArray( file ); } public void copyFile( File source, File dest ) throws IOException { FileUtils.copyFile( source, dest ); } public void writeFile( File file, String contents ) throws IOException { FileUtils.fileWrite( file, contents ); } public void writeFile( File file, InputStream input ) throws IOException { FileOutputStream fout = null; try { fout = new FileOutputStream( file ); IOUtils.copy( input, fout ); } finally { if ( fout != null ) { fout.close(); } } } public File getTempDir() { return new File( System.getProperty( "java.io.tmpdir" ) ); } public File createTempFile( String prefix, String suffix, File parent ) { return FileUtils.createTempFile( prefix, suffix, parent ); } public void copyFileToDir( File file, File dest ) throws IOException { FileUtils.copyFileToDirectory( file, dest ); } public void deleteOnExit( File fileOrDir ) throws IOException { FileUtils.forceDeleteOnExit( fileOrDir ); } }
5,361
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/file/FileSystemManager.java
package org.apache.continuum.utils.file; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 java.io.File; import java.io.IOException; import java.io.InputStream; /** * A service interface for handling common file system related tasks. By depending on this interface rather than static * utility methods, components can have consistent, bug-fixed and easily-stubbed file system operations. By limiting * coupling to utility libraries, it also allows for easier upgrades for utility libraries. */ public interface FileSystemManager { /** * Removes contents contained in the specified directory, leaving the directory intact. * * @param dir the directory to clean out * @throws IOException */ void wipeDir( File dir ) throws IOException; /** * Removes the specified directory and all contents, if any. * * @param dir the directory to remove * @throws IOException */ void removeDir( File dir ) throws IOException; /** * Copies the source directory and its contents to the specified destination. * * @param source directory to copy * @param dest location to copy the directory to */ void copyDir( File source, File dest ) throws IOException; /** * Forcibly removes the target directory or file, including contents. Also handles symlinks. * * @param fileOrDir file or directory to delete * @throws IOException */ void delete( File fileOrDir ) throws IOException; /** * Reads the entire contents of the specified file. * * @param file the file to read * @return contents of the file, as String * @throws IOException */ String fileContents( File file ) throws IOException; /** * Reads the entire contents of the specified file. * * @param file the file to read * @return contents of the file, as a byte array * @throws IOException */ byte[] fileBytes( File file ) throws IOException; /** * Copies the specified file to a file at the specified destination. * * @param source the file to copy * @param dest the destination of the copy * @throws IOException */ void copyFile( File source, File dest ) throws IOException; /** * Writes a String as content for the specified file. * * @param file file to write to * @param contents contents to write * @throws IOException */ void writeFile( File file, String contents ) throws IOException; /** * Writes contents of InputStream as content for the specified file. * * @param file file to write to * @param input opened stream to read contents from, will not be closed automatically * @throws IOException */ void writeFile( File file, InputStream input ) throws IOException; /** * Returns the temporary directory for this environment. * * @return a {@link File} pointing at the file system path specified by the system property, java.io.tmpdir */ File getTempDir(); /** * Create a new temporary file under the specified parent directory. * * @param prefix prefix to start file with * @param suffix suffix to end file name with * @param parent the directory to create the temp file in * @return */ File createTempFile( String prefix, String suffix, File parent ); /** * Copies the specified file to the destination directory. * * @param file the file to copy * @param dest the destination directory to put the copy * @throws IOException */ void copyFileToDir( File file, File dest ) throws IOException; /** * Registers the given file or directory for removal upon JVM shutdown. * * @param fileOrDir the file or dir to remove when JVM shuts down * @throws IOException */ void deleteOnExit( File fileOrDir ) throws IOException; }
5,362
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/shell/ShellCommandHelper.java
package org.apache.continuum.utils.shell; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.shared.release.ReleaseResult; import java.io.File; import java.util.Map; import java.util.Properties; /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public interface ShellCommandHelper { String ROLE = ShellCommandHelper.class.getName(); Properties getSystemEnvVars(); ExecutionResult executeShellCommand( File workingDirectory, String executable, String arguments, File output, long idCommand, Map<String, String> environments ) throws Exception; ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments, OutputConsumer io, long idCommand, Map<String, String> environments ) throws Exception; ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments, File output, long idCommand, Map<String, String> environments ) throws Exception; boolean isRunning( long idCommand ); void killProcess( long idCommand ); void executeGoals( File workingDirectory, String executable, String goals, boolean interactive, String arguments, ReleaseResult relResult, Map<String, String> environments ) throws Exception; void executeGoals( File workingDirectory, String executable, String goals, boolean interactive, String[] arguments, ReleaseResult relResult, Map<String, String> environments ) throws Exception; }
5,363
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/shell/ListOutputConsumer.java
package org.apache.continuum.utils.shell; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 java.util.ArrayList; import java.util.List; /** * Collects output into a list. Since all output is stored in memory simultaneously, it should not be used when expected * output is large. */ public class ListOutputConsumer implements OutputConsumer { List<String> list; public ListOutputConsumer() { list = new ArrayList<String>(); } public void consume( String line ) { list.add( line ); } public List<String> getList() { return list; } }
5,364
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/shell/DefaultShellCommandHelper.java
package org.apache.continuum.utils.shell; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.shared.release.ReleaseResult; import org.apache.maven.shared.release.exec.MavenExecutorException; import org.apache.maven.shared.release.exec.TeeConsumer; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Arg; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.StreamConsumer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Properties; import java.util.Set; /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ @Service( "shellCommandHelper" ) public class DefaultShellCommandHelper implements ShellCommandHelper { private static final Logger log = LoggerFactory.getLogger( DefaultShellCommandHelper.class ); private Set<Long> running = Collections.synchronizedSet( new HashSet<Long>() ); // ---------------------------------------------------------------------- // ShellCommandHelper Implementation // ---------------------------------------------------------------------- public Properties getSystemEnvVars() { try { return CommandLineUtils.getSystemEnvVars( false ); } catch ( IOException e ) { log.warn( "failed to get system environment", e ); } return new Properties(); } /** * Make the command line * * @param workingDirectory * @param executable * @param arguments * @param idCommand * @param environments * @return * @throws Exception */ protected Commandline createCommandline( File workingDirectory, String executable, String[] arguments, long idCommand, Map<String, String> environments ) throws Exception { Commandline cl = new Commandline(); cl.setPid( idCommand ); cl.addEnvironment( "MAVEN_TERMINATE_CMD", "on" ); if ( environments != null && !environments.isEmpty() ) { for ( String key : environments.keySet() ) { String value = environments.get( key ); cl.addEnvironment( key, value ); } } cl.addSystemEnvironment(); cl.setExecutable( executable ); if ( workingDirectory != null ) { cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); } if ( arguments != null ) { for ( String argument : arguments ) { cl.createArg().setValue( argument ); } } return cl; } public ExecutionResult executeShellCommand( File workingDirectory, String executable, String arguments, File output, long idCommand, Map<String, String> environments ) throws Exception { Commandline cl = new Commandline(); Arg argument = cl.createArg(); argument.setLine( arguments ); return executeShellCommand( workingDirectory, executable, argument.getParts(), output, idCommand, environments ); } public ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments, File output, long idCommand, Map<String, String> environments ) throws Exception { FileOutputConsumer fileConsumer = new FileOutputConsumer( output ); try { return executeShellCommand( workingDirectory, executable, arguments, fileConsumer, idCommand, environments ); } finally { fileConsumer.close(); } } private static class IOConsumerWrapper implements StreamConsumer { private OutputConsumer userConsumer; public IOConsumerWrapper( OutputConsumer userConsumer ) { this.userConsumer = userConsumer; } public void consumeLine( String line ) { if ( userConsumer != null ) { userConsumer.consume( line ); } } } public ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments, OutputConsumer io, long idCommand, Map<String, String> environments ) throws Exception { Commandline cl = createCommandline( workingDirectory, executable, arguments, idCommand, environments ); log.info( "Executing: " + cl ); File clWorkDir = cl.getWorkingDirectory(); log.info( "Working directory: " + ( clWorkDir != null ? clWorkDir.getAbsolutePath() : "default" ) ); log.debug( "EnvironmentVariables " + Arrays.asList( cl.getEnvironmentVariables() ) ); StreamConsumer consumer = new IOConsumerWrapper( io ); int exitCode = runCommand( cl, consumer, consumer ); return new ExecutionResult( exitCode ); } public void executeGoals( File workingDirectory, String executable, String goals, boolean interactive, String arguments, ReleaseResult relResult, Map<String, String> environments ) throws Exception { Commandline cl = new Commandline(); Arg argument = cl.createArg(); argument.setLine( arguments ); executeGoals( workingDirectory, executable, goals, interactive, argument.getParts(), relResult, environments ); } public void executeGoals( File workingDirectory, String executable, String goals, boolean interactive, String[] arguments, ReleaseResult relResult, Map<String, String> environments ) throws Exception { if ( executable == null ) { executable = "mvn"; } Commandline cl = createCommandline( workingDirectory, executable, arguments, -1, environments ); if ( goals != null ) { // accept both space and comma, so the old way still work String[] tokens = StringUtils.split( goals, ", " ); for ( String token : tokens ) { cl.createArg().setValue( token ); } } cl.createArg().setValue( "--no-plugin-updates" ); if ( !interactive ) { cl.createArg().setValue( "--batch-mode" ); } StreamConsumer stdOut = new TeeConsumer( System.out ); StreamConsumer stdErr = new TeeConsumer( System.err ); try { relResult.appendInfo( "Executing: " + cl.toString() ); log.info( "Executing: " + cl.toString() ); int result = runCommand( cl, stdOut, stdErr ); if ( result != 0 ) { throw new MavenExecutorException( "Maven execution failed, exit code: \'" + result + "\'", result, stdOut.toString(), stdErr.toString() ); } } catch ( CommandLineException e ) { throw new MavenExecutorException( "Can't run goal " + goals, stdOut.toString(), stdErr.toString(), e ); } finally { relResult.appendOutput( stdOut.toString() ); } } public boolean isRunning( long idCommand ) { boolean isIdRunning = running.contains( idCommand ); log.debug( "process running for id {}? {}", idCommand, isIdRunning ); return isIdRunning; } public void killProcess( long idCommand ) { log.warn( "unsupported attempt to kill process for id {}", idCommand ); } /** * Handles all command executions for the helper, allowing it to track which commands are running. * The process tracking functionality done here attempts to mimick functionality lost with the move to * plexus-utils 3.0.15. The utility of this method depends on two assumptions: * * Command execution is synchronous (the thread is blocked while the command executes) * * The scope of this object is appropriate (singleton or otherwise) * * @param cli the command to run, will be tracked by abstract pid set * @param systemOut the stream handler for stdout from command * @param systemErr the stream handler for stderr from command * @return the exit code from the process */ private int runCommand( Commandline cli, StreamConsumer systemOut, StreamConsumer systemErr ) throws CommandLineException { Long pid = cli.getPid(); try { running.add( pid ); return CommandLineUtils.executeCommandLine( cli, systemOut, systemErr ); } finally { running.remove( pid ); } } }
5,365
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/shell/FileOutputConsumer.java
package org.apache.continuum.utils.shell; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 java.io.File; import java.io.FileDescriptor; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; /** * Collects output to a file using a buffered writer. Unlike the list-based consumer, this should be safe to use when * the output size is expected to be large. */ public class FileOutputConsumer implements OutputConsumer { private PrintWriter writer; /** * Creates a output consumer for the given file. * * @param outputFile the file to write the results to * @throws IOException if there is a problem creating a file */ public FileOutputConsumer( File outputFile ) throws IOException { this.writer = new PrintWriter( new FileWriter( outputFile ) ); this.writer.close(); // make the file exist immediately this.writer = new PrintWriter( new FileWriter( outputFile, true ), true ); // append to created file } public void consume( String line ) { if ( writer != null ) writer.println( line ); } public void close() { if ( writer != null ) writer.close(); } }
5,366
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/shell/OutputConsumer.java
package org.apache.continuum.utils.shell; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * Interface for handling shell output. * Created to avoid dependency on plexus's CommandLineUtils. */ public interface OutputConsumer { void consume( String line ); }
5,367
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/shell/LogOutputConsumer.java
package org.apache.continuum.utils.shell; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.slf4j.Logger; /** * Collects output to a logger. Unlike the list-based consumer, this should be safe to use when the output size is * expected to be large. It logs the output at level INFO. */ public class LogOutputConsumer implements OutputConsumer { private Logger log; public LogOutputConsumer( Logger log ) { this.log = log; } public void consume( String line ) { if ( log != null ) log.info( line ); } }
5,368
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/shell/ExecutionResult.java
package org.apache.continuum.utils.shell; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> */ public class ExecutionResult { private final int exitCode; public ExecutionResult( int exitCode ) { this.exitCode = exitCode; } public int getExitCode() { return exitCode; } }
5,369
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/m2/SettingsHelper.java
package org.apache.continuum.utils.m2; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.execution.SettingsConfigurationException; import org.apache.maven.settings.Settings; public interface SettingsHelper { String ROLE = SettingsHelper.class.getName(); Settings getSettings() throws SettingsConfigurationException; }
5,370
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/m2/DefaultLocalRepositoryHelper.java
package org.apache.continuum.utils.m2; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.LocalRepository; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.continuum.execution.SettingsConfigurationException; import org.apache.maven.settings.Settings; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Configuration; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.StringUtils; @Component( role = LocalRepositoryHelper.class, hint = "default" ) public class DefaultLocalRepositoryHelper implements LocalRepositoryHelper { @Requirement private ArtifactRepositoryFactory artifactRepositoryFactory; @Requirement private ArtifactRepositoryLayout repositoryLayout; @Requirement private SettingsHelper settingsHelper; @Configuration( "${plexus.home}/local-repository" ) private String localRepository; public ArtifactRepository getLocalRepository() throws SettingsConfigurationException { return getRepository( null, settingsHelper.getSettings() ); } public ArtifactRepository getLocalRepository( LocalRepository localRepo ) throws SettingsConfigurationException { return getRepository( localRepo, settingsHelper.getSettings() ); } private ArtifactRepository getRepository( LocalRepository repository, Settings settings ) { // ---------------------------------------------------------------------- // Set our configured location as the default but try to use the defaults // as returned by the MavenSettings component. // ---------------------------------------------------------------------- String localRepo = localRepository; if ( repository != null ) { return artifactRepositoryFactory.createArtifactRepository( repository.getName(), "file://" + repository.getLocation(), repositoryLayout, null, null ); } else if ( !( StringUtils.isEmpty( settings.getLocalRepository() ) ) ) { localRepo = settings.getLocalRepository(); } return artifactRepositoryFactory.createArtifactRepository( "local", "file://" + localRepo, repositoryLayout, null, null ); } public LocalRepository convertAgentRepo( org.apache.continuum.buildagent.model.LocalRepository repo ) { LocalRepository result = new LocalRepository(); result.setLayout( repo.getLayout() ); result.setName( repo.getName() ); result.setLocation( repo.getLocation() ); return result; } }
5,371
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/m2/DefaultSettingsHelper.java
package org.apache.continuum.utils.m2; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.execution.SettingsConfigurationException; import org.apache.maven.settings.MavenSettingsBuilder; import org.apache.maven.settings.Settings; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.IOException; @Service( "settingsHelper" ) public class DefaultSettingsHelper implements SettingsHelper { @Resource private MavenSettingsBuilder mavenSettingsBuilder; public Settings getSettings() throws SettingsConfigurationException { try { return mavenSettingsBuilder.buildSettings( false ); } catch ( IOException e ) { throw new SettingsConfigurationException( "error reading settings file", e ); } catch ( XmlPullParserException e ) { throw new SettingsConfigurationException( e.getMessage(), e.getCause(), e.getLineNumber(), e.getColumnNumber() ); } } }
5,372
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/m2/LocalRepositoryHelper.java
package org.apache.continuum.utils.m2; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.LocalRepository; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.continuum.execution.SettingsConfigurationException; public interface LocalRepositoryHelper { String ROLE = LocalRepositoryHelper.class.getName(); ArtifactRepository getLocalRepository() throws SettingsConfigurationException; ArtifactRepository getLocalRepository( LocalRepository localRepo ) throws SettingsConfigurationException; LocalRepository convertAgentRepo( org.apache.continuum.buildagent.model.LocalRepository repo ); }
5,373
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java
package org.apache.continuum.utils.build; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author Jevica Arianne B. Zurbano * @since 19 jun 09 */ public class BuildTrigger { private int trigger; private String triggeredBy; public BuildTrigger( int trigger ) { this.trigger = trigger; } public BuildTrigger( String triggeredBy ) { this.triggeredBy = triggeredBy; } public BuildTrigger( int trigger, String triggeredBy ) { this.trigger = trigger; this.triggeredBy = triggeredBy; } public void setTrigger( int trigger ) { this.trigger = trigger; } public int getTrigger() { return this.trigger; } public void setTriggeredBy( String triggeredBy ) { this.triggeredBy = triggeredBy; } public String getTriggeredBy() { return this.triggeredBy; } }
5,374
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/release/distributed
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/release/distributed/manager/DistributedReleaseManager.java
package org.apache.continuum.release.distributed.manager; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.configuration.BuildAgentConfigurationException; import org.apache.continuum.model.repository.LocalRepository; import org.apache.continuum.release.model.PreparedRelease; import org.apache.maven.continuum.model.project.Project; import org.apache.maven.continuum.release.ContinuumReleaseException; import org.apache.maven.shared.release.ReleaseResult; import java.util.List; import java.util.Map; import java.util.Properties; public interface DistributedReleaseManager { Map getReleasePluginParameters( int projectId, String pomFilename ) throws ContinuumReleaseException, BuildAgentConfigurationException; List<Map<String, String>> processProject( int projectId, String pomFilename, boolean autoVersionSubmodules ) throws ContinuumReleaseException, BuildAgentConfigurationException; String releasePrepare( Project project, Properties releaseProperties, Map<String, String> releaseVersion, Map<String, String> developmentVersion, Map<String, String> environments, String username ) throws ContinuumReleaseException, BuildAgentConfigurationException; ReleaseResult getReleaseResult( String releaseId ) throws ContinuumReleaseException, BuildAgentConfigurationException; Map<String, Object> getListener( String releaseId ) throws ContinuumReleaseException, BuildAgentConfigurationException; void removeListener( String releaseId ) throws ContinuumReleaseException, BuildAgentConfigurationException; @Deprecated String getPreparedReleaseName( String releaseId ) throws ContinuumReleaseException; Map<String, String> getPreparedReleases( String groupId, String artifactId ) throws ContinuumReleaseException; void releasePerform( int projectId, String releaseId, String goals, String arguments, boolean useReleaseProfile, LocalRepository repository, String username ) throws ContinuumReleaseException, BuildAgentConfigurationException; String releasePerformFromScm( int projectId, String goals, String arguments, boolean useReleaseProfile, LocalRepository repository, String scmUrl, String scmUsername, String scmPassword, String scmTag, String scmTagBase, Map environments, String username ) throws ContinuumReleaseException, BuildAgentConfigurationException; void releaseRollback( String releaseId, int projectId ) throws ContinuumReleaseException, BuildAgentConfigurationException; String releaseCleanup( String releaseId ) throws ContinuumReleaseException, BuildAgentConfigurationException; List<Map<String, Object>> getAllReleasesInProgress() throws ContinuumReleaseException, BuildAgentConfigurationException; String getDefaultBuildagent( int projectId ); PreparedRelease getPreparedRelease( String releaseId, String releaseType ) throws ContinuumReleaseException; }
5,375
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationServiceException.java
package org.apache.continuum.purge; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author Maria Catherine Tan * @since 25 jul 07 */ public class PurgeConfigurationServiceException extends Exception { public PurgeConfigurationServiceException( String message ) { super( message ); } public PurgeConfigurationServiceException( Throwable cause ) { super( cause ); } public PurgeConfigurationServiceException( String message, Throwable cause ) { super( message, cause ); } }
5,376
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/ContinuumPurgeManager.java
package org.apache.continuum.purge; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.DirectoryPurgeConfiguration; import org.apache.continuum.model.repository.DistributedDirectoryPurgeConfiguration; import org.apache.continuum.model.repository.DistributedRepositoryPurgeConfiguration; import org.apache.continuum.model.repository.RepositoryPurgeConfiguration; import org.apache.maven.continuum.model.project.Schedule; /** * @author Maria Catherine Tan * @since 25 jul 07 */ public interface ContinuumPurgeManager { String ROLE = ContinuumPurgeManager.class.getName(); /** * Purge repositories and directories * * @param schedule * @throws ContinuumPurgeManagerException */ void purge( Schedule schedule ) throws ContinuumPurgeManagerException; /** * Purge repository * * @param repoPurgeConfig * @throws ContinuumPurgeManagerException */ void purgeRepository( RepositoryPurgeConfiguration repoPurgeConfig ) throws ContinuumPurgeManagerException; /** * Purge directory * * @param dirPurgeConfig * @throws ContinuumPurgeManagerException */ void purgeDirectory( DirectoryPurgeConfiguration dirPurgeConfig ) throws ContinuumPurgeManagerException; /** * Purge directory in distributed build mode * * @param dirPurgeConfig distributed purge configuration * @throws ContinuumPurgeManagerException */ void purgeDistributedDirectory( DistributedDirectoryPurgeConfiguration dirPurgeConfig ) throws ContinuumPurgeManagerException; /** * Purge repository in distributed build mode * * @param repoPurgeConfig distributed purge configuration * @throws ContinuumPurgeManagerException */ void purgeDistributedRepository( DistributedRepositoryPurgeConfiguration repoPurgeConfig ) throws ContinuumPurgeManagerException; }
5,377
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/ContinuumPurgeManagerException.java
package org.apache.continuum.purge; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author Maria Catherine Tan * @since 25 jul 07 */ public class ContinuumPurgeManagerException extends Exception { public ContinuumPurgeManagerException( String message ) { super( message ); } public ContinuumPurgeManagerException( Throwable cause ) { super( cause ); } public ContinuumPurgeManagerException( String message, Throwable cause ) { super( message, cause ); } }
5,378
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java
package org.apache.continuum.purge; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.AbstractPurgeConfiguration; import org.apache.continuum.model.repository.DirectoryPurgeConfiguration; import org.apache.continuum.model.repository.DistributedDirectoryPurgeConfiguration; import org.apache.continuum.model.repository.DistributedRepositoryPurgeConfiguration; import org.apache.continuum.model.repository.RepositoryPurgeConfiguration; import org.apache.continuum.purge.repository.content.RepositoryManagedContent; import java.util.List; /** * @author Maria Catherine Tan * @since 25 jul 07 */ public interface PurgeConfigurationService { String ROLE = PurgeConfigurationService.class.getName(); AbstractPurgeConfiguration addPurgeConfiguration( AbstractPurgeConfiguration purgeConfig ) throws PurgeConfigurationServiceException; void updatePurgeConfiguration( AbstractPurgeConfiguration purgeConfig ) throws PurgeConfigurationServiceException; void removePurgeConfiguration( int purgeConfigId ) throws PurgeConfigurationServiceException; RepositoryPurgeConfiguration addRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge ) throws PurgeConfigurationServiceException; void updateRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge ) throws PurgeConfigurationServiceException; void removeRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge ) throws PurgeConfigurationServiceException; RepositoryPurgeConfiguration getRepositoryPurgeConfiguration( int repoPurgeId ) throws PurgeConfigurationServiceException; RepositoryPurgeConfiguration getDefaultPurgeConfigurationForRepository( int repositoryId ); List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsBySchedule( int scheduleId ); List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule( int scheduleId ); List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByRepository( int repositoryId ); List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations(); DirectoryPurgeConfiguration addDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge ) throws PurgeConfigurationServiceException; void updateDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge ) throws PurgeConfigurationServiceException; void removeDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge ) throws PurgeConfigurationServiceException; DirectoryPurgeConfiguration getDirectoryPurgeConfiguration( int dirPurgeId ) throws PurgeConfigurationServiceException; DirectoryPurgeConfiguration getDefaultPurgeConfigurationForDirectoryType( String directoryType ); List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsBySchedule( int scheduleId ); List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule( int scheduleId ); List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation( String location ); List<DirectoryPurgeConfiguration> getAllDirectoryPurgeConfigurations(); List<AbstractPurgeConfiguration> getAllPurgeConfigurations(); List<DistributedDirectoryPurgeConfiguration> getAllDistributedDirectoryPurgeConfigurations(); List<DistributedRepositoryPurgeConfiguration> getAllDistributedRepositoryPurgeConfigurations(); DistributedDirectoryPurgeConfiguration getDistributedDirectoryPurgeConfiguration( int dirPurgeId ) throws PurgeConfigurationServiceException; DistributedDirectoryPurgeConfiguration addDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration dirPurge ) throws PurgeConfigurationServiceException; void updateDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration dirPurge ) throws PurgeConfigurationServiceException; void removeDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration dirPurge ) throws PurgeConfigurationServiceException; AbstractPurgeConfiguration getPurgeConfiguration( int purgeConfigId ); List<DistributedDirectoryPurgeConfiguration> getEnableDistributedDirectoryPurgeConfigurationsBySchedule( int scheduleId ); List<DistributedRepositoryPurgeConfiguration> getEnableDistributedRepositoryPurgeConfigurationsBySchedule( int scheduleId ); /** * @param repositoryId * @return * @throws PurgeConfigurationServiceException */ RepositoryManagedContent getManagedRepositoryContent( int repositoryId ) throws PurgeConfigurationServiceException; }
5,379
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/repository
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/repository/content/RepositoryManagedContent.java
package org.apache.continuum.purge.repository.content; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.model.repository.LocalRepository; import org.apache.maven.archiva.model.ArtifactReference; import org.apache.maven.archiva.model.ProjectReference; import org.apache.maven.archiva.model.VersionedReference; import org.apache.maven.archiva.repository.ContentNotFoundException; import org.apache.maven.archiva.repository.layout.LayoutException; import java.io.File; import java.util.Set; /** * Taken from Archiva's ManagedRepositoryContent interface and made some few changes. * * @author Maria Catherine Tan * @since 25 jul 07 */ public interface RepositoryManagedContent { String ROLE = RepositoryManagedContent.class.getName(); /** * Delete from the local repository all files / directories associated with the * provided version reference. * * @param reference the version reference to delete. * @throws ContentNotFoundException */ public void deleteVersion( VersionedReference reference ) throws ContentNotFoundException; /** * <p> * Convenience method to get the repository id. * </p> * <p> * Equivalent to calling <code>.getRepository().getId()</code> * </p> * * @return the repository id. */ public int getId(); /** * <p> * Gather up the list of related artifacts to the ArtifactReference provided. * This typically inclues the pom files, and those things with * classifiers (such as doc, source code, test libs, etc...) * </p> * <p> * <strong>NOTE:</strong> Some layouts (such as maven 1 "legacy") are not compatible with this query. * </p> * * @param reference the reference to work off of. * @return the set of ArtifactReferences for related artifacts. * @throws ContentNotFoundException if the initial artifact reference does not exist within the repository. * @throws LayoutException */ public Set<ArtifactReference> getRelatedArtifacts( ArtifactReference reference ) throws ContentNotFoundException, LayoutException; /** * <p> * Convenience method to get the repository (on disk) root directory. * </p> * <p> * Equivalent to calling <code>.getLocalRepository().getDirectory()</code> * </p> * * @return the repository (on disk) root directory. */ public String getRepoRoot(); /** * Get the local repository associated with this * repository content. * * @return the local repository that is associated with this repository content. */ public LocalRepository getRepository(); /** * Given a specific {@link ProjectReference}, return the list of available versions for * that project reference. * * @param reference the project reference to work off of. * @return the list of versions found for that project reference. * @throws ContentNotFoundException if the project reference does not exist within the repository. * @throws LayoutException */ public Set<String> getVersions( ProjectReference reference ) throws ContentNotFoundException, LayoutException; /** * <p> * Given a specific {@link VersionedReference}, return the list of available versions for that * versioned reference. * </p> * <p> * <strong>NOTE:</strong> This is really only useful when working with SNAPSHOTs. * </p> * * @param reference the versioned reference to work off of. * @return the set of versions found. * @throws ContentNotFoundException if the versioned reference does not exist within the repository. * @throws LayoutException */ public Set<String> getVersions( VersionedReference reference ) throws ContentNotFoundException, LayoutException; /** * Set the local repository to associate with this * repository content. * * @param repo the repository to associate with this repository content. */ public void setRepository( LocalRepository repo ); /** * Given a repository relative path to a filename, return the {@link VersionedReference} object suitable for the path. * * @param path the path relative to the repository base dir for the artifact. * @return the {@link ArtifactReference} representing the path. (or null if path cannot be converted to * a {@link ArtifactReference}) * @throws LayoutException if there was a problem converting the path to an artifact. */ public ArtifactReference toArtifactReference( String path ) throws LayoutException; /** * Given an {@link ArtifactReference}, return the file reference to the artifact. * * @param reference the artifact reference to use. * @return the relative path to the artifact. */ public File toFile( ArtifactReference reference ); /** * Given a {@link ProjectReference}, return the path to the metadata for * the project. * * @param reference the reference to use. * @return the path to the metadata file, or null if no metadata is appropriate. */ public String toMetadataPath( ProjectReference reference ); /** * Given a {@link VersionedReference}, return the path to the metadata for * the specific version of the project. * * @param reference the reference to use. * @return the path to the metadata file, or null if no metadata is appropriate. */ public String toMetadataPath( VersionedReference reference ); /** * Given an {@link ArtifactReference}, return the relative path to the artifact. * * @param reference the artifact reference to use. * @return the relative path to the artifact. */ public String toPath( ArtifactReference reference ); }
5,380
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/repository
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/repository/scanner/RepositoryScanner.java
package org.apache.continuum.purge.repository.scanner; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.purge.executor.ContinuumPurgeExecutorException; import java.io.File; import java.util.List; /** * Codes were taken from Archiva and made some changes. * * @author Maria Catherine Tan * @since 25 jul 07 */ public interface RepositoryScanner { void scan( File repoLocation, ScannerHandler handler ) throws ContinuumPurgeExecutorException; void scan( File repoLocation, ScannerHandler handler, List<String> ignoredContentPatterns ) throws ContinuumPurgeExecutorException; }
5,381
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/repository
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/repository/scanner/ScannerHandler.java
package org.apache.continuum.purge.repository.scanner; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public interface ScannerHandler { void handle( String path ); }
5,382
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/executor/ContinuumPurgeExecutorException.java
package org.apache.continuum.purge.executor; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author Maria Catherine Tan * @since 25 jul 07 */ public class ContinuumPurgeExecutorException extends Exception { public ContinuumPurgeExecutorException( String message ) { super( message ); } public ContinuumPurgeExecutorException( Throwable cause ) { super( cause ); } public ContinuumPurgeExecutorException( String message, Throwable cause ) { super( message, cause ); } }
5,383
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/purge/executor/ContinuumPurgeExecutor.java
package org.apache.continuum.purge.executor; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author Maria Catherine Tan * @since 25 jul 07 */ public interface ContinuumPurgeExecutor { String ROLE = ContinuumPurgeExecutor.class.getName(); void purge( String path ) throws ContinuumPurgeExecutorException; }
5,384
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildManagerException.java
package org.apache.continuum.buildmanager; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a> */ public class BuildManagerException extends Exception { public BuildManagerException( String message ) { super( message ); } public BuildManagerException( Throwable cause ) { super( cause ); } public BuildManagerException( String message, Throwable cause ) { super( message, cause ); } }
5,385
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
package org.apache.continuum.buildmanager; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.taskqueue.BuildProjectTask; import org.apache.continuum.taskqueue.CheckOutTask; import org.apache.continuum.taskqueue.PrepareBuildProjectsTask; import org.apache.continuum.utils.build.BuildTrigger; import org.apache.maven.continuum.model.project.BuildDefinition; import org.apache.maven.continuum.model.project.BuildQueue; import org.apache.maven.continuum.model.project.Project; import org.apache.maven.continuum.model.scm.ScmResult; import java.io.File; import java.util.List; import java.util.Map; /** * BuildsManager. All builds whether forced or triggered will go through (or have to be added through) a builds manager. * * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a> */ public interface BuildsManager { /** * Build projects using their corresponding build definitions. This method adds the group of projects to the * build queue of the overall queue with the least amount of tasks queued. * * @param projects * @param projectsBuildDefinitionsMap * @param buildTrigger * @param scmResultMap TODO * @param projectGroupId * @throws BuildManagerException */ void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, Map<Integer, ScmResult> scmResultMap, int projectGroupId ) throws BuildManagerException; /** * Build the project using the specified build definition. Adds the project to the build queue of the overall queue with the * least among of tasks queued. The overall queue is chosen from the pool of queues attached to the schedule of the * build definition. * * @param projectId * @param buildDefinition * @param projectName * @param buildTrigger * @param scmResult TODO * @param projectGroupId * @throws BuildManagerException */ void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, BuildTrigger buildTrigger, ScmResult scmResult, int projectGroupId ) throws BuildManagerException; /** * Adds the projects in the prepare-build-queue. * * @param projectsBuildDefinitionsMap * @param buildTrigger * @param projectGroupId TODO * @param scmRootAddress TODO * @param scmRootId * @throws BuildManagerException */ void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId, String projectGroupName, String scmRootAddress, int scmRootId ) throws BuildManagerException; /** * Adds the project to the checkout queue of the overall build queue with the least amount of tasks queued. * The overall queue is chosen from the pool of queues attached to the schedule of the build definition. * * @param projectId * @param projectName * @param workingDirectory * @param scmRootUrl TODO * @param scmUsername * @param scmPassword * @param defaultBuildDefinition * @param subProjects TODO * @throws BuildManagerException */ void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl, String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition, List<Project> subProjects ) throws BuildManagerException; /** * Cancels the specified project's build. * * @param projectId * @return * @throws BuildManagerException */ boolean cancelBuild( int projectId ) throws BuildManagerException; /** * Cancels all the builds in all the overall queues. * * @return * @throws BuildManagerException */ boolean cancelAllBuilds() throws BuildManagerException; /** * Cancels the current build on the specified overall queue. * * @param buildQueueId * @return * @throws BuildManagerException */ boolean cancelBuildInQueue( int buildQueueId ) throws BuildManagerException; /** * @param projectId * @return * @throws BuildManagerException */ boolean cancelCheckout( int projectId ) throws BuildManagerException; /** * @return * @throws BuildManagerException */ boolean cancelAllCheckouts() throws BuildManagerException; // public boolean cancelPrepareBuild(int projectId) throws BuildManagerException; /** * Cancels all the prepare builds in all overall queues */ boolean cancelAllPrepareBuilds() throws BuildManagerException; /** * Cancels the specified project group prepare build * * @param projectGroupId * @param scmRootId * @return * @throws BuildManagerException */ boolean cancelPrepareBuild( int projectGroupId, int scmRootId ) throws BuildManagerException; /** * Cancels the specified project prepare build * * @param projectId * @return * @throws BuildManagerException */ boolean cancelPrepareBuild( int projectId ) throws BuildManagerException; /** * Removes the project from the build queue. * * @param projectId * @throws BuildManagerException */ void removeProjectFromBuildQueue( int projectId ) throws BuildManagerException; /** * Removes the project built using the specified build definition from the build queue. * * @param projectId * @param buildDefinitionId * @param buildTrigger * @param projectName * @param projectGroupId * @throws BuildManagerException */ void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, String projectName, int projectGroupId ) throws BuildManagerException; // TODO: should we throw an exception when one of the projects cannot be removed? /** * Removes the specified projects from their build queues. * * @param projectIds */ void removeProjectsFromBuildQueue( int[] projectIds ); /** * Removes a set of projects using the specified hashcodes from the build queues. * * @param hascodes * @throws BuildManagerException */ void removeProjectsFromBuildQueueWithHashcodes( int[] hascodes ) throws BuildManagerException; /** * Removes the project from the checkout queue. * * @param projectId * @throws BuildManagerException */ void removeProjectFromCheckoutQueue( int projectId ) throws BuildManagerException; /** * Removes the specified projects from their checkout queues. * * @param projectIds */ void removeProjectsFromCheckoutQueue( int[] projectIds ); /** * Removes a set of projects using the specified hashcodes from the checkout queues. * * @param hashcodes * @throws BuildManagerException */ void removeProjectsFromCheckoutQueueWithHashcodes( int[] hashcodes ) throws BuildManagerException; boolean removeProjectGroupFromPrepareBuildQueue( int projectGroupId, String scmRootAddress ) throws BuildManagerException; /*void removeProjectFromPrepareBuildQueue( int projectId ) throws BuildManagerException; void removeProjectsFromPrepareBuildQueue( int[] projectIds ) throws BuildManagerException;*/ /** * Add an overall build queue. * * @param buildQueue * @throws BuildManagerException TODO */ void addOverallBuildQueue( BuildQueue buildQueue ) throws BuildManagerException; /** * Remove an overall build queue. * * @param overallBuildQueueId * @throws BuildManagerException */ void removeOverallBuildQueue( int overallBuildQueueId ) throws BuildManagerException; /** * Checks whether the project build is queued. * * @param projectId * @return * @throws BuildManagerException */ boolean isInAnyBuildQueue( int projectId ) throws BuildManagerException; /** * Checks whether the project build using the specified build definition is queued. * * @param projectId * @param buildDefinitionId * @return * @throws BuildManagerException */ boolean isInAnyBuildQueue( int projectId, int buildDefinitionId ) throws BuildManagerException; /** * Checks whether the project checkout is already queued. * * @param projectId * @return * @throws BuildManagerException */ boolean isInAnyCheckoutQueue( int projectId ) throws BuildManagerException; /** * Checks if at least one of the projects is currently being checked out. * * @param projectIds * @return * @throws BuildManagerException */ boolean isAnyProjectCurrentlyBeingCheckedOut( int[] projectIds ) throws BuildManagerException; /** * Checks whether the project is already in the prepare-build queue. * * @param projectId * @return * @throws BuildManagerException */ boolean isInPrepareBuildQueue( int projectId ) throws BuildManagerException; /** * Checks where the project group is already in the prepare-build queue * * @param projectGroupId * @param scmRootId * @return * @throws BuildManagerException */ boolean isInPrepareBuildQueue( int projectGroupId, int scmRootId ) throws BuildManagerException; /** * Checks whether the project is currently being built. * * @param projectId * @return * @throws BuildManagerException */ boolean isProjectInAnyCurrentBuild( int projectId ) throws BuildManagerException; /** * Checks if at least one of the projects is currently preparing build * * @param projectIds * @return * @throws BuildManagerException */ boolean isAnyProjectCurrentlyPreparingBuild( int[] projectIds ) throws BuildManagerException; // needed in QueuesAction /** * Returns all the build tasks currently being executed. * * @return * @throws BuildManagerException */ Map<String, BuildProjectTask> getCurrentBuilds() throws BuildManagerException; /** * Returns all the checkout tasks currently being executed. * * @return * @throws BuildManagerException */ Map<String, CheckOutTask> getCurrentCheckouts() throws BuildManagerException; /** * Returns all the overall build queues together with a list of the build tasks in it's build queue. * * @return * @throws BuildManagerException */ Map<String, List<BuildProjectTask>> getProjectsInBuildQueues() throws BuildManagerException; /** * Returns all the overall build queues together with a list of checkout tasks in it's checkout queue. * * @return * @throws BuildManagerException */ Map<String, List<CheckOutTask>> getProjectsInCheckoutQueues() throws BuildManagerException; /** * Checks whether a build is in progress. * * @return */ boolean isBuildInProgress(); /** * Checks if at least one of the projects is currently building. * * @param projectIds * @return * @throws BuildManagerException */ boolean isAnyProjectCurrentlyBuilding( int[] projectIds ) throws BuildManagerException; /** * Checks whether project is currently being checked out. * * @param projectId * @return * @throws BuildManagerException */ boolean isProjectCurrentlyBeingCheckedOut( int projectId ) throws BuildManagerException; /** * Checks whether project is currently preparing build * * @param projectId * @return * @throws BuildManagerException */ boolean isProjectCurrentlyPreparingBuild( int projectId ) throws BuildManagerException; /** * Checks whether project group is currently preparing build * * @param projectGroupId * @param scmRootId * @return * @throws BuildManagerException */ boolean isProjectGroupCurrentlyPreparingBuild( int projectGroupId, int scmRootId ) throws BuildManagerException; /** * Return currently preparing build project. * * @return * @throws BuildManagerException */ Map<String, PrepareBuildProjectsTask> getCurrentProjectInPrepareBuild() throws BuildManagerException; /** * Return all projects in prepare build queue. * * @return * @throws BuildManagerException */ Map<String, List<PrepareBuildProjectsTask>> getProjectsInPrepareBuildQueue() throws BuildManagerException; /** * Remove a project from a prepare build queue. * * @param projectGroupId * @param scmRootId * @return * @throws BuildManagerException */ boolean removeProjectFromPrepareBuildQueue( int projectGroupId, int scmRootId ) throws BuildManagerException; /** * Removes a set of projects using the specified hashcodes from the prepare build queues. * * @param hashcodes * @throws BuildManagerException */ void removeProjectsFromPrepareBuildQueueWithHashCodes( int[] hashCodes ) throws BuildManagerException; }
5,386
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueService.java
package org.apache.continuum.buildqueue; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.BuildQueue; import java.util.List; /** * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a> */ public interface BuildQueueService { BuildQueue addBuildQueue( BuildQueue buildQueue ) throws BuildQueueServiceException; void removeBuildQueue( BuildQueue buildQueue ) throws BuildQueueServiceException; BuildQueue getBuildQueue( int buildQueueId ) throws BuildQueueServiceException; BuildQueue getBuildQueueByName( String buildQueueName ) throws BuildQueueServiceException; BuildQueue updateBuildQueue( BuildQueue buildQueue ) throws BuildQueueServiceException; List<BuildQueue> getAllBuildQueues() throws BuildQueueServiceException; }
5,387
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueServiceException.java
package org.apache.continuum.buildqueue; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a> */ public class BuildQueueServiceException extends Exception { public BuildQueueServiceException( String message ) { super( message ); } public BuildQueueServiceException( Throwable cause ) { super( cause ); } public BuildQueueServiceException( String message, Throwable cause ) { super( message, cause ); } }
5,388
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed/DistributedBuildService.java
package org.apache.continuum.builder.distributed; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.ContinuumException; import java.util.Map; public interface DistributedBuildService { String ROLE = DistributedBuildService.class.getName(); void prepareBuildFinished( Map<String, Object> context ) throws ContinuumException; boolean shouldBuild( Map<String, Object> context ); void startPrepareBuild( Map<String, Object> context ) throws ContinuumException; void startProjectBuild( int projectId, int buildDefinitionId ) throws ContinuumException; void updateBuildResult( Map<String, Object> context ) throws ContinuumException; void updateProject( Map<String, Object> context ) throws ContinuumException; Map<String, String> getEnvironments( int buildDefinitionId, String installationType ) throws ContinuumException; }
5,389
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
package org.apache.continuum.builder.distributed.manager; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.continuum.buildagent.NoBuildAgentException; import org.apache.continuum.buildagent.NoBuildAgentInGroupException; import org.apache.continuum.configuration.BuildAgentConfiguration; import org.apache.continuum.model.project.ProjectRunSummary; import org.apache.continuum.model.project.ProjectScmRoot; import org.apache.continuum.taskqueue.BuildProjectTask; import org.apache.continuum.taskqueue.PrepareBuildProjectsTask; import org.apache.continuum.utils.build.BuildTrigger; import org.apache.maven.continuum.ContinuumException; import org.apache.maven.continuum.model.system.Installation; import java.util.List; import java.util.Map; public interface DistributedBuildManager { String ROLE = DistributedBuildManager.class.getName(); void cancelDistributedBuild( String buildAgentUrl ) throws ContinuumException; void reload() throws ContinuumException; void update( BuildAgentConfiguration buildAgent ) throws ContinuumException; void removeDistributedBuildQueueOfAgent( String buildAgentUrl ) throws ContinuumException; boolean isBuildAgentBusy( String buildAgentUrl ); List<Installation> getAvailableInstallations( String buildAgentUrl ) throws ContinuumException; String getBuildAgentPlatform( String buildAgentUrl ) throws ContinuumException; Map<String, List<PrepareBuildProjectsTask>> getProjectsInPrepareBuildQueue() throws ContinuumException; Map<String, List<BuildProjectTask>> getProjectsInBuildQueue() throws ContinuumException; Map<String, Object> getBuildResult( int projectId ) throws ContinuumException; String generateWorkingCopyContent( int projectId, String directory, String baseUrl, String imagesBaseUrl ) throws ContinuumException; Map<String, Object> getFileContent( int projectId, String directory, String filename ) throws ContinuumException; void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId, String projectGroupName, String scmRootAddress, int scmRootId, List<ProjectScmRoot> scmRoots ) throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException; Map<String, PrepareBuildProjectsTask> getProjectsCurrentlyPreparingBuild() throws ContinuumException; Map<String, BuildProjectTask> getProjectsCurrentlyBuilding() throws ContinuumException; void removeFromPrepareBuildQueue( String buildAgentUrl, int projectGroupId, int scmRootId ) throws ContinuumException; void removeFromPrepareBuildQueue( List<String> hashCodes ) throws ContinuumException; void removeFromBuildQueue( String buildAgentUrl, int projectId, int buildDefinitionId ) throws ContinuumException; void removeFromBuildQueue( List<String> hashCodes ) throws ContinuumException; boolean isAgentAvailable( String buildAgentUrl ) throws ContinuumException; boolean pingBuildAgent( String buildAgentUrl ) throws ContinuumException; boolean isProjectInAnyPrepareBuildQueue( int projectId, int buildDefinitionId ) throws ContinuumException; boolean isProjectInAnyBuildQueue( int projectId, int buildDefinitionId ) throws ContinuumException; boolean isProjectCurrentlyPreparingBuild( int projectId, int buildDefinitionId ) throws ContinuumException; boolean isProjectCurrentlyBuilding( int projectId, int buildDefinitionId ) throws ContinuumException; String getBuildAgentUrl( int projectId, int buildDefinitionId ) throws ContinuumException; List<ProjectRunSummary> getCurrentRuns(); ProjectRunSummary getCurrentRun( int projectId, int buildDefinitionId ) throws ContinuumException; ProjectRunSummary getCanceledRun( int projectId, int buildDefinitionId ) throws ContinuumException; void removeCanceledRun( ProjectRunSummary canceled ); void removeCurrentRun( int projectId, int buildDefinitionId ); void cancelBuild( int projectId ) throws ContinuumException; void cancelGroupBuild( int projectGroupId ) throws ContinuumException; }
5,390
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed/work/BuildStatusUpdater.java
package org.apache.continuum.builder.distributed.work; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public interface BuildStatusUpdater { void performScan(); }
5,391
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskExecutor.java
package org.apache.continuum.builder.distributed.executor; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.codehaus.plexus.taskqueue.Task; import org.codehaus.plexus.taskqueue.execution.TaskExecutionException; public interface DistributedBuildTaskExecutor { void executeTask( Task task ) throws TaskExecutionException; String getBuildAgentUrl(); void setBuildAgentUrl( String buildAgentUrl ); }
5,392
0
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed
Create_ds/continuum/continuum-api/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskQueueExecutor.java
package org.apache.continuum.builder.distributed.executor; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.codehaus.plexus.taskqueue.Task; import org.codehaus.plexus.taskqueue.TaskQueue; public interface DistributedBuildTaskQueueExecutor { String ROLE = DistributedBuildTaskQueueExecutor.class.getName(); /** * Returns the build agent url of task queue executor * * @return the build agent url */ String getBuildAgentUrl(); /** * Sets the build agent url of this task queue executor * * @param buildAgentUrl */ void setBuildAgentUrl( String buildAgentUrl ); /** * Returns the currently executing task. * * @return the currently executing task. */ Task getCurrentTask(); /** * Cancels execution of this task, if it's currently running. * Does NOT remove it from the associated queue! * * @param task The task to cancel * @return true if the task was cancelled, false if the task was not executing. */ boolean cancelTask( Task task ); /** * Returns the task queue * * @return the TaskQueue of the task queue executor */ public TaskQueue getQueue(); }
5,393
0
Create_ds/continuum/continuum-security/src/main/java/org/apache/maven/continuum
Create_ds/continuum/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java
package org.apache.maven.continuum.security; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /** * ContinuumRoleConstants: * * @author Jesse McConnell <jmcconnell@apache.org> */ public class ContinuumRoleConstants { public static final String DELIMITER = " - "; // globalish roles public static final String SYSTEM_ADMINISTRATOR_ROLE = "System Administrator"; public static final String USER_ADMINISTRATOR_ROLE = "User Administrator"; public static final String GROUP_ADMINISTRATOR_ROLE = "Continuum Group Project Administrator"; public static final String REGISTERED_USER_ROLE = "Registered User"; public static final String GUEST_ROLE = "Guest"; // roles public static final String CONTINUUM_PROJECT_ADMINISTRATOR_ROLE_PREFIX = "Project Administrator"; public static final String CONTINUUM_PROJECT_DEVELOPER_ROLE_PREFIX = "Project Developer"; public static final String CONTINUUM_PROJECT_USER_ROLE_PREFIX = "Project User"; // global operations public static final String CONTINUUM_MANAGE_SCHEDULES = "continuum-manage-schedules"; public static final String CONTINUUM_MANAGE_CONFIGURATION = "continuum-manage-configuration"; public static final String CONTINUUM_MANAGE_USERS = "continuum-manage-users"; public static final String CONTINUUM_ACTIVE_GUEST_OPERATION = "continuum-guest"; // dynamic operations public static final String CONTINUUM_VIEW_GROUP_OPERATION = "continuum-view-group"; public static final String CONTINUUM_ADD_GROUP_OPERATION = "continuum-add-group"; public static final String CONTINUUM_REMOVE_GROUP_OPERATION = "continuum-remove-group"; public static final String CONTINUUM_BUILD_GROUP_OPERATION = "continuum-build-group"; public static final String CONTINUUM_MODIFY_GROUP_OPERATION = "continuum-modify-group"; public static final String CONTINUUM_ADD_PROJECT_TO_GROUP_OPERATION = "continuum-add-project-to-group"; public static final String CONTINUUM_REMOVE_PROJECT_FROM_GROUP_OPERATION = "continuum-remove-project-from-group"; public static final String CONTINUUM_MODIFY_PROJECT_IN_GROUP_OPERATION = "continuum-modify-project-in-group"; public static final String CONTINUUM_BUILD_PROJECT_IN_GROUP_OPERATION = "continuum-build-project-in-group"; public static final String CONTINUUM_ADD_GROUP_BUILD_DEFINTION_OPERATION = "continuum-add-group-build-definition"; public static final String CONTINUUM_REMOVE_GROUP_BUILD_DEFINITION_OPERATION = "continuum-remove-group-build-definition"; public static final String CONTINUUM_MODIFY_GROUP_BUILD_DEFINITION_OPERATION = "continuum-modify-group-build-definition"; public static final String CONTINUUM_ADD_GROUP_NOTIFIER_OPERATION = "continuum-add-group-notifier"; public static final String CONTINUUM_REMOVE_GROUP_NOTIFIER_OPERATION = "continuum-remove-group-notifier"; public static final String CONTINUUM_MODIFY_GROUP_NOTIFIER_OPERATION = "continuum-modify-group-notifier"; public static final String CONTINUUM_ADD_PROJECT_BUILD_DEFINTION_OPERATION = "continuum-add-project-build-definition"; public static final String CONTINUUM_REMOVE_PROJECT_BUILD_DEFINITION_OPERATION = "continuum-remove-project-build-definition"; public static final String CONTINUUM_MODIFY_PROJECT_BUILD_DEFINITION_OPERATION = "continuum-modify-project-build-definition"; public static final String CONTINUUM_ADD_PROJECT_NOTIFIER_OPERATION = "continuum-add-project-notifier"; public static final String CONTINUUM_REMOVE_PROJECT_NOTIFIER_OPERATION = "continuum-remove-project-notifier"; public static final String CONTINUUM_MODIFY_PROJECT_NOTIFIER_OPERATION = "continuum-modify-project-notifier"; // operations against user assignment. public static final String USER_MANAGEMENT_ROLE_GRANT_OPERATION = "user-management-role-grant"; public static final String USER_MANAGEMENT_USER_ROLE_OPERATION = "user-management-user-role"; public static final String CONTINUUM_MANAGE_INSTALLATIONS = "continuum-manage-installations"; public static final String CONTINUUM_MANAGE_PROFILES = "continuum-manage-profiles"; public static final String CONTINUUM_MANAGE_BUILD_TEMPLATES = "continuum-manage-build-templates"; public static final String CONTINUUM_MANAGE_QUEUES = "continuum-manage-queues"; public static final String CONTINUUM_VIEW_QUEUES = "continuum-view-queues"; public static final String CONTINUUM_MANAGE_REPOSITORIES = "continuum-manage-repositories"; public static final String CONTINUUM_MANAGE_PURGING = "continuum-manage-purging"; public static final String CONTINUUM_MANAGE_DISTRIBUTED_BUILDS = "continuum-manage-distributed-builds"; public static final String CONTINUUM_VIEW_RELEASE = "continuum-view-release"; public static final String CONTINUUM_MANAGE_PARALLEL_BUILDS = "continuum-manage-parallel-builds"; public static final String CONTINUUM_VIEW_REPORT = "continuum-view-report"; }
5,394
0
Create_ds/continuum/continuum-model/src/main/java/org/apache/maven/continuum/model
Create_ds/continuum/continuum-model/src/main/java/org/apache/maven/continuum/model/project/ContinuumModelloMetadata.java
package org.apache.maven.continuum.model.project; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public class ContinuumModelloMetadata { private String modelVersion; public String getModelVersion() { return modelVersion; } public void setModelVersion( String modelVersion ) { this.modelVersion = modelVersion; } }
5,395
0
Create_ds/continuum/continuum-model/src/main/java/org/apache/continuum/model
Create_ds/continuum/continuum-model/src/main/java/org/apache/continuum/model/release/ReleaseListenerSummary.java
package org.apache.continuum.model.release; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 java.util.List; public class ReleaseListenerSummary { private String goalName; private String error; private String username; private String inProgress; private int state; private List<String> phases; public String getGoalName() { return goalName; } public void setGoalName( String goalName ) { this.goalName = goalName; } public String getError() { return error; } public void setError( String error ) { this.error = error; } public String getUsername() { return username; } public void setUsername( String username ) { this.username = username; } public String getInProgress() { return inProgress; } public void setInProgress( String inProgress ) { this.inProgress = inProgress; } public int getState() { return state; } public void setState( int state ) { this.state = state; } public List<String> getPhases() { return phases; } public void setPhases( List<String> phases ) { this.phases = phases; } public List<String> getCompletedPhases() { return completedPhases; } public void setCompletedPhases( List<String> completedPhases ) { this.completedPhases = completedPhases; } private List<String> completedPhases; }
5,396
0
Create_ds/continuum/continuum-model/src/main/java/org/apache/continuum/model
Create_ds/continuum/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectGroupSummary.java
package org.apache.continuum.model.project; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public class ProjectGroupSummary { private int projectGroupId; private int numberOfSuccesses; private int numberOfFailures; private int numberOfErrors; private int numberOfProjects; public ProjectGroupSummary() { } public ProjectGroupSummary( int projectGroupId ) { this.projectGroupId = projectGroupId; } public int getProjectGroupId() { return projectGroupId; } public void setProjectGroupId( int projectGroupId ) { this.projectGroupId = projectGroupId; } public void setNumberOfSuccesses( int numberOfSuccesses ) { this.numberOfSuccesses = numberOfSuccesses; } public int getNumberOfSuccesses() { return numberOfSuccesses; } public void setNumberOfFailures( int numberOfFailures ) { this.numberOfFailures = numberOfFailures; } public int getNumberOfFailures() { return numberOfFailures; } public void setNumberOfErrors( int numberOfErrors ) { this.numberOfErrors = numberOfErrors; } public int getNumberOfErrors() { return numberOfErrors; } public void setNumberOfProjects( int numberOfProjects ) { this.numberOfProjects = numberOfProjects; } public int getNumberOfProjects() { return numberOfProjects; } public void addProjects( int projects ) { this.numberOfProjects += projects; } public void addNumberOfSuccesses( int numberOfSuccesses ) { this.numberOfSuccesses += numberOfSuccesses; } public void addNumberOfErrors( int numberOfErrors ) { this.numberOfErrors += numberOfErrors; } public void addNumberOfFailures( int numberOfFailures ) { this.numberOfFailures += numberOfFailures; } }
5,397
0
Create_ds/continuum/continuum-model/src/main/java/org/apache/continuum/model
Create_ds/continuum/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectSummaryResult.java
package org.apache.continuum.model.project; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public class ProjectSummaryResult { private int projectGroupId; private int projectState; private long size; public ProjectSummaryResult( int projectGroupId, int projectState, long size ) { this.projectGroupId = projectGroupId; this.projectState = projectState; this.size = size; } public int getProjectGroupId() { return projectGroupId; } public void setProjectGroupId( int projectGroupId ) { this.projectGroupId = projectGroupId; } public int getProjectState() { return projectState; } public void setProjectState( int projectState ) { this.projectState = projectState; } public long getSize() { return size; } public void setSize( long size ) { this.size = size; } }
5,398
0
Create_ds/continuum/continuum-model/src/main/java/org/apache/continuum/model
Create_ds/continuum/continuum-model/src/main/java/org/apache/continuum/model/project/ProjectRunSummary.java
package org.apache.continuum.model.project; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ public class ProjectRunSummary { private int projectId; private int buildDefinitionId; private int projectGroupId; private int projectScmRootId; private String buildAgentUrl; private int trigger; private String triggeredBy; private int buildResultId; public int getProjectId() { return projectId; } public void setProjectId( int projectId ) { this.projectId = projectId; } public int getBuildDefinitionId() { return buildDefinitionId; } public void setBuildDefinitionId( int buildDefinitionId ) { this.buildDefinitionId = buildDefinitionId; } public int getProjectGroupId() { return projectGroupId; } public void setProjectGroupId( int projectGroupId ) { this.projectGroupId = projectGroupId; } public int getProjectScmRootId() { return projectScmRootId; } public void setProjectScmRootId( int projectScmRootId ) { this.projectScmRootId = projectScmRootId; } public String getBuildAgentUrl() { return buildAgentUrl; } public void setBuildAgentUrl( String buildAgentUrl ) { this.buildAgentUrl = buildAgentUrl; } public int getTrigger() { return trigger; } public void setTrigger( int trigger ) { this.trigger = trigger; } public String getTriggeredBy() { return triggeredBy; } public void setTriggeredBy( String triggeredBy ) { this.triggeredBy = triggeredBy; } public int getBuildResultId() { return buildResultId; } public void setBuildResultId( int buildResultId ) { this.buildResultId = buildResultId; } }
5,399