Class AbstractClaimBuildAction<T extends Saveable>

    • Method Detail

      • getOwner

        protected abstract T getOwner()
      • doClaim

        @POST
        public final void doClaim​(org.kohsuke.stapler.StaplerRequest req,
                                  org.kohsuke.stapler.StaplerResponse resp)
                           throws Exception
        Throws:
        Exception
      • claim

        public final void claim​(User claimedByUser,
                                String providedReason,
                                User assignedByUser,
                                Date date,
                                boolean isSticky,
                                boolean isPropagated,
                                boolean notify)
        Claims a Saveable, and optionally notifies of the claim.
        Parameters:
        claimedByUser - claiming user
        providedReason - reason for the claim
        assignedByUser - assigner user
        date - date of the claim
        isSticky - true if the claim has to be kept until resolution
        isPropagated - true if the claim has to be propagated to following builds
        notify - true if notifications have to be sent
      • sendInitialClaimEmail

        protected abstract void sendInitialClaimEmail​(User claimedByUser,
                                                      String providedReason,
                                                      User assignedByUser)
                                               throws jakarta.mail.MessagingException,
                                                      IOException,
                                                      InterruptedException
        Sends an initial claim email.
        Parameters:
        claimedByUser - the claiming user
        providedReason - reason for the claim
        assignedByUser - the assigner user
        Throws:
        jakarta.mail.MessagingException - if there has been some problem with sending the email
        IOException - if there is an IO problem when sending the mail
        InterruptedException - if the send operation is interrupted
      • applyClaim

        protected void applyClaim​(@Nonnull
                                  User claimedByUser,
                                  String providedReason,
                                  @Nonnull
                                  User assignedByUser,
                                  Date date,
                                  boolean isSticky,
                                  boolean isPropagated)
        Applies the claim data to the AbstractClaimBuildAction.
        Parameters:
        claimedByUser - the claiming user
        providedReason - reason for the claim
        assignedByUser - the assigner user
        date - date of the claim
        isSticky - true if the claim has to be kept until resolution
        isPropagated - true if the claim has to be propagated to following builds
      • doUnclaim

        @POST
        public final void doUnclaim​(org.kohsuke.stapler.StaplerRequest req,
                                    org.kohsuke.stapler.StaplerResponse resp)
                             throws javax.servlet.ServletException,
                                    IOException
        Throws:
        javax.servlet.ServletException
        IOException
      • unclaim

        public final void unclaim​(boolean notify)
        Unclaims a Saveable, and optionally notifies of the unclaim.
        Parameters:
        notify - true if notifications have to be sent
      • getClaimedBy

        @Exported
        public final String getClaimedBy()
      • getAssignedBy

        @Exported
        public final String getAssignedBy()
      • getClaimedByName

        public final String getClaimedByName()
      • getAssignedByName

        public final String getAssignedByName()
      • setClaimedBy

        public final void setClaimedBy​(String claimedBy)
      • setAssignedBy

        public final void setAssignedBy​(String assignedBy)
      • isClaimed

        @Exported
        public final boolean isClaimed()
      • copyTo

        protected boolean copyTo​(AbstractClaimBuildAction<T> other)
        Claim a new Saveable with the same settings as this one.
        Parameters:
        other - the source data
        Returns:
        true if claim has been copied, false otherwise
      • isClaimedByMe

        public final boolean isClaimedByMe()
      • canReassign

        public final boolean canReassign()
      • canClaim

        public final boolean canClaim()
      • canRelease

        public final boolean canRelease()
      • isUserAnonymous

        public final boolean isUserAnonymous()
      • getReason

        @Exported
        public final String getReason()
      • setReason

        public final void setReason​(String reason)
      • hasReason

        public final boolean hasReason()
      • isTransientClaim

        public final boolean isTransientClaim()
      • setTransientClaim

        public final void setTransientClaim​(boolean transientClaim)
      • isSticky

        public final boolean isSticky()
      • setSticky

        public final void setSticky​(boolean sticky)
      • isPropagateToFollowingBuildsByDefault

        @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class)
        public final boolean isPropagateToFollowingBuildsByDefault()
      • getError

        public final String getError()
      • isBFAEnabled

        public final boolean isBFAEnabled()
      • getClaimDate

        @Exported
        public final Date getClaimDate()
      • hasClaimDate

        public final boolean hasClaimDate()
      • isSelfAssigned

        public boolean isSelfAssigned()
        Was the action claimed by someone to themselves?
        Returns:
        true if the item was claimed by the user to themselves, false otherwise
      • getNoun

        public abstract String getNoun()
      • evalGroovyScript

        protected final void evalGroovyScript()
      • getUserFromId

        protected final User getUserFromId​(String userId)
      • getUserFromId

        protected final User getUserFromId​(String userId,
                                           boolean throwIfNotFound)