Package hudson.plugins.claim
Class AbstractClaimBuildAction<T extends Saveable>
- java.lang.Object
-
- hudson.tasks.junit.TestAction
-
- hudson.plugins.claim.DescribableTestAction
-
- hudson.plugins.claim.AbstractClaimBuildAction<T>
-
- All Implemented Interfaces:
Action
,BuildBadgeAction
,Describable<DescribableTestAction>
,ModelObject
,ProminentProjectAction
- Direct Known Subclasses:
ClaimBuildAction
,ClaimTestAction
@ExportedBean(defaultVisibility=2) public abstract class AbstractClaimBuildAction<T extends Saveable> extends DescribableTestAction implements BuildBadgeAction, ProminentProjectAction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.plugins.claim.DescribableTestAction
DescribableTestAction.DescriptorImpl
-
-
Field Summary
-
Fields inherited from class hudson.plugins.claim.DescribableTestAction
DESCRIPTOR
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
applyClaim(User claimedByUser, String providedReason, User assignedByUser, Date date, boolean isSticky, boolean isPropagated)
Applies the claim data to theAbstractClaimBuildAction
.protected void
applyUnclaim()
Removes the claim data to theAbstractClaimBuildAction
.boolean
canClaim()
boolean
canReassign()
boolean
canRelease()
void
claim(User claimedByUser, String providedReason, User assignedByUser, Date date, boolean isSticky, boolean isPropagated, boolean notify)
Claims aSaveable
, and optionally notifies of the claim.protected boolean
copyTo(AbstractClaimBuildAction<T> other)
Claim a newSaveable
with the same settings as this one.void
doClaim(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse resp)
void
doUnclaim(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse resp)
protected void
evalGroovyScript()
String
getAssignedBy()
String
getAssignedByName()
ClaimBuildFailureAnalyzer
getBfaClaimer()
Date
getClaimDate()
String
getClaimedBy()
String
getClaimedByName()
String
getError()
String
getIconFileName()
CommonMessagesProvider
getMessageProvider()
protected abstract Optional<AbstractClaimBuildAction>
getNextAction()
abstract String
getNoun()
protected abstract T
getOwner()
String
getReason()
String
getReason(String error)
String
getUrlName()
protected User
getUserFromId(String userId)
protected User
getUserFromId(String userId, boolean throwIfNotFound)
boolean
hasClaimDate()
boolean
hasReason()
boolean
isBFAEnabled()
boolean
isClaimed()
boolean
isClaimedByMe()
boolean
isPropagateToFollowingBuildsByDefault()
boolean
isSelfAssigned()
Was the action claimed by someone to themselves?boolean
isSticky()
boolean
isTransientClaim()
boolean
isUserAnonymous()
protected abstract void
sendInitialClaimEmail(User claimedByUser, String providedReason, User assignedByUser)
Sends an initial claim email.void
setAssignedBy(String assignedBy)
void
setClaimedBy(String claimedBy)
void
setReason(String reason)
void
setSticky(boolean sticky)
void
setTransientClaim(boolean transientClaim)
void
unclaim(boolean notify)
Unclaims aSaveable
, and optionally notifies of the unclaim.-
Methods inherited from class hudson.plugins.claim.DescribableTestAction
getDescriptor
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.model.Action
getDisplayName
-
-
-
-
Method Detail
-
getOwner
protected abstract T getOwner()
-
getMessageProvider
public final CommonMessagesProvider getMessageProvider()
-
getBfaClaimer
public final ClaimBuildFailureAnalyzer getBfaClaimer()
-
getIconFileName
public final String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getUrlName
public final String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
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 aSaveable
, and optionally notifies of the claim.- Parameters:
claimedByUser
- claiming userprovidedReason
- reason for the claimassignedByUser
- assigner userdate
- date of the claimisSticky
- true if the claim has to be kept until resolutionisPropagated
- true if the claim has to be propagated to following buildsnotify
- 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 userprovidedReason
- reason for the claimassignedByUser
- the assigner user- Throws:
jakarta.mail.MessagingException
- if there has been some problem with sending the emailIOException
- if there is an IO problem when sending the mailInterruptedException
- 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 theAbstractClaimBuildAction
.- Parameters:
claimedByUser
- the claiming userprovidedReason
- reason for the claimassignedByUser
- the assigner userdate
- date of the claimisSticky
- true if the claim has to be kept until resolutionisPropagated
- true if the claim has to be propagated to following builds
-
getNextAction
protected abstract Optional<AbstractClaimBuildAction> getNextAction()
-
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 aSaveable
, and optionally notifies of the unclaim.- Parameters:
notify
- true if notifications have to be sent
-
applyUnclaim
protected void applyUnclaim()
Removes the claim data to theAbstractClaimBuildAction
.
-
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 newSaveable
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()
-
getReason
@JavaScriptMethod public final String getReason(String error) throws Exception
- Throws:
Exception
-
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()
-
-