Class RequestedCatalogTarget

Direct Known Subclasses:
CatalogTargetProcessorBase

public class RequestedCatalogTarget extends CatalogTarget
RequestedCatalogTarget describes a catalog target that an integration connector should refresh.

The catalog target's element is read from open metadata on demand rather than up front. The targets manager retrieves each target with its header, its properties and the relationship that makes it a target, and nothing more; that is enough to identify it and to build the connector to it. A processor that needs to see what is attached to the element asks for it here, and says how much: getCatalogTargetElement() reads the element in full, as a default read would, and getCatalogTargetElement(GetOptions) reads exactly what the caller's options describe. Either way the result is kept for the rest of the refresh, so reading it twice costs one read, and the targets manager clears it before each refresh so that no refresh works from the last one's picture.

Reading in full assembles the element's whole graph to the default depth, one related-elements call per element per level. Done up front for every target, that was where a refresh with many targets spent most of its time before any target was refreshed.
  • Field Details

  • Constructor Details

    • RequestedCatalogTarget

      public RequestedCatalogTarget(CatalogTarget template, CatalogTargetContext catalogTargetContext, Connector connectorToTarget)
      Constructor for new catalog target processor
      Parameters:
      template - object to copy
      catalogTargetContext - context for this catalog target
      connectorToTarget - connector to access the target resource
    • RequestedCatalogTarget

      public RequestedCatalogTarget(RequestedCatalogTarget template)
      Copy/clone constructor
      Parameters:
      template - object to copy
  • Method Details

    • start

      Indicates that the catalog target processor is completely configured and can begin processing. This call can be used to register with non-blocking services.
      Throws:
      ConnectorCheckedException - the connector detected a problem.
      UserNotAuthorizedException - the connector was disconnected before/during start
    • getCatalogTargetElementHeader

      public ElementHeader getCatalogTargetElementHeader()
      Return the header of the catalog target's element - its identity, type, classifications and versions. This was retrieved with the catalog target and costs nothing to return. Use it in preference to getCatalogTargetElement() when the identity is all that is needed.
      Returns:
      element header, or null if the catalog target carries no element
    • getCatalogTargetElement

      public OpenMetadataRootElement getCatalogTargetElement()
      Return the catalog target's element read in full - with everything attached to it, as a default read of the element would return - reading it from open metadata the first time it is asked for in a refresh and returning the same element thereafter.

      This is what a processor that reads the target's schema, capabilities or other attachments should use, and it is what existing processors get when they call the accessor they always called. A processor that uses only the header should call getCatalogTargetElementHeader(), and one that uses a known part of the graph should call getCatalogTargetElement(GetOptions) and say which part.

      If the read fails the element as retrieved by the targets manager - header and properties - is returned instead, and the exception is available from getCatalogTargetElementRetrievalException().
      Overrides:
      getCatalogTargetElement in class CatalogTarget
      Returns:
      the element
    • getCatalogTargetElement

      Return the catalog target's element read with the supplied options - which say how much of what is attached to the element to bring back - reading it from open metadata and keeping the result for the rest of the refresh. A later call in the same refresh with the same options returns the kept element without another read.
      Parameters:
      getOptions - what to read; null means a full, default read
      Returns:
      the element, or the element as retrieved by the targets manager if this catalog target has no context to read through
      Throws:
      InvalidParameterException - the element cannot be read - probably a bug in the calling code
      PropertyServerException - the repository is not available
      UserNotAuthorizedException - the connector has been disconnected, or its userId may not read the element
    • clearRetrievedCatalogTargetElement

      public void clearRetrievedCatalogTargetElement()
      Forget the element read on demand, so that the next request reads it again. The targets manager calls this before each refresh of the catalog target.
    • getCatalogTargetElementRetrievalException

      public Exception getCatalogTargetElementRetrievalException()
      Return the exception from the last on-demand read of the element that failed, if getCatalogTargetElement() fell back to the element as retrieved by the targets manager.
      Returns:
      exception or null
    • getConnectorToTarget

      public Connector getConnectorToTarget()
      Return the connector to the target resource.
      Returns:
      connector
    • getNetworkAddress

      protected String getNetworkAddress()
      Return the network address from the connector's connection's endpoint.
      Returns:
      string or null
    • getIntegrationContext

      public CatalogTargetContext getIntegrationContext()
      Return the context for this catalog target.
      Returns:
      context
    • toString

      public String toString()
      Standard toString method.
      Overrides:
      toString in class CatalogTarget
      Returns:
      print out of variables in a JSON-style
    • equals

      public boolean equals(Object objectToCompare)
      Compare the values of the supplied object with those stored in the current object.
      Overrides:
      equals in class CatalogTarget
      Parameters:
      objectToCompare - supplied object
      Returns:
      boolean result of comparison
    • hashCode

      public int hashCode()
      Return hash code based on properties.
      Overrides:
      hashCode in class CatalogTarget
      Returns:
      int