org.marvelution.jira.plugins.jenkins.dao.IssueDAO Maven / Gradle / Ivy
/*
* Copyright (c) 2012-present Marvelution B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.marvelution.jira.plugins.jenkins.dao;
import java.util.Set;
import org.marvelution.jira.plugins.jenkins.model.Build;
import org.marvelution.jira.plugins.jenkins.model.Job;
/**
* Issue Data Access Service
*
* @author Mark Rekveld
* @since 1.0.0
*/
public interface IssueDAO {
/**
* Get all the related Issue Keys for the {@link Build} given
*
* @param build the {@link Build} to get the issue keys for
* @return the collection of all the related issue keys
*/
Set getIssueKeysByBuild(Build build);
/**
* Get all the related Issue Keys for the {@link Job} given
*
* @param job the {@link Job} to get the issue keys for
* @return the collection of all the related issue keys
*/
Set getIssueKeysByJob(Job job);
/**
* Get all the related Project Keys for the {@link Build} given
*
* @param build the {@link Build} to get the project keys for
* @return the collection of all the related project keys
*/
Set getProjectKeysByBuild(Build build);
/**
* Get the count of issues related for the given {@link Build}
*
* @param build the {@link Build}
* @return the count, zero or higher
*/
int getIssueLinkCount(Build build);
/**
* Create a new link between the given {@link Build} and issue key
*
* @param build the {@link Build}
* @param issueKey the issue key to link with
* @return {@code true} in case of a successful link, {@code false} otherwise
*/
boolean link(Build build, String issueKey);
/**
* Unlink all builds related to the {@code issueKey} given
*
* @param issueKey the {@code issueKey} unlink
*/
void unlinkForIssueKey(String issueKey);
/**
* Unlink all builds related to the {@code projectKey} given
*
* @param projectKey the {@code projectKey} unlink
*/
void unlinkForProjectKey(String projectKey);
/**
* Delete all the issue links for the specified builds
*
* @since 2.3.0
*/
void delete(int... buildIds);
}