ATLAS-1775 Enterprise OMRS Connector Initial Impl 2 Signed-off-by: David Radley <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/f57fd7f0 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/f57fd7f0 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/f57fd7f0 Branch: refs/heads/master Commit: f57fd7f0f0b5cd5617a897b950030e92b2beb746 Parents: 9a4ca16 Author: Mandy Chessell <[email protected]> Authored: Mon Apr 16 23:22:36 2018 +0200 Committer: David Radley <[email protected]> Committed: Tue Apr 17 11:38:31 2018 +0100 ---------------------------------------------------------------------- .../atlas/ocf/properties/ElementType.java | 28 +- .../properties/beans/AdditionalProperties.java | 4 +- .../atlas/ocf/properties/beans/Connection.java | 2 +- .../atlas/ocf/properties/beans/ElementType.java | 3 +- omag-api/pom.xml | 3 + .../omag/admin/OMAGServerAdministration.java | 2 + .../server/OMAGAccessServiceRegistration.java | 47 + .../admin/server/OMAGServerAdminResource.java | 101 +- .../server/properties/OMAGAPIResponse.java | 172 + .../properties/OMAGServerConfigResponse.java | 80 + .../admin/server/properties/VoidResponse.java | 54 + .../properties/AccessServiceConfig.java | 20 +- .../properties/OMAGServerConfig.java | 2 +- .../registration/AccessServiceAdmin.java | 28 +- .../registration/AccessServiceDescription.java | 178 +- .../registration/AccessServiceRegistration.java | 228 + .../apache/atlas/omag/ffdc/OMAGErrorCode.java | 9 +- omag-server/pom.xml | 12 + .../atlas/omag/application/OMAGApplication.java | 4 +- omas-assetconsumer/README.md | 38 + omas-assetconsumer/pom.xml | 107 + .../assetconsumer/AssetConsumerInterface.java | 388 ++ .../assetconsumer/admin/AssetConsumerAdmin.java | 133 + .../auditlog/AssetConsumerAuditCode.java | 174 + .../assetconsumer/client/AssetConsumer.java | 1260 ++++ .../events/AssetConsumerEvent.java | 93 + .../events/AssetConsumerEventType.java | 98 + .../ffdc/AssetConsumerErrorCode.java | 251 + .../atlas/omas/assetconsumer/ffdc/README.md | 46 + .../AmbiguousConnectionNameException.java | 59 + .../AssetConsumerCheckedExceptionBase.java | 173 + .../AssetConsumerRuntimeException.java | 158 + .../exceptions/InvalidParameterException.java | 58 + .../exceptions/PropertyServerException.java | 58 + .../UnrecognizedConnectionGUIDException.java | 59 + .../UnrecognizedConnectionNameException.java | 58 + .../UnrecognizedConnectionURLException.java | 58 + .../exceptions/UserNotAuthorizedException.java | 58 + .../AssetConsumerOMRSTopicListener.java | 249 + .../omas/assetconsumer/properties/Asset.java | 179 + .../publisher/AssetConsumerPublisher.java | 319 + .../server/AssetConsumerRESTServices.java | 1057 ++++ .../assetconsumer/server/AuditLogHandler.java | 137 + .../assetconsumer/server/ConnectionHandler.java | 645 ++ .../omas/assetconsumer/server/ErrorHandler.java | 333 + .../assetconsumer/server/FeedbackHandler.java | 1013 +++ .../AssetConsumerOMASAPIResponse.java | 172 + .../server/properties/ConnectionResponse.java | 81 + .../server/properties/GUIDResponse.java | 81 + .../server/properties/VoidResponse.java | 54 + omas-connectedasset/README.md | 42 + omas-connectedasset/pom.xml | 111 + .../connectedasset/ConnectedAssetInterface.java | 67 + .../admin/ConnectedAssetAdmin.java | 80 + .../connectedasset/client/ConnectedAsset.java | 117 + .../client/ConnectedAssetProperties.java | 174 + .../ffdc/ConnectedAssetErrorCode.java | 194 + .../atlas/omas/connectedasset/ffdc/README.md | 46 + .../ConnectedAssetCheckedExceptionBase.java | 175 + .../ConnectedAssetRuntimeException.java | 158 + .../exceptions/InvalidParameterException.java | 58 + .../exceptions/PropertyServerException.java | 57 + .../UnrecognizedConnectionGUIDException.java | 59 + .../exceptions/UserNotAuthorizedException.java | 58 + .../properties/AdditionalProperties.java | 149 + .../connectedasset/properties/Analysis.java | 108 + .../connectedasset/properties/Annotation.java | 472 ++ .../properties/AnnotationStatus.java | 98 + .../properties/AssetDescriptor.java | 154 + .../connectedasset/properties/AssetDetail.java | 356 ++ .../connectedasset/properties/AssetSummary.java | 384 ++ .../properties/AssetUniverse.java | 332 + .../properties/Certification.java | 321 + .../properties/Classification.java | 169 + .../omas/connectedasset/properties/Comment.java | 186 + .../connectedasset/properties/CommentType.java | 96 + .../connectedasset/properties/Connection.java | 313 + .../properties/ConnectorType.java | 173 + .../properties/DerivedSchemaElement.java | 129 + .../properties/ElementHeader.java | 208 + .../connectedasset/properties/ElementType.java | 237 + .../properties/EmbeddedConnection.java | 136 + .../connectedasset/properties/Endpoint.java | 236 + .../properties/ExternalIdentifier.java | 215 + .../properties/ExternalReference.java | 195 + .../connectedasset/properties/Feedback.java | 210 + .../connectedasset/properties/InformalTag.java | 197 + .../connectedasset/properties/KeyPattern.java | 98 + .../omas/connectedasset/properties/License.java | 317 + .../omas/connectedasset/properties/Like.java | 87 + .../omas/connectedasset/properties/Lineage.java | 69 + .../connectedasset/properties/Location.java | 111 + .../properties/MapSchemaElement.java | 137 + .../omas/connectedasset/properties/Meaning.java | 115 + .../omas/connectedasset/properties/Note.java | 140 + .../omas/connectedasset/properties/NoteLog.java | 149 + .../properties/PrimitiveSchemaElement.java | 110 + .../connectedasset/properties/PropertyBase.java | 78 + .../omas/connectedasset/properties/Rating.java | 140 + .../properties/Referenceable.java | 170 + .../connectedasset/properties/RelatedAsset.java | 141 + .../properties/RelatedAssetProperties.java | 143 + .../properties/RelatedMediaReference.java | 253 + .../properties/RelatedMediaType.java | 90 + .../properties/RelatedMediaUsage.java | 96 + .../omas/connectedasset/properties/Schema.java | 218 + .../properties/SchemaAttribute.java | 182 + .../properties/SchemaElement.java | 161 + .../properties/SchemaImplementationQuery.java | 155 + .../connectedasset/properties/SchemaLink.java | 197 + .../connectedasset/properties/StarRating.java | 97 + .../properties/VirtualConnection.java | 113 + .../server/ConnectedAssetRESTServices.java | 87 + .../properties/AssetUniverseResponse.java | 83 + .../ConnectedAssetOMASAPIResponse.java | 172 + .../InMemoryOMRSMetadataCollection.java | 955 ++- .../InMemoryOMRSMetadataStore.java | 89 +- .../InMemoryOMRSRepositoryConnector.java | 19 +- .../omrs/admin/OMRSConfigurationFactory.java | 5 +- .../omrs/admin/OMRSOperationalServices.java | 108 +- .../omrs/admin/properties/CohortConfig.java | 10 +- .../properties/EnterpriseAccessConfig.java | 10 +- .../omrs/archivemanager/OMRSArchiveBuilder.java | 2 + .../omrs/archivemanager/OMRSArchiveHelper.java | 6 +- .../opentypes/OpenMetadataTypesArchive.java | 102 +- .../atlas/omrs/auditlog/OMRSAuditCode.java | 72 +- .../atlas/omrs/auditlog/OMRSAuditLog.java | 22 +- .../omrs/auditlog/store/OMRSAuditLogRecord.java | 117 +- .../file/FileBasedAuditLogStoreConnector.java | 17 +- .../OMRSEnterpriseConnectorManager.java | 11 +- .../EnterpriseOMRSConnectorProvider.java | 7 +- .../EnterpriseOMRSMetadataCollection.java | 5884 ++++++++++++++---- .../EnterpriseOMRSRepositoryConnector.java | 276 +- .../omrs/eventmanagement/OMRSEventListener.java | 14 +- .../eventmanagement/OMRSEventPublisher.java | 40 +- .../OMRSRepositoryEventManager.java | 23 +- .../events/OMRSEventOriginator.java | 2 +- .../events/OMRSInstanceEvent.java | 4 +- .../events/OMRSInstanceEventErrorCode.java | 2 +- .../events/OMRSRegistryEvent.java | 26 +- .../events/OMRSRegistryEventProcessor.java | 11 +- .../events/OMRSTypeDefEventType.java | 2 +- .../eventmanagement/events/v1/OMRSEventV1.java | 2 +- .../events/v1/OMRSEventV1RegistrySection.java | 26 +- .../apache/atlas/omrs/ffdc/OMRSErrorCode.java | 46 +- .../LocalOMRSInstanceEventProcessor.java | 41 +- .../LocalOMRSMetadataCollection.java | 1765 ++++-- .../LocalOMRSRepositoryConnector.java | 88 +- .../OMRSInstanceHelper.java | 2 + .../OMRSInstanceValidator.java | 24 + .../OMRSRepositoryContentManager.java | 563 +- .../OMRSRepositoryHelper.java | 909 ++- .../OMRSRepositoryValidator.java | 914 ++- .../OMRSTypeDefHelper.java | 2 +- .../OMRSTypeDefManager.java | 2 +- .../OMRSTypeDefValidator.java | 32 +- .../OMRSMetadataCollection.java | 117 +- .../OMRSMetadataCollectionBase.java | 2401 ++++++- .../properties/instances/EntityDetail.java | 2 +- .../properties/instances/EntityProxy.java | 2 +- .../properties/instances/EntitySummary.java | 2 +- .../instances/InstanceAuditHeader.java | 8 +- .../properties/instances/InstanceHeader.java | 2 +- .../instances/InstanceProperties.java | 21 + .../instances/InstancePropertyValue.java | 24 +- .../properties/instances/InstanceType.java | 8 +- .../properties/instances/Relationship.java | 2 +- .../properties/typedefs/AttributeTypeDef.java | 13 +- .../properties/typedefs/ClassificationDef.java | 2 +- .../properties/typedefs/EntityDef.java | 2 +- .../typedefs/PrimitiveDefCategory.java | 2 +- .../properties/typedefs/RelationshipDef.java | 2 +- .../properties/typedefs/TypeDef.java | 17 +- .../properties/typedefs/TypeDefPatch.java | 4 +- .../properties/typedefs/TypeDefSummary.java | 2 +- .../OMRSMetadataCollectionManager.java | 69 +- .../OMRSRepositoryConnector.java | 113 +- .../omrs/metadatahighway/OMRSCohortManager.java | 13 +- .../cohortregistry/OMRSCohortRegistry.java | 72 +- .../store/properties/CohortMembership.java | 2 +- .../omrs/rest/properties/BooleanResponse.java | 2 +- .../properties/OMRSRESTAPIPagedResponse.java | 2 +- .../rest/properties/OMRSRESTAPIResponse.java | 2 +- .../OMRSRESTMetadataCollection.java | 160 +- .../OMRSRESTRepositoryConnector.java | 5 +- .../rest/server/OMRSRepositoryRESTServices.java | 168 +- .../atlas/omrs/topicconnectors/OMRSTopic.java | 2 +- .../topicconnectors/OMRSTopicConnector.java | 107 +- .../inmemory/InMemoryOMRSTopicConnector.java | 109 + .../inmemory/InMemoryOMRSTopicProvider.java | 39 + pom.xml | 3 + 191 files changed, 30837 insertions(+), 3919 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java index efdb030..5c84894 100644 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java +++ b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java @@ -25,13 +25,13 @@ package org.apache.atlas.ocf.properties; */ public class ElementType extends PropertyBase { - protected String elementTypeId = null; - protected String elementTypeName = null; - protected long elementTypeVersion = 0; - protected String elementTypeDescription = null; - protected String elementAccessServiceURL = null; - protected ElementOrigin elementOrigin = null; - protected String elementHomeMetadataCollectionId = null; + protected String elementTypeId = null; + protected String elementTypeName = null; + protected long elementTypeVersion = 0; + protected String elementTypeDescription = null; + protected String elementSourceServer = null; + protected ElementOrigin elementOrigin = null; + protected String elementHomeMetadataCollectionId = null; /** @@ -41,7 +41,7 @@ public class ElementType extends PropertyBase * @param elementTypeName - element type name * @param elementTypeVersion - version number for the element type * @param elementTypeDescription - description of element type - * @param elementAccessServiceURL - url of the OMAS server + * @param elementSourceServer - url of the OMAS server * @param elementOrigin - enum describing type of origin * @param elementHomeMetadataCollectionId - metadata collection id */ @@ -49,7 +49,7 @@ public class ElementType extends PropertyBase String elementTypeName, long elementTypeVersion, String elementTypeDescription, - String elementAccessServiceURL, + String elementSourceServer, ElementOrigin elementOrigin, String elementHomeMetadataCollectionId) { @@ -59,7 +59,7 @@ public class ElementType extends PropertyBase this.elementTypeName = elementTypeName; this.elementTypeVersion = elementTypeVersion; this.elementTypeDescription = elementTypeDescription; - this.elementAccessServiceURL = elementAccessServiceURL; + this.elementSourceServer = elementSourceServer; this.elementOrigin = elementOrigin; this.elementHomeMetadataCollectionId = elementHomeMetadataCollectionId; } @@ -83,7 +83,7 @@ public class ElementType extends PropertyBase this.elementTypeName = templateType.getElementTypeName(); this.elementTypeVersion = templateType.getElementTypeVersion(); this.elementTypeDescription = templateType.getElementTypeDescription(); - this.elementAccessServiceURL = templateType.getElementAccessServiceURL(); + this.elementSourceServer = templateType.getElementSourceServer(); this.elementOrigin = templateType.getElementOrigin(); this.elementHomeMetadataCollectionId = templateType.getElementHomeMetadataCollectionId(); } @@ -140,9 +140,9 @@ public class ElementType extends PropertyBase * * @return elementSourceServerURL - the url of the server where the element came from */ - public String getElementAccessServiceURL() + public String getElementSourceServer() { - return elementAccessServiceURL; + return elementSourceServer; } @@ -179,7 +179,7 @@ public class ElementType extends PropertyBase ", elementTypeName='" + elementTypeName + '\'' + ", elementTypeVersion=" + elementTypeVersion + ", elementTypeDescription='" + elementTypeDescription + '\'' + - ", elementAccessServiceURL='" + elementAccessServiceURL + '\'' + + ", elementSourceServer='" + elementSourceServer + '\'' + ", elementOrigin=" + elementOrigin + ", elementHomeMetadataCollectionId='" + elementHomeMetadataCollectionId + '\'' + '}'; http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/AdditionalProperties.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/AdditionalProperties.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/AdditionalProperties.java index c6ce0ff..6a23a47 100644 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/AdditionalProperties.java +++ b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/AdditionalProperties.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.util.HashMap; import java.util.Map; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -35,6 +36,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ @JsonIgnoreProperties(ignoreUnknown=true) public class AdditionalProperties extends org.apache.atlas.ocf.properties.AdditionalProperties { + /** * Default constructor */ @@ -47,7 +49,7 @@ public class AdditionalProperties extends org.apache.atlas.ocf.properties.Additi /** * Set up the additional properties. * - * @param additionalProperties + * @param additionalProperties - property map */ public void setAdditionalProperties(Map<String, Object> additionalProperties) { http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/Connection.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/Connection.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/Connection.java index e1554bd..465255f 100644 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/Connection.java +++ b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/Connection.java @@ -172,7 +172,7 @@ public class Connection extends org.apache.atlas.ocf.properties.Connection /** * Set up the secured properties for this Connection. * - * @param securedProperties + * @param securedProperties - properties that contain secret information such as log on information. */ public void setSecuredProperties(AdditionalProperties securedProperties) { http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/ElementType.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/ElementType.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/ElementType.java index 10bb8f9..6fb4683 100644 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/ElementType.java +++ b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/beans/ElementType.java @@ -40,6 +40,7 @@ public class ElementType extends org.apache.atlas.ocf.properties.ElementType public ElementType() { super(null); + elementOrigin = ElementOrigin.CONFIGURATION; } @@ -105,7 +106,7 @@ public class ElementType extends org.apache.atlas.ocf.properties.ElementType */ public void setElementAccessServiceURL(String elementAccessServiceURL) { - super.elementAccessServiceURL = elementAccessServiceURL; + super.elementSourceServer = elementAccessServiceURL; } http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/pom.xml ---------------------------------------------------------------------- diff --git a/omag-api/pom.xml b/omag-api/pom.xml index 4bb6c80..2338286 100644 --- a/omag-api/pom.xml +++ b/omag-api/pom.xml @@ -91,12 +91,15 @@ <artifactId>om-fwk-ocf</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> + <dependency> <groupId>org.apache.atlas</groupId> <artifactId>omrs</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> + + </dependencies> <build> http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/admin/OMAGServerAdministration.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/admin/OMAGServerAdministration.java b/omag-api/src/main/java/org/apache/atlas/omag/admin/OMAGServerAdministration.java index e3fadfb..dd19018 100644 --- a/omag-api/src/main/java/org/apache/atlas/omag/admin/OMAGServerAdministration.java +++ b/omag-api/src/main/java/org/apache/atlas/omag/admin/OMAGServerAdministration.java @@ -325,6 +325,8 @@ public interface OMAGServerAdministration * * @param userId - user that is issuing the request * @param serverName - local server name + * @throws OMAGNotAuthorizedException - the supplied userId is not authorized to issue this command. + * @throws OMAGInvalidParameterException - the server name is invalid * @throws OMAGConfigurationErrorException - there is a problem using the supplied configuration */ void initialize (String userId, http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGAccessServiceRegistration.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGAccessServiceRegistration.java b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGAccessServiceRegistration.java new file mode 100644 index 0000000..aa9d80c --- /dev/null +++ b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGAccessServiceRegistration.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.atlas.omag.admin.server; + +import org.apache.atlas.omag.configuration.registration.AccessServiceRegistration; + +import java.util.ArrayList; +import java.util.List; + +public class OMAGAccessServiceRegistration +{ + static private List<AccessServiceRegistration> accessServiceRegistrationList = new ArrayList<>(); + + + /* + * Register OMAS + */ + + public static synchronized void registerAccessService(AccessServiceRegistration registration) + { + if (registration != null) + { + accessServiceRegistrationList.add(registration); + } + } + + public static synchronized List<AccessServiceRegistration> getAccessServiceRegistrationList() + { + return accessServiceRegistrationList; + } + +} http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGServerAdminResource.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGServerAdminResource.java b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGServerAdminResource.java index c6248b8..ebc9f2a 100644 --- a/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGServerAdminResource.java +++ b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/OMAGServerAdminResource.java @@ -29,8 +29,8 @@ import org.apache.atlas.omag.admin.OMAGServiceMode; import org.apache.atlas.omag.configuration.properties.AccessServiceConfig; import org.apache.atlas.omag.configuration.properties.OMAGServerConfig; import org.apache.atlas.omag.configuration.registration.AccessServiceAdmin; -import org.apache.atlas.omag.configuration.registration.AccessServiceDescription; import org.apache.atlas.omag.configuration.registration.AccessServiceOperationalStatus; +import org.apache.atlas.omag.configuration.registration.AccessServiceRegistration; import org.apache.atlas.omag.configuration.store.OMAGServerConfigStore; import org.apache.atlas.omag.configuration.store.file.FileBasedServerConfigStoreProvider; import org.apache.atlas.omag.ffdc.OMAGErrorCode; @@ -43,6 +43,7 @@ import org.apache.atlas.omrs.admin.properties.CohortConfig; import org.apache.atlas.omrs.admin.properties.EnterpriseAccessConfig; import org.apache.atlas.omrs.admin.properties.LocalRepositoryConfig; import org.apache.atlas.omrs.admin.properties.RepositoryServicesConfig; +import org.apache.atlas.omrs.topicconnectors.OMRSTopicConnector; import org.springframework.web.bind.annotation.*; @@ -81,8 +82,11 @@ import java.util.UUID; @RequestMapping("/omag/admin/{userId}/{serverName}") public class OMAGServerAdminResource implements OMAGServerAdministration { - private OMAGServerConfigStore serverConfigStore = null; - private OMRSOperationalServices operationalServices = null; + private OMAGServerConfigStore serverConfigStore = null; + private OMRSOperationalServices operationalServices = null; + private List<AccessServiceAdmin> accessServiceAdminList = new ArrayList<>(); + + /* * ============================================================= @@ -260,20 +264,27 @@ public class OMAGServerAdminResource implements OMAGServerAdministration if (serviceMode == OMAGServiceMode.ENABLED) { + List<AccessServiceRegistration> accessServiceRegistrationList = OMAGAccessServiceRegistration.getAccessServiceRegistrationList(); + /* * Set up the available access services. */ - ArrayList<AccessServiceDescription> accessServiceList = AccessServiceDescription.getAccessServiceDescriptionList(); - - for (AccessServiceDescription accessServiceDescription : accessServiceList) + if (accessServiceRegistrationList != null) { - if (accessServiceDescription.getAccessServiceOperationalStatus() == AccessServiceOperationalStatus.ENABLED) + for (AccessServiceRegistration registration : accessServiceRegistrationList) { - AccessServiceConfig accessServiceConfig = new AccessServiceConfig(accessServiceDescription); - accessServiceConfigList.add(accessServiceConfig); + if (registration != null) + { + if (registration.getAccessServiceOperationalStatus() == AccessServiceOperationalStatus.ENABLED) + { + AccessServiceConfig accessServiceConfig = new AccessServiceConfig(registration); + accessServiceConfigList.add(accessServiceConfig); + } + } } } + /* * Now set up the enterprise repository services. */ @@ -724,7 +735,7 @@ public class OMAGServerAdminResource implements OMAGServerAdministration @RequestParam LocalRepositoryConfig localRepositoryConfig) throws OMAGNotAuthorizedException, OMAGInvalidParameterException { - final String methodName = "setLocalRepositoryConfig()"; + final String methodName = "setLocalRepositoryConfig"; validateServerName(serverName, methodName); validateUserId(userId, serverName, methodName); @@ -774,7 +785,7 @@ public class OMAGServerAdminResource implements OMAGServerAdministration @RequestParam EnterpriseAccessConfig enterpriseAccessConfig) throws OMAGNotAuthorizedException, OMAGInvalidParameterException { - final String methodName = "setEnterpriseAccessConfig()"; + final String methodName = "setEnterpriseAccessConfig"; validateServerName(serverName, methodName); validateUserId(userId, serverName, methodName); @@ -819,7 +830,7 @@ public class OMAGServerAdminResource implements OMAGServerAdministration @RequestParam CohortConfig cohortConfig) throws OMAGNotAuthorizedException, OMAGInvalidParameterException { - final String methodName = "setCohortConfig()"; + final String methodName = "setCohortConfig"; validateServerName(serverName, methodName); validateUserId(userId, serverName, methodName); @@ -916,7 +927,7 @@ public class OMAGServerAdminResource implements OMAGServerAdministration @PathVariable String serverName) throws OMAGNotAuthorizedException, OMAGInvalidParameterException { - final String methodName = "getCurrentConfiguration()"; + final String methodName = "getCurrentConfiguration"; validateServerName(serverName, methodName); validateUserId(userId, serverName, methodName); @@ -943,7 +954,7 @@ public class OMAGServerAdminResource implements OMAGServerAdministration OMAGInvalidParameterException, OMAGConfigurationErrorException { - final String methodName = "initialize()"; + final String methodName = "initialize"; validateServerName(serverName, methodName); validateUserId(userId, serverName, methodName); @@ -969,7 +980,7 @@ public class OMAGServerAdminResource implements OMAGServerAdministration OMAGInvalidParameterException, OMAGConfigurationErrorException { - final String methodName = "initialize()"; + final String methodName = "initialize"; validateServerName(serverName, methodName); validateUserId(userId, serverName, methodName); @@ -1024,14 +1035,8 @@ public class OMAGServerAdminResource implements OMAGServerAdministration /* * Now initialize the open metadata access services */ - List<AccessServiceConfig> accessServiceConfigList = configuration.getAccessServicesConfig(); - EnterpriseAccessConfig enterpriseAccessConfig = repositoryServicesConfig.getEnterpriseAccessConfig(); - Connection enterpriseOMRSTopicConnection = null; - - if (enterpriseAccessConfig != null) - { - enterpriseOMRSTopicConnection = enterpriseAccessConfig.getEnterpriseOMRSTopicConnection(); - } + List<AccessServiceConfig> accessServiceConfigList = configuration.getAccessServicesConfig(); + OMRSTopicConnector enterpriseTopicConnector = operationalServices.getEnterpriseOMRSTopicConnector(); if (accessServiceConfigList != null) { @@ -1047,7 +1052,15 @@ public class OMAGServerAdminResource implements OMAGServerAdministration { AccessServiceAdmin accessServiceAdmin = (AccessServiceAdmin)Class.forName(accessServiceAdminClassName).newInstance(); - accessServiceAdmin.initialize(accessServiceConfig, enterpriseOMRSTopicConnection); + accessServiceAdmin.initialize(accessServiceConfig, + enterpriseTopicConnector, + operationalServices.getEnterpriseOMRSRepositoryConnector(accessServiceConfig.getAccessServiceName()), + operationalServices.getAuditLog(accessServiceConfig.getAccessServiceId(), + accessServiceConfig.getAccessServiceName(), + accessServiceConfig.getAccessServiceDescription(), + accessServiceConfig.getAccessServiceWiki()), + "OMASUser"); + accessServiceAdminList.add(accessServiceAdmin); } catch (Throwable error) { @@ -1082,6 +1095,27 @@ public class OMAGServerAdminResource implements OMAGServerAdministration } } } + + if (enterpriseTopicConnector != null) + { + try + { + enterpriseTopicConnector.start(); + } + catch (Throwable error) + { + OMAGErrorCode errorCode = OMAGErrorCode.ENTERPRISE_TOPIC_START_FAILED; + String errorMessage = errorCode.getErrorMessageId() + + errorCode.getFormattedErrorMessage(serverName, error.getMessage()); + + throw new OMAGConfigurationErrorException(errorCode.getHTTPErrorCode(), + this.getClass().getName(), + methodName, + errorMessage, + errorCode.getSystemAction(), + errorCode.getUserAction()); + } + } } @@ -1101,11 +1135,28 @@ public class OMAGServerAdminResource implements OMAGServerAdministration @RequestParam boolean permanent) throws OMAGNotAuthorizedException, OMAGInvalidParameterException { - final String methodName = "terminate()"; + final String methodName = "terminate"; validateServerName(serverName, methodName); validateUserId(userId, serverName, methodName); + /* + * Shutdown the access services + */ + if (accessServiceAdminList != null) + { + for (AccessServiceAdmin accessServiceAdmin : accessServiceAdminList) + { + if (accessServiceAdmin != null) + { + accessServiceAdmin.shutdown(); + } + } + } + + /* + * Terminate the OMRS + */ if (operationalServices != null) { operationalServices.disconnect(permanent); http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/OMAGAPIResponse.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/OMAGAPIResponse.java b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/OMAGAPIResponse.java new file mode 100644 index 0000000..67262cc --- /dev/null +++ b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/OMAGAPIResponse.java @@ -0,0 +1,172 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.atlas.omag.admin.server.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * OMAGAPIResponse provides a common header for OMAG managed responses to its REST API. + * It manages information about exceptions. If no exception has been raised exceptionClassName is null. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public abstract class OMAGAPIResponse +{ + protected int relatedHTTPCode = 200; + protected String exceptionClassName = null; + protected String exceptionErrorMessage = null; + protected String exceptionSystemAction = null; + protected String exceptionUserAction = null; + + + /** + * Default constructor + */ + public OMAGAPIResponse() + { + } + + + /** + * Return the HTTP Code to use if forwarding response to HTTP client. + * + * @return integer HTTP status code + */ + public int getRelatedHTTPCode() + { + return relatedHTTPCode; + } + + + /** + * Set up the HTTP Code to use if forwarding response to HTTP client. + * + * @param relatedHTTPCode - integer HTTP status code + */ + public void setRelatedHTTPCode(int relatedHTTPCode) + { + this.relatedHTTPCode = relatedHTTPCode; + } + + + /** + * Return the name of the Java class name to use to recreate the exception. + * + * @return String name of the fully-qualified java class name + */ + public String getExceptionClassName() + { + return exceptionClassName; + } + + + /** + * Set up the name of the Java class name to use to recreate the exception. + * + * @param exceptionClassName - String name of the fully-qualified java class name + */ + public void setExceptionClassName(String exceptionClassName) + { + this.exceptionClassName = exceptionClassName; + } + + + /** + * Return the error message associated with the exception. + * + * @return string error message + */ + public String getExceptionErrorMessage() + { + return exceptionErrorMessage; + } + + + /** + * Set up the error message associated with the exception. + * + * @param exceptionErrorMessage - string error message + */ + public void setExceptionErrorMessage(String exceptionErrorMessage) + { + this.exceptionErrorMessage = exceptionErrorMessage; + } + + + /** + * Return the description of the action taken by the system as a result of the exception. + * + * @return - string description of the action taken + */ + public String getExceptionSystemAction() + { + return exceptionSystemAction; + } + + + /** + * Set up the description of the action taken by the system as a result of the exception. + * + * @param exceptionSystemAction - string description of the action taken + */ + public void setExceptionSystemAction(String exceptionSystemAction) + { + this.exceptionSystemAction = exceptionSystemAction; + } + + + /** + * Return the action that a user should take to resolve the problem. + * + * @return string instructions + */ + public String getExceptionUserAction() + { + return exceptionUserAction; + } + + + /** + * Set up the action that a user should take to resolve the problem. + * + * @param exceptionUserAction - string instructions + */ + public void setExceptionUserAction(String exceptionUserAction) + { + this.exceptionUserAction = exceptionUserAction; + } + + + @Override + public String toString() + { + return "OMAGAPIResponse{" + + "relatedHTTPCode=" + relatedHTTPCode + + ", exceptionClassName='" + exceptionClassName + '\'' + + ", exceptionErrorMessage='" + exceptionErrorMessage + '\'' + + ", exceptionSystemAction='" + exceptionSystemAction + '\'' + + ", exceptionUserAction='" + exceptionUserAction + '\'' + + '}'; + } +} http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/OMAGServerConfigResponse.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/OMAGServerConfigResponse.java b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/OMAGServerConfigResponse.java new file mode 100644 index 0000000..9cc69ca --- /dev/null +++ b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/OMAGServerConfigResponse.java @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.atlas.omag.admin.server.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.apache.atlas.omag.configuration.properties.OMAGServerConfig; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * OMAGServerConfigResponse is the response structure used on the OMAG REST API calls that returns a + * Connection object as a response. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class OMAGServerConfigResponse extends OMAGAPIResponse +{ + private OMAGServerConfig serverConfig = null; + + /** + * Default constructor + */ + public OMAGServerConfigResponse() + { + } + + + /** + * Return the OMAGServerConfig object. + * + * @return OMAGServerConfig object + */ + public OMAGServerConfig getOMAGServerConfig() + { + return serverConfig; + } + + /** + * Set up the OMAGServerConfig object. + * + * @param serverConfig - OMAGServerConfig object + */ + public void setOMAGServerConfig(OMAGServerConfig serverConfig) + { + this.serverConfig = serverConfig; + } + + @Override + public String toString() + { + return "OMAGServerConfigResponse{" + + "serverConfig=" + serverConfig + + ", relatedHTTPCode=" + relatedHTTPCode + + ", exceptionClassName='" + exceptionClassName + '\'' + + ", exceptionErrorMessage='" + exceptionErrorMessage + '\'' + + ", exceptionSystemAction='" + exceptionSystemAction + '\'' + + ", exceptionUserAction='" + exceptionUserAction + '\'' + + '}'; + } +} http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/VoidResponse.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/VoidResponse.java b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/VoidResponse.java new file mode 100644 index 0000000..d093fb5 --- /dev/null +++ b/omag-api/src/main/java/org/apache/atlas/omag/admin/server/properties/VoidResponse.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.atlas.omag.admin.server.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * VoidResponse defines the response structure for the OMAG REST API calls that returns a + * void as a response. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class VoidResponse extends OMAGAPIResponse +{ + /** + * Default constructor + */ + public VoidResponse() + { + } + + @Override + public String toString() + { + return "VoidResponse{" + + "relatedHTTPCode=" + relatedHTTPCode + + ", exceptionClassName='" + exceptionClassName + '\'' + + ", exceptionErrorMessage='" + exceptionErrorMessage + '\'' + + ", exceptionSystemAction='" + exceptionSystemAction + '\'' + + ", exceptionUserAction='" + exceptionUserAction + '\'' + + '}'; + } +} http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/AccessServiceConfig.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/AccessServiceConfig.java b/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/AccessServiceConfig.java index b74bfd3..0a5bec1 100644 --- a/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/AccessServiceConfig.java +++ b/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/AccessServiceConfig.java @@ -27,6 +27,7 @@ import org.apache.atlas.ocf.properties.beans.ElementType; import org.apache.atlas.ocf.properties.beans.Endpoint; import org.apache.atlas.omag.configuration.registration.AccessServiceDescription; import org.apache.atlas.omag.configuration.registration.AccessServiceOperationalStatus; +import org.apache.atlas.omag.configuration.registration.AccessServiceRegistration; import org.apache.atlas.omrs.topicconnectors.kafka.KafkaOMRSTopicProvider; import java.io.Serializable; @@ -70,19 +71,20 @@ public class AccessServiceConfig implements Serializable /** * Set up the default values for an access service using an access service description. * - * @param accessServiceDescription - AccessServiceDescription enum + * @param accessServiceRegistration - AccessServiceDescription enum */ - public AccessServiceConfig(AccessServiceDescription accessServiceDescription) + public AccessServiceConfig(AccessServiceRegistration accessServiceRegistration) { - this.accessServiceId = accessServiceDescription.getAccessServiceCode(); - this.accessServiceAdminClass = accessServiceDescription.getAccessServiceAdminClassName(); - this.accessServiceName = accessServiceDescription.getAccessServiceDescription(); - this.accessServiceWiki = accessServiceDescription.getAccessServiceWiki(); - this.accessServiceOperationalStatus = accessServiceDescription.getAccessServiceOperationalStatus(); + this.accessServiceId = accessServiceRegistration.getAccessServiceCode(); + this.accessServiceName = accessServiceRegistration.getAccessServiceName(); + this.accessServiceAdminClass = accessServiceRegistration.getAccessServiceAdminClassName(); + this.accessServiceDescription = accessServiceRegistration.getAccessServiceDescription(); + this.accessServiceWiki = accessServiceRegistration.getAccessServiceWiki(); + this.accessServiceOperationalStatus = accessServiceRegistration.getAccessServiceOperationalStatus(); this.accessServiceInTopic = this.getDefaultTopicConnection(defaultInTopicName, - accessServiceDescription.getAccessServiceInTopic()); + accessServiceRegistration.getAccessServiceInTopic()); this.accessServiceOutTopic = this.getDefaultTopicConnection(defaultOutTopicName, - accessServiceDescription.getAccessServiceOutTopic()); + accessServiceRegistration.getAccessServiceOutTopic()); } http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/OMAGServerConfig.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/OMAGServerConfig.java b/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/OMAGServerConfig.java index 86b4672..46d4a65 100644 --- a/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/OMAGServerConfig.java +++ b/omag-api/src/main/java/org/apache/atlas/omag/configuration/properties/OMAGServerConfig.java @@ -44,7 +44,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ * </li> * <li> * localServerType - descriptive type name for the local server. Again this is useful information for the - * administrator to understand which vendor implementation, or versionName of the vendor implementation, is + * administrator to understand which vendor implementation, or version of the vendor implementation, is * in operation. * * The default value is "Open Metadata and Governance Server". http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceAdmin.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceAdmin.java b/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceAdmin.java index 360d38f..f6c15d3 100644 --- a/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceAdmin.java +++ b/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceAdmin.java @@ -17,9 +17,11 @@ */ package org.apache.atlas.omag.configuration.registration; -import org.apache.atlas.ocf.properties.Connection; import org.apache.atlas.omag.configuration.properties.AccessServiceConfig; import org.apache.atlas.omag.ffdc.exception.OMAGConfigurationErrorException; +import org.apache.atlas.omrs.auditlog.OMRSAuditLog; +import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnector; +import org.apache.atlas.omrs.topicconnectors.OMRSTopicConnector; /** * AccessServiceAdmin is the interface that an access service implements to receive its configuration. @@ -31,22 +33,18 @@ public interface AccessServiceAdmin /** * Initialize the access service. * - * @param configurationProperties - specific configuration properties for this access service. - * @throws OMAGConfigurationErrorException - invalid parameters in the configuration properties. - - */ - void initialize(AccessServiceConfig configurationProperties, - Connection enterpriseOMRSTopicConnector) throws OMAGConfigurationErrorException; - - - /** - * Refresh the configuration in the access service. - * - * @param configurationProperties - specific configuration properties for this access service. + * @param accessServiceConfigurationProperties - specific configuration properties for this access service. + * @param enterpriseOMRSTopicConnector - connector for receiving OMRS Events from the cohorts + * @param enterpriseOMRSRepositoryConnector - connector for querying the cohort repositories + * @param auditLog - audit log component for logging messages. + * @param serverUserName - user id to use on OMRS calls where there is no end user. * @throws OMAGConfigurationErrorException - invalid parameters in the configuration properties. */ - void refreshConfiguration(AccessServiceConfig configurationProperties, - Connection enterpriseOMRSTopicConnector) throws OMAGConfigurationErrorException; + void initialize(AccessServiceConfig accessServiceConfigurationProperties, + OMRSTopicConnector enterpriseOMRSTopicConnector, + OMRSRepositoryConnector enterpriseOMRSRepositoryConnector, + OMRSAuditLog auditLog, + String serverUserName) throws OMAGConfigurationErrorException; /** http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceDescription.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceDescription.java b/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceDescription.java index 59c3ca9..1a15215 100644 --- a/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceDescription.java +++ b/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceDescription.java @@ -26,91 +26,48 @@ import java.util.ArrayList; */ public enum AccessServiceDescription implements Serializable { - ASSET_CATALOG_OMAS (0, "AssetCatalog", "Search and understand your assets", - "https://cwiki.apache.org/confluence/display/ATLAS/Asset+Catalog+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - ASSET_CONSUMER_OMAS (1, "AssetConsumer", "Access assets through connectors", - "https://cwiki.apache.org/confluence/display/ATLAS/Asset+Consumer+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - ASSET_OWNER_OMAS (2, "AssetOwner", "Manage an asset", - "https://cwiki.apache.org/confluence/display/ATLAS/Asset+Owner+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - COMMUNITY_PROFILE_OMAS (3, "CommunityProfile", "Define personal profile and collaborate", - "https://cwiki.apache.org/confluence/display/ATLAS/Community+Profile+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - CONNECTED_ASSET_OMAS (4, "ConnectedAsset", "Understand an asset", - "https://cwiki.apache.org/confluence/display/ATLAS/Connected+Asset+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - DATA_PLATFORM_OMAS (5, "DataPlatform", "Capture changes in the types of data stored in a data platform", - "https://cwiki.apache.org/confluence/display/ATLAS/Data+Platform+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - DATA_SCIENCE_OMAS (6, "DataScience", "Create and manage data science definitions and models", - "https://cwiki.apache.org/confluence/display/ATLAS/Data+Science+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - DEVOPS_OMAS (7, "DevOps", "Manage a DevOps pipeline", - "https://cwiki.apache.org/confluence/display/ATLAS/DevOps+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - GOVERNANCE_ENGINE_OMAS (8, "GovernanceEngine", "Set up an operational governance engine", - "https://cwiki.apache.org/confluence/display/ATLAS/Governance+Engine+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - GOVERNANCE_PROGRAM_OMAS (9, "GovernanceProgram", "Manage the governance program", - "https://cwiki.apache.org/confluence/display/ATLAS/Governance+Program+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - INFORMATION_INFRASTRUCTURE_OMAS (10, "InformationInfrastructure", "Describe and plan IT infrastructure", - "https://cwiki.apache.org/confluence/display/ATLAS/Information+Infrastructure+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - INFORMATION_LANDSCAPE_OMAS (11, "InformationLandscape", "Design the information landscape", - "https://cwiki.apache.org/confluence/display/ATLAS/Information+Landscape+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - INFORMATION_PROCESS_OMAS (12, "InformationProcess", "Manage process definitions and lineage tracking", - "https://cwiki.apache.org/confluence/display/ATLAS/Information+Process+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - INFORMATION_PROTECTION_OMAS (13, "InformationProtection", "Manage information protection definitions and compliance", - "https://cwiki.apache.org/confluence/display/ATLAS/Information+Protection+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - INFORMATION_VIEW_OMAS (14, "InformationView", "Support information virtualization and data set definitions", - "https://cwiki.apache.org/confluence/display/ATLAS/Information+View+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - METADATA_DISCOVERY_OMAS (15, "MetadataDiscovery", "Support automated metadata discovery", - "https://cwiki.apache.org/confluence/display/ATLAS/Metadata+Discovery+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - PRIVACY_OFFICE_OMAS (16, "PrivacyOffice", "Manage privacy compliance", - "https://cwiki.apache.org/confluence/display/ATLAS/Privacy+Office+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - PROJECT_MANAGEMENT_OMAS (17, "ProjectManagement", "Manage data projects", - "https://cwiki.apache.org/confluence/display/ATLAS/Project+Management+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - SOFTWARE_DEVELOPMENT_OMAS (18, "SoftwareDevelopment", "Develop software with best practices", - "https://cwiki.apache.org/confluence/display/ATLAS/Software+Development+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - STEWARDSHIP_ACTION_OMAS (19, "StewardshipAction", "Manage exceptions and actions from open governance", - "https://cwiki.apache.org/confluence/display/ATLAS/Stewardship+Action+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null), - SUBJECT_AREA_OMAS (20, "SubjectArea", "Document knowledge about a subject area", - "https://cwiki.apache.org/confluence/display/ATLAS/Subject+Area+OMAS", - AccessServiceOperationalStatus.NOT_IMPLEMENTED, - null) - ; + ASSET_CATALOG_OMAS (1000, "AssetCatalog", "Search and understand your assets", + "https://cwiki.apache.org/confluence/display/ATLAS/Asset+Catalog+OMAS"), + ASSET_CONSUMER_OMAS (1001, "AssetConsumer", "Access assets through connectors", + "https://cwiki.apache.org/confluence/display/ATLAS/Asset+Consumer+OMAS"), + ASSET_OWNER_OMAS (1002, "AssetOwner", "Manage an asset", + "https://cwiki.apache.org/confluence/display/ATLAS/Asset+Owner+OMAS"), + COMMUNITY_PROFILE_OMAS (1003, "CommunityProfile", "Define personal profile and collaborate", + "https://cwiki.apache.org/confluence/display/ATLAS/Community+Profile+OMAS"), + CONNECTED_ASSET_OMAS (1004, "ConnectedAsset", "Understand an asset", + "https://cwiki.apache.org/confluence/display/ATLAS/Connected+Asset+OMAS"), + DATA_PLATFORM_OMAS (1005, "DataPlatform", "Capture changes in the types of data stored in a data platform", + "https://cwiki.apache.org/confluence/display/ATLAS/Data+Platform+OMAS"), + DATA_SCIENCE_OMAS (1006, "DataScience", "Create and manage data science definitions and models", + "https://cwiki.apache.org/confluence/display/ATLAS/Data+Science+OMAS"), + DEVOPS_OMAS (1007, "DevOps", "Manage a DevOps pipeline", + "https://cwiki.apache.org/confluence/display/ATLAS/DevOps+OMAS"), + GOVERNANCE_ENGINE_OMAS (1008, "GovernanceEngine", "Set up an operational governance engine", + "https://cwiki.apache.org/confluence/display/ATLAS/Governance+Engine+OMAS"), + GOVERNANCE_PROGRAM_OMAS (1009, "GovernanceProgram", "Manage the governance program", + "https://cwiki.apache.org/confluence/display/ATLAS/Governance+Program+OMAS"), + INFORMATION_INFRASTRUCTURE_OMAS (1010, "InformationInfrastructure", "Describe and plan IT infrastructure", + "https://cwiki.apache.org/confluence/display/ATLAS/Information+Infrastructure+OMAS"), + INFORMATION_LANDSCAPE_OMAS (1011, "InformationLandscape", "Design the information landscape", + "https://cwiki.apache.org/confluence/display/ATLAS/Information+Landscape+OMAS"), + INFORMATION_PROCESS_OMAS (1012, "InformationProcess", "Manage process definitions and lineage tracking", + "https://cwiki.apache.org/confluence/display/ATLAS/Information+Process+OMAS"), + INFORMATION_PROTECTION_OMAS (1013, "InformationProtection", "Manage information protection definitions and compliance", + "https://cwiki.apache.org/confluence/display/ATLAS/Information+Protection+OMAS"), + INFORMATION_VIEW_OMAS (1014, "InformationView", "Support information virtualization and data set definitions", + "https://cwiki.apache.org/confluence/display/ATLAS/Information+View+OMAS"), + METADATA_DISCOVERY_OMAS (1015, "MetadataDiscovery", "Support automated metadata discovery", + "https://cwiki.apache.org/confluence/display/ATLAS/Metadata+Discovery+OMAS"), + PRIVACY_OFFICE_OMAS (1016, "PrivacyOffice", "Manage privacy compliance", + "https://cwiki.apache.org/confluence/display/ATLAS/Privacy+Office+OMAS"), + PROJECT_MANAGEMENT_OMAS (1017, "ProjectManagement", "Manage data projects", + "https://cwiki.apache.org/confluence/display/ATLAS/Project+Management+OMAS"), + SOFTWARE_DEVELOPMENT_OMAS (1018, "SoftwareDevelopment", "Develop software with best practices", + "https://cwiki.apache.org/confluence/display/ATLAS/Software+Development+OMAS"), + STEWARDSHIP_ACTION_OMAS (1019, "StewardshipAction", "Manage exceptions and actions from open governance", + "https://cwiki.apache.org/confluence/display/ATLAS/Stewardship+Action+OMAS"), + SUBJECT_AREA_OMAS (1020, "SubjectArea", "Document knowledge about a subject area", + "https://cwiki.apache.org/confluence/display/ATLAS/Subject+Area+OMAS"); private static final long serialVersionUID = 1L; private static final String defaultTopicRoot = "omag/omas/"; @@ -167,14 +124,11 @@ public enum AccessServiceDescription implements Serializable * @param accessServiceName - symbolic name for this access service * @param accessServiceDescription - short description for this access service * @param accessServiceWiki - wiki page for the access service for this access service - * @param accessServiceOperationalStatus - default initial operational status for the access service */ AccessServiceDescription(int accessServiceCode, String accessServiceName, String accessServiceDescription, - String accessServiceWiki, - AccessServiceOperationalStatus accessServiceOperationalStatus, - String accessServiceAdminClassName) + String accessServiceWiki) { /* * Save the values supplied @@ -183,8 +137,6 @@ public enum AccessServiceDescription implements Serializable this.accessServiceName = accessServiceName; this.accessServiceDescription = accessServiceDescription; this.accessServiceWiki = accessServiceWiki; - this.accessServiceOperationalStatus = accessServiceOperationalStatus; - this.accessServiceAdminClassName = accessServiceAdminClassName; } @@ -230,48 +182,4 @@ public enum AccessServiceDescription implements Serializable { return accessServiceWiki; } - - - /** - * Return the default initial operational status for the service. - * - * @return AccessServiceOperationalStatus enum - */ - public AccessServiceOperationalStatus getAccessServiceOperationalStatus() - { - return accessServiceOperationalStatus; - } - - - /** - * Return the InTopic name for the access service. - * - * @return String topic name - */ - public String getAccessServiceInTopic() - { - return defaultTopicRoot + accessServiceName + defaultInTopicLeaf; - } - - - /** - * Return the OutTopic name for the access service. - * - * @return String topic name - */ - public String getAccessServiceOutTopic() - { - return defaultTopicRoot + accessServiceName + defaultOutTopicLeaf; - } - - - /** - * Return the name of the java class that implements the admin class for the access service. - * - * @return Name of Java class implementing the AccessServiceAdmin interface. - */ - public String getAccessServiceAdminClassName() - { - return accessServiceAdminClassName; - } } http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceRegistration.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceRegistration.java b/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceRegistration.java new file mode 100644 index 0000000..c2950c4 --- /dev/null +++ b/omag-api/src/main/java/org/apache/atlas/omag/configuration/registration/AccessServiceRegistration.java @@ -0,0 +1,228 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.atlas.omag.configuration.registration; + +/** + * AccessServiceRegistration is used by an access service to register its admin interface + */ +public class AccessServiceRegistration +{ + private static final long serialVersionUID = 1L; + private static final String defaultTopicRoot = "omag/omas/"; + private static final String defaultInTopicLeaf = "/inTopic"; + private static final String defaultOutTopicLeaf = "/outTopic"; + + + private int accessServiceCode; + private String accessServiceName; + private String accessServiceDescription; + private String accessServiceWiki; + private AccessServiceOperationalStatus accessServiceOperationalStatus; + private String accessServiceAdminClassName; + + /** + * Complete Constructor + * + * @param accessServiceCode - ordinal for this access service + * @param accessServiceName - symbolic name for this access service + * @param accessServiceDescription - short description for this access service + * @param accessServiceWiki - wiki page for the access service for this access service + * @param accessServiceOperationalStatus - default initial operational status for the access service + * @param accessServiceAdminClassName - class name of admin class + */ + public AccessServiceRegistration(int accessServiceCode, + String accessServiceName, + String accessServiceDescription, + String accessServiceWiki, + AccessServiceOperationalStatus accessServiceOperationalStatus, + String accessServiceAdminClassName) + { + /* + * Save the values supplied + */ + this.accessServiceCode = accessServiceCode; + this.accessServiceName = accessServiceName; + this.accessServiceDescription = accessServiceDescription; + this.accessServiceWiki = accessServiceWiki; + this.accessServiceOperationalStatus = accessServiceOperationalStatus; + this.accessServiceAdminClassName = accessServiceAdminClassName; + } + + + /** + * Default constructor + */ + public AccessServiceRegistration() + { + } + + /** + * Return the code for this access service + * + * @return int - type code + */ + public int getAccessServiceCode() + { + return accessServiceCode; + } + + + /** + * Set up the code for this access service + * + * @param accessServiceCode int - type code + */ + public void setAccessServiceCode(int accessServiceCode) + { + this.accessServiceCode = accessServiceCode; + } + + + /** + * Return the default name for this access service. + * + * @return String - default name + */ + public String getAccessServiceName() + { + return accessServiceName; + } + + + /** + * Set up the default name for this access service. + * + * @param accessServiceName String - default name + */ + public void setAccessServiceName(String accessServiceName) + { + this.accessServiceName = accessServiceName; + } + + + /** + * Return the default description for the type for this access service. + * + * @return String - default description + */ + public String getAccessServiceDescription() + { + return accessServiceDescription; + } + + + /** + * Set up the default description for the type for this access service. + * + * @param accessServiceDescription String - default description + */ + public void setAccessServiceDescription(String accessServiceDescription) + { + this.accessServiceDescription = accessServiceDescription; + } + + + /** + * Return the URL for the wiki page describing this access service. + * + * @return String URL name for the wiki page + */ + public String getAccessServiceWiki() + { + return accessServiceWiki; + } + + + /** + * Set up the URL for the wiki page describing this access service. + * + * @param accessServiceWiki String URL name for the wiki page + */ + public void setAccessServiceWiki(String accessServiceWiki) + { + this.accessServiceWiki = accessServiceWiki; + } + + + /** + * Return the initial operational status for this access service. + * + * @return AccessServiceOperationalStatus enum + */ + public AccessServiceOperationalStatus getAccessServiceOperationalStatus() + { + return accessServiceOperationalStatus; + } + + + /** + * Set up the initial operational status for this access service. + * + * @param accessServiceOperationalStatus - AccessServiceOperationalStatus enum + */ + public void setAccessServiceOperationalStatus(AccessServiceOperationalStatus accessServiceOperationalStatus) + { + this.accessServiceOperationalStatus = accessServiceOperationalStatus; + } + + /** + * Return the class name of the admin class that should be called during initialization and + * termination. + * + * @return class name + */ + public String getAccessServiceAdminClassName() + { + return accessServiceAdminClassName; + } + + + /** + * Set up the class name of the admin class that should be called during initialization and + * termination. + * + * @param accessServiceAdminClassName class name + */ + public void setAccessServiceAdminClassName(String accessServiceAdminClassName) + { + this.accessServiceAdminClassName = accessServiceAdminClassName; + } + + + /** + * Return the InTopic name for the access service. + * + * @return String topic name + */ + public String getAccessServiceInTopic() + { + return defaultTopicRoot + accessServiceName + defaultInTopicLeaf; + } + + + /** + * Return the OutTopic name for the access service. + * + * @return String topic name + */ + public String getAccessServiceOutTopic() + { + return defaultTopicRoot + accessServiceName + defaultOutTopicLeaf; + } + +} http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-api/src/main/java/org/apache/atlas/omag/ffdc/OMAGErrorCode.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/ffdc/OMAGErrorCode.java b/omag-api/src/main/java/org/apache/atlas/omag/ffdc/OMAGErrorCode.java index 114dc40..7bd264b 100644 --- a/omag-api/src/main/java/org/apache/atlas/omag/ffdc/OMAGErrorCode.java +++ b/omag-api/src/main/java/org/apache/atlas/omag/ffdc/OMAGErrorCode.java @@ -116,8 +116,13 @@ public enum OMAGErrorCode BAD_MAX_PAGE_SIZE(400, "OMAG-ADMIN-400-013 ", "The OMAG server {0} has been passed an invalid maximum page size of {1}", "The system has ignored this value.", - "The maximum page size must be a number greater than zero. Retry the request with a valid value.") - ; + "The maximum page size must be a number greater than zero. Retry the request with a valid value."), + + ENTERPRISE_TOPIC_START_FAILED(400, "OMAG-ADMIN-400-014 ", + "The OMAG server {0} is unable to start the enterprise OMRS topic connector, error message was {1}", + "The open metadata access services will not be able to receive events from the connected repositories.", + "Review the error messages and once the source of the problem is resolved, restart the server and retry the request.") + ; private int httpErrorCode; private String errorMessageId; http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-server/pom.xml ---------------------------------------------------------------------- diff --git a/omag-server/pom.xml b/omag-server/pom.xml index 7ebfdeb..4c1c98a 100644 --- a/omag-server/pom.xml +++ b/omag-server/pom.xml @@ -100,6 +100,18 @@ <dependency> <groupId>org.apache.atlas</groupId> + <artifactId>omas-connectedasset</artifactId> + <version>1.0.0-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.atlas</groupId> + <artifactId>omas-assetconsumer</artifactId> + <version>1.0.0-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.atlas</groupId> <artifactId>omag-api</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omag-server/src/main/java/org/apache/atlas/omag/application/OMAGApplication.java ---------------------------------------------------------------------- diff --git a/omag-server/src/main/java/org/apache/atlas/omag/application/OMAGApplication.java b/omag-server/src/main/java/org/apache/atlas/omag/application/OMAGApplication.java index cb629e9..88397de 100644 --- a/omag-server/src/main/java/org/apache/atlas/omag/application/OMAGApplication.java +++ b/omag-server/src/main/java/org/apache/atlas/omag/application/OMAGApplication.java @@ -25,7 +25,9 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @SpringBootApplication -@ComponentScan({"org.apache.atlas.omag.admin.server", "org.apache.atlas.omrs.rest.server"}) +@ComponentScan({"org.apache.atlas.omag.admin.server", + "org.apache.atlas.omrs.rest.server", + "org.apache.atlas.omas.*"}) @Configuration public class OMAGApplication http://git-wip-us.apache.org/repos/asf/atlas/blob/f57fd7f0/omas-assetconsumer/README.md ---------------------------------------------------------------------- diff --git a/omas-assetconsumer/README.md b/omas-assetconsumer/README.md new file mode 100644 index 0000000..dc641d1 --- /dev/null +++ b/omas-assetconsumer/README.md @@ -0,0 +1,38 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +# AssetConsumer Open Metadata Access Service (OMAS) + +The AssetConsumer OMAS provides services for an application +accessing assets such as data stores, APIs or functions such as analytical services. + +The AssetConsumer REST API supports the retrieval of connection metadata, the +adding of feedback to specific assets and an audit log for the asset. + +The AssetConsumer Java client supports all of the operations of the REST API. +It adds the capability to act as a factory for connectors to assets. +The Java client takes the name or id of a connection, looks up the properties +of the connection and, using the Open Connector Framework (OCF), it creates a new +connector instance and returns it to the caller. + +In addition it can add and remove feedback (tags, ratings, comments, likes) from +the asset description. + +The caller can use the connector to access metadata about the +asset it is accessing. This service is provided by the ConnectedAsset OMAS. +
