http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java b/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java index 6b9bfd5..3d54344 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSMetadataStore.java @@ -17,8 +17,6 @@ */ package org.apache.atlas.omrs.adapters.inmemory.repositoryconnector; -import org.apache.atlas.omrs.ffdc.OMRSErrorCode; -import org.apache.atlas.omrs.ffdc.exception.InvalidParameterException; import org.apache.atlas.omrs.metadatacollection.properties.instances.EntityDetail; import org.apache.atlas.omrs.metadatacollection.properties.instances.EntityProxy; import org.apache.atlas.omrs.metadatacollection.properties.instances.Relationship; @@ -132,7 +130,7 @@ public class InMemoryOMRSMetadataStore /** * Return a list of entities from the store that are at the latest level. * - * @return + * @return list of EntityDetail objects */ protected List<EntityDetail> getEntities() { @@ -168,41 +166,16 @@ public class InMemoryOMRSMetadataStore * Return an entity store that contains entities as they were at the time supplied in the asOfTime * parameter * - * @param methodName - name of the method requesting the store * @param asOfTime - time for the store (or null means now) * @return entity store for the requested time - * @throws InvalidParameterException - asOfTime is for the future. */ - protected HashMap<String, EntityDetail> timeWarpEntityStore(String methodName, - Date asOfTime) throws InvalidParameterException + protected HashMap<String, EntityDetail> timeWarpEntityStore(Date asOfTime) { - final String asOfTimeParameterName = "asOfTime"; - if (asOfTime == null) { return entityStore; } - Date now = new Date(); - - if (asOfTime.after(now)) - { - OMRSErrorCode errorCode = OMRSErrorCode.REPOSITORY_NOT_CRYSTAL_BALL; - String errorMessage = errorCode.getErrorMessageId() - + errorCode.getFormattedErrorMessage(asOfTime.toString(), - asOfTimeParameterName, - methodName, - repositoryName); - - throw new InvalidParameterException(errorCode.getHTTPErrorCode(), - this.getClass().getName(), - methodName, - errorMessage, - errorCode.getSystemAction(), - errorCode.getUserAction()); - } - - HashMap<String, EntityDetail> timeWarpedEntityStore = new HashMap<>(); /* @@ -299,40 +272,16 @@ public class InMemoryOMRSMetadataStore * Return a relationship store that contains relationships as they were at the time supplied in the asOfTime * parameter * - * @param methodName - name of the method requesting the store * @param asOfTime - time for the store (or null means now) * @return relationship store for the requested time - * @throws InvalidParameterException - asOfTime is for the future. */ - protected HashMap<String, Relationship> timeWarpRelationshipStore(String methodName, - Date asOfTime) throws InvalidParameterException + protected HashMap<String, Relationship> timeWarpRelationshipStore(Date asOfTime) { - final String asOfTimeParameterName = "asOfTime"; - if (asOfTime == null) { return relationshipStore; } - Date now = new Date(); - - if (asOfTime.after(now)) - { - OMRSErrorCode errorCode = OMRSErrorCode.REPOSITORY_NOT_CRYSTAL_BALL; - String errorMessage = errorCode.getErrorMessageId() - + errorCode.getFormattedErrorMessage(asOfTime.toString(), - asOfTimeParameterName, - methodName, - repositoryName); - - throw new InvalidParameterException(errorCode.getHTTPErrorCode(), - this.getClass().getName(), - methodName, - errorMessage, - errorCode.getSystemAction(), - errorCode.getUserAction()); - } - HashMap<String, Relationship> timeWarpedRelationshipStore = new HashMap<>(); @@ -610,6 +559,22 @@ public class InMemoryOMRSMetadataStore } /** + * Remove a reference entity from the active store and add it to the history store. + * + * @param guid - entity to remove + */ + protected void removeReferenceEntityFromStore(String guid) + { + EntityDetail entity = entityStore.remove(guid); + + if (entity != null) + { + entityHistoryStore.add(0, entity); + } + } + + + /** * Remove an entity from the active store and add it to the history store. * * @param guid - entity proxy to remove @@ -631,4 +596,20 @@ public class InMemoryOMRSMetadataStore relationshipHistoryStore.add(0, relationship); } + + /** + * Remove a reference relationship from the active store and add it to the history store. + * + * @param guid - relationship to remove + */ + protected void removeReferenceRelationshipFromStore(String guid) + { + Relationship relationship = relationshipStore.remove(guid); + + if (relationship != null) + { + relationshipHistoryStore.add(0, relationship); + } + } + }
http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSRepositoryConnector.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSRepositoryConnector.java b/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSRepositoryConnector.java index 56dbb96..b564027 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSRepositoryConnector.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/adapters/inmemory/repositoryconnector/InMemoryOMRSRepositoryConnector.java @@ -46,13 +46,16 @@ public class InMemoryOMRSRepositoryConnector extends OMRSRepositoryConnector { super.metadataCollectionId = metadataCollectionId; - /* - * Initialize the metadata collection only once the connector is properly set up. - */ - super.metadataCollection = new InMemoryOMRSMetadataCollection(this, - super.serverName, - repositoryHelper, - repositoryValidator, - metadataCollectionId); + if (metadataCollectionId != null) + { + /* + * Initialize the metadata collection only once the connector is properly set up. + */ + super.metadataCollection = new InMemoryOMRSMetadataCollection(this, + super.serverName, + repositoryHelper, + repositoryValidator, + metadataCollectionId); + } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSConfigurationFactory.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSConfigurationFactory.java b/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSConfigurationFactory.java index 0f7bd01..7ae87c6 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSConfigurationFactory.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSConfigurationFactory.java @@ -32,6 +32,7 @@ import org.apache.atlas.omrs.auditlog.store.file.FileBasedAuditLogStoreProvider; import org.apache.atlas.omrs.metadatahighway.cohortregistry.store.file.FileBasedRegistryStoreProvider; import org.apache.atlas.omrs.metadatacollection.properties.typedefs.TypeDefSummary; import org.apache.atlas.omrs.rest.repositoryconnector.OMRSRESTRepositoryConnectorProvider; +import org.apache.atlas.omrs.topicconnectors.inmemory.InMemoryOMRSTopicProvider; import org.apache.atlas.omrs.topicconnectors.kafka.KafkaOMRSTopicProvider; import java.util.ArrayList; @@ -388,7 +389,7 @@ public class OMRSConfigurationFactory final String connectorTypeDescription = "OMRS default enterprise connector type."; - final String connectorTypeJavaClassName = KafkaOMRSTopicProvider.class.getName(); + final String connectorTypeJavaClassName = InMemoryOMRSTopicProvider.class.getName(); String connectorTypeName = "DefaultEnterpriseTopic.ConnectorType." + localServerName; @@ -698,6 +699,8 @@ public class OMRSConfigurationFactory /** * Return the local repository configuration for a repository proxy. * + * @param localServerName - name of local server + * @param localServerURL - url used to call local server * @return LocalRepositoryConfig object */ public LocalRepositoryConfig getRepositoryProxyLocalRepositoryConfig(String localServerName, String localServerURL) http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSOperationalServices.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSOperationalServices.java b/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSOperationalServices.java index 60b4704..f540b0d 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSOperationalServices.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/admin/OMRSOperationalServices.java @@ -32,6 +32,8 @@ import org.apache.atlas.omrs.auditlog.OMRSAuditingComponent; import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogStore; import org.apache.atlas.omrs.enterprise.connectormanager.OMRSConnectionConsumer; import org.apache.atlas.omrs.enterprise.connectormanager.OMRSEnterpriseConnectorManager; +import org.apache.atlas.omrs.enterprise.repositoryconnector.EnterpriseOMRSConnection; +import org.apache.atlas.omrs.enterprise.repositoryconnector.EnterpriseOMRSRepositoryConnector; import org.apache.atlas.omrs.eventmanagement.OMRSRepositoryEventExchangeRule; import org.apache.atlas.omrs.eventmanagement.OMRSRepositoryEventManager; import org.apache.atlas.omrs.eventmanagement.repositoryeventmapper.OMRSRepositoryEventMapperConnector; @@ -46,6 +48,7 @@ import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSReposi import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSRepositoryHelper; import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSRepositoryValidator; import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSTypeDefValidator; +import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnector; import org.apache.atlas.omrs.metadatahighway.OMRSMetadataHighwayManager; import org.apache.atlas.omrs.rest.server.OMRSRepositoryRESTServices; import org.apache.atlas.omrs.topicconnectors.OMRSTopicConnector; @@ -54,6 +57,7 @@ import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; +import java.util.UUID; /** * OMRSOperationalServices provides the OMAG Server with access to the OMRS capabilities. @@ -105,6 +109,7 @@ public class OMRSOperationalServices * @param localServerType - type of the local server * @param organizationName - name of the organization that owns the local server * @param localServerURL - URL root for this server. + * @param maxPageSize - maximum number of records that can be requested on the pageSize parameter */ public OMRSOperationalServices(String localServerName, String localServerType, @@ -124,6 +129,85 @@ public class OMRSOperationalServices /** + * Return the Enterprise OMRS Topic Connector. + * + * @return OMRSTopicConnector for use by the Access Services. + */ + public OMRSTopicConnector getEnterpriseOMRSTopicConnector() + { + return enterpriseOMRSTopicConnector; + } + + + /** + * Create repository connector for an access service. + * + * @param accessServiceName - name of the access service name. + * @return a repository connector that is able to retrieve and maintain information from all connected repositories. + */ + public OMRSRepositoryConnector getEnterpriseOMRSRepositoryConnector(String accessServiceName) + { + final String actionDescription = "getEnterpriseOMRSRepositoryConnector"; + + ConnectorBroker connectorBroker = new ConnectorBroker(); + + try + { + Connector connector = connectorBroker.getConnector(new EnterpriseOMRSConnection()); + + EnterpriseOMRSRepositoryConnector omrsRepositoryConnector = (EnterpriseOMRSRepositoryConnector)connector; + + omrsRepositoryConnector.setAccessServiceName(accessServiceName); + omrsRepositoryConnector.setMaxPageSize(maxPageSize); + + OMRSAuditCode auditCode = OMRSAuditCode.NEW_ENTERPRISE_CONNECTOR; + auditLog.logRecord(actionDescription, + auditCode.getLogMessageId(), + auditCode.getSeverity(), + auditCode.getFormattedLogMessage(accessServiceName), + null, + auditCode.getSystemAction(), + auditCode.getUserAction()); + + omrsRepositoryConnector.start(); + + return omrsRepositoryConnector; + } + catch (Throwable error) + { + OMRSAuditCode auditCode = OMRSAuditCode.ENTERPRISE_CONNECTOR_FAILED; + auditLog.logRecord(actionDescription, + auditCode.getLogMessageId(), + auditCode.getSeverity(), + auditCode.getFormattedLogMessage(accessServiceName), + null, + auditCode.getSystemAction(), + auditCode.getUserAction()); + + return null; + } + } + + + /** + * Create an audit log for an external component. + * + * @param componentId - numerical identifier for the component. + * @param componentName - display name for the component. + * @param componentDescription - description of the component. + * @param componentWikiURL - link to more information. + * @return new audit log object + */ + public OMRSAuditLog getAuditLog(int componentId, + String componentName, + String componentDescription, + String componentWikiURL) + { + return new OMRSAuditLog(componentId, componentName, componentDescription, componentWikiURL); + } + + + /** * Initialize the OMRS component for the Open Metadata Repository Services (OMRS). The configuration * is taken as is. Any configuration errors are reported as exceptions. * @@ -133,7 +217,7 @@ public class OMRSOperationalServices { final String actionDescription = "Initialize Open Metadata Repository Operational Services"; final String methodName = "initialize()"; - OMRSAuditCode auditCode = null; + OMRSAuditCode auditCode; if (repositoryServicesConfig == null) @@ -626,30 +710,14 @@ public class OMRSOperationalServices } } + /* + * This will disconnect all repository connectors - both local and remote. + */ if (enterpriseConnectorManager != null) { enterpriseConnectorManager.disconnect(); } - if (localRepositoryConnector != null) - { - try - { - localRepositoryConnector.disconnect(); - } - catch (Throwable error) - { - auditCode = OMRSAuditCode.LOCAL_REPOSITORY_FAILED_TO_DISCONNECT; - auditLog.logRecord(actionDescription, - auditCode.getLogMessageId(), - auditCode.getSeverity(), - auditCode.getFormattedLogMessage(error.getMessage()), - null, - auditCode.getSystemAction(), - auditCode.getUserAction()); - } - } - if (archiveManager != null) { archiveManager.close(); http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/CohortConfig.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/CohortConfig.java b/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/CohortConfig.java index 0e6a458..6dffbf7 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/CohortConfig.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/CohortConfig.java @@ -52,7 +52,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ * This is used to send/receive events between members of the open metadata repository cohort. * </li> * <li> - * cohortOMRSTopicProtocolVersion defines the versionName of the event payload to use when communicating with other + * cohortOMRSTopicProtocolVersion defines the version of the event payload to use when communicating with other * members of the cohort through the OMRS Topic. * </li> * <li> @@ -176,9 +176,9 @@ public class CohortConfig /** - * Return the protocol versionName to use when exchanging events amongst the cohort members. + * Return the protocol version to use when exchanging events amongst the cohort members. * - * @return protocol versionName enum + * @return protocol version enum */ public OpenMetadataEventProtocolVersion getCohortOMRSTopicProtocolVersion() { @@ -187,9 +187,9 @@ public class CohortConfig /** - * Set up the protocol versionName to use when exchanging events amongst the cohort members. + * Set up the protocol version to use when exchanging events amongst the cohort members. * - * @param cohortOMRSTopicProtocolVersion - protocol versionName enum + * @param cohortOMRSTopicProtocolVersion - protocol version enum */ public void setCohortOMRSTopicProtocolVersion(OpenMetadataEventProtocolVersion cohortOMRSTopicProtocolVersion) { http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/EnterpriseAccessConfig.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/EnterpriseAccessConfig.java b/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/EnterpriseAccessConfig.java index 76576d4..c9e809c 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/EnterpriseAccessConfig.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/admin/properties/EnterpriseAccessConfig.java @@ -70,7 +70,7 @@ public class EnterpriseAccessConfig * @param enterpriseMetadataCollectionId - unique identifier for the combined metadata collection covered by the * connected open metadata repositories. * @param enterpriseOMRSTopicConnection - connection for the OMRS Topic connector. - * @param enterpriseOMRSTopicProtocolVersion - protocol versionName enum + * @param enterpriseOMRSTopicProtocolVersion - protocol version enum */ public EnterpriseAccessConfig(String enterpriseMetadataCollectionName, String enterpriseMetadataCollectionId, @@ -155,9 +155,9 @@ public class EnterpriseAccessConfig /** - * Return the protocol versionName to use on the EnterpriseOMRSTopicConnector. + * Return the protocol version to use on the EnterpriseOMRSTopicConnector. * - * @return protocol versionName enum + * @return protocol version enum */ public OpenMetadataEventProtocolVersion getEnterpriseOMRSTopicProtocolVersion() { @@ -166,9 +166,9 @@ public class EnterpriseAccessConfig /** - * Set up the protocol versionName to use on the EnterpriseOMRSTopicConnector. + * Set up the protocol version to use on the EnterpriseOMRSTopicConnector. * - * @param enterpriseOMRSTopicProtocolVersion - protocol versionName enum + * @param enterpriseOMRSTopicProtocolVersion - protocol version enum */ public void setEnterpriseOMRSTopicProtocolVersion(OpenMetadataEventProtocolVersion enterpriseOMRSTopicProtocolVersion) { http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveBuilder.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveBuilder.java b/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveBuilder.java index 72f37f0..5902c42 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveBuilder.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveBuilder.java @@ -179,6 +179,7 @@ public class OMRSArchiveBuilder * Retrieve a PrimitiveDef from the archive. * * @param primitiveDefName - primitive to retrieve + * @return PrimitiveDef type */ public PrimitiveDef getPrimitiveDef(String primitiveDefName) { @@ -306,6 +307,7 @@ public class OMRSArchiveBuilder * Retrieve a CollectionDef from the archive. * * @param collectionDefName - type to retrieve + * @return CollectionDef type */ public CollectionDef getCollectionDef(String collectionDefName) { http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveHelper.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveHelper.java b/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveHelper.java index 8a834ee..42d2d87 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveHelper.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/OMRSArchiveHelper.java @@ -90,6 +90,7 @@ public class OMRSArchiveHelper * @param guid - unique identifier for the CollectionDef * @param description - short default description of the enum type * @param descriptionGUID - guid of the glossary term describing this collection type + * @param arrayType - type of the array. * @return Filled out CollectionDef */ public CollectionDef getArrayCollectionDef(String guid, @@ -121,6 +122,7 @@ public class OMRSArchiveHelper * @param description - short default description of the enum type * @param descriptionGUID - guid of the glossary term describing this collection type * @param propertyKeyType - type of the key for the map. + * @param propertyValueType - type of map value. * @return Filled out CollectionDef */ public CollectionDef getMapCollectionDef(String guid, @@ -349,7 +351,7 @@ public class OMRSArchiveHelper /** - * Return an attribute with the supplied name and description that is of type "array<string>". + * Return an attribute with the supplied name and description that is an array of strings. * It is set up to be optional, * indexable (useful for searches) but the value does not need to be unique. * These are the typical values used for most open metadata attribute. @@ -383,7 +385,7 @@ public class OMRSArchiveHelper /** - * Return an attribute with the supplied name and description that is of type "map<string, string>". + * Return an attribute with the supplied name and description that is of a map from string to string. * It is set up to be optional, * indexable (useful for searches) but the value does not need to be unique. * These are the typical values used for most open metadata attribute. http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/opentypes/OpenMetadataTypesArchive.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/opentypes/OpenMetadataTypesArchive.java b/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/opentypes/OpenMetadataTypesArchive.java index 62842a2..faab96c 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/opentypes/OpenMetadataTypesArchive.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/archivemanager/opentypes/OpenMetadataTypesArchive.java @@ -633,7 +633,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element4Ordinal = 3; - final String element4Value = "Usage Guidance"; + final String element4Value = "UsageGuidance"; final String element4Description = "Provides guidance to a person on how to use the asset."; final String element4DescriptionGUID = null; @@ -999,7 +999,7 @@ public class OpenMetadataTypesArchive EnumElementDef elementDef; final int element1Ordinal = 0; - final String element1Value = "Local Key"; + final String element1Value = "LocalKey"; final String element1Description = "Unique key allocated and used within the scope of a single system."; final String element1DescriptionGUID = null; @@ -1007,7 +1007,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element2Ordinal = 1; - final String element2Value = "Recycled Key"; + final String element2Value = "RecycledKey"; final String element2Description = "Key allocated and used within the scope of a single system that is periodically reused for different records."; final String element2DescriptionGUID = null; @@ -1015,7 +1015,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element3Ordinal = 2; - final String element3Value = "Natural Key"; + final String element3Value = "NaturalKey"; final String element3Description = "Key derived from an attribute of the entity, such as email address, passport number."; final String element3DescriptionGUID = null; @@ -1023,7 +1023,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element4Ordinal = 3; - final String element4Value = "Mirror Key"; + final String element4Value = "MirrorKey"; final String element4Description = "Key value copied from another system."; final String element4DescriptionGUID = null; @@ -1031,7 +1031,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element5Ordinal = 4; - final String element5Value = "Aggregate Key"; + final String element5Value = "AggregateKey"; final String element5Description = "Key formed by combining keys from multiple systems."; final String element5DescriptionGUID = null; @@ -1039,7 +1039,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element6Ordinal = 5; - final String element6Value = "Caller's Key"; + final String element6Value = "CallersKey"; final String element6Description = "Key from another system can bey used if system name provided."; final String element6DescriptionGUID = null; @@ -1047,7 +1047,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element7Ordinal = 6; - final String element7Value = "Stable Key"; + final String element7Value = "StableKey"; final String element7Description = "Key value will remain active even if records are merged."; final String element7DescriptionGUID = null; @@ -1803,7 +1803,7 @@ public class OpenMetadataTypesArchive EnumElementDef elementDef; final int element1Ordinal = 0; - final String element1Value = "Big Endian"; + final String element1Value = "BigEndian"; final String element1Description = "Bits or bytes order from the big end."; final String element1DescriptionGUID = null; @@ -1811,7 +1811,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element2Ordinal = 1; - final String element2Value = "Little Endian"; + final String element2Value = "LittleEndian"; final String element2Description = "Bits or bytes ordered from the little end."; final String element2DescriptionGUID = null; @@ -3769,7 +3769,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element3Ordinal = 2; - final String element3Value = "Date Added"; + final String element3Value = "DateAdded"; final String element3Description = "Order by date added to the metadata collection."; final String element3DescriptionGUID = null; @@ -3777,7 +3777,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element4Ordinal = 3; - final String element4Value = "Date Updated"; + final String element4Value = "DateUpdated"; final String element4Description = "Order by date that the asset was updated."; final String element4DescriptionGUID = null; @@ -3785,7 +3785,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element5Ordinal = 4; - final String element5Value = "Date Created"; + final String element5Value = "DateCreated"; final String element5Description = "Order by date that the asset was created."; final String element5DescriptionGUID = null; @@ -4536,7 +4536,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element2Ordinal = 1; - final String element2Value = "In progress"; + final String element2Value = "InProgress"; final String element2Description = "Work is underway to complete the action."; final String element2DescriptionGUID = null; @@ -5200,7 +5200,7 @@ public class OpenMetadataTypesArchive EnumElementDef elementDef; final int element1Ordinal = 0; - final String element1Value = "Not Recommended"; + final String element1Value = "NotRecommended"; final String element1Description = "This content is not recommended."; final String element1DescriptionGUID = null; @@ -5208,7 +5208,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element2Ordinal = 1; - final String element2Value = "*"; + final String element2Value = "OneStar"; final String element2Description = "One star rating."; final String element2DescriptionGUID = null; @@ -5216,7 +5216,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element3Ordinal = 2; - final String element3Value = "**"; + final String element3Value = "TwoStar"; final String element3Description = "Two star rating."; final String element3DescriptionGUID = null; @@ -5224,7 +5224,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element4Ordinal = 3; - final String element4Value = "***"; + final String element4Value = "ThreeStar"; final String element4Description = "Three star rating."; final String element4DescriptionGUID = null; @@ -5232,7 +5232,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element5Ordinal = 4; - final String element5Value = "****"; + final String element5Value = "FourStar"; final String element5Description = "Four star rating."; final String element5DescriptionGUID = null; @@ -5240,7 +5240,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element6Ordinal = 5; - final String element6Value = "*****"; + final String element6Value = "FiveStar"; final String element6Description = "Five star rating."; final String element6DescriptionGUID = null; @@ -5266,7 +5266,7 @@ public class OpenMetadataTypesArchive EnumElementDef elementDef; final int element1Ordinal = 0; - final String element1Value = "General Comment"; + final String element1Value = "GeneralComment"; final String element1Description = "General comment."; final String element1DescriptionGUID = null; @@ -10647,7 +10647,7 @@ public class OpenMetadataTypesArchive private RelationshipDef getSemanticAssignmentRelationship() { final String guid = "e6670973-645f-441a-bec7-6f5570345b92"; - final String name = "Semantic Assignment"; + final String name = "SemanticAssignment"; final String description = "Links a glossary term to another element such as an asset or schema element to define its meaning."; final String descriptionGUID = null; @@ -11276,8 +11276,8 @@ public class OpenMetadataTypesArchive final String attribute1Name = "title"; final String attribute1Description = "Title describing the governance definition."; final String attribute1DescriptionGUID = null; - final String attribute2Name = "abstract"; - final String attribute2Description = "Short description of the governance definition."; + final String attribute2Name = "summary"; + final String attribute2Description = "Short summary of the governance definition."; final String attribute2DescriptionGUID = null; final String attribute3Name = "description"; final String attribute3Description = "Detailed description of the governance definition."; @@ -12100,7 +12100,7 @@ public class OpenMetadataTypesArchive enumDef.setDefaultValue(elementDef); final int element2Ordinal = 1; - final String element2Value = "Ad hoc"; + final String element2Value = "AdHoc"; final String element2Description = "The data comes from an ad hoc process."; final String element2DescriptionGUID = null; @@ -12182,7 +12182,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element3Ordinal = 2; - final String element3Value = "Project Lifetime"; + final String element3Value = "ProjectLifetime"; final String element3Description = "The data is needed for the lifetime of the referenced project."; final String element3DescriptionGUID = null; @@ -12190,7 +12190,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element4Ordinal = 3; - final String element4Value = "Team Lifetime"; + final String element4Value = "TeamLifetime"; final String element4Description = "The data is needed for the lifetime of the referenced team."; final String element4DescriptionGUID = null; @@ -12198,7 +12198,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element5Ordinal = 4; - final String element5Value = "Contract Lifetime"; + final String element5Value = "ContractLifetime"; final String element5Description = "The data is needed for the lifetime of the referenced contract."; final String element5DescriptionGUID = null; @@ -12206,7 +12206,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element6Ordinal = 5; - final String element6Value = "Regulated Lifetime"; + final String element6Value = "RegulatedLifetime"; final String element6Description = "The retention period for the data is defined by the referenced regulation."; final String element6DescriptionGUID = null; @@ -12214,7 +12214,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element7Ordinal = 6; - final String element7Value = "Time-boxed Lifetime"; + final String element7Value = "TimeBoxedLifetime"; final String element7Description = "The data is needed for the specified time."; final String element7DescriptionGUID = null; @@ -13118,7 +13118,7 @@ public class OpenMetadataTypesArchive enumDef.setDefaultValue(elementDef); final int element2Ordinal = 1; - final String element2Value = "Business Service"; + final String element2Value = "BusinessService"; final String element2Description = "A functional business capability."; final String element2DescriptionGUID = null; @@ -13126,7 +13126,7 @@ public class OpenMetadataTypesArchive elementDefs.add(elementDef); final int element3Ordinal = 2; - final String element3Value = "Business Area"; + final String element3Value = "BusinessArea"; final String element3Description = "A collection of related business services."; final String element3DescriptionGUID = null; @@ -16046,13 +16046,14 @@ public class OpenMetadataTypesArchive this.archiveBuilder.addEntityDef(getRelationalDBSchemaTypeEntity()); this.archiveBuilder.addEntityDef(getRelationalTableTypeEntity()); this.archiveBuilder.addEntityDef(getRelationalTableEntity()); - this.archiveBuilder.addEntityDef(getRelationalViewEntity()); this.archiveBuilder.addEntityDef(getRelationalColumnEntity()); this.archiveBuilder.addEntityDef(getRelationalColumnTypeEntity()); this.archiveBuilder.addEntityDef(getDerivedRelationalColumnEntity()); this.archiveBuilder.addClassificationDef(getPrimaryKeyClassification()); this.archiveBuilder.addClassificationDef(getForeignKeyClassification()); + this.archiveBuilder.addClassificationDef(getRelationalViewClassification()); + } @@ -16107,23 +16108,6 @@ public class OpenMetadataTypesArchive } - private EntityDef getRelationalViewEntity() - { - final String guid = "4814bec8-482d-463d-8376-160b0358e129"; - final String name = "RelationalView"; - final String description = "A view within a relational database schema type."; - final String descriptionGUID = null; - - final String superTypeName = "SchemaAttribute"; - - return archiveHelper.getDefaultEntityDef(guid, - name, - this.archiveBuilder.getEntityDef(superTypeName), - description, - descriptionGUID); - } - - private EntityDef getRelationalColumnEntity() { final String guid = "aa8d5470-6dbc-4648-9e2f-045e5df9d2f9"; @@ -16230,6 +16214,24 @@ public class OpenMetadataTypesArchive } + private ClassificationDef getRelationalViewClassification() + { + final String guid = "4814bec8-482d-463d-8376-160b0358e129"; + final String name = "RelationalView"; + final String description = "A view within a relational database schema type."; + final String descriptionGUID = null; + + final String linkedToEntity = "RelationalTable"; + + return archiveHelper.getClassificationDef(guid, + name, + null, + description, + descriptionGUID, + this.archiveBuilder.getEntityDef(linkedToEntity), + false); + } + /* * ------------------------------------------------------------------------------------------------------- */ http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditCode.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditCode.java b/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditCode.java index 304dde2..1316f33 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditCode.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditCode.java @@ -73,7 +73,7 @@ public enum OMRSAuditCode COHORT_CONFIG_ERROR("OMRS-AUDIT-0006", OMRSAuditLogRecordSeverity.EXCEPTION, - "Configuration error detected while connecting to cohort {0}", + "Configuration error detected while connecting to cohort {0}, error message was: {2}", "The local server has started to initialize the communication with the named " + "open metadata repository cohort and a configuration error was detected.", "Review the exception and resolve the issue it documents. " + @@ -101,19 +101,19 @@ public enum OMRSAuditCode OMRS_DISCONNECTING("OMRS-AUDIT-0010", OMRSAuditLogRecordSeverity.INFO, - "The Open Metadata Repository Services (OMRS) is about to disconnect from the open metadata repositories.", + "The Open Metadata Repository Services (OMRS) is disconnecting the open metadata repositories", "The local server has completed the initialization of the OMRS.", "No action is required. This is part of the normal operation of the server."), OMRS_DISCONNECTED("OMRS-AUDIT-0011", OMRSAuditLogRecordSeverity.INFO, - "The Open Metadata Repository Services (OMRS) has disconnected from the open metadata repositories.", + "The Open Metadata Repository Services (OMRS) has disconnected from the open metadata repositories", "The local server has completed the disconnection of the OMRS.", "No action is required. This is part of the normal operation of the server."), NO_LOCAL_REPOSITORY("OMRS-AUDIT-0012", OMRSAuditLogRecordSeverity.INFO, - "No events will be sent to the open metadata repository cohort {0} because the local metadata collection id is null.", + "No events will be sent to the open metadata repository cohort {0} because the local metadata collection id is null", "The local server will not send outbound events because there is no local metadata repository.", "Validate that the server is configured without a local metadata repository. " + "If there should be a metadata repository then, verify the server configuration is" + @@ -134,7 +134,19 @@ public enum OMRSAuditCode "The local server may not shutdown cleanly.", "Review previous error messages to determine the precise error. Correct the cause and restart the server. "), - NULL_TOPIC_CONNECTOR("OMRS-AUDIT-0015", + OMRS_TOPIC_LISTENER_START("OMRS-AUDIT-0015", + OMRSAuditLogRecordSeverity.INFO, + "The listener thread for an OMRS Topic Connector for topic {0} has started", + "The listener thread will process inbound events", + "No action is required. This is part of the normal operation of the server."), + + OMRS_TOPIC_LISTENER_SHUTDOWN("OMRS-AUDIT-0016", + OMRSAuditLogRecordSeverity.INFO, + "The listener thread for the OMRS Topic Connector for topic {0} has shutdown", + "The listener thread will process inbound events", + "No action is required. This is part of the normal operation of the server."), + + NULL_TOPIC_CONNECTOR("OMRS-AUDIT-0017", OMRSAuditLogRecordSeverity.EXCEPTION, "Unable to send or receive events for cohort {0} because the connector to the OMRS Topic failed to initialize", "The local server will not connect to the cohort.", @@ -143,29 +155,53 @@ public enum OMRSAuditCode "start up configuration. " + "Correct the configuration and reconnect the server to the cohort. "), + NEW_ENTERPRISE_CONNECTOR("OMRS-AUDIT-0018", + OMRSAuditLogRecordSeverity.INFO, + "An enterprise OMRS Connector has been created for the {0} open metadata access service", + "The connector will support access to the connected open metadata repositories.", + "No action is required. This is part of the normal operation of the server."), + + STARTING_ENTERPRISE_CONNECTOR("OMRS-AUDIT-0019", + OMRSAuditLogRecordSeverity.INFO, + "The enterprise OMRS Connector for the {0} open metadata access service has started", + "The connector will support access to the connected open metadata repositories.", + "No action is required. This is part of the normal operation of the server."), + + DISCONNECTING_ENTERPRISE_CONNECTOR("OMRS-AUDIT-0020", + OMRSAuditLogRecordSeverity.INFO, + "The enterprise OMRS Connector for the {0} open metadata access service has shutdown", + "The connector will support access to the connected open metadata repositories.", + "No action is required. This is part of the normal operation of the server."), + + ENTERPRISE_CONNECTOR_FAILED("OMRS-AUDIT-0019", + OMRSAuditLogRecordSeverity.INFO, + "The create of an enterprise OMRS Connector for the {0} open metadata access service failed with this error message: {1}", + "The connector will support access to the connected open metadata repositories.", + "No action is required. This is part of the normal operation of the server."), + PROCESSING_ARCHIVE("OMRS-AUDIT-0050", OMRSAuditLogRecordSeverity.INFO, - "The Open Metadata Repository Services (OMRS) is about to process open metadata archive {0}.", + "The Open Metadata Repository Services (OMRS) is about to process open metadata archive {0}", "The local server is about to local types and instances from an open metadata archive.", "No action is required. This is part of the normal operation of the server."), EMPTY_ARCHIVE("OMRS-AUDIT-0051", OMRSAuditLogRecordSeverity.ERROR, - "The Open Metadata Repository Services (OMRS) is unable to process an open metadata archive because it is empty.", + "The Open Metadata Repository Services (OMRS) is unable to process an open metadata archive because it is empty", "The local server is skipping an open metadata archive because it is empty.", "Review the list of archives for the server and determine which archive is in error. " + "Request a new version of the archive or remove it from the server's archive list."), NULL_PROPERTIES_IN_ARCHIVE("OMRS-AUDIT-0052", OMRSAuditLogRecordSeverity.ERROR, - "The Open Metadata Repository Services (OMRS) is unable to process an open metadata archive because it is empty.", + "The Open Metadata Repository Services (OMRS) is unable to process an open metadata archive because it is empty", "The local server is skipping an open metadata archive because it is empty.", "Review the list of archives for the server and determine which archive is in error. " + "Request a new version of the archive or remove it from the server's archive list."), COMPLETED_ARCHIVE("OMRS-AUDIT-0053", OMRSAuditLogRecordSeverity.INFO, - "The Open Metadata Repository Services (OMRS) has loaded {0} types and {1} instances from open metadata archive {2}.", + "The Open Metadata Repository Services (OMRS) has loaded {0} types and {1} instances from open metadata archive {2}", "The local server has completed the processing of the open metadata archive.", "No action is required. This is part of the normal operation of the server."), @@ -334,8 +370,8 @@ public enum OMRSAuditCode OMRSAuditLogRecordSeverity.ACTION, "Registration request for this server in cohort {0} was rejected by server {1} that " + "hosts metadata collection {2} because TypeDef {3} ({4}) in the local " + - "server is at versionName {5} which is different from this TypeDef in the " + - "remote server which is at versionName {6}", + "server is at version {5} which is different from this TypeDef in the " + + "remote server which is at version {6}", "The remote server may not be able to exchange metadata with this local server.", "It is necessary to update the TypeDef to remove the conflict to ensure that the remote server " + "can exchange metadata with this server."), @@ -352,9 +388,9 @@ public enum OMRSAuditCode OUTGOING_TYPEDEF_PATCH_MISMATCH("OMRS-AUDIT-0204", OMRSAuditLogRecordSeverity.ACTION, "The local server in cohort {0} has rejected a TypeDef update from server {1} that hosts metadata " + - "collection {2} because the versionName of TypeDef {3} ({4}) in the local server " + - "is at versionName {5} is different from this TypeDef in the remote server " + - "which is at versionName {6}", + "collection {2} because the version of TypeDef {3} ({4}) in the local server " + + "is at version {5} is different from this TypeDef in the remote server " + + "which is at version {6}", "The local server will not exchange metadata with this remote server.", "It is necessary to update the TypeDef to remove the conflict before the local server will " + "exchange metadata with the remote server."), @@ -362,9 +398,9 @@ public enum OMRSAuditCode OUTGOING_TYPE_MISMATCH("OMRS-AUDIT-0205", OMRSAuditLogRecordSeverity.ACTION, "The local server in cohort {0} has rejected a TypeDef update from server {1} that hosts " + - "metadata collection {2} because the versionName of TypeDef {3} ({4}) in the local " + - "server is at versionName {5} is different from this TypeDef in the remote server " + - "which is at versionName {6}", + "metadata collection {2} because the version of TypeDef {3} ({4}) in the local " + + "server is at version {5} is different from this TypeDef in the remote server " + + "which is at version {6}", "The local server will not exchange metadata with this remote server.", "It is necessary to update the TypeDef to remove the conflict before the local server will " + "exchange metadata with the remote server."), @@ -407,7 +443,7 @@ public enum OMRSAuditCode "The local server has received an unknown event from another member of the metadata repository " + "cohort and is unable to process it. " + "This is possible if a server in the cohort is at a higher level than this server and " + - "is using a more advanced versionName of the protocol. " + + "is using a more advanced version of the protocol. " + "The local server should continue to operate correctly.", "Verify that the event is a new event type introduced after this server was written."), http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditLog.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditLog.java b/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditLog.java index 1c9991e..46ea3e3 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditLog.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/auditlog/OMRSAuditLog.java @@ -88,6 +88,26 @@ public class OMRSAuditLog * Typical constructor - Each component using the Audit log will create their own OMRSAuditLog instance and * will push log records to it. * + * @param componentId - numerical identifier for the component. + * @param componentName - display name for the component. + * @param componentDescription - description of the component. + * @param componentWikiURL - link to more information. + */ + public OMRSAuditLog(int componentId, + String componentName, + String componentDescription, + String componentWikiURL) + { + this.reportingComponent = new OMRSAuditLogReportingComponent(componentId, + componentName, + componentDescription, + componentWikiURL); + } + + + /** + * External constructor - used to create an audit log for a component outside of OMRS + * * @param reportingComponent - information about the component that will use this instance of the audit log. */ public OMRSAuditLog(OMRSAuditingComponent reportingComponent) @@ -140,7 +160,7 @@ public class OMRSAuditLog { if (auditLogStore != null) { - ArrayList<String> additionalInformationArray = null; + List<String> additionalInformationArray = null; if (additionalInformation != null) { http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/OMRSAuditLogRecord.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/OMRSAuditLogRecord.java b/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/OMRSAuditLogRecord.java index fca5773..25ced7d 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/OMRSAuditLogRecord.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/OMRSAuditLogRecord.java @@ -44,7 +44,7 @@ public class OMRSAuditLogRecord private OMRSAuditLogReportingComponent reportingComponent = null; private String messageId = null; private String messageText = null; - private ArrayList<String> additionalInformation = null; + private List<String> additionalInformation = null; private String systemAction = null; private String userAction = null; @@ -75,7 +75,7 @@ public class OMRSAuditLogRecord String severity, String messageId, String messageText, - ArrayList<String> additionalInformation, + List<String> additionalInformation, String systemAction, String userAction) { @@ -124,6 +124,17 @@ public class OMRSAuditLogRecord /** + * Set up the time stamp for when the audit log record was created. + * + * @param timeStamp Date object + */ + public void setTimeStamp(Date timeStamp) + { + this.timeStamp = timeStamp; + } + + + /** * Return details of the originator of the log record. * * @return OMRSAuditLogRecordOriginator object @@ -135,6 +146,16 @@ public class OMRSAuditLogRecord /** + * Set up details of the originator of the log record. + * + * @param originator + */ + public void setOriginator(OMRSAuditLogRecordOriginator originator) + { + this.originator = originator; + } + + /** * Return the severity of the situation recorded in the log record. * * @return String severity @@ -146,6 +167,17 @@ public class OMRSAuditLogRecord /** + * Set up the severity of the situation recorded in the log record. + * + * @param severity - String severity + */ + public void setSeverity(String severity) + { + this.severity = severity; + } + + + /** * Return the name of the component that reported the situation recorded in the log record. * * @return OMRSAuditLogReportingComponent object @@ -157,78 +189,87 @@ public class OMRSAuditLogRecord /** - * Return the identifier of the message within the log record. + * Set up the name of the component that reported the situation recorded in the log record. * - * @return String message Id + * @param reportingComponent - OMRSAuditLogReportingComponent object */ - public String getMessageId() + public void setReportingComponent(OMRSAuditLogReportingComponent reportingComponent) { - return messageId; + this.reportingComponent = reportingComponent; } /** - * Return the text of the message within the log record. + * Return the identifier of the message within the log record. * - * @return String message text + * @return String message id */ - public String getMessageText() + public String getMessageId() { - return messageText; + return messageId; } /** - * Return any additional information in the audit log record. + * Set up the identifier of the message within the log record. * - * @return String additional information + * @param messageId - String message id */ - public List<String> getAdditionalInformation() + public void setMessageId(String messageId) { - return additionalInformation; + this.messageId = messageId; } - - - - public void setTimeStamp(Date timeStamp) + /** + * Return the text of the message within the log record. + * + * @return String message text + */ + public String getMessageText() { - this.timeStamp = timeStamp; + return messageText; } - public void setOriginator(OMRSAuditLogRecordOriginator originator) - { - this.originator = originator; - } - public void setSeverity(String severity) + /** + * Set up the text of the message within the log record. + * + * @param messageText - String message text + */ + public void setMessageText(String messageText) { - this.severity = severity; + this.messageText = messageText; } - public void setReportingComponent(OMRSAuditLogReportingComponent reportingComponent) - { - this.reportingComponent = reportingComponent; - } - public void setMessageId(String messageId) + /** + * Return any additional information in the audit log record. + * + * @return List of String additional information + */ + public List<String> getAdditionalInformation() { - this.messageId = messageId; + return additionalInformation; } - public void setMessageText(String messageText) - { - this.messageText = messageText; - } - public void setAdditionalInformation(ArrayList<String> additionalInformation) + /** + * Set up any additional information in the audit log record. + * + * @param additionalInformation - List of String additional information + */ + public void setAdditionalInformation(List<String> additionalInformation) { this.additionalInformation = additionalInformation; } - + /** + * Return the description of the actions taken by the local server as a result of the reported situation. + * + * @return string description + */ public String getSystemAction() { return systemAction; @@ -238,7 +279,7 @@ public class OMRSAuditLogRecord /** * Set up the description of the actions taken by the local server as a result of the reported situation. * - * @param systemAction + * @param systemAction - a description of the actions taken by the system as a result of the error. */ public void setSystemAction(String systemAction) { http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/file/FileBasedAuditLogStoreConnector.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/file/FileBasedAuditLogStoreConnector.java b/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/file/FileBasedAuditLogStoreConnector.java index 0eda0c9..1914f42 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/file/FileBasedAuditLogStoreConnector.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/auditlog/store/file/FileBasedAuditLogStoreConnector.java @@ -20,6 +20,7 @@ package org.apache.atlas.omrs.auditlog.store.file; import org.apache.atlas.ocf.ffdc.ConnectorCheckedException; import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogRecord; import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogStoreConnectorBase; +import org.apache.atlas.omrs.ffdc.OMRSErrorCode; import org.apache.atlas.omrs.ffdc.exception.PagingErrorException; import org.apache.atlas.omrs.ffdc.exception.InvalidParameterException; import org.slf4j.Logger; @@ -56,9 +57,19 @@ public class FileBasedAuditLogStoreConnector extends OMRSAuditLogStoreConnectorB */ public String storeLogRecord(OMRSAuditLogRecord logRecord) throws InvalidParameterException { + final String methodName = "storeLogRecord"; + if (logRecord == null) { - // TODO Throw PropertyErrorException + OMRSErrorCode errorCode = OMRSErrorCode.NULL_LOG_RECORD; + String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(); + + throw new InvalidParameterException(errorCode.getHTTPErrorCode(), + this.getClass().getName(), + methodName, + errorMessage, + errorCode.getSystemAction(), + errorCode.getUserAction()); } if (log.isDebugEnabled()) @@ -79,10 +90,6 @@ public class FileBasedAuditLogStoreConnector extends OMRSAuditLogStoreConnectorB */ public OMRSAuditLogRecord getAuditLogRecord(String logRecordId) throws InvalidParameterException { - if (logRecordId == null) - { - // TODO Throw PropertyErrorException - } return null; } http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java b/omrs/src/main/java/org/apache/atlas/omrs/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java index d03fcc0..28c226d 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/enterprise/connectormanager/OMRSEnterpriseConnectorManager.java @@ -184,10 +184,19 @@ public class OMRSEnterpriseConnectorManager implements OMRSConnectionConsumer, O if (remoteConnector != null) { + OMRSMetadataCollection metadataCollection = null; + /* * Need to validate that this repository connector has a metadata collection. */ - OMRSMetadataCollection metadataCollection = remoteConnector.getMetadataCollection(); + try + { + metadataCollection = remoteConnector.getMetadataCollection(); + } + catch (Throwable error) + { + metadataCollection = null; + } /* * Don't need to connector any more. http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java b/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java index 8d50c07..8db8230 100644 --- a/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java +++ b/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSConnectorProvider.java @@ -63,6 +63,7 @@ public class EnterpriseOMRSConnectorProvider extends OMRSRepositoryConnectorProv * list of connectors to the repositories in the cohort. * * @param connectorManager - manager of the list of connectors to remote repositories. + * @param repositoryContentManager - manager of lists of active and known types with associated helper methods * @param localServerName - name of the local server for this connection. * @param localServerType - type of the local server. * @param owningOrganizationName - name of the organization the owns the remote server. @@ -140,16 +141,16 @@ public class EnterpriseOMRSConnectorProvider extends OMRSRepositoryConnectorProv /* * Create and initialize a new connector. */ - EnterpriseOMRSRepositoryConnector connector = new EnterpriseOMRSRepositoryConnector(EnterpriseOMRSConnectorProvider.connectorManager, - enterpriseMetadataCollectionName); + EnterpriseOMRSRepositoryConnector connector = new EnterpriseOMRSRepositoryConnector(EnterpriseOMRSConnectorProvider.connectorManager); connector.initialize(this.getNewConnectorGUID(), connection); connector.setServerName(localServerName); connector.setServerType(localServerType); + connector.setRepositoryName(enterpriseMetadataCollectionName); connector.setOrganizationName(owningOrganizationName); - connector.setMetadataCollectionId(enterpriseMetadataCollectionId); connector.setRepositoryHelper(new OMRSRepositoryHelper(repositoryContentManager)); connector.setRepositoryValidator(new OMRSRepositoryValidator(repositoryContentManager)); + connector.setMetadataCollectionId(enterpriseMetadataCollectionId); connector.initializeConnectedAssetProperties(new EnterpriseOMRSConnectorProperties(connector, EnterpriseOMRSConnectorProvider.connectorManager, enterpriseMetadataCollectionId,
