Interface CapabilityScope
-
public interface CapabilityScopeScope in which acapabilityis available.The
GLOBALscope 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 Classes Modifier and Type Interface Description static classCapabilityScope.FactoryFactory for creating aCapabilityScope
-
Field Summary
Fields Modifier and Type Field Description static CapabilityScopeGLOBALACapabilityScopethat can satisfy any dependent scope.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancanSatisfyRequirement(String requiredName, CapabilityScope dependentScope, CapabilityResolutionContext context)Gets whether a given capability associated with this scope can satisfy the given requirement.default Set<CapabilityScope>getIncludingScopes(CapabilityResolutionContext context)Gets any scope that logically include this one, i.e.StringgetName()Gets a descriptive name of the scopebooleanrequiresConsistencyCheck()Gets whether a consistency check must be performed when other capabilities depend on capabilities in this scope.
-
-
-
Field Detail
-
GLOBAL
static final CapabilityScope 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 Detail
-
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
default Set<CapabilityScope> getIncludingScopes(CapabilityResolutionContext context)
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.
-
-