Class RequestedCatalogTarget
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipProperties
org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipBeanProperties
org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.connectors.CatalogTargetProperties
org.odpi.openmetadata.frameworks.opengovernance.properties.CatalogTarget
org.odpi.openmetadata.frameworks.integration.properties.RequestedCatalogTarget
- Direct Known Subclasses:
CatalogTargetProcessorBase
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:
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.
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 Summary
FieldsFields inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipBeanProperties
typeName -
Constructor Summary
ConstructorsConstructorDescriptionRequestedCatalogTarget(RequestedCatalogTarget template) Copy/clone constructorRequestedCatalogTarget(CatalogTarget template, CatalogTargetContext catalogTargetContext, Connector connectorToTarget) Constructor for new catalog target processor -
Method Summary
Modifier and TypeMethodDescriptionvoidForget the element read on demand, so that the next request reads it again.booleanCompare the values of the supplied object with those stored in the current object.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.getCatalogTargetElement(GetOptions getOptions) 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.Return the header of the catalog target's element - its identity, type, classifications and versions.Return the exception from the last on-demand read of the element that failed, ifgetCatalogTargetElement()fell back to the element as retrieved by the targets manager.Return the connector to the target resource.Return the context for this catalog target.protected StringReturn the network address from the connector's connection's endpoint.inthashCode()Return hash code based on properties.voidstart()Indicates that the catalog target processor is completely configured and can begin processing.toString()Standard toString method.Methods inherited from class org.odpi.openmetadata.frameworks.opengovernance.properties.CatalogTarget
getRelationshipGUID, getRelationshipVersions, setCatalogTargetElement, setRelationshipGUID, setRelationshipVersionsMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.connectors.CatalogTargetProperties
getCatalogTargetName, getConfigurationProperties, getConnectionName, getDeleteMethod, getMetadataCollectionQualifiedName, getMetadataSourceQualifiedName, getPermittedSynchronization, getTemplates, setCatalogTargetName, setConfigurationProperties, setConnectionName, setDeleteMethod, setMetadataCollectionQualifiedName, setMetadataSourceQualifiedName, setPermittedSynchronization, setTemplatesMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipBeanProperties
getExtendedProperties, getTypeName, setExtendedProperties, setTypeNameMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipProperties
getEffectiveFrom, getEffectiveTo, setEffectiveFrom, setEffectiveTo
-
Field Details
-
connectorToTarget
-
integrationContext
-
-
Constructor Details
-
RequestedCatalogTarget
public RequestedCatalogTarget(CatalogTarget template, CatalogTargetContext catalogTargetContext, Connector connectorToTarget) Constructor for new catalog target processor- Parameters:
template- object to copycatalogTargetContext- context for this catalog targetconnectorToTarget- connector to access the target resource
-
RequestedCatalogTarget
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
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 togetCatalogTargetElement()when the identity is all that is needed.- Returns:
- element header, or null if the catalog target carries no element
-
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 callgetCatalogTargetElementHeader(), and one that uses a known part of the graph should callgetCatalogTargetElement(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 fromgetCatalogTargetElementRetrievalException().- Overrides:
getCatalogTargetElementin classCatalogTarget- Returns:
- the element
-
getCatalogTargetElement
public OpenMetadataRootElement getCatalogTargetElement(GetOptions getOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException 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 codePropertyServerException- the repository is not availableUserNotAuthorizedException- 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
Return the exception from the last on-demand read of the element that failed, ifgetCatalogTargetElement()fell back to the element as retrieved by the targets manager.- Returns:
- exception or null
-
getConnectorToTarget
Return the connector to the target resource.- Returns:
- connector
-
getNetworkAddress
Return the network address from the connector's connection's endpoint.- Returns:
- string or null
-
getIntegrationContext
Return the context for this catalog target.- Returns:
- context
-
toString
Standard toString method.- Overrides:
toStringin classCatalogTarget- Returns:
- print out of variables in a JSON-style
-
equals
Compare the values of the supplied object with those stored in the current object.- Overrides:
equalsin classCatalogTarget- Parameters:
objectToCompare- supplied object- Returns:
- boolean result of comparison
-
hashCode
public int hashCode()Return hash code based on properties.- Overrides:
hashCodein classCatalogTarget- Returns:
- int
-