S - the type of SCMSourceRequest.H - the specialization of SCMHeadMixin that this authority provides trust information for.R - the specialization of SCMRevision that this authority provides trust information for.public abstract class SCMHeadAuthority<S extends SCMSourceRequest,H extends SCMHeadMixin,R extends SCMRevision> extends AbstractDescribableImpl<SCMHeadAuthority<?,?,?>>
SCMHead and SCMRevision instances in the
context of a specific SCMSourceRequest.
Note: there can be multiple authorities for the same types of head / revision active in the context of any one request. The ultimate trust state is determined by a logical OR operation, in other words if any one authority says that the head / revision is trusted then the head / revision is trusted.
| Constructor and Description |
|---|
SCMHeadAuthority() |
| Modifier and Type | Method and Description |
|---|---|
static List<SCMHeadAuthorityDescriptor> |
_for(Class<? extends SCMSourceRequest> requestClass,
Class<? extends SCMHeadMixin> headClass,
Class<? extends SCMRevision> revisionClass,
Class<? extends SCMHeadOrigin>... origins)
Returns the subset of
SCMHeadAuthorityDescriptor instances applicable to the supplied criteria. |
static DescriptorExtensionList<SCMHeadAuthority<?,?,?>,SCMHeadAuthorityDescriptor> |
all()
Returns a list of all
SCMHeadAuthorityDescriptor instances. |
protected abstract boolean |
checkTrusted(S request,
H head)
SPI: checks if the supplied
SCMHead is trusted in the context of the supplied SCMSourceRequest. |
protected boolean |
checkTrusted(S request,
R revision)
SPI: checks if the supplied
SCMRevision is trusted in the context of the supplied
SCMSourceRequest. |
SCMHeadAuthorityDescriptor |
getDescriptor() |
boolean |
isApplicableTo(SCMHead head)
Checks if this authority is relevant to the supplied
SCMHead. |
boolean |
isApplicableTo(SCMRevision revision)
Checks if this authority is relevant to the supplied
SCMRevision. |
boolean |
isApplicableTo(SCMSourceRequest request)
Checks if this authority is relevant to the supplied
SCMSourceRequest. |
boolean |
isTrusted(SCMSourceRequest request,
SCMHead head)
Checks if the supplied
SCMHead is trusted in the context of the specified SCMSourceRequest. |
boolean |
isTrusted(SCMSourceRequest request,
SCMRevision revision)
Checks if the supplied
SCMRevision is trusted in the context of the specified SCMSourceRequest. |
public final boolean isApplicableTo(@NonNull
SCMHead head)
SCMHead.head - the supplied SCMHead.true if and only if this authority can provide trust information for the supplied head.public final boolean isApplicableTo(@NonNull
SCMRevision revision)
SCMRevision.revision - the supplied SCMRevision.true if and only if this authority can provide trust information for the supplied revision.public final boolean isApplicableTo(@NonNull
SCMSourceRequest request)
SCMSourceRequest.request - the supplied SCMSourceRequest.true if and only if this authority can provide trust information for the supplied request.public final boolean isTrusted(@NonNull
SCMSourceRequest request,
@NonNull
SCMHead head)
throws IOException,
InterruptedException
SCMHead is trusted in the context of the specified SCMSourceRequest.request - the SCMSourceRequest.head - the SCMHead.true if the supplied head is trusted.IOException - if there was an I/O error trying to establish the trust status.InterruptedException - if interrupted while trying to establing the trust status.public final boolean isTrusted(@NonNull
SCMSourceRequest request,
@CheckForNull
SCMRevision revision)
throws IOException,
InterruptedException
SCMRevision is trusted in the context of the specified SCMSourceRequest.request - the SCMSourceRequest.revision - the SCMRevision.true if the supplied revision is trusted.IOException - if there was an I/O error trying to establish the trust status.InterruptedException - if interrupted while trying to establing the trust status.protected abstract boolean checkTrusted(@NonNull
S request,
@NonNull
H head)
throws IOException,
InterruptedException
SCMHead is trusted in the context of the supplied SCMSourceRequest.request - the SCMSourceRequest.head - the SCMHead.true if trusted.IOException - if there was an I/O error trying to establish the trust status.InterruptedException - if interrupted while trying to establing the trust status.@OverrideMustInvoke
protected boolean checkTrusted(@NonNull
S request,
@NonNull
R revision)
throws IOException,
InterruptedException
SCMRevision is trusted in the context of the supplied
SCMSourceRequest. Default implementation just calls checkTrusted(SCMSourceRequest, SCMHeadMixin)
with SCMRevision.getHead().request - the SCMSourceRequest.revision - the SCMRevision.true if trusted.IOException - if there was an I/O error trying to establish the trust status.InterruptedException - if interrupted while trying to establing the trust status.public SCMHeadAuthorityDescriptor getDescriptor()
getDescriptor in interface Describable<SCMHeadAuthority<?,?,?>>getDescriptor in class AbstractDescribableImpl<SCMHeadAuthority<?,?,?>>public static DescriptorExtensionList<SCMHeadAuthority<?,?,?>,SCMHeadAuthorityDescriptor> all()
SCMHeadAuthorityDescriptor instances.SCMHeadAuthorityDescriptor instances.public static List<SCMHeadAuthorityDescriptor> _for(@CheckForNull Class<? extends SCMSourceRequest> requestClass, @CheckForNull Class<? extends SCMHeadMixin> headClass, @CheckForNull Class<? extends SCMRevision> revisionClass, Class<? extends SCMHeadOrigin>... origins)
SCMHeadAuthorityDescriptor instances applicable to the supplied criteria.requestClass - the SCMSourceRequest class (or null to match any).headClass - the SCMHeadMixin class (or null to match any).revisionClass - the SCMRevision class (or null to match any).origins - the SCMHeadOrigin instances.SCMHeadAuthorityDescriptor instances.Copyright © 2016–2019. All rights reserved.