From a969bee9193e0ddede577a819de4f9732328c7b6 Mon Sep 17 00:00:00 2001 From: Stephen Connolly Date: Wed, 4 Jan 2017 11:24:19 +0000 Subject: [PATCH] [FIXED JENKINS-38718] Add a metadata action to identify 'primary instances' --- .../PrimaryInstanceMetadataAction.java | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/main/java/jenkins/scm/api/metadata/PrimaryInstanceMetadataAction.java diff --git a/src/main/java/jenkins/scm/api/metadata/PrimaryInstanceMetadataAction.java b/src/main/java/jenkins/scm/api/metadata/PrimaryInstanceMetadataAction.java new file mode 100644 index 00000000..58c989ac --- /dev/null +++ b/src/main/java/jenkins/scm/api/metadata/PrimaryInstanceMetadataAction.java @@ -0,0 +1,79 @@ +/* + * The MIT License + * + * Copyright (c) 2017 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.scm.api.metadata; + +import hudson.model.InvisibleAction; +import hudson.model.TaskListener; +import java.io.Serializable; +import jenkins.scm.api.SCMCategory; +import jenkins.scm.api.SCMHead; +import jenkins.scm.api.SCMHeadEvent; +import jenkins.scm.api.SCMNavigator; +import jenkins.scm.api.SCMSource; +import jenkins.scm.api.SCMSourceEvent; + +/** + * Identifies a {@link SCMHead} / {@link SCMSource} as being a primary instance. Some examples of how this metadata is + * intended to be used: + * + * + * Consumers of the SCM API should assume that: + * + * + * @since 2.0.1 + */ +public class PrimaryInstanceMetadataAction extends InvisibleAction implements Serializable { + /** + * Ensure consistent serialization. + */ + private static final long serialVersionUID = 1L; + +}