Interface CapabilityScope
public interface CapabilityScope
Scope in which a
capability is available.
The GLOBAL scope can be used for most cases. A Host Controller will use a different implementation
of this interface for capabilities that are limited to some subset of the domain-wide model, e.g. a single
profile.
Implementations of this interface should override #equals(Object) and #hashCode() such that
logically equivalent but non-identical instances can function as keys in a hash map.
- Author:
- Brian Stansberry (c) 2014 Red Hat Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFactory for creating aCapabilityScope -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CapabilityScopeACapabilityScopethat can satisfy any dependent scope. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSatisfyRequirement(String requiredName, CapabilityScope dependentScope, CapabilityResolutionContext context) Gets whether a given capability associated with this scope can satisfy the given requirement.default Set<CapabilityScope>Gets any scope that logically include this one, i.e. where this scope can satisfy requirements as if it were the including scope.getName()Gets a descriptive name of the scopebooleanGets whether a consistency check must be performed when other capabilities depend on capabilities in this scope.
-
Field Details
-
GLOBAL
ACapabilityScopethat can satisfy any dependent scope. Meant for capabilities that are present regardless of any scope, or for convenience use in cases where there is only one scope.
-
-
Method Details
-
canSatisfyRequirement
boolean canSatisfyRequirement(String requiredName, CapabilityScope dependentScope, CapabilityResolutionContext context) Gets whether a given capability associated with this scope can satisfy the given requirement.- Parameters:
requiredName- the name of the required capabilitydependentScope- the scope of the dependent capabilitycontext- resolution context in use for this resolution run- Returns:
trueif the requirement can be satisfied from this scope;falseotherwise
-
requiresConsistencyCheck
boolean requiresConsistencyCheck()Gets whether a consistency check must be performed when other capabilities depend on capabilities in this scope. A consistency check is necessary if different capabilities in the dependent scope can potentially require capabilities in different other scopes, but all such capabilities must be available in at least one scope.- Returns:
trueif a consistency check is required
-
getName
String getName()Gets a descriptive name of the scope- Returns:
- the name. Will not return
null
-
getIncludingScopes
Gets any scope that logically include this one, i.e. where this scope can satisfy requirements as if it were the including scope.- Parameters:
context- resolution context in use for this resolution run- Returns:
- the including scopes. Will not be
nullbut may be empty.
-