Class ApacheAtlasRESTConnector

java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.resource.apacheatlas.ApacheAtlasRESTConnector
All Implemented Interfaces:
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, org.odpi.openmetadata.frameworks.connectors.SecureConnectorExtension, org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension

public class ApacheAtlasRESTConnector extends org.odpi.openmetadata.frameworks.connectors.ConnectorBase implements org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension
RESTClient is responsible for issuing calls to the OMAS REST APIs.
  • Constructor Details

    • ApacheAtlasRESTConnector

      public ApacheAtlasRESTConnector()
      Default Constructor used by the connector provider.
  • Method Details

    • setAuditLog

      public void setAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog)
      Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.
      Specified by:
      setAuditLog in interface org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
      Parameters:
      auditLog - audit log object
    • getConnectorComponentDescription

      public org.odpi.openmetadata.frameworks.auditlog.ComponentDescription getConnectorComponentDescription()
      Return the component description that is used by this connector in the audit log.
      Specified by:
      getConnectorComponentDescription in interface org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
      Returns:
      id, name, description, wiki page URL.
    • initializeEmbeddedConnectors

      public void initializeEmbeddedConnectors(List<org.odpi.openmetadata.frameworks.connectors.Connector> embeddedConnectors)
      Set up the list of connectors that this virtual connector will use to support its interface. The connectors are initialized waiting to start. When start() is called on the virtual connector, it needs to pass start() to each of the embedded connectors. Similarly for disconnect().
      Specified by:
      initializeEmbeddedConnectors in interface org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension
      Parameters:
      embeddedConnectors - list of connectors
    • start

      public void start() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Indicates that the connector is completely configured and can begin processing. This call can be used to register with non-blocking services.
      Overrides:
      start in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - there is a problem within the connector.
    • getAllTypes

      public AtlasTypesDef getAllTypes() throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the types registered to Apache Atlas.
      Returns:
      type definition list from Apache Atlas
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getEntityType

      public AtlasEntityDef getEntityType(String typeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the requested type from Apache Atlas.
      Parameters:
      typeName - name of type to retrieve
      Returns:
      type definition from Apache Atlas
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getRelationshipType

      public AtlasRelationshipDef getRelationshipType(String typeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the requested type from Apache Atlas.
      Parameters:
      typeName - name of type to retrieve
      Returns:
      type definition from Apache Atlas
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getClassificationType

      public AtlasClassificationDef getClassificationType(String typeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the requested type from Apache Atlas.
      Parameters:
      typeName - name of type to retrieve
      Returns:
      type definition from Apache Atlas
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getBusinessMetadataType

      public AtlasBusinessMetadataDef getBusinessMetadataType(String typeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the requested type from Apache Atlas.
      Parameters:
      typeName - name of type to retrieve
      Returns:
      type definition from Apache Atlas
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • addNewTypes

      public AtlasTypesDef addNewTypes(AtlasTypesDef newTypeDefinitions) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Create new types. The registered types are returned from Apache Atlas.
      Parameters:
      newTypeDefinitions - gallery of new types
      Returns:
      type definition list from Apache Atlas
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • addEntity

      public String addEntity(AtlasEntity entity) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Add an entity.
      Parameters:
      entity - description of entity
      Returns:
      description of the operation
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • updateEntity

      public AtlasEntityWithExtInfo updateEntity(AtlasEntityWithExtInfo entityWithExtInfo) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Update an entity's properties.
      Parameters:
      entityWithExtInfo - description of entity and any associated entities
      Returns:
      updated entity
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • deleteEntity

      public AtlasEntityMutationResponse deleteEntity(String entityGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Delete an entity.
      Parameters:
      entityGUID - unique identifier of entity and any associated entities
      Returns:
      description of the operation
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • addRelationship

      public AtlasRelationship addRelationship(AtlasRelationship atlasRelationship) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Add a relationship.
      Parameters:
      atlasRelationship - description of relationship
      Returns:
      description of the operation
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • clearRelationship

      public void clearRelationship(String atlasRelationshipGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Remove a relationship.
      Parameters:
      atlasRelationshipGUID - relationship to delete
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getEntityByGUID

      public AtlasEntityWithExtInfo getEntityByGUID(String guid) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve a single entity by GUID.
      Parameters:
      guid - unique identifier
      Returns:
      description of requested entity
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getRelatedEntity

      public AtlasEntityWithExtInfo getRelatedEntity(AtlasEntityWithExtInfo startingEntity, String relationshipLabel) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve the entity at the other end of the named relationship.
      Parameters:
      startingEntity - entity information detailing the entity proxy for the entity at the far end of a named relationship.
      relationshipLabel - name of relationship to traverse
      Returns:
      description of requested entity
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getRelationshipGUID

      public String getRelationshipGUID(AtlasEntityWithExtInfo startingEntity, String relationshipLabel) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve the named relationship.
      Parameters:
      startingEntity - entity information detailing the entity proxy for the entity at the far end of a named relationship.
      relationshipLabel - name of relationship to traverse
      Returns:
      description of requested entity
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getRelatedEntity

      public AtlasEntityWithExtInfo getRelatedEntity(AtlasEntity startingEntity, String relationshipLabel) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve the entity at the other end of the named relationship.
      Parameters:
      startingEntity - entity information detailing the entity proxy for the entity at the far end of a named relationship.
      relationshipLabel - name of relationship to traverse
      Returns:
      description of requested entity
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getRelationships

      public Map<String,String> getRelationships(AtlasEntityWithExtInfo startingEntity, String relationshipLabel) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve the entities at the other end of the named relationship and build a map of the relationships.
      Parameters:
      startingEntity - entity information detailing the entity proxy for the entity at the far end of a named relationship.
      relationshipLabel - name of relationship to traverse
      Returns:
      list of related entity GUIDs mapped to their relationship GUID
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getRelatedEntities

      public List<AtlasEntityWithExtInfo> getRelatedEntities(AtlasEntityWithExtInfo startingEntity, String relationshipLabel) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve the entities at the other end of the named relationship.
      Parameters:
      startingEntity - entity information detailing the entity proxy for the entity at the far end of a named relationship.
      relationshipLabel - name of relationship to traverse
      Returns:
      list of related entities
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem connecting to Apache Atlas
    • getEntitiesForType

      public List<AtlasEntityHeader> getEntitiesForType(String typeName, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return a list of entities that are of the requested type.
      Parameters:
      typeName - name of the type to query
      startFrom - offset to start results
      pageSize - max number of results
      Returns:
      list of matching entities. List may be empty if no matches
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem communicating with Apache Atlas
    • getAtlasGlossary

      public AtlasGlossaryElement getAtlasGlossary(int glossaryCount) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return a glossary based on the paging count.
      Parameters:
      glossaryCount - position of the glossary in the paging list.
      Returns:
      glossary or null
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • getAtlasGlossary

      public AtlasGlossaryElement getAtlasGlossary(String glossaryGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return a glossary based on its guid.
      Parameters:
      glossaryGUID - unique identifier of the glossary.
      Returns:
      glossary or null
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • createAtlasGlossary

      public String createAtlasGlossary(AtlasGlossaryElement glossary) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Create a new empty glossary.
      Parameters:
      glossary - glossary to create
      Returns:
      glossaryGUID
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • saveAtlasGlossary

      public AtlasGlossaryElement saveAtlasGlossary(AtlasGlossaryElement glossary) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Save a glossary with all of its links to terms and categories.
      Parameters:
      glossary - glossary to create/update
      Returns:
      glossary or null
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • deleteAtlasGlossary

      public void deleteAtlasGlossary(AtlasGlossaryElement glossary) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Delete a glossary with all of its links to terms and categories.
      Parameters:
      glossary - glossary to delete
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • getAtlasGlossaryTerm

      public AtlasGlossaryTermElement getAtlasGlossaryTerm(String glossaryTermGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return a glossary term based on its guid.
      Parameters:
      glossaryTermGUID - unique identifier of the glossary term.
      Returns:
      glossary or null
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • createAtlasGlossaryTerm

      public String createAtlasGlossaryTerm(AtlasGlossaryTermElement term) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, NameConflictException
      Create a new term linked to its glossary, other terms and categories.
      Parameters:
      term - term to create
      Returns:
      glossaryTermGUID
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
      NameConflictException - the name supplied clashes with another term
    • saveAtlasGlossaryTerm

      public AtlasGlossaryTermElement saveAtlasGlossaryTerm(AtlasGlossaryTermElement term) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Save a term with all of its links to other terms and categories.
      Parameters:
      term - term to create/update
      Returns:
      term or null
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • deleteAtlasGlossaryTerm

      public void deleteAtlasGlossaryTerm(AtlasGlossaryTermElement term) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Delete a term with all of its links to other terms and categories.
      Parameters:
      term - term to delete
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • getAtlasGlossaryCategory

      public AtlasGlossaryCategoryElement getAtlasGlossaryCategory(String glossaryCategoryGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return a category based on its guid.
      Parameters:
      glossaryCategoryGUID - unique identifier of the category.
      Returns:
      glossary or null
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • createAtlasGlossaryCategory

      public String createAtlasGlossaryCategory(AtlasGlossaryCategoryElement category) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, NameConflictException
      Create a new category linked to its glossary and potentially other categories and terms.
      Parameters:
      category - category to create
      Returns:
      glossaryCategoryGUID
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
      NameConflictException - the name supplied clashes with another term
    • saveAtlasGlossaryCategory

      public AtlasGlossaryCategoryElement saveAtlasGlossaryCategory(AtlasGlossaryCategoryElement category) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Save a category with all of its links to terms and categories.
      Parameters:
      category - category to create/update
      Returns:
      glossary category or null
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request
    • deleteAtlasGlossaryCategory

      public void deleteAtlasGlossaryCategory(AtlasGlossaryCategoryElement category) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Delete a category with all of its links to terms and categories.
      Parameters:
      category - category to create/update
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem with the request