http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omag-api/src/main/java/org/apache/atlas/omag/ffdc/exception/OMAGInvalidParameterException.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/ffdc/exception/OMAGInvalidParameterException.java b/omag-api/src/main/java/org/apache/atlas/omag/ffdc/exception/OMAGInvalidParameterException.java deleted file mode 100644 index ecaec18..0000000 --- a/omag-api/src/main/java/org/apache/atlas/omag/ffdc/exception/OMAGInvalidParameterException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.ffdc.exception; - -/** - * OMAGInvalidParameterException is used when invalid parameters are passed on an OMAG call. - */ -public class OMAGInvalidParameterException extends OMAGCheckedExceptionBase -{ - /** - * This is the typical constructor used for creating a OMAGInvalidParameterException. - * - * @param httpCode - http response code to use if this exception flows over a REST call - * @param className - name of class reporting error - * @param actionDescription - description of function it was performing when error detected - * @param errorMessage - description of error - * @param systemAction - actions of the system as a result of the error - * @param userAction - instructions for correcting the error - */ - public OMAGInvalidParameterException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This is the constructor used for creating a OMAGInvalidParameterException that resulted from a previous error. - * - * @param httpCode - http response code to use if this exception flows over a REST call - * @param className - name of class reporting error - * @param actionDescription - description of function it was performing when error detected - * @param errorMessage - description of error - * @param systemAction - actions of the system as a result of the error - * @param userAction - instructions for correcting the error - * @param caughtError - the error that resulted in this exception. - * */ - public OMAGInvalidParameterException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtError) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtError); - } -}
http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omag-api/src/main/java/org/apache/atlas/omag/ffdc/exception/OMAGNotAuthorizedException.java ---------------------------------------------------------------------- diff --git a/omag-api/src/main/java/org/apache/atlas/omag/ffdc/exception/OMAGNotAuthorizedException.java b/omag-api/src/main/java/org/apache/atlas/omag/ffdc/exception/OMAGNotAuthorizedException.java deleted file mode 100644 index 2400f0c..0000000 --- a/omag-api/src/main/java/org/apache/atlas/omag/ffdc/exception/OMAGNotAuthorizedException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.ffdc.exception; - -/** - * OMAGNotAuthorizedException is used when invalid parameters are passed on an OMAG call. - */ -public class OMAGNotAuthorizedException extends OMAGCheckedExceptionBase -{ - /** - * This is the typical constructor used for creating a OMAGNotAuthorizedException. - * - * @param httpCode - http response code to use if this exception flows over a REST call - * @param className - name of class reporting error - * @param actionDescription - description of function it was performing when error detected - * @param errorMessage - description of error - * @param systemAction - actions of the system as a result of the error - * @param userAction - instructions for correcting the error - */ - public OMAGNotAuthorizedException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This is the constructor used for creating a OMAGNotAuthorizedException that resulted from a previous error. - * - * @param httpCode - http response code to use if this exception flows over a REST call - * @param className - name of class reporting error - * @param actionDescription - description of function it was performing when error detected - * @param errorMessage - description of error - * @param systemAction - actions of the system as a result of the error - * @param userAction - instructions for correcting the error - * @param caughtError - the error that resulted in this exception. - * */ - public OMAGNotAuthorizedException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtError) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtError); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omag-server/README.md ---------------------------------------------------------------------- diff --git a/omag-server/README.md b/omag-server/README.md deleted file mode 100644 index f47466e..0000000 --- a/omag-server/README.md +++ /dev/null @@ -1,24 +0,0 @@ -<!-- - ~ 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. - --> - # Open Metadata And Governance Server - -See https://cwiki.apache.org/confluence/display/ATLAS/OMAG+Server+Package for more information about the OMAG Server Package - -**Launching the standalone server** - - java -jar ./omag-server-1.0.0-SNAPSHOT.jar http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omag-server/pom.xml ---------------------------------------------------------------------- diff --git a/omag-server/pom.xml b/omag-server/pom.xml deleted file mode 100644 index a4a8a05..0000000 --- a/omag-server/pom.xml +++ /dev/null @@ -1,137 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ 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. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <artifactId>apache-atlas</artifactId> - <groupId>org.apache.atlas</groupId> - <version>1.0.0</version> - </parent> - - <artifactId>omag-server</artifactId> - - <name>Open Metadata and Governance (OMAG) Server</name> - <description> - Open Metadata and Governance (OMAG) server for running open metadata function outside of the Apache Atlas server. - </description> - - <packaging>jar</packaging> - - <dependencies> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter</artifactId> - <version>1.5.7.RELEASE</version> - </dependency> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - <version>1.5.7.RELEASE</version> - </dependency> - - <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - </dependency> - - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - - <dependency> - <groupId>com.fasterxml.jackson.jaxrs</groupId> - <artifactId>jackson-jaxrs-base</artifactId> - <version>${jackson.version}</version> - </dependency> - - <dependency> - <groupId>com.fasterxml.jackson.jaxrs</groupId> - <artifactId>jackson-jaxrs-json-provider</artifactId> - <version>${jackson.version}</version> - </dependency> - - <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>${javax-inject.version}</version> - </dependency> - - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>om-fwk-ocf</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>omrs</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>omas-connectedasset</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>omas-assetconsumer</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>omag-api</artifactId> - <version>1.0.0</version> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <version>1.5.10.RELEASE</version> - <executions> - <execution> - <goals> - <goal>repackage</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/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 deleted file mode 100644 index 88397de..0000000 --- a/omag-server/src/main/java/org/apache/atlas/omag/application/OMAGApplication.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.application; - -import org.apache.log4j.BasicConfigurator; -import org.apache.log4j.Logger; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -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", - "org.apache.atlas.omas.*"}) -@Configuration - -public class OMAGApplication -{ - public static void main(String[] args) - { - BasicConfigurator.configure(); - - SpringApplication.run(OMAGApplication.class, args); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omas-assetconsumer/README.md ---------------------------------------------------------------------- diff --git a/omas-assetconsumer/README.md b/omas-assetconsumer/README.md deleted file mode 100644 index dc641d1..0000000 --- a/omas-assetconsumer/README.md +++ /dev/null @@ -1,38 +0,0 @@ -<!-- - ~ 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. - http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omas-assetconsumer/pom.xml ---------------------------------------------------------------------- diff --git a/omas-assetconsumer/pom.xml b/omas-assetconsumer/pom.xml deleted file mode 100644 index a10a3b3..0000000 --- a/omas-assetconsumer/pom.xml +++ /dev/null @@ -1,107 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ 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. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <artifactId>apache-atlas</artifactId> - <groupId>org.apache.atlas</groupId> - <version>1.0.0</version> - </parent> - - <artifactId>omas-assetconsumer</artifactId> - - <name>Asset Consumer Open Metadata Access Service (OMAS)</name> - <description>APIs for tools and applications wishing to access data assets through Open Connector Framework (OCF) connectors.</description> - - <packaging>jar</packaging> - - <dependencies> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter</artifactId> - <version>1.5.7.RELEASE</version> - </dependency> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - <version>1.5.7.RELEASE</version> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>om-fwk-ocf</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>omrs</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>omag-api</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>org.apache.atlas</groupId> - <artifactId>omas-connectedasset</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - <version>3.2.2</version> - </dependency> - - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.4</version> - <executions> - <execution> - <goals> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/AssetConsumerInterface.java ---------------------------------------------------------------------- diff --git a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/AssetConsumerInterface.java b/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/AssetConsumerInterface.java deleted file mode 100644 index 2118568..0000000 --- a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/AssetConsumerInterface.java +++ /dev/null @@ -1,388 +0,0 @@ -/* - * 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.omas.assetconsumer; - - -import org.apache.atlas.ocf.Connector; -import org.apache.atlas.ocf.ffdc.ConnectionCheckedException; -import org.apache.atlas.ocf.ffdc.ConnectorCheckedException; -import org.apache.atlas.ocf.properties.CommentType; -import org.apache.atlas.omas.connectedasset.properties.AssetUniverse; -import org.apache.atlas.ocf.properties.beans.Connection; -import org.apache.atlas.ocf.properties.StarRating; -import org.apache.atlas.omas.assetconsumer.ffdc.exceptions.*; - -/** - * The AssetConsumer Open Metadata Access Service (OMAS) is used by applications and tools as a factory for Open - * Connector Framework (OCF) connectors. The configuration for the connectors is managed as open metadata in - * a Connection definition. The caller to the AssetConsumer OMAS passes either the name, GUID or URL for the - * connection to the appropriate method to retrieve a connector. The AssetConsumer OMAS retrieves the connection - * from the metadata repository and creates an appropriate connector as described the connection and - * returns it to the caller. - * - * Each connection has a unique guid and a name. An application can request a connector instance - * from the OCF's Connector Broker using the guid, name or URL of a connection, or by passing a fully - * populated connection object. If the connection guid, name or URL is used, AssetConsumer OMAS - * looks up the connection properties in the metadata repository before calling the OCF ConnectorBroker to create the - * connector - * - * In addition it is possible to maintain feedback for the asset through the AssetConsumer OMAS. - * This is in terms of tags, star ratings, likes and comments. There is also the ability to add audit log records - * related to the use of the asset through the AssetConsumerInterface OMAS. - */ -public interface AssetConsumerInterface -{ - /** - * Returns the connector corresponding to the supplied connection name. - * - * @param userId - String - userId of user making request. - * @param connectionName - this may be the qualifiedName or displayName of the connection. - * - * @return Connector - connector instance. - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws UnrecognizedConnectionNameException - there is no connection defined for this name. - * @throws AmbiguousConnectionNameException - there is more than one connection defined for this name. - * @throws ConnectionCheckedException - there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException - there are errors in the initialization of the connector. - * @throws PropertyServerException - there is a problem retrieving information from the property (metadata) server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - Connector getConnectorByName(String userId, - String connectionName) throws InvalidParameterException, - UnrecognizedConnectionNameException, - AmbiguousConnectionNameException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Returns the connector corresponding to the supplied connection GUID. - * - * @param userId - String - userId of user making request. - * @param connectionGUID - the unique id for the connection within the metadata repository. - * - * @return Connector - connector instance. - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws UnrecognizedConnectionGUIDException - the supplied GUID is not recognized by the property server. - * @throws ConnectionCheckedException - there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException - there are errors in the initialization of the connector. - * @throws PropertyServerException - there is a problem retrieving information from the property (metadata) server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - Connector getConnectorByGUID(String userId, - String connectionGUID) throws InvalidParameterException, - UnrecognizedConnectionGUIDException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Returns the connector corresponding to the supplied connection. - * - * @param userId - String - userId of user making request. - * @param connection - the connection object that contains the properties needed to create the connection. - * - * @return Connector - connector instance - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws ConnectionCheckedException - there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException - there are errors in the initialization of the connector. - * @throws PropertyServerException - there is a problem retrieving information from the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - Connector getConnectorByConnection(String userId, - Connection connection) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Returns a comprehensive collection of properties about the requested asset. - * - * @param userId - String - userId of user making request. - * @param assetGUID - String - unique id for asset. - * - * @return AssetUniverse - a comprehensive collection of properties about the asset. - - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem retrieving the asset properties from - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - AssetUniverse getAssetProperties(String userId, - String assetGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Creates an Audit log record for the asset. This log record is stored in the Asset's Audit Log. - * - * @param userId - String - userId of user making request. - * @param assetGUID - String - unique id for the asset. - * @param connectorInstanceId - String - (optional) id of connector in use (if any). - * @param connectionName - String - (optional) name of the connection (extracted from the connector). - * @param connectorType - String - (optional) type of connector in use (if any). - * @param contextId - String - (optional) function name, or processId of the activity that the caller is performing. - * @param message - log record content. - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem adding the asset properties to - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - void addLogMessageToAsset(String userId, - String assetGUID, - String connectorInstanceId, - String connectionName, - String connectorType, - String contextId, - String message) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - - /** - * Adds a new public tag to the asset's properties. - * - * @param userId - String - userId of user making request. - * @param assetGUID - String - unique id for the asset. - * @param tagName - String - name of the tag. - * @param tagDescription - String - (optional) description of the tag. Setting a description, particularly in - * a public tag makes the tag more valuable to other users and can act as an embryonic - * glossary term. - * @return String - GUID for new tag. - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem adding the asset properties to - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - String addTagToAsset(String userId, - String assetGUID, - String tagName, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Adds a new private tag to the asset's properties. - * - * @param userId - String - userId of user making request. - * @param assetGUID - String - unique id for the asset. - * @param tagName - String - name of the tag. - * @param tagDescription - String - (optional) description of the tag. Setting a description, particularly in - * a public tag makes the tag more valuable to other users and can act as an embryonic - * glossary term. - * @return String - GUID for new tag. - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem adding the asset properties to - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - String addPrivateTagToAsset(String userId, - String assetGUID, - String tagName, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - - /** - * Adds a rating to the asset. - * - * @param userId - String - userId of user making request. - * @param assetGUID - String - unique id for the asset. - * @param starRating - StarRating - enumeration for none, one to five stars. - * @param review - String - user review of asset. - * - * @return guid of new rating object. - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem adding the asset properties to - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - String addRatingToAsset(String userId, - String assetGUID, - StarRating starRating, - String review) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - /** - * Adds a "Like" to the asset. - * - * @param userId - String - userId of user making request. - * @param assetGUID - String - unique id for the asset - * - * @return guid of new like object. - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem adding the asset properties to - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - String addLikeToAsset(String userId, - String assetGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Adds a comment to the asset. - * - * @param userId - String - userId of user making request. - * @param assetGUID - String - unique id for the asset. - * @param commentType - type of comment enum. - * @param commentText - String - the text of the comment. - * - * @return guid of new comment. - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem adding the asset properties to - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - String addCommentToAsset(String userId, - String assetGUID, - CommentType commentType, - String commentText) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Adds a comment to the asset. - * - * @param userId - String - userId of user making request. - * @param commentGUID - String - unique id for an existing comment. Used to add a reply to a comment. - * @param commentType - type of comment enum. - * @param commentText - String - the text of the comment. - * - * @return guid of new comment. - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem adding the asset properties to - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - String addCommentReply(String userId, - String commentGUID, - CommentType commentType, - String commentText) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes a tag from the asset that was added by this user. - * - * @param userId - String - userId of user making request. - * @param tagGUID - String - unique id for the tag. - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem updating the asset properties in - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - void removeTag(String userId, - String tagGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes a tag from the asset that was added by this user. - * - * @param userId - String - userId of user making request. - * @param tagGUID - String - unique id for the tag. - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem updating the asset properties in - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - void removePrivateTag(String userId, - String tagGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes of a star rating that was added to the asset by this user. - * - * @param userId - String - userId of user making request. - * @param ratingGUID - String - unique id for the rating object - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem updating the asset properties in - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - void removeRating(String userId, - String ratingGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes a "Like" added to the asset by this user. - * - * @param userId - String - userId of user making request. - * @param likeGUID - String - unique id for the like object - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem updating the asset properties in - * the property server. - * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. - */ - void removeLike(String userId, - String likeGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes a comment added to the asset by this user. - * - * @param userId - String - userId of user making request. - * @param commentGUID - String - unique id for the comment object - * - * @throws InvalidParameterException - one of the parameters is null or invalid. - * @throws PropertyServerException - There is a problem updating the asset properties in - * the property server. - * @throws UserNotAuthorizedException - the user does not have permission to perform this request. - */ - void removeComment(String userId, - String commentGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; -} http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/admin/AssetConsumerAdmin.java ---------------------------------------------------------------------- diff --git a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/admin/AssetConsumerAdmin.java b/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/admin/AssetConsumerAdmin.java deleted file mode 100644 index c3d4b75..0000000 --- a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/admin/AssetConsumerAdmin.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.omas.assetconsumer.admin; - -import org.apache.atlas.omag.configuration.properties.AccessServiceConfig; -import org.apache.atlas.omag.configuration.registration.AccessServiceAdmin; -import org.apache.atlas.omag.ffdc.exception.OMAGConfigurationErrorException; -import org.apache.atlas.omas.assetconsumer.auditlog.AssetConsumerAuditCode; -import org.apache.atlas.omas.assetconsumer.listener.AssetConsumerOMRSTopicListener; -import org.apache.atlas.omas.assetconsumer.server.AssetConsumerRESTServices; -import org.apache.atlas.omrs.auditlog.OMRSAuditLog; -import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnector; -import org.apache.atlas.omrs.topicconnectors.OMRSTopicConnector; - -public class AssetConsumerAdmin implements AccessServiceAdmin -{ - private OMRSRepositoryConnector repositoryConnector = null; - private OMRSTopicConnector omrsTopicConnector = null; - private AccessServiceConfig accessServiceConfig = null; - private OMRSAuditLog auditLog = null; - private String serverUserName = null; - - private AssetConsumerOMRSTopicListener omrsTopicListener = null; - - /** - * Default constructor - */ - public AssetConsumerAdmin() - { - } - - - /** - * Initialize the 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. - */ - public void initialize(AccessServiceConfig accessServiceConfigurationProperties, - OMRSTopicConnector enterpriseOMRSTopicConnector, - OMRSRepositoryConnector enterpriseOMRSRepositoryConnector, - OMRSAuditLog auditLog, - String serverUserName) throws OMAGConfigurationErrorException - { - final String actionDescription = "initialize"; - AssetConsumerAuditCode auditCode; - - auditCode = AssetConsumerAuditCode.SERVICE_INITIALIZING; - auditLog.logRecord(actionDescription, - auditCode.getLogMessageId(), - auditCode.getSeverity(), - auditCode.getFormattedLogMessage(), - null, - auditCode.getSystemAction(), - auditCode.getUserAction()); - - this.repositoryConnector = enterpriseOMRSRepositoryConnector; - AssetConsumerRESTServices.setRepositoryConnector(accessServiceConfigurationProperties.getAccessServiceName(), - repositoryConnector); - - this.accessServiceConfig = accessServiceConfigurationProperties; - this.omrsTopicConnector = enterpriseOMRSTopicConnector; - - if (omrsTopicConnector != null) - { - auditCode = AssetConsumerAuditCode.SERVICE_REGISTERED_WITH_TOPIC; - auditLog.logRecord(actionDescription, - auditCode.getLogMessageId(), - auditCode.getSeverity(), - auditCode.getFormattedLogMessage(), - null, - auditCode.getSystemAction(), - auditCode.getUserAction()); - - omrsTopicListener = new AssetConsumerOMRSTopicListener(accessServiceConfig.getAccessServiceOutTopic(), - repositoryConnector.getRepositoryHelper(), - repositoryConnector.getRepositoryValidator(), - accessServiceConfig.getAccessServiceName()); - - omrsTopicConnector.registerListener(omrsTopicListener); - } - - this.auditLog = auditLog; - this.serverUserName = serverUserName; - - auditCode = AssetConsumerAuditCode.SERVICE_INITIALIZED; - auditLog.logRecord(actionDescription, - auditCode.getLogMessageId(), - auditCode.getSeverity(), - auditCode.getFormattedLogMessage(), - null, - auditCode.getSystemAction(), - auditCode.getUserAction()); - } - - - /** - * Shutdown the access service. - */ - public void shutdown() - { - final String actionDescription = "shutdown"; - AssetConsumerAuditCode auditCode; - - auditCode = AssetConsumerAuditCode.SERVICE_SHUTDOWN; - auditLog.logRecord(actionDescription, - auditCode.getLogMessageId(), - auditCode.getSeverity(), - auditCode.getFormattedLogMessage(), - null, - auditCode.getSystemAction(), - auditCode.getUserAction()); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/auditlog/AssetConsumerAuditCode.java ---------------------------------------------------------------------- diff --git a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/auditlog/AssetConsumerAuditCode.java b/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/auditlog/AssetConsumerAuditCode.java deleted file mode 100644 index 1d76880..0000000 --- a/omas-assetconsumer/src/main/java/org/apache/atlas/omas/assetconsumer/auditlog/AssetConsumerAuditCode.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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.omas.assetconsumer.auditlog; - -import org.apache.atlas.omrs.auditlog.OMRSAuditLogRecordSeverity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.text.MessageFormat; -import java.util.Arrays; - -/** - * The AssetConsumerAuditCode is used to define the message content for the OMRS Audit Log. - * - * The 5 fields in the enum are: - * <ul> - * <li>Log Message Id - to uniquely identify the message</li> - * <li>Severity - is this an event, decision, action, error or exception</li> - * <li>Log Message Text - includes placeholder to allow additional values to be captured</li> - * <li>Additional Information - further parameters and data relating to the audit message (optional)</li> - * <li>SystemAction - describes the result of the situation</li> - * <li>UserAction - describes how a user should correct the situation</li> - * </ul> - */ -public enum AssetConsumerAuditCode -{ - SERVICE_INITIALIZING("OMAS-ASSET-CONSUMER-0001", - OMRSAuditLogRecordSeverity.INFO, - "The Asset Consumer Open Metadata Access Service (OMAS) is initializing", - "The local server has started up the Asset Consumer OMAS.", - "No action is required. This is part of the normal operation of the server."), - - SERVICE_REGISTERED_WITH_TOPIC("OMAS-ASSET-CONSUMER-0002", - OMRSAuditLogRecordSeverity.INFO, - "The Asset Consumer Open Metadata Access Service (OMAS) is registering a listener with the OMRS Topic", - "The Asset Consumer OMAS is registering to receive events from the connected open metadata repositories.", - "No action is required. This is part of the normal operation of the server."), - - SERVICE_INITIALIZED("OMAS-ASSET-CONSUMER-0003", - OMRSAuditLogRecordSeverity.INFO, - "The Asset Consumer Open Metadata Access Service (OMAS) is initialized", - "The Asset Consumer OMAS has completed initialization.", - "No action is required. This is part of the normal operation of the server."), - - SERVICE_SHUTDOWN("OMAS-ASSET-CONSUMER-0004", - OMRSAuditLogRecordSeverity.INFO, - "The Asset Consumer Open Metadata Access Service (OMAS) is shutting down", - "The local server has requested shut down of the Asset Consumer OMAS.", - "No action is required. This is part of the normal operation of the server."), - - - ; - - private String logMessageId; - private OMRSAuditLogRecordSeverity severity; - private String logMessage; - private String systemAction; - private String userAction; - - private static final Logger log = LoggerFactory.getLogger(AssetConsumerAuditCode.class); - - - /** - * The constructor for OMRSAuditCode expects to be passed one of the enumeration rows defined in - * OMRSAuditCode above. For example: - * - * OMRSAuditCode auditCode = OMRSAuditCode.SERVER_NOT_AVAILABLE; - * - * This will expand out to the 4 parameters shown below. - * - * @param messageId - unique Id for the message - * @param severity - severity of the message - * @param message - text for the message - * @param systemAction - description of the action taken by the system when the condition happened - * @param userAction - instructions for resolving the situation, if any - */ - AssetConsumerAuditCode(String messageId, - OMRSAuditLogRecordSeverity severity, - String message, - String systemAction, - String userAction) - { - this.logMessageId = messageId; - this.severity = severity; - this.logMessage = message; - this.systemAction = systemAction; - this.userAction = userAction; - } - - - /** - * Returns the unique identifier for the error message. - * - * @return logMessageId - */ - public String getLogMessageId() - { - return logMessageId; - } - - - /** - * Return the severity of the audit log record. - * - * @return OMRSAuditLogRecordSeverity enum - */ - public OMRSAuditLogRecordSeverity getSeverity() - { - return severity; - } - - /** - * Returns the log message with the placeholders filled out with the supplied parameters. - * - * @param params - strings that plug into the placeholders in the logMessage - * @return logMessage (formatted with supplied parameters) - */ - public String getFormattedLogMessage(String... params) - { - if (log.isDebugEnabled()) - { - log.debug(String.format("<== OMRS Audit Code.getMessage(%s)", Arrays.toString(params))); - } - - MessageFormat mf = new MessageFormat(logMessage); - String result = mf.format(params); - - if (log.isDebugEnabled()) - { - log.debug(String.format("==> OMRS Audit Code.getMessage(%s): %s", Arrays.toString(params), result)); - } - - return result; - } - - - - /** - * Returns a description of the action taken by the system when the condition that caused this exception was - * detected. - * - * @return systemAction String - */ - public String getSystemAction() - { - return systemAction; - } - - - /** - * Returns instructions of how to resolve the issue reported in this exception. - * - * @return userAction String - */ - public String getUserAction() - { - return userAction; - } -}