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 Summary
ConstructorsConstructorDescriptionDefault Constructor used by the connector provider. -
Method Summary
Modifier and TypeMethodDescriptionaddEntity(AtlasEntity entity) Add an entity.addNewTypes(AtlasTypesDef newTypeDefinitions) Create new types.addRelationship(AtlasRelationship atlasRelationship) Add a relationship.voidclearRelationship(String atlasRelationshipGUID) Remove a relationship.createAtlasGlossary(AtlasGlossaryElement glossary) Create a new empty glossary.Create a new category linked to its glossary and potentially other categories and terms.Create a new term linked to its glossary, other terms and categories.voiddeleteAtlasGlossary(AtlasGlossaryElement glossary) Delete a glossary with all of its links to terms and categories.voidDelete a category with all of its links to terms and categories.voidDelete a term with all of its links to other terms and categories.deleteEntity(String entityGUID) Delete an entity.Return the types registered to Apache Atlas.getAtlasGlossary(int glossaryCount) Return a glossary based on the paging count.getAtlasGlossary(String glossaryGUID) Return a glossary based on its guid.getAtlasGlossaryCategory(String glossaryCategoryGUID) Return a category based on its guid.getAtlasGlossaryTerm(String glossaryTermGUID) Return a glossary term based on its guid.getBusinessMetadataType(String typeName) Return the requested type from Apache Atlas.getClassificationType(String typeName) Return the requested type from Apache Atlas.org.odpi.openmetadata.frameworks.auditlog.ComponentDescriptionReturn the component description that is used by this connector in the audit log.getEntitiesForType(String typeName, int startFrom, int pageSize) Return a list of entities that are of the requested type.getEntityByGUID(String guid) Retrieve a single entity by GUID.getEntityType(String typeName) Return the requested type from Apache Atlas.getRelatedEntities(AtlasEntityWithExtInfo startingEntity, String relationshipLabel) Retrieve the entities at the other end of the named relationship.getRelatedEntity(AtlasEntity startingEntity, String relationshipLabel) Retrieve the entity at the other end of the named relationship.getRelatedEntity(AtlasEntityWithExtInfo startingEntity, String relationshipLabel) Retrieve the entity at the other end of the named relationship.getRelationshipGUID(AtlasEntityWithExtInfo startingEntity, String relationshipLabel) Retrieve the named relationship.getRelationships(AtlasEntityWithExtInfo startingEntity, String relationshipLabel) Retrieve the entities at the other end of the named relationship and build a map of the relationships.getRelationshipType(String typeName) Return the requested type from Apache Atlas.voidinitializeEmbeddedConnectors(List<org.odpi.openmetadata.frameworks.connectors.Connector> embeddedConnectors) Set up the list of connectors that this virtual connector will use to support its interface.saveAtlasGlossary(AtlasGlossaryElement glossary) Save a glossary with all of its links to terms and categories.Save a category with all of its links to terms and categories.Save a term with all of its links to other terms and categories.voidsetAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.voidstart()Indicates that the connector is completely configured and can begin processing.updateEntity(AtlasEntityWithExtInfo entityWithExtInfo) Update an entity's properties.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
disconnect, equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initialize, initializeConnectedAssetProperties, initializeSecretsStoreConnector, isActive, toStringMethods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp
-
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:
setAuditLogin interfaceorg.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:
getConnectorComponentDescriptionin interfaceorg.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:
initializeEmbeddedConnectorsin interfaceorg.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension- Parameters:
embeddedConnectors- list of connectors
-
start
public void start() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedExceptionIndicates that the connector is completely configured and can begin processing. This call can be used to register with non-blocking services.- Overrides:
startin classorg.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.PropertyServerExceptionReturn 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 querystartFrom- offset to start resultspageSize- 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 requestNameConflictException- 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 requestNameConflictException- 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
-