Class SpecificationMapSourceConnector

  • All Implemented Interfaces:
    IRegistrySourceConnector

    public class SpecificationMapSourceConnector
    extends AbstractRegistrySourceConnector
    A simple connector implementation that allows users to simply add and remove specifications. These changes are propagated to listeners (e.g. the registry). Note that duplicate FQNs are not allowed in a given connector.
    Since:
    1.3
    • Constructor Detail

      • SpecificationMapSourceConnector

        public SpecificationMapSourceConnector​(java.lang.String identifier,
                                               boolean includeInDefaultViews)
        Creates an instance of the connector with the given identifier. The identifier should be unique if you want to add it to a registry as a source.
        Parameters:
        identifier - of the newly created connector
        includeInDefaultViews - true if the specifications in the connector should be included in default views
      • SpecificationMapSourceConnector

        public SpecificationMapSourceConnector​(java.lang.String identifier,
                                               java.util.Set<IQuerySpecificationProvider> specificationProviders,
                                               boolean includeInDefaultViews)
        Creates an instance of the connector with the given identifier and fills it up with the given specification providers. The identifier should be unique if you want to add it to a registry as a source.
        Parameters:
        identifier - of the newly created connector
        specificationProviders - the initial set of specifications in the connector
        includeInDefaultViews - true if the specifications in the connector should be included in default views
      • SpecificationMapSourceConnector

        public SpecificationMapSourceConnector​(java.lang.String identifier,
                                               SpecificationMapSourceConnector connector,
                                               boolean includeInDefaultViews)
        Creates an instance of the connector with the given identifier and fills it up with the specification providers from the given SpecificationMapSourceConnector. The identifier should be unique if you want to add it to a registry as a source.
        Parameters:
        identifier - of the newly created connector
        connector - that contains the specifications to copy into the new instance
        includeInDefaultViews - true if the specifications in the connector should be included in default views
    • Method Detail

      • addQuerySpecificationProvider

        public void addQuerySpecificationProvider​(IQuerySpecificationProvider provider)
        Adds a query specification to the connector. If you have an IQuerySpecification object, use SingletonQuerySpecificationProvider.
        Parameters:
        provider - to add to the connector
        Throws:
        java.lang.IllegalArgumentException - if the connector already contains a specification with the same FQN
      • removeQuerySpecificationProvider

        public void removeQuerySpecificationProvider​(java.lang.String fullyQualifiedName)
        Remove a specification that has been added with the given FQN.
        Parameters:
        fullyQualifiedName -
        Throws:
        java.util.NoSuchElementException - if the connector does not contain a specification with the given FQN
      • getQuerySpecificationFQNs

        public java.util.Set<java.lang.String> getQuerySpecificationFQNs()
        Returns:
        the immutable copy of the set of FQNs for the added query specifications
      • hasQuerySpecificationFQN

        public boolean hasQuerySpecificationFQN​(java.lang.String fullyQualifiedName)
        Parameters:
        fullyQualifiedName - that is checked
        Returns:
        true if a specification with the given FQN exists in the connector, false otherwise