Interface CapabilityReferenceRecorder

All Superinterfaces:
Feature
All Known Implementing Classes:
CapabilityReferenceRecorder.CompositeAttributeDependencyRecorder, CapabilityReferenceRecorder.ContextDependencyRecorder, CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder, CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder

public interface CapabilityReferenceRecorder extends Feature
Records information about capability reference information encoded in an attribute's value.
Author:
Brian Stansberry (c) 2015 Red Hat Inc.
  • Method Details

    • addCapabilityRequirements

      void addCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues)
      Registers capability requirement information to the given context.
      Parameters:
      context - the context
      resource - the resource on which requirements are gathered
      attributeName - the name of the attribute
      attributeValues - the values of the attribute, which may contain null
    • removeCapabilityRequirements

      void removeCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues)
      Deregisters capability requirement information from the given context.
      Parameters:
      context - the context
      resource - the resource on which requirements are gathered
      attributeName - the name of the attribute
      attributeValues - the values of the attribute, which may contain null
    • getBaseDependentName

      @Deprecated(forRemoval=true) String getBaseDependentName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      No longer required and may throw UnsupportedOperationException
      Returns:
      base name of dependant, usually name of the attribute that provides reference to capability
    • getBaseRequirementName

      String getBaseRequirementName()
      Returns:
      requirement name of the capability this reference depends on
    • isDynamicDependent

      @Deprecated(forRemoval=true) default boolean isDynamicDependent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      No longer required and may throw UnsupportedOperationException
      Returns:
      tells is reference is dynamic or static, in case where it is dynamic it uses base name + name of dependent attribute to construct name of capability
    • getRequirementPatternSegments

      default String[] getRequirementPatternSegments(String name, PathAddress address)
      Returns the elements to be added to the baseRequirementName to build the capability name pattern. It will return an array of the form `segment[.segment]` where each segment represents either the name of one of the resource's attributes or one of the keys in the resource's address. In the actual name the attribute name or address key will be replaced by the value associated with that attribute or key.
      Parameters:
      name - the name of the attribute.
      address - the registration address of the resource definition that has the capability and its requirement. N.B. This parameter is only specified in association with a ResourcDefinition. When associated with an AttributeDefinition, address will always be PathAddress.EMPTY_ADDRESS.
      Returns:
      the elements to be added to the baseRequirementName to build the capability name pattern.