Commit 8a57e657 by Mandy Chessell Committed by David Radley

ATLAS-2246: OMRS Connector API plus REST and IGC Connector skeleton - 15th February 2018

parent c2be0646
......@@ -18,6 +18,7 @@
package org.apache.atlas.ocf;
import org.apache.atlas.ocf.ffdc.PropertyServerException;
import org.apache.atlas.ocf.properties.AdditionalProperties;
import org.apache.atlas.ocf.properties.ConnectedAssetProperties;
import org.apache.atlas.ocf.properties.Connection;
import org.slf4j.Logger;
......@@ -51,6 +52,12 @@ public abstract class ConnectorBase extends Connector
protected Connection connection = null;
protected ConnectedAssetProperties connectedAssetProperties = null;
/*
* Secured properties are protected properties from the connection. They are retrieved as a protected
* variable to allow subclasses of ConnectorBase to access them.
*/
protected AdditionalProperties securedProperties = null;
private static final int hashCode = UUID.randomUUID().hashCode();
private static final Logger log = LoggerFactory.getLogger(ConnectorBase.class);
......@@ -86,6 +93,12 @@ public abstract class ConnectorBase extends Connector
this.connectorInstanceId = connectorInstanceId;
this.connection = connection;
/*
* Set up the secured properties
*/
ProtectedConnection protectedConnection = new ProtectedConnection(connection);
this.securedProperties = protectedConnection.getSecuredProperties();
if (log.isDebugEnabled())
{
log.debug("New Connector initialized: " + connectorInstanceId + ", " + connection.getConnectionName());
......@@ -217,4 +230,31 @@ public abstract class ConnectorBase extends Connector
", connectedAssetProperties=" + connectedAssetProperties +
'}';
}
private class ProtectedConnection extends Connection
{
private ProtectedConnection(Connection templateConnection)
{
super(templateConnection);
}
/**
* Return a copy of the secured properties. Null means no secured properties are available.
* This method is protected so only OCF (or subclasses) can access them. When Connector is passed to calling
* OMAS, the secured properties are not available.
*
* @return secured properties - typically user credentials for the connection
*/
protected AdditionalProperties getSecuredProperties()
{
if (super.securedProperties == null)
{
return securedProperties;
}
else
{
return new AdditionalProperties(super.getParentAsset(), securedProperties);
}
}
}
}
\ No newline at end of file
......@@ -65,7 +65,7 @@ public abstract class ConnectorProviderBase extends ConnectorProvider
*
* @return guid for a new connector instance
*/
private String getNewConnectorGUID()
protected String getNewConnectorGUID()
{
UUID newUUID = UUID.randomUUID();
......
......@@ -77,10 +77,10 @@ public class Connection extends Referenceable
/*
* Attributes of a connector
*/
private String displayName = null;
private String description = null;
private ConnectorType connectorType = null;
private Endpoint endpoint = null;
protected String displayName = null;
protected String description = null;
protected ConnectorType connectorType = null;
protected Endpoint endpoint = null;
/*
* Secured properties are protected so they can only be accessed by subclassing this object.
......
......@@ -20,19 +20,19 @@ package org.apache.atlas.ocf.properties;
import java.io.Serializable;
/**
* A KeyPattern defines the type of External Identifier in use of an asset, or the type of Primary Key used within an
* A KeyPattern defines the type of External Identifier in use for an asset, or the type of Primary Key used within an
* asset.
*/
public enum KeyPattern implements Serializable
{
LOCAL_KEY(0, "Local Key", "Unique key allocated and used within the scope of a single system."),
RECYCLED_KEY(1, "Recycled Key", "Key allocated and used within the scope of a single system that is periodically reused for different records."),
NATURAL_KEY(2, "Natural Key", "Key derived from an attribute of the entity, such as email address, passport number."),
MIRROR_KEY(3, "Mirror Key", "Key value copied from another system."),
AGGREGATE_KEY(4, "Aggregate Key", "Key formed by combining keys from multiple systems."),
CALLERS_KEY(5, "Caller's Key", "Key from another system can bey used if system name provided."),
STABLE_KEY(6, "Stable Key", "Key value will remain active even if records are merged."),
OTHER(99, "Other", "Another key pattern.");
LOCAL_KEY (0, "Local Key", "Unique key allocated and used within the scope of a single system."),
RECYCLED_KEY (1, "Recycled Key", "Key allocated and used within the scope of a single system that is periodically reused for different records."),
NATURAL_KEY (2, "Natural Key", "Key derived from an attribute of the entity, such as email address, passport number."),
MIRROR_KEY (3, "Mirror Key", "Key value copied from another system."),
AGGREGATE_KEY (4, "Aggregate Key", "Key formed by combining keys from multiple systems."),
CALLERS_KEY (5, "Caller's Key", "Key from another system can bey used if system name provided."),
STABLE_KEY (6, "Stable Key", "Key value will remain active even if records are merged."),
OTHER (99, "Other", "Another key pattern.");
private static final long serialVersionUID = 1L;
......
<!--
~ 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 Repository Service (OMRS)
The Open Metadata Repository Services (OMRS) enable metadata repositories to exchange metadata.
Traditional metadata management technology tends to centralize metadata into a single repository.
An organization often begins with a single metadata repository, typically deployed to support a
single project or initiative.
However, over time, depending on the tools they buy, the projects they run or the political structures
within the organization, the number of deployed metadata repositories grows, creating multiple metadata silos.
So for example, an organization may have:
* a metadata repository and tools for its governance team.
This metadata repository may host the canonical glossary, and the governance policies, rules and classifications.
* a metadata repository for its data lake.
This metadata repository has the details of the data repositories in the data lake and the
movement of data between them.
* a metadata repository for its data integration tools that continuously extract data
from the operational systems and sends them to the data lake.
The role of the OMRS is to bring these metadata repositories together so this metadata can be linked
and used together across the organization.
It enables these metadata repositories to act as a aggregated source of metadata.
The metadata repositories using OMRS may be instances of Apache Atlas and they may
include a mixture of repositories from different vendors that support the OMRS integration interfaces.
\ No newline at end of file
<?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-SNAPSHOT</version>
</parent>
<artifactId>omrs</artifactId>
<name>Open Metadata Repository Services (OMRS)</name>
<description>Open Metadata Repository Services (OMRS) interfaces and implementation for linking metadata repositories into a cohort</description>
<packaging>jar</packaging>
<dependencies>
<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-SNAPSHOT</version>
</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>
\ No newline at end of file
/*
* 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.omrs.adapters.atlas.eventmapper;
import org.apache.atlas.omrs.eventmanagement.repositoryeventmapper.OMRSRepositoryEventMapperBase;
public class AtlasOMRSRepositoryEventMapper extends OMRSRepositoryEventMapperBase
{
/**
* Default constructor
*/
public AtlasOMRSRepositoryEventMapper()
{
}
/**
* Free up any resources held since the connector is no longer needed.
*/
public void disconnect()
{
}
}
/*
* 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.omrs.adapters.atlas.eventmapper;
import org.apache.atlas.omrs.adapters.igc.v1.eventmapper.IGCOMRSRepositoryEventMapper;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnectorProviderBase;
/**
* In the Open Connector Framework (OCF), a ConnectorProvider is a factory for a specific type of connector.
* The IGCOMRSRepositoryEventMapperProvider is the connector provider for the IGCOMRSRepositoryEventMapper.
* It extends OMRSRepositoryEventMapperProviderBase which in turn extends the OCF ConnectorProviderBase.
* ConnectorProviderBase supports the creation of connector instances.
*
* The OMRSRESTRepositoryConnectorProvider must initialize ConnectorProviderBase with the Java class
* name of the OMRS Connector implementation (by calling super.setConnectorClassName(className)).
* Then the connector provider will work.
*/
public class AtlasOMRSRepositoryEventMapperProvider extends OMRSRepositoryConnectorProviderBase
{
/**
* Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific
* OMRS Connector implementation.
*/
public AtlasOMRSRepositoryEventMapperProvider()
{
Class connectorClass = IGCOMRSRepositoryEventMapper.class;
super.setConnectorClassName(connectorClass.getName());
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.atlas.repositoryconnector;
import org.apache.atlas.omrs.ffdc.exception.NotImplementedRuntimeException;
import org.apache.atlas.omrs.metadatacollection.OMRSMetadataCollectionBase;
/**
* The OMRSRESTMetadataCollection represents a remote metadata repository that supports the OMRS REST API.
* Requests to this metadata collection are translated one-for-one to requests to the remote repository since
* the OMRS REST API has a one-to-one correspondence with the metadata collection.
*/
public class LocalAtlasOMRSMetadataCollection extends OMRSMetadataCollectionBase
{
private LocalAtlasOMRSRepositoryConnector parentConnector = null;
private String metadataCollectionId = null;
/**
* Default constructor.
*
* @param parentConnector - connector that this metadata collection supports. The connector has the information
* to call the metadata repository.
* @param metadataCollectionId - unique Identifier of the metadata collection Id.
*/
public LocalAtlasOMRSMetadataCollection(LocalAtlasOMRSRepositoryConnector parentConnector,
String metadataCollectionId)
{
/*
* The metadata collection Id is the unique Id for the metadata collection. It is managed by the super class.
*/
super(metadataCollectionId);
this.metadataCollectionId = metadataCollectionId;
/*
* Save parentConnector since this has the connection information and access to the metadata about the
* metadata cluster.
*/
this.parentConnector = parentConnector;
/*
* This is a temporary implementation to allow the structural implementation of the connectors to
* be committed before the metadata collection implementation is complete.
*/
throw new NotImplementedRuntimeException("LocalAtlasMetadataCollection", "constructor", "ATLAS-1773");
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.atlas.repositoryconnector;
import org.apache.atlas.ocf.ffdc.ConnectorCheckedException;
import org.apache.atlas.omrs.metadatacollection.OMRSMetadataCollection;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnector;
/**
* The OMRSRESTRepositoryConnector is a connector to a remote Apache Atlas repository (or any other metadata repository
* that supports the OMRS REST APIs). This is the connector used by the EnterpriseOMRSRepositoryConnector to make a direct call
* to another open metadata repository.
*/
public class LocalAtlasOMRSRepositoryConnector extends OMRSRepositoryConnector
{
private LocalAtlasOMRSMetadataCollection metadataCollection = null;
private String metadataCollectionId = null;
/**
* Default constructor used by the OCF Connector Provider.
*/
public LocalAtlasOMRSRepositoryConnector()
{
/*
* Nothing to do (yet !)
*/
}
/**
* Set up the unique Id for this metadata collection.
*
* @param metadataCollectionId - String unique Id
*/
public void setMetadataCollectionId(String metadataCollectionId)
{
this.metadataCollectionId = metadataCollectionId;
/*
* Initialize the metadata collection only once the connector is properly set up.
*/
metadataCollection = new LocalAtlasOMRSMetadataCollection(this, metadataCollectionId);
}
/**
* Returns the metadata collection object that provides an OMRS abstraction of the metadata within
* a metadata repository.
*
* @return OMRSMetadataCollection - metadata information retrieved from the metadata repository.
*/
public OMRSMetadataCollection getMetadataCollection()
{
if (metadataCollection == null)
{
// TODO Throw exception since it means the local metadata collection id is not set up.
}
return metadataCollection;
}
/**
* Free up any resources held since the connector is no longer needed.
*
* @throws ConnectorCheckedException - there is a problem disconnecting the connector.
*/
public void disconnect() throws ConnectorCheckedException
{
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.atlas.repositoryconnector;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnectorProviderBase;
import org.apache.atlas.omrs.rest.repositoryconnector.OMRSRESTRepositoryConnector;
/**
* In the Open Connector Framework (OCF), a ConnectorProvider is a factory for a specific type of connector.
* The OMRSRESTRepositoryConnectorProvider is the connector provider for the OMRSRESTRepositoryConnector.
* It extends OMRSRepositoryConnectorProviderBase which in turn extends the OCF ConnectorProviderBase.
* ConnectorProviderBase supports the creation of connector instances.
*
* The OMRSRESTRepositoryConnectorProvider must initialize ConnectorProviderBase with the Java class
* name of the OMRS Connector implementation (by calling super.setConnectorClassName(className)).
* Then the connector provider will work.
*/
public class LocalAtlasOMRSRepositoryConnectorProvider extends OMRSRepositoryConnectorProviderBase
{
/**
* Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific
* OMRS Connector implementation.
*/
public LocalAtlasOMRSRepositoryConnectorProvider()
{
Class connectorClass = OMRSRESTRepositoryConnector.class;
super.setConnectorClassName(connectorClass.getName());
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.igc.v1.eventmapper;
import org.apache.atlas.omrs.eventmanagement.repositoryeventmapper.OMRSRepositoryEventMapperBase;
/**
* IGCOMRSRepositoryEventMapper provides an implementation of a repository event mapper for the
* IBM Governance Catalog (IGC).
*/
public class IGCOMRSRepositoryEventMapper extends OMRSRepositoryEventMapperBase
{
/**
* Default constructor
*/
public IGCOMRSRepositoryEventMapper()
{
}
/**
* Free up any resources held since the connector is no longer needed.
*/
public void disconnect()
{
}
}
/*
* 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.omrs.adapters.igc.v1.eventmapper;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnectorProviderBase;
/**
* In the Open Connector Framework (OCF), a ConnectorProvider is a factory for a specific type of connector.
* The IGCOMRSRepositoryEventMapperProvider is the connector provider for the IGCOMRSRepositoryEventMapper.
* It extends OMRSRepositoryEventMapperProviderBase which in turn extends the OCF ConnectorProviderBase.
* ConnectorProviderBase supports the creation of connector instances.
*
* The OMRSRESTRepositoryConnectorProvider must initialize ConnectorProviderBase with the Java class
* name of the OMRS Connector implementation (by calling super.setConnectorClassName(className)).
* Then the connector provider will work.
*/
public class IGCOMRSRepositoryEventMapperProvider extends OMRSRepositoryConnectorProviderBase
{
/**
* Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific
* OMRS Connector implementation.
*/
public IGCOMRSRepositoryEventMapperProvider()
{
Class connectorClass = IGCOMRSRepositoryEventMapper.class;
super.setConnectorClassName(connectorClass.getName());
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.igc.v1.repositoryconnector;
import org.apache.atlas.omrs.ffdc.exception.NotImplementedRuntimeException;
import org.apache.atlas.omrs.metadatacollection.OMRSMetadataCollectionBase;
/**
* The IGCOMRSMetadataCollection represents a remote IBM Information Governance Catalog (IGC)
* metadata repository. IGC supports its own native REST APIs.
* Requests to this metadata collection are translated to the IGC REST API calls and the results are
* transformed to OMRS objects before returning to the caller.
*/
public class IGCOMRSMetadataCollection extends OMRSMetadataCollectionBase
{
private IGCOMRSRepositoryConnector parentConnector = null;
/**
* Default constructor.
*
* @param parentConnector - connector that this metadata collection supports. The connector has the information
* to call the metadata repository.
* @param metadataCollectionId - unique identifier for the repository.
*/
public IGCOMRSMetadataCollection(IGCOMRSRepositoryConnector parentConnector,
String metadataCollectionId)
{
/*
* The metadata collection Id is the unique Id for the metadata collection. It is managed by the super class.
*/
super(metadataCollectionId);
this.metadataCollectionId = metadataCollectionId;
/*
* Save parentConnector since this has the connection information.
*/
this.parentConnector = parentConnector;
/*
* This is a temporary implementation to allow the structural implementation of the connectors to
* be committed before the metadata collection implementation is complete.
*/
throw new NotImplementedRuntimeException("IGCOMRSMetadataCollection", "constructor", "ATLAS-1774");
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.igc.v1.repositoryconnector;
import org.apache.atlas.ocf.ffdc.ConnectorCheckedException;
import org.apache.atlas.omrs.metadatacollection.OMRSMetadataCollection;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnector;
/**
* The IGCOMRSRepositoryConnector is a connector to a remote IBM Information Governance Catalog (IGC) repository.
*/
public class IGCOMRSRepositoryConnector extends OMRSRepositoryConnector
{
private IGCOMRSMetadataCollection metadataCollection = null;
private String metadataCollectionId = null;
/**
* Default constructor used by the OCF Connector Provider.
*/
public IGCOMRSRepositoryConnector()
{
/*
* Nothing to do (yet !)
*/
}
/**
* Set up the unique Id for this metadata collection.
*
* @param metadataCollectionId - String unique Id
*/
public void setMetadataCollectionId(String metadataCollectionId)
{
this.metadataCollectionId = metadataCollectionId;
/*
* Initialize the metadata collection only once the connector is properly set up.
*/
metadataCollection = new IGCOMRSMetadataCollection(this, metadataCollectionId);
}
/**
* Returns the metadata collection object that provides an OMRS abstraction of the metadata within
* a metadata repository.
*
* @return OMRSMetadataCollection - metadata information retrieved from the metadata repository.
*/
public OMRSMetadataCollection getMetadataCollection()
{
if (metadataCollection == null)
{
// TODO Throw exception since it means the local metadata collection id is not set up.
}
return metadataCollection;
}
/**
* Free up any resources held since the connector is no longer needed.
*
* @throws ConnectorCheckedException - there is a problem disconnecting the connector.
*/
public void disconnect() throws ConnectorCheckedException
{
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.igc.v1.repositoryconnector;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnectorProviderBase;
/**
* In the Open Connector Framework (OCF), a ConnectorProvider is a factory for a specific type of connector.
* The IGCOMRSRepositoryConnectorProvider is the connector provider for the IGCOMRSRepositoryConnector.
* It extends OMRSRepositoryConnectorProviderBase which in turn extends the OCF ConnectorProviderBase.
* ConnectorProviderBase supports the creation of connector instances.
*
* The IGCOMRSRepositoryConnectorProvider must initialize ConnectorProviderBase with the Java class
* name of the OMRS Connector implementation (by calling super.setConnectorClassName(className)).
* Then the connector provider will work.
*/
public class IGCOMRSRepositoryConnectorProvider extends OMRSRepositoryConnectorProviderBase
{
/**
* Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific
* OMRS Connector implementation.
*/
public IGCOMRSRepositoryConnectorProvider()
{
Class connectorClass = IGCOMRSRepositoryConnector.class;
super.setConnectorClassName(connectorClass.getName());
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.igc.v2.eventmapper;
import org.apache.atlas.omrs.eventmanagement.repositoryeventmapper.OMRSRepositoryEventMapperBase;
/**
* IGCOMRSRepositoryEventMapper provides an implementation of a repository event mapper for the
* IBM Governance Catalog (IGC) for relaeave following 11.7.
*/
public class IGCV2OMRSRepositoryEventMapper extends OMRSRepositoryEventMapperBase
{
/**
* Default constructor
*/
public IGCV2OMRSRepositoryEventMapper()
{
}
/**
* Free up any resources held since the connector is no longer needed.
*/
public void disconnect()
{
}
}
/*
* 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.omrs.adapters.igc.v2.eventmapper;
import org.apache.atlas.omrs.adapters.igc.v1.eventmapper.IGCOMRSRepositoryEventMapper;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnectorProviderBase;
/**
* In the Open Connector Framework (OCF), a ConnectorProvider is a factory for a specific type of connector.
* The IGCOMRSRepositoryEventMapperProvider is the connector provider for the IGCOMRSRepositoryEventMapper.
* It extends OMRSRepositoryEventMapperProviderBase which in turn extends the OCF ConnectorProviderBase.
* ConnectorProviderBase supports the creation of connector instances.
*
* The IGCV2OMRSRepositoryEventMapperProvider must initialize ConnectorProviderBase with the Java class
* name of the OMRS Connector implementation (by calling super.setConnectorClassName(className)).
* Then the connector provider will work.
*/
public class IGCV2OMRSRepositoryEventMapperProvider extends OMRSRepositoryConnectorProviderBase
{
/**
* Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific
* OMRS Connector implementation.
*/
public IGCV2OMRSRepositoryEventMapperProvider()
{
Class connectorClass = IGCV2OMRSRepositoryEventMapper.class;
super.setConnectorClassName(connectorClass.getName());
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.igc.v2.repositoryconnector;
import org.apache.atlas.omrs.ffdc.exception.NotImplementedRuntimeException;
import org.apache.atlas.omrs.metadatacollection.OMRSMetadataCollectionBase;
/**
* The IGCV2OMRSMetadataCollection represents a remote IBM Information Governance Catalog (IGC)
* metadata repository. IGC supports its own native REST APIs.
* Requests to this metadata collection are translated to the IGC REST API calls and the results are
* transformed to OMRS objects before returning to the caller.
*/
public class IGCV2OMRSMetadataCollection extends OMRSMetadataCollectionBase
{
private IGCV2OMRSRepositoryConnector parentConnector = null;
/**
* Default constructor.
*
* @param parentConnector - connector that this metadata collection supports. The connector has the information
* to call the metadata repository.
* @param metadataCollectionId - unique identifier for the repository.
*/
public IGCV2OMRSMetadataCollection(IGCV2OMRSRepositoryConnector parentConnector,
String metadataCollectionId)
{
/*
* The metadata collection Id is the unique Id for the metadata collection. It is managed by the super class.
*/
super(metadataCollectionId);
this.metadataCollectionId = metadataCollectionId;
/*
* Save parentConnector since this has the connection information.
*/
this.parentConnector = parentConnector;
/*
* This is a temporary implementation to allow the structural implementation of the connectors to
* be committed before the metadata collection implementation is complete.
*/
throw new NotImplementedRuntimeException("IGCV2OMRSMetadataCollection", "constructor", "ATLAS-1774");
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.igc.v2.repositoryconnector;
import org.apache.atlas.ocf.ffdc.ConnectorCheckedException;
import org.apache.atlas.omrs.adapters.igc.v1.repositoryconnector.IGCOMRSMetadataCollection;
import org.apache.atlas.omrs.metadatacollection.OMRSMetadataCollection;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnector;
/**
* The IGCV2OMRSRepositoryConnector is a connector to a remote IBM Information Governance Catalog (IGC) repository
* for releases after 11.7.
*/
public class IGCV2OMRSRepositoryConnector extends OMRSRepositoryConnector
{
private IGCV2OMRSMetadataCollection metadataCollection = null;
private String metadataCollectionId = null;
/**
* Default constructor used by the OCF Connector Provider.
*/
public IGCV2OMRSRepositoryConnector()
{
/*
* Nothing to do (yet !)
*/
}
/**
* Set up the unique Id for this metadata collection.
*
* @param metadataCollectionId - String unique Id
*/
public void setMetadataCollectionId(String metadataCollectionId)
{
this.metadataCollectionId = metadataCollectionId;
/*
* Initialize the metadata collection only once the connector is properly set up.
*/
metadataCollection = new IGCV2OMRSMetadataCollection(this, metadataCollectionId);
}
/**
* Returns the metadata collection object that provides an OMRS abstraction of the metadata within
* a metadata repository.
*
* @return OMRSMetadataCollection - metadata information retrieved from the metadata repository.
*/
public OMRSMetadataCollection getMetadataCollection()
{
if (metadataCollection == null)
{
// TODO Throw exception since it means the local metadata collection id is not set up.
}
return metadataCollection;
}
/**
* Free up any resources held since the connector is no longer needed.
*
* @throws ConnectorCheckedException - there is a problem disconnecting the connector.
*/
public void disconnect() throws ConnectorCheckedException
{
}
}
\ No newline at end of file
/*
* 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.omrs.adapters.igc.v2.repositoryconnector;
import org.apache.atlas.omrs.adapters.igc.v1.repositoryconnector.IGCOMRSRepositoryConnector;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnectorProviderBase;
/**
* In the Open Connector Framework (OCF), a ConnectorProvider is a factory for a specific type of connector.
* The IGCV2OMRSRepositoryConnectorProvider is the connector provider for the IGCV2OMRSRepositoryConnector.
* It extends OMRSRepositoryConnectorProviderBase which in turn extends the OCF ConnectorProviderBase.
* ConnectorProviderBase supports the creation of connector instances.
*
* The IGCV2OMRSRepositoryConnectorProvider must initialize ConnectorProviderBase with the Java class
* name of the OMRS Connector implementation (by calling super.setConnectorClassName(className)).
* Then the connector provider will work.
*/
public class IGCV2OMRSRepositoryConnectorProvider extends OMRSRepositoryConnectorProviderBase
{
/**
* Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific
* OMRS Connector implementation.
*/
public IGCV2OMRSRepositoryConnectorProvider()
{
Class connectorClass = IGCV2OMRSRepositoryConnector.class;
super.setConnectorClassName(connectorClass.getName());
}
}
\ No newline at end of file
/*
* 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.omrs.admin;
import org.apache.atlas.ocf.properties.*;
import org.apache.atlas.omrs.admin.properties.*;
import org.apache.atlas.omrs.metadatahighway.cohortregistry.store.file.FileBasedRegistryStoreProvider;
import org.apache.atlas.omrs.metadatacollection.properties.typedefs.TypeDefSummary;
import org.apache.atlas.omrs.topicconnectors.kafka.KafkaOMRSTopicProvider;
import java.util.ArrayList;
import java.util.UUID;
/**
* OMRSConfigurationFactory sets up default configuration for the OMRS components and manages the changes made
* by the server administrator.
*/
public class OMRSConfigurationFactory
{
/*
* Default property fillers
*/
private static final String defaultEnterpriseMetadataCollectionName = "Enterprise Metadata Collection";
private static final String defaultTopicRootName = "omag";
private static final String defaultTopicLeafName = "OMRSTopic";
private static final String defaultTopicConnectorLeafName = "OMRS Topic Connector";
private static final String defaultEnterpriseTopicConnectorRootName = "Enterprise";
private static final String defaultTopicConnectorName = "OMRS Kafka Topic Connector";
private static final String defaultTopicConnectorDescription = "Kafka Topic used to exchange event between members of an open metadata repository cluster.";
private static final String defaultTopicConnectorProviderClassName = KafkaOMRSTopicProvider.class.getName();
private static final String defaultCohortName = "defaultCohort";
private static final String defaultRegistryStoreFQName = "OMRS Cohort Registry Store: cohort.registry";
private static final String defaultRegistryStoreDisplayName = "Cohort Registry Store";
private static final String defaultRegistryStoreDescription = "File-based Store use by the cohort registry to store information about the members of the open metadata repository cluster.";
private static final String defaultRegistryStoreAddress = "cohort.registry";
private static final String defaultRegistryStoreProviderClassName = FileBasedRegistryStoreProvider.class.getName();
private String localServerName = null;
private String localServerType = null;
private String localServerURL = null;
private String localOrganizationName = null;
private RepositoryServicesConfig repositoryServicesConfig = null;
/**
* Constructor used when the server is being configured. Any parameter may be null.
*
* @param localServerName - name of the local server
* @param localServerType - type of the local server
* @param localServerURL - URL of the local server
* @param localOrganizationName - name of the organization that owns the local server
*/
public OMRSConfigurationFactory(String localServerName,
String localServerType,
String localServerURL,
String localOrganizationName)
{
this.localServerName = localServerName;
this.localServerType = localServerType;
this.localServerURL = localServerURL;
this.localOrganizationName = localOrganizationName;
}
public Connection getGenericConnection()
{
return null;
}
public Connection getDefaultAuditLogConnection()
{
return null;
}
public Connection getDefaultOpenMetadataTypesArchiveConnection()
{
return null;
}
private Connection getGenericArchiveConnection()
{
return null;
}
private Connection getGenericRepositoryConnection()
{
return null;
}
private Connection getDefaultLocalRepositoryLocalConnection()
{
return null;
}
private Connection getAtlasLocalRepositoryLocalConnection()
{
return null;
}
private Connection getDefaultLocalRepositoryRemoteConnection(String localServerURL)
{
return null;
}
private Connection getDefaultEventMapperConnection()
{
return null;
}
public Connection getGenericEventMapperConnection()
{
return null;
}
private Connection getDefaultEnterpriseOMRSTopicConnection() { return null; }
private Connection getDefaultCohortOMRSTopicConnection () { return null; }
private Connection getDefaultCohortRegistryConnection ()
{
return null;
}
private OpenMetadataEventProtocolVersion getDefaultEnterpriseOMRSTopicProtocolVersion() { return OpenMetadataEventProtocolVersion.V1; }
private OpenMetadataEventProtocolVersion getDefaultCohortOMRSTopicProtocolVersion() { return OpenMetadataEventProtocolVersion.V1; }
private OpenMetadataExchangeRule getDefaultEventsToSendRule()
{
return OpenMetadataExchangeRule.ALL;
}
private ArrayList<TypeDefSummary> getDefaultSelectedTypesToSend() { return null; }
private OpenMetadataExchangeRule getDefaultEventsToSaveRule()
{
return OpenMetadataExchangeRule.ALL;
}
private ArrayList<TypeDefSummary> getDefaultSelectedTypesToSave() { return null; }
private OpenMetadataExchangeRule getDefaultEventsToProcessRule()
{
return OpenMetadataExchangeRule.ALL;
}
private ArrayList<TypeDefSummary> getDefaultSelectedTypesToProcess() { return null; }
private ArrayList<Connection> getDefaultOpenMetadataArchiveList()
{
ArrayList<Connection> openMetadataArchiveList = new ArrayList<>();
openMetadataArchiveList.add(this.getDefaultOpenMetadataTypesArchiveConnection());
return openMetadataArchiveList;
}
public LocalRepositoryConfig getDefaultLocalRepositoryConfig(String localServerURL)
{
LocalRepositoryConfig localRepositoryConfig = new LocalRepositoryConfig();
localRepositoryConfig.setMetadataCollectionId(UUID.randomUUID().toString());
localRepositoryConfig.setLocalRepositoryLocalConnection(this.getDefaultLocalRepositoryLocalConnection());
localRepositoryConfig.setLocalRepositoryRemoteConnection(this.getDefaultLocalRepositoryRemoteConnection(localServerURL));
localRepositoryConfig.setEventsToSaveRule(this.getDefaultEventsToSaveRule());
localRepositoryConfig.setSelectedTypesToSave(this.getDefaultSelectedTypesToSave());
localRepositoryConfig.setEventsToSendRule(this.getDefaultEventsToSendRule());
localRepositoryConfig.setSelectedTypesToSend(this.getDefaultSelectedTypesToSend());
localRepositoryConfig.setEventMapperConnection(this.getDefaultEventMapperConnection());
return localRepositoryConfig;
}
public EnterpriseAccessConfig getDefaultEnterpriseAccessConfig()
{
EnterpriseAccessConfig enterpriseAccessConfig = new EnterpriseAccessConfig();
enterpriseAccessConfig.setEnterpriseMetadataCollectionId(UUID.randomUUID().toString());
enterpriseAccessConfig.setEnterpriseMetadataCollectionName(defaultEnterpriseMetadataCollectionName);
enterpriseAccessConfig.setEnterpriseOMRSTopicConnection(this.getDefaultEnterpriseOMRSTopicConnection());
enterpriseAccessConfig.setEnterpriseOMRSTopicProtocolVersion(this.getDefaultEnterpriseOMRSTopicProtocolVersion());
return enterpriseAccessConfig;
}
/**
* Return a CohortConfig object that is pre-configured with default values.
*
* @return default values in a CohortConfig object
*/
public CohortConfig getDefaultCohortConfig()
{
CohortConfig cohortConfig = new CohortConfig();
cohortConfig.setCohortName(defaultCohortName);
cohortConfig.setCohortRegistryConnection(this.getDefaultCohortRegistryConnection());
cohortConfig.setCohortOMRSTopicConnection(this.getDefaultCohortOMRSTopicConnection());
cohortConfig.setCohortOMRSTopicProtocolVersion(this.getDefaultCohortOMRSTopicProtocolVersion());
cohortConfig.setEventsToProcessRule(this.getDefaultEventsToProcessRule());
cohortConfig.setSelectedTypesToProcess(this.getDefaultSelectedTypesToProcess());
return cohortConfig;
}
}
/*
* 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.omrs.admin.properties;
import org.apache.atlas.ocf.properties.Connection;
import org.apache.atlas.omrs.metadatacollection.properties.typedefs.TypeDefSummary;
import java.util.ArrayList;
/**
* CohortConfig provides the configuration properties used to connect to an open metadata repository cohort.
* <ul>
* <li>
* cohortName is a descriptive name for the cohort that is used primarily for messages and diagnostics.
* It is also used to create a default name for the cohort's OMRS Topic and the cohortRegistry's store
* if these names are not explicitly defined.
* </li>
* <li>
* cohortRegistryConnection is the connection properties necessary to create the connector to the
* cohort registry store. This is the store where the cohort registry keeps information about its
* local metadata collection Id and details of other repositories in the cohort.
*
* The default value is to use a local file called "cohort.registry" that is stored in the server's
* home directory.
* </li>
* <li>
* cohortOMRSTopicConnection is the connection properties necessary to create the connector to the OMRS Topic.
* This is used to send/receive events between members of the open metadata repository cohort.
* </li>
* <li>
* cohortOMRSTopicProtocolVersion defines the versionName of the event payload to use when communicating with other
* members of the cohort through the OMRS Topic.
* </li>
* <li>
* eventsToProcessRule defines how incoming events on the OMRS Topic should be processed.
* </li>
* <li>
* selectedTypesToProcess - list of TypeDefs used if the eventsToProcess rule (above) says
* "SELECTED_TYPES" - otherwise it is set to null.
* </li>
* </ul>
*/
public class CohortConfig
{
private String cohortName = null;
private Connection cohortRegistryConnection = null;
private Connection cohortOMRSTopicConnection = null;
private OpenMetadataEventProtocolVersion cohortOMRSTopicProtocolVersion = null;
private OpenMetadataExchangeRule eventsToProcessRule = null;
private ArrayList<TypeDefSummary> selectedTypesToProcess = null;
/**
* Default constructor does nothing.
*/
public CohortConfig()
{
}
/**
* Constructor to populate all config values.
*
* @param cohortName - name of the cohort
* @param cohortRegistryConnection - connection to the cohort registry store
* @param cohortOMRSTopicConnection - connection to the OMRS Topic
* @param eventsToProcessRule - rule indicating whether metadata events should be sent to the federated OMRS Topic.
* @param selectedTypesToProcess - if the rule says "SELECTED_TYPES" then this is the list of types - otherwise
* it is set to null.
*/
public CohortConfig(String cohortName,
Connection cohortRegistryConnection,
Connection cohortOMRSTopicConnection,
OpenMetadataExchangeRule eventsToProcessRule,
ArrayList<TypeDefSummary> selectedTypesToProcess)
{
this.cohortName = cohortName;
this.cohortRegistryConnection = cohortRegistryConnection;
this.cohortOMRSTopicConnection = cohortOMRSTopicConnection;
this.eventsToProcessRule = eventsToProcessRule;
this.selectedTypesToProcess = selectedTypesToProcess;
}
/**
* Return the name of the cohort.
*
* @return String name
*/
public String getCohortName()
{
return cohortName;
}
/**
* Set up the name of the cohort.
*
* @param cohortName String
*/
public void setCohortName(String cohortName)
{
this.cohortName = cohortName;
}
/**
* Set up the connection to the cohort registry store.
*
* @return Connection object
*/
public Connection getCohortRegistryConnection()
{
return cohortRegistryConnection;
}
/**
* Set up the connection for the cohort registry store.
*
* @param cohortRegistryConnection - Connection object
*/
public void setCohortRegistryConnection(Connection cohortRegistryConnection)
{
this.cohortRegistryConnection = cohortRegistryConnection;
}
/**
* Return the connection to the cohort's OMRS Topic.
*
* @return Connection object
*/
public Connection getCohortOMRSTopicConnection()
{
return cohortOMRSTopicConnection;
}
/**
* Set up the connection to the cohort's OMRS Topic.
*
* @param cohortOMRSTopicConnection - Connection object
*/
public void setCohortOMRSTopicConnection(Connection cohortOMRSTopicConnection)
{
this.cohortOMRSTopicConnection = cohortOMRSTopicConnection;
}
/**
* Return the protocol versionName to use when exchanging events amongst the cohort members.
*
* @return protocol versionName enum
*/
public OpenMetadataEventProtocolVersion getCohortOMRSTopicProtocolVersion()
{
return cohortOMRSTopicProtocolVersion;
}
/**
* Set up the protocol versionName to use when exchanging events amongst the cohort members.
*
* @param cohortOMRSTopicProtocolVersion - protocol versionName enum
*/
public void setCohortOMRSTopicProtocolVersion(OpenMetadataEventProtocolVersion cohortOMRSTopicProtocolVersion)
{
this.cohortOMRSTopicProtocolVersion = cohortOMRSTopicProtocolVersion;
}
/**
* Return the rule indicating whether incoming metadata events from a cohort should be processed.
*
* @return OpenMetadataExchangeRule - NONE, JUST_TYPEDEFS, SELECTED_TYPES and ALL.
*/
public OpenMetadataExchangeRule getEventsToProcessRule()
{
return eventsToProcessRule;
}
/**
* Set up the rule indicating whether incoming metadata events from a cohort should be processed.
*
* @param eventsToProcessRule - OpenMetadataExchangeRule - NONE, JUST_TYPEDEFS, SELECTED_TYPES and ALL.
*/
public void setEventsToProcessRule(OpenMetadataExchangeRule eventsToProcessRule)
{
this.eventsToProcessRule = eventsToProcessRule;
}
/**
* Return the list of TypeDefs used if the eventsToProcess rule (above) says "SELECTED_TYPES" - otherwise
* it is set to null.
*
* @return list of TypeDefs that determine which metadata instances to process
*/
public ArrayList<TypeDefSummary> getSelectedTypesToProcess()
{
return selectedTypesToProcess;
}
/**
* Set up the list of TypeDefs used if the EventsToProcess rule (above) says "SELECTED_TYPES" - otherwise
* it is set to null.
*
* @param selectedTypesToProcess - list of TypeDefs that determine which metadata instances to process
*/
public void setSelectedTypesToProcess(ArrayList<TypeDefSummary> selectedTypesToProcess)
{
this.selectedTypesToProcess = selectedTypesToProcess;
}
}
/*
* 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.omrs.admin.properties;
import org.apache.atlas.ocf.properties.Connection;
/**
* EnterpriseAccessConfig describes the properties that control the enterprise access services that the
* OMRS provides to the Open Metadata Access Services (OMASs).
* <ul>
* <li>
* enterpriseMetadataCollectionName - name of the combined metadata collection covered by the connected open
* metadata repositories. Used for messages.
* </li>
* <li>
* enterpriseMetadataCollectionId - unique identifier for the combined metadata collection covered by the
* connected open metadata repositories.
* </li>
* <li>
* enterpriseOMRSTopicConnection - connection for the enterprise OMRS Topic connector.
* </li>
* </ul>
*/
public class EnterpriseAccessConfig
{
private String enterpriseMetadataCollectionName = null;
private String enterpriseMetadataCollectionId = null;
private Connection enterpriseOMRSTopicConnection = null;
private OpenMetadataEventProtocolVersion enterpriseOMRSTopicProtocolVersion = null;
/**
* Default Constructor does nothing.
*/
public EnterpriseAccessConfig()
{
}
/**
* Constructor to set up all configuration values.
*
* @param enterpriseMetadataCollectionName - name of the combined metadata collection covered by the connected open
* metadata repositories. Used for messages.
* @param enterpriseMetadataCollectionId - unique identifier for the combined metadata collection covered by the
* connected open metadata repositories.
* @param enterpriseOMRSTopicConnection - connection for the OMRS Topic connector.
* @param enterpriseOMRSTopicProtocolVersion - protocol versionName enum
*/
public EnterpriseAccessConfig(String enterpriseMetadataCollectionName,
String enterpriseMetadataCollectionId,
Connection enterpriseOMRSTopicConnection,
OpenMetadataEventProtocolVersion enterpriseOMRSTopicProtocolVersion)
{
this.enterpriseMetadataCollectionName = enterpriseMetadataCollectionName;
this.enterpriseMetadataCollectionId = enterpriseMetadataCollectionId;
this.enterpriseOMRSTopicConnection = enterpriseOMRSTopicConnection;
this.enterpriseOMRSTopicProtocolVersion = enterpriseOMRSTopicProtocolVersion;
}
/**
* Return the name of the combined metadata collection covered by the connected open
* metadata repositories. Used for messages.
*
* @return String name
*/
public String getEnterpriseMetadataCollectionName()
{
return enterpriseMetadataCollectionName;
}
/**
* Set up the name of the combined metadata collection covered by the connected open
* metadata repositories. Used for messages.
*
* @param enterpriseMetadataCollectionName - String name
*/
public void setEnterpriseMetadataCollectionName(String enterpriseMetadataCollectionName)
{
this.enterpriseMetadataCollectionName = enterpriseMetadataCollectionName;
}
/**
* Return the unique identifier for the combined metadata collection covered by the
* connected open metadata repositories.
*
* @return Unique identifier (guid)
*/
public String getEnterpriseMetadataCollectionId()
{
return enterpriseMetadataCollectionId;
}
/**
* Set up the unique identifier for the combined metadata collection covered by the
* connected open metadata repositories.
*
* @param enterpriseMetadataCollectionId - Unique identifier (guid)
*/
public void setEnterpriseMetadataCollectionId(String enterpriseMetadataCollectionId)
{
this.enterpriseMetadataCollectionId = enterpriseMetadataCollectionId;
}
/**
* Return the connection for the Enterprise OMRS Topic connector.
*
* @return Connection object
*/
public Connection getEnterpriseOMRSTopicConnection()
{
return enterpriseOMRSTopicConnection;
}
/**
* Set up the connection for the Enterprise OMRS Topic connector.
*
* @param enterpriseOMRSTopicConnection - Connection object
*/
public void setEnterpriseOMRSTopicConnection(Connection enterpriseOMRSTopicConnection)
{
this.enterpriseOMRSTopicConnection = enterpriseOMRSTopicConnection;
}
/**
* Return the protocol versionName to use on the EnterpriseOMRSTopicConnector.
*
* @return protocol versionName enum
*/
public OpenMetadataEventProtocolVersion getEnterpriseOMRSTopicProtocolVersion()
{
return enterpriseOMRSTopicProtocolVersion;
}
/**
* Set up the protocol versionName to use on the EnterpriseOMRSTopicConnector.
*
* @param enterpriseOMRSTopicProtocolVersion - protocol versionName enum
*/
public void setEnterpriseOMRSTopicProtocolVersion(OpenMetadataEventProtocolVersion enterpriseOMRSTopicProtocolVersion)
{
this.enterpriseOMRSTopicProtocolVersion = enterpriseOMRSTopicProtocolVersion;
}
}
/*
* 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.omrs.admin.properties;
/**
* OpenMetadataEventProtocolVersion provides the identifier for the version number of the event payload. There is
* only one version at the moment which is why it looks a little sad.
*/
public enum OpenMetadataEventProtocolVersion
{
V1
}
/*
* 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.omrs.admin.properties;
/**
* OpenMetadataExchangeRule controls the sending/receiving of metadata instances on the metadata highway.
* <ul>
* <li>
* REGISTRATION_ONLY means do not send/receive reference metadata - just perform the minimal registration
* exchanges.
* </li>
* <li>
* JUST_TYPEDEFS - means only send/receive/validate type definitions (TypeDefs).
* </li>
* <li>
* SELECTED_TYPES means that in addition to TypeDefs events, only metadata instances of the types
* supplied in the related list of TypeDefs (see typesToSend, typesToSave and typesToFederate) should be processed.
* </li>
* <li>
* LEARNED_TYPES means that the local repository requests reference copies of metadata based on the requests of
* the local user community.
* </li>
* <li>
* ALL means send/receive all types of metadata that are supported by the local repository.
* </li>
* </ul>
*/
public enum OpenMetadataExchangeRule
{
REGISTRATION_ONLY (0, "Registration Only", "Only registration exchange; no TypeDefs or metadata instances."),
JUST_TYPEDEFS (1, "Just TypeDefs", "Only registration and type definitions (TypeDefs) exchange."),
SELECTED_TYPES (2, "Selected Types", "Registration plus all type definitions (TypeDefs) and metadata " +
"instances (Entities and Relationships) of selected types."),
LEARNED_TYPES (3, "Learned Types", "Registration plus all type definitions (TypeDefs) and metadata " +
"instances (Entities and Relationships) of types " +
"requested by local users to this server."),
ALL (99, "All", "Registration plus all type definitions (TypeDefs) and metadata " +
"instances (Entities and Relationships).");
private int replicationRuleCode;
private String replicationRuleName;
private String replicationRuleDescription;
/**
* Constructor for the metadata instance replication rule.
*
* @param replicationRuleCode - the code number of this metadata instance replication rule.
* @param replicationRuleName - the name of this metadata instance replication rule.
* @param replicationRuleDescription - the description of this metadata instance replication rule.
*/
OpenMetadataExchangeRule(int replicationRuleCode, String replicationRuleName, String replicationRuleDescription)
{
this.replicationRuleCode = replicationRuleCode;
this.replicationRuleName = replicationRuleName;
this.replicationRuleDescription = replicationRuleDescription;
}
/**
* Return the code number of this metadata instance replication rule.
*
* @return int replication rule code number
*/
public int getReplicationRuleCode()
{
return replicationRuleCode;
}
/**
* Return the name of this metadata instance replication rule.
*
* @return String replication rule name
*/
public String getReplicationRuleName()
{
return replicationRuleName;
}
/**
* Return the description of this metadata instance replication rule.
*
* @return String replication rule description
*/
public String getReplicationRuleDescription()
{
return replicationRuleDescription;
}
}
/*
* 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.omrs.admin.properties;
import org.apache.atlas.ocf.properties.Connection;
import java.util.ArrayList;
/**
* RepositoryServicesConfig provides the configuration properties that are needed by the OMRS components
* to manage access to the metadata repositories that are members of the open metadata repository clusters that
* this server connects to.
* <ul>
* <li>
* auditLogConnection is a connection describing the connector to the AuditLog that the OMRS
* component should use.
* </li>
* <li>
* openMetadataArchiveConnectionList is a list of Open Metadata Archive Connections.
* An open metadata archive connection provides properties needed to create a connector to manage
* an open metadata archive. This contains pre-built TypeDefs and metadata instance.
* The archives are managed by the OMRSArchiveManager.
* </li>
* <li>
* localRepositoryConfig describes the properties used to manage the local metadata repository for this server.
* </li>
* <li>
* enterpriseAccessConfig describes the properties that control the cluster federation services that the
* OMRS provides to the Open Metadata AccessServices (OMASs).
* </li>
* <li>
* cohortConfigList provides details of each open metadata repository cluster that the local server is
* connected to.
* </li>
* </ul>
*/
public class RepositoryServicesConfig
{
private Connection auditLogConnection = null;
private ArrayList<Connection> openMetadataArchiveConnectionList = new ArrayList<>();
private LocalRepositoryConfig localRepositoryConfig = null;
private EnterpriseAccessConfig enterpriseAccessConfig = null;
private ArrayList<CohortConfig> cohortConfigList = new ArrayList<>();
/**
* Default constructor does nothing
*/
public RepositoryServicesConfig()
{
}
/**
* Constructor to set all properties.
*
* @param auditLogConnection - connection to the audit log.
* @param openMetadataArchiveConnectionList - list of open metadata archive files to load.
* @param localRepositoryConfig - properties to configure the behavior of the local repository.
* @param enterpriseAccessConfig - properties to configure the behavior of the federation services provided
* to the Open Metadata Access Services (OMASs).
* @param cohortConfigList - properties about the open metadata repository clusters that this server connects to.
*/
public RepositoryServicesConfig(Connection auditLogConnection,
ArrayList<Connection> openMetadataArchiveConnectionList,
LocalRepositoryConfig localRepositoryConfig,
EnterpriseAccessConfig enterpriseAccessConfig,
ArrayList<CohortConfig> cohortConfigList)
{
this.auditLogConnection = auditLogConnection;
this.openMetadataArchiveConnectionList = openMetadataArchiveConnectionList;
this.localRepositoryConfig = localRepositoryConfig;
this.enterpriseAccessConfig = enterpriseAccessConfig;
this.cohortConfigList = cohortConfigList;
}
/**
* Return the Connection properties used to create an OCF Connector to the AuditLog.
*
* @return Connection object
*/
public Connection getAuditLogConnection()
{
return auditLogConnection;
}
/**
* Set up the Connection properties used to create an OCF Connector to the AuditLog.
*
* @param auditLogConnection - Connection object
*/
public void setAuditLogConnection(Connection auditLogConnection)
{
this.auditLogConnection = auditLogConnection;
}
/**
* Return the list of Connection object, each of which is used to create the Connector to an Open Metadata
* Archive. Open Metadata Archive contains pre-built metadata types and instances.
*
* @return list of Connection objects
*/
public ArrayList<Connection> getOpenMetadataArchiveConnectionList()
{
return openMetadataArchiveConnectionList;
}
/**
* Set up the list of Connection object, each of which is used to create the Connector to an Open Metadata
* Archive. Open Metadata Archive contains pre-built metadata types and instances.
*
* @param openMetadataArchiveConnectionList - list of Connection objects
*/
public void setOpenMetadataArchiveConnectionList(ArrayList<Connection> openMetadataArchiveConnectionList)
{
this.openMetadataArchiveConnectionList = openMetadataArchiveConnectionList;
}
/**
* Return the configuration properties for the local repository.
*
* @return configuration properties
*/
public LocalRepositoryConfig getLocalRepositoryConfig()
{
return localRepositoryConfig;
}
/**
* Set up the configuration properties for the local repository.
*
* @param localRepositoryConfig - configuration properties
*/
public void setLocalRepositoryConfig(LocalRepositoryConfig localRepositoryConfig)
{
this.localRepositoryConfig = localRepositoryConfig;
}
/**
* Return the configuration for the federation services provided by OMRS to the Open Metadata Access
* Services (OMASs).
*
* @return configuration properties
*/
public EnterpriseAccessConfig getEnterpriseAccessConfig()
{
return enterpriseAccessConfig;
}
/**
* Set up the configuration for the federation services provided by OMRS to the Open Metadata Access
* Services (OMASs).
*
* @param enterpriseAccessConfig configuration properties
*/
public void setEnterpriseAccessConfig(EnterpriseAccessConfig enterpriseAccessConfig)
{
this.enterpriseAccessConfig = enterpriseAccessConfig;
}
/**
* Return the configuration properties for each open metadata repository cluster that this local server
* connects to.
*
* @return list of cluster configuration properties
*/
public ArrayList<CohortConfig> getCohortConfigList()
{
return cohortConfigList;
}
/**
* Set up the configuration properties for each open metadata repository cluster that this local server
* connects to.
*
* @param cohortConfigList - list of cluster configuration properties
*/
public void setCohortConfigList(ArrayList<CohortConfig> cohortConfigList)
{
this.cohortConfigList = cohortConfigList;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* 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.omrs.archivemanager.properties;
/**
* OpenMetadataArchive defines the structure of the properties inside of an open metadata archive.
* There are 3 sections:
* <ul>
* <li>
* ArchiveProperties - provides details of the source and contents of the archive.
* </li>
* <li>
* TypeStore - a list of new TypeDefs and patches to existing TypeDefs.
* </li>
* <li>
* InstanceStore - a list of new metadata instances (Entities and Relationships).
* </li>
* </ul>
*/
public class OpenMetadataArchive
{
private OpenMetadataArchiveProperties archiveProperties = null;
private OpenMetadataArchiveTypeStore archiveTypeStore = null;
private OpenMetadataArchiveInstanceStore archiveInstanceStore = null;
/**
* Default constructor relies on the initialization of variables in their type declaration.
*/
public OpenMetadataArchive()
{
}
/**
* Return details of the archive.
*
* @return OpenMetadataArchiveProperties object
*/
public OpenMetadataArchiveProperties getArchiveProperties()
{
return archiveProperties;
}
/**
* Set the archive properties for a new archive.
*
* @param archiveProperties - the descriptive properties of the archive
*/
public void setArchiveProperties(OpenMetadataArchiveProperties archiveProperties)
{
this.archiveProperties = archiveProperties;
}
/**
* Return the TypeStore for this archive. The TypeStore contains TypeDefs and TypeDef patches.
*
* @return OpenMetadataArchiveTypeStore object
*/
public OpenMetadataArchiveTypeStore getArchiveTypeStore()
{
return archiveTypeStore;
}
/**
* Set up the TypeStore for this archive. The TypeStore contains TypeDefs and TypeDef patches.
*
* @param archiveTypeStore - OpenMetadataArchiveTypeStore object
*/
public void setArchiveTypeStore(OpenMetadataArchiveTypeStore archiveTypeStore)
{
this.archiveTypeStore = archiveTypeStore;
}
/**
* Return the InstanceStore for this archive. The InstanceStore contains entity and relationship metadata
* instances.
*
* @return OpenMetadataArchiveInstanceStore object
*/
public OpenMetadataArchiveInstanceStore getArchiveInstanceStore()
{
return archiveInstanceStore;
}
/**
* Set up the InstanceStore for this archive. The InstanceStore contains entity and relationship metadata
* instances.
*
* @param archiveInstanceStore - OpenMetadataArchiveInstanceStore object
*/
public void setArchiveInstanceStore(OpenMetadataArchiveInstanceStore archiveInstanceStore)
{
this.archiveInstanceStore = archiveInstanceStore;
}
}
/*
* 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.omrs.archivemanager.properties;
import org.apache.atlas.omrs.metadatacollection.properties.instances.EntityDetail;
import org.apache.atlas.omrs.metadatacollection.properties.instances.Relationship;
import java.util.ArrayList;
/**
* OpenMetadataArchiveInstanceStore defines the contents of the InstanceStore in an open metadata archive. It
* consists of a list of entities and a list of relationships.
*/
public class OpenMetadataArchiveInstanceStore
{
private ArrayList<EntityDetail> entities = null;
private ArrayList<Relationship> relationships = null;
/**
* Default constructor relying on the initialization of variables in their declaration.
*/
public OpenMetadataArchiveInstanceStore()
{
}
/**
* Return the list of entities defined in the open metadata archive.
*
* @return list of entities
*/
public ArrayList<EntityDetail> getEntities()
{
return entities;
}
/**
* Set up the list of entities defined in the open metadata archive.
*
* @param entities - list of entities
*/
public void setEntities(ArrayList<EntityDetail> entities)
{
this.entities = entities;
}
/**
* Return the list of relationships defined in this open metadata archive.
*
* @return list of relationships
*/
public ArrayList<Relationship> getRelationships()
{
return relationships;
}
/**
* Set up the list of relationships defined in this open metadata archive.
*
* @param relationships - list of relationship objects
*/
public void setRelationships(ArrayList<Relationship> relationships)
{
this.relationships = relationships;
}
}
/*
* 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.omrs.archivemanager.properties;
import java.util.ArrayList;
import java.util.Date;
/**
* OpenMetadataArchiveProperties defines the properties of an open metadata archive. This includes the following
* properties:
* <ul>
* <li>
* Unique identifier (GUID) of the archive.
* </li>
* <li>
* Archive name.
* </li>
* <li>
* Archive description.
* </li>
* <li>
* Archive Type (CONTENT_PACK or METADATA_EXPORT).
* </li>
* <li>
* Originator name (organization or person).
* </li>
* <li>
* Creation date
* </li>
* <li>
* GUIDs for archives that this archive depends on.
* </li>
* </ul>
*/
public class OpenMetadataArchiveProperties
{
private String archiveGUID = null;
private String archiveName = null;
private String archiveDescription = null;
private OpenMetadataArchiveType archiveType = null;
private String originatorName = null;
private Date creationDate = null;
private ArrayList<String> dependsOnArchives = null;
/**
* Default constructor that relies on initialization of variables in their declaration.
*/
public OpenMetadataArchiveProperties()
{
}
/**
* Return the unique identifier for this archive.
*
* @return String guid
*/
public String getArchiveGUID()
{
return archiveGUID;
}
/**
* Set up the unique identifier for this open metadata archive.
*
* @param archiveGUID - String guid
*/
public void setArchiveGUID(String archiveGUID)
{
this.archiveGUID = archiveGUID;
}
/**
* Return the descriptive name for this open metadata archive.
*
* @return String name
*/
public String getArchiveName()
{
return archiveName;
}
/**
* Set up the descriptive name for this open metadata archive.
*
* @param archiveName - String name
*/
public void setArchiveName(String archiveName)
{
this.archiveName = archiveName;
}
/**
* Return the description for this open metadata archive.
*
* @return String description
*/
public String getArchiveDescription()
{
return archiveDescription;
}
/**
* Set up the description for this open metadata archive.
*
* @param archiveDescription - String description
*/
public void setArchiveDescription(String archiveDescription)
{
this.archiveDescription = archiveDescription;
}
/**
* Return the type of this open metadata archive.
*
* @return OpenMetadataArchiveType enum
*/
public OpenMetadataArchiveType getArchiveType()
{
return archiveType;
}
/**
* Set up the type of this open metadata archive.
*
* @param archiveType - OpenMetadataArchiveType enum
*/
public void setArchiveType(OpenMetadataArchiveType archiveType)
{
this.archiveType = archiveType;
}
/**
* Return the name of the originator of this open metadata archive (persona or organization).
*
* @return String name
*/
public String getOriginatorName()
{
return originatorName;
}
/**
* Set up the name of the originator of this open metadata archive (persona or organization).
*
* @param originatorName - String name
*/
public void setOriginatorName(String originatorName)
{
this.originatorName = originatorName;
}
/**
* Return the date that this open metadata archive was created.
*
* @return Date object
*/
public Date getCreationDate()
{
return creationDate;
}
/**
* Set up the date that this open metadata archive was created.
*
* @param creationDate - Date object
*/
public void setCreationDate(Date creationDate)
{
this.creationDate = creationDate;
}
/**
* Return the list of GUIDs for open metadata archives that need to be loaded before this one.
*
* @return list of guids
*/
public ArrayList<String> getDependsOnArchives()
{
return dependsOnArchives;
}
/**
* Set up the list of GUIDs for open metadata archives that need to be loaded before this one.
*
* @param dependsOnArchives - list of guids
*/
public void setDependsOnArchives(ArrayList<String> dependsOnArchives)
{
this.dependsOnArchives = dependsOnArchives;
}
}
/*
* 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.omrs.archivemanager.properties;
public enum OpenMetadataArchiveType
{
CONTENT_PACK (1, "ContentPack",
"A collection of metadata elements that define a standard or support a specific use case."),
METADATA_EXPORT (2, "MetadataExport",
"A collection of metadata elements that have been extracted from a specific open metadata repository.");
private int archiveTypeCode;
private String archiveTypeName;
private String archiveTypeDescription;
/**
* Constructor fo an enum instance.
*
* @param archiveTypeCode - code number for the archive type
* @param archiveTypeName - name for the archive type
* @param archiveTypeDescription - default description ofr the archive type
*/
OpenMetadataArchiveType(int archiveTypeCode, String archiveTypeName, String archiveTypeDescription)
{
this.archiveTypeCode = archiveTypeCode;
this.archiveTypeName = archiveTypeName;
this.archiveTypeDescription = archiveTypeDescription;
}
/**
* Return the code number for the archive type.
*
* @return int code number
*/
public int getArchiveTypeCode()
{
return archiveTypeCode;
}
/**
* Return the printable name for the archive type.
*
* @return String archive type name
*/
public String getArchiveTypeName()
{
return archiveTypeName;
}
/**
* Return the default description of the archive type.
*
* @return String archive description
*/
public String getArchiveTypeDescription()
{
return archiveTypeDescription;
}
}
/*
* 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.omrs.archivemanager.properties;
import org.apache.atlas.omrs.metadatacollection.properties.typedefs.AttributeTypeDef;
import org.apache.atlas.omrs.metadatacollection.properties.typedefs.TypeDef;
import org.apache.atlas.omrs.metadatacollection.properties.typedefs.TypeDefPatch;
import java.util.ArrayList;
/**
* OpenMetadataArchiveTypeStore defines the contents of the TypeStore in an open metadata archive. The TypeStore
* contains a list of types used for attributes, a list of type definition (TypeDef) patches to update existing types
* and a list of TypeDefs for new types of classifications, entities and relationships.
*/
public class OpenMetadataArchiveTypeStore
{
private ArrayList<AttributeTypeDef> attributeTypeDefs = null;
private ArrayList<TypeDefPatch> typeDefPatches = null;
private ArrayList<TypeDef> newTypeDefs = null;
/**
* Default constructor for OpenMetadataArchiveTypeStore relies on variables being initialized in their declaration.
*/
public OpenMetadataArchiveTypeStore()
{
}
/**
* Return the list of attribute types used in this archive.
*
* @return list of AttributeTypeDef objects
*/
public ArrayList<AttributeTypeDef> getAttributeTypeDefs()
{
return attributeTypeDefs;
}
/**
* Set up the list of attribute types used in this archive.
*
* @param attributeTypeDefs - list of AttributeTypeDef objects
*/
public void setAttributeTypeDefs(ArrayList<AttributeTypeDef> attributeTypeDefs)
{
this.attributeTypeDefs = attributeTypeDefs;
}
/**
* Return the list of TypeDef patches from this archive.
*
* @return list of TypeDef objects
*/
public ArrayList<TypeDefPatch> getTypeDefPatches()
{
return typeDefPatches;
}
/**
* Set up the list of TypeDef patches from this archive.
*
* @param typeDefPatches - list of TypeDef objects
*/
public void setTypeDefPatches(ArrayList<TypeDefPatch> typeDefPatches)
{
this.typeDefPatches = typeDefPatches;
}
/**
* Return the list of new TypeDefs in this open metadata archive.
*
* @return list of TypeDef objects
*/
public ArrayList<TypeDef> getNewTypeDefs()
{
return newTypeDefs;
}
/**
* Set up the list of new TypeDefs in this open metadata archive.
*
* @param newTypeDefs - list of TypeDef objects
*/
public void setNewTypeDefs(ArrayList<TypeDef> newTypeDefs)
{
this.newTypeDefs = newTypeDefs;
}
}
/*
* 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.omrs.archivemanager.store;
import org.apache.atlas.omrs.archivemanager.properties.OpenMetadataArchive;
/**
* <p>
* OpenMetadataArchiveStore is the interface for a connector to an open metadata archive. The open metadata archive
* is a collection of type definitions (TypeDefs) and metadata instances (Entities and Relationships) that can be
* loaded into an open metadata repository.
* </p>
* <p>
* An open metadata archive has 3 sections:
* </p>
* <ul>
* <li>
* Archive properties
* </li>
* <li>
* Type store - ordered list of types
* </li>
* <li>
* Instance store - list of entities and relationships
* </li>
* </ul>
*/
public interface OpenMetadataArchiveStore
{
/**
* Open the archive and retrieve archive contents (if any)
*/
void openArchive();
/**
* Return the contents of the archive.
*
* @return OpenMetadataArchive object
*/
OpenMetadataArchive getArchiveContents();
/**
* Set new contents into the archive. This overrides any content previously stored.
*
* @param archiveContents - OpenMetadataArchive object
*/
void setArchiveContents(OpenMetadataArchive archiveContents);
/**
* Close the archive - this releases the connection and any resources held.
*/
void closeArchive();
}
/*
* 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.omrs.archivemanager.store;
import org.apache.atlas.ocf.ConnectorBase;
/**
* OpenMetadataArchiveStoreConnectorBase is the base class for connectors that support the OpenMetadataArchiveStore
*/
public abstract class OpenMetadataArchiveStoreConnectorBase extends ConnectorBase implements OpenMetadataArchiveStore
{
}
/*
* 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.omrs.archivemanager.store;
import org.apache.atlas.ocf.ConnectorProviderBase;
/**
* The OpenMetadataArchiveProviderStoreBase provides a base class for the connector provider supporting OMRS
* open metadata archive stores. It extends ConnectorProviderBase which does the creation of connector instances.
* The subclasses of OpenMetadataArchiveStoreProviderBase must initialize ConnectorProviderBase with the Java class
* name of the audit log connector implementation (by calling super.setConnectorClassName(className)).
* Then the connector provider will work.
*/
public abstract class OpenMetadataArchiveStoreProviderBase extends ConnectorProviderBase
{
/**
* Default Constructor
*/
public OpenMetadataArchiveStoreProviderBase()
{
/*
* Nothing to do
*/
}
}
/*
* 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.omrs.auditlog;
import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogRecord;
import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogRecordOriginator;
import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogReportingComponent;
import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
/**
* OMRSAuditLog is a class for managing the audit logging of activity for the OMRS components. Each auditing component
* will have their own instance of an OMRSAuditLog. OMRSAuditLog will ensure audit log records are written to
* disk in the common OMRSAuditLog for this local server.
*
* There are different levels of log record to cover all of the activity of the OMRS.
*
* This audit log is critical to validate the behavior of the OMRS, particularly in the initial interaction of
* a new metadata repository to the OMRS Cohort.
*/
public class OMRSAuditLog
{
static private final OMRSAuditLogRecordOriginator originator = new OMRSAuditLogRecordOriginator();
static private OMRSAuditLogStore auditLogStore = null;
private static final Logger log = LoggerFactory.getLogger(OMRSAuditLog.class);
private OMRSAuditLogReportingComponent reportingComponent = null;
/**
* Initialize the static values used in all log records. These values help to pin-point the source of messages
* when audit log records from many servers are consolidated into centralized operational tooling.
*
* @param localServerName - name of the local server
* @param localServerType - type of the local server
* @param localOrganizationName - name of the organization that owns the local server
* @param auditLogStore - destination for the audit log records
*/
public static void initialize(String localServerName,
String localServerType,
String localOrganizationName,
OMRSAuditLogStore auditLogStore)
{
OMRSAuditLog.originator.setServerName(localServerName);
OMRSAuditLog.originator.setServerType(localServerType);
OMRSAuditLog.originator.setOrganizationName(localOrganizationName);
OMRSAuditLog.auditLogStore = auditLogStore;
}
/**
* Set up the local metadata collection Id. This is null if there is no local repository.
*
* @param localMetadataCollectionId - String unique identifier for the metadata collection
*/
public static void setLocalMetadataCollectionId(String localMetadataCollectionId)
{
OMRSAuditLog.originator.setMetadataCollectionId(localMetadataCollectionId);
}
/**
* Typical constructor - Each component using the Audit log will create their own OMRSAuditLog instance and
* will push log records to it.
*
* @param reportingComponent - information about the component that will use this instance of the audit log.
*/
public OMRSAuditLog(OMRSAuditingComponent reportingComponent)
{
this.reportingComponent = new OMRSAuditLogReportingComponent(reportingComponent.getComponentId(),
reportingComponent.getComponentName(),
reportingComponent.getComponentDescription(),
reportingComponent.getComponentWikiURL());
}
/**
* Log an audit log record for an event, decision, error, or exception detected by the OMRS.
*
* @param actionDescription - description of the activity creating the audit log record
* @param logMessageId - id for the audit log record
* @param severity - is this an event, decision, error or exception?
* @param logMessage - description of the audit log record including specific resources involved
* @param additionalInformation - additional data to help resolve issues of verify behavior
* @param systemAction - the related action taken by the OMRS.
* @param userAction - details of any action that an administrator needs to take.
*/
public void logRecord(String actionDescription,
String logMessageId,
OMRSAuditLogRecordSeverity severity,
String logMessage,
String additionalInformation,
String systemAction,
String userAction)
{
if (severity != null)
{
if ((severity == OMRSAuditLogRecordSeverity.ERROR) || (severity == OMRSAuditLogRecordSeverity.EXCEPTION))
{
log.error("New Audit Log Record", actionDescription, logMessageId, severity, logMessage, additionalInformation, systemAction, userAction);
}
else
{
log.info("New Audit Log Record", actionDescription, logMessageId, severity, logMessage, additionalInformation, systemAction, userAction);
}
}
else
{
severity = OMRSAuditLogRecordSeverity.UNKNOWN;
}
if (auditLogStore != null)
{
ArrayList<String> additionalInformationArray = null;
if (additionalInformation != null)
{
additionalInformationArray = new ArrayList<>();
additionalInformationArray.add(additionalInformation);
}
OMRSAuditLogRecord logRecord = new OMRSAuditLogRecord(originator,
reportingComponent,
severity.getSeverityName(),
logMessageId,
logMessage,
additionalInformationArray,
systemAction,
userAction);
try
{
auditLogStore.storeLogRecord(logRecord);
}
catch (Throwable error)
{
log.error("Error writing audit log: ", logRecord, error);
}
}
}
/**
* Log details of an unexpected exception detected by the OMRS. These exceptions typically mean that the local
* server is not configured correctly, or there is a logic error in the code. When exceptions are logged, it is
* important that they are investigated and the cause corrected since the local repository is not able to operate
* as a proper peer in the metadata repository cluster whilst these conditions persist.
*
* @param actionDescription - description of the activity in progress when the error occurred
* @param logMessageId - id for the type of exception caught
* @param severity - severity of the error
* @param logMessage - description of the exception including specific resources involved
* @param additionalInformation - additional data to help resolve issues of verify behavior
* @param systemAction - the action taken by the OMRS in response to the error.
* @param userAction - details of any action that an administrator needs to take.
* @param caughtException - the original exception.
*/
public void logException(String actionDescription,
String logMessageId,
OMRSAuditLogRecordSeverity severity,
String logMessage,
String additionalInformation,
String systemAction,
String userAction,
Throwable caughtException)
{
if (caughtException != null)
{
this.logRecord(actionDescription,
logMessageId,
severity,
logMessage,
additionalInformation + caughtException.toString(),
systemAction,
userAction);
}
}
}
/*
* 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.omrs.auditlog;
/**
* OMRSAuditLogRecordSeverity defines the different levels of severity for log records stored in the OMRSAuditLogRecord.
* <ul>
* <li>
* UNKNOWN - Uninitialized Severity - if this is seen then there is a logic error in the audit log processing.
* </li>
* <li>
* INFO - An activity occurred as part of the normal operation of the open metadata repository.
* </li>
* <li>
* EVENT - An OMRS Event was sent to or received from members of an open metadata repository cohort.
* </li>
* <li>
* DECISION - A decision has been made related to the interaction of the local metadata repository and the
* rest of the open metadata repository cohort.
* </li>
* <li>
* ACTION - A situation has been detected that requires administrator intervention.
* </li>
* <li>
* ERROR - An unexpected error occurred, possibly caused by an incompatibility between the local metadata repository
* and one of the remote repositories. The local repository may restrict some of the metadata interchange
* functions as a result.
* </li>
* <li>
* EXCEPTION - Unexpected exception occurred. This means that the local repository needs some administration
* attention to correct configuration or fix a logic error because it is not operating as a proper peer in the
* metadata repository cluster.
* </li>
* </ul>
*/
public enum OMRSAuditLogRecordSeverity
{
UNKNOWN (0, "<Unknown>", "Uninitialized Severity."),
INFO (1, "Information", "The server is providing information about its normal operation."),
EVENT (2, "Event", "An OMRSEvent was exchanged amongst members of the metadata repository cohort."),
DECISION (3, "Decision", "A decision has been made related to the interaction of the local metadata repository and the rest of the cohort."),
ACTION (4, "Action", "Action is required by the administrator. " +
"At a minimum, the situation needs to be investigated and if necessary, corrective action taken."),
ERROR (5, "Error", "An error occurred, possibly caused by an incompatibility between the local metadata repository \n" +
"and one of the remote repositories. " +
"The local repository may restrict some of the metadata interchange \n" +
"functions as a result."),
EXCEPTION (6, "Exception", "Unexpected exception occurred. This means that the local repository needs some administration\n" +
" attention to correct configuration or fix a logic error because it is not operating as a proper peer in the\n" +
" metadata repository cohort.");
private int severityCode;
private String severityName;
private String severityDescription;
/**
* Typical constructor sets up the selected enum value.
*
* @param severityCode - numeric of this enum.
* @param severityName - name of enum.
* @param severityDescription - default description of enum..
*/
OMRSAuditLogRecordSeverity(int severityCode,
String severityName,
String severityDescription)
{
this.severityCode = severityCode;
this.severityName = severityName;
this.severityDescription = severityDescription;
}
/**
* Return the code for this enum.
*
* @return int numeric for this enum
*/
public int getSeverityCode()
{
return severityCode;
}
/**
* Return the name of this enum.
*
* @return String name
*/
public String getSeverityName()
{
return severityName;
}
/**
* Return the default description of this enum. This description is in English. Natural language translations can be
* created using a Resource Bundle indexed by the severity code. This description is a fall back when the resource
* bundle is not available.
*
* @return String default description
*/
public String getSeverityDescription()
{
return severityDescription;
}
}
/*
* 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.omrs.auditlog.store;
import java.util.ArrayList;
import java.util.Date;
import java.util.UUID;
/**
* OMRSAuditLogRecord provides a carrier for details about a single log record in the OMRS audit log.
*/
public class OMRSAuditLogRecord
{
private String guid = null;
private Date timeStamp = new Date();
private OMRSAuditLogRecordOriginator originator = null;
private String severity = null;
private OMRSAuditLogReportingComponent reportingComponent = null;
private String messageId = null;
private String messageText = null;
private ArrayList<String> additionalInformation = null;
private String systemAction = null;
private String userAction = null;
/**
* Audit log records are immutable so the only way to update the values is through the constructor.
*
* @param originator - details of the originating server
* @param reportingComponent - details of the component making the audit log entry.
* @param severity - OMRSAuditLogRecordSeverity enum that indicates the severity of log record.
* @param messageId - id of the message in the audit log record.
* @param messageText - description of the message for the audit log record.
* @param additionalInformation - additional properties that help to describe the situation.
* @param systemAction - action taken by the system.
* @param userAction - followup action that should be taken by the target end user (typically the server
* administrator).
*/
public OMRSAuditLogRecord(OMRSAuditLogRecordOriginator originator,
OMRSAuditLogReportingComponent reportingComponent,
String severity,
String messageId,
String messageText,
ArrayList<String> additionalInformation,
String systemAction,
String userAction)
{
this.guid = UUID.randomUUID().toString();
this.originator = originator;
this.severity = severity;
this.reportingComponent = reportingComponent;
this.messageId = messageId;
this.messageText = messageText;
this.additionalInformation = additionalInformation;
this.systemAction = systemAction;
this.userAction = userAction;
}
/**
* Return the unique Id of the audit log record
*
* @return String guid
*/
public String getGUID()
{
return guid;
}
/**
* Return the time stamp for when the audit log record was created.
*
* @return Date object
*/
public Date getTimeStamp()
{
return timeStamp;
}
/**
* Return details of the originator of the log record.
*
* @return OMRSAuditLogRecordOriginator object
*/
public OMRSAuditLogRecordOriginator getOriginator()
{
return originator;
}
/**
* Return the severity of the situation recorded in the log record.
*
* @return String severity
*/
public String getSeverity()
{
return severity;
}
/**
* Return the name of the component that reported the situation recorded in the log record.
*
* @return OMRSAuditLogReportingComponent object
*/
public OMRSAuditLogReportingComponent getReportingComponent()
{
return reportingComponent;
}
/**
* Return the identifier of the message within the log record.
*
* @return String message Id
*/
public String getMessageId()
{
return messageId;
}
/**
* Return the text of the message within the log record.
*
* @return String message text
*/
public String getMessageText()
{
return messageText;
}
/**
* Return any additional information in the audit log record.
*
* @return String additional information
*/
public ArrayList<String> getAdditionalInformation()
{
return additionalInformation;
}
public String getSystemAction()
{
return systemAction;
}
public String getUserAction()
{
return userAction;
}
@Override
public String toString()
{
String originatorString = null;
if (this.originator != null)
{
originatorString = this.originator.toString();
}
String reportingComponentString = null;
if (this.reportingComponent != null)
{
reportingComponentString = this.reportingComponent.toString();
}
String additionalInformationString = null;
if (this.additionalInformation != null)
{
boolean notFirst = false;
additionalInformationString = "[ ";
for (String nugget : additionalInformation)
{
if (notFirst)
{
additionalInformationString = additionalInformationString + ", ";
notFirst = true;
}
additionalInformationString = additionalInformationString + nugget;
}
additionalInformationString = additionalInformationString + " ]";
}
return "AuditLogRecord { " +
"timestamp : " + timeStamp.toString() + ", " +
"guid : " + guid + ", " +
"originator : " + originatorString + ", " +
"severity : " + severity + ", " +
"reportingComponent : " + reportingComponentString + ", " +
"messageId : " + messageId + ", " +
"messageText : " + messageText + ", " +
"additionalInformation : " + additionalInformationString + ", " +
"systemAction : " + systemAction + ", " +
"userAction : " + userAction + " }";
}
@Override
public int hashCode()
{
return super.hashCode();
}
@Override
public boolean equals(Object object)
{
if (this == object)
{
return true;
}
if (object == null || getClass() != object.getClass())
{
return false;
}
OMRSAuditLogRecord that = (OMRSAuditLogRecord) object;
return guid.equals(that.guid);
}
}
/*
* 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.omrs.auditlog.store;
/**
* OMRSAuditLogRecordOriginator describes the server that originated an audit log record. This is useful if
* an organization is aggregating messages from different servers together.
*/
public class OMRSAuditLogRecordOriginator
{
private String metadataCollectionId = null;
private String serverName = null;
private String serverType = null;
private String organizationName = null;
/**
* Default constructor used by parsing engines and other consumers.
*/
public OMRSAuditLogRecordOriginator()
{
}
/**
* Returns the unique identifier (guid) of the originating repository's metadata collection.
*
* @return String guid
*/
public String getMetadataCollectionId()
{
return metadataCollectionId;
}
/**
* Sets up the unique identifier (guid) of the originating repository.
*
* @param metadataCollectionId - String guid
*/
public void setMetadataCollectionId(String metadataCollectionId)
{
this.metadataCollectionId = metadataCollectionId;
}
/**
* Return the display name for the server that is used in events, messages and UIs to
* make it easier for people to understand the origin of metadata.
*
* @return String server name
*/
public String getServerName()
{
return serverName;
}
/**
* Set up the display name for the server that is used in events, messages and UIs to
* make it easier for people to understand the origin of metadata.
*
* @param serverName - String server name
*/
public void setServerName(String serverName)
{
this.serverName = serverName;
}
/**
* Return the descriptive string describing the type of the server. This might be the
* name of the product, or similar identifier.
*
* @return String server type
*/
public String getServerType()
{
return serverType;
}
/**
* Set up the descriptive string describing the type of the server. This might be the
* name of the product, or similar identifier.
*
* @param serverType - String server type
*/
public void setServerType(String serverType)
{
this.serverType = serverType;
}
/**
* Return the name of the organization that runs/owns the server.
*
* @return String organization name
*/
public String getOrganizationName()
{
return organizationName;
}
/**
* Set up the name of the organization that runs/owns the server.
*
* @param organizationName - String organization name
*/
public void setOrganizationName(String organizationName)
{
this.organizationName = organizationName;
}
@Override
public String toString()
{
return "Originator { " +
"metadataCollectionId : " + this.metadataCollectionId + ", " +
"serverName : " + this.serverName + ", " +
"serverType : " + this.serverType + ", " +
"organizationName : " + this.organizationName + " }";
}
@Override
public boolean equals(Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
OMRSAuditLogRecordOriginator that = (OMRSAuditLogRecordOriginator) o;
if (metadataCollectionId != null ? !metadataCollectionId.equals(that.metadataCollectionId) : that.metadataCollectionId != null)
{
return false;
}
if (serverName != null ? !serverName.equals(that.serverName) : that.serverName != null)
{
return false;
}
if (serverType != null ? !serverType.equals(that.serverType) : that.serverType != null)
{
return false;
}
return organizationName != null ? organizationName.equals(that.organizationName) : that.organizationName == null;
}
@Override
public int hashCode()
{
int result = metadataCollectionId != null ? metadataCollectionId.hashCode() : 0;
result = 31 * result + (serverName != null ? serverName.hashCode() : 0);
result = 31 * result + (serverType != null ? serverType.hashCode() : 0);
result = 31 * result + (organizationName != null ? organizationName.hashCode() : 0);
return result;
}
}
/*
* 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.omrs.auditlog.store;
/**
* OMRSAuditLogReportingComponent describes the component issuing the audit log record.
*/
public class OMRSAuditLogReportingComponent
{
private int componentId = 0;
private String componentName = null;
private String componentDescription = null;
private String componentWikiURL = null;
/**
* Construct the description of the reporting component.
*
* @param componentId - numerical identifier for the component.
* @param componentName - display name for the component.
* @param componentDescription - description of the component.
* @param componentWikiURL - link to more information.
*/
public OMRSAuditLogReportingComponent(int componentId,
String componentName,
String componentDescription,
String componentWikiURL)
{
this.componentId = componentId;
this.componentName = componentName;
this.componentDescription = componentDescription;
this.componentWikiURL = componentWikiURL;
}
/**
* Return the numerical code for this enum.
*
* @return int componentId
*/
public int getComponentId()
{
return componentId;
}
/**
* Return the name of the component. This is the name used in the audit log records.
*
* @return String component name
*/
public String getComponentName()
{
return componentName;
}
/**
* Return the short description of the component. This is an English description. Natural language support for
* these values can be added to UIs using a resource bundle indexed with the component Id. This value is
* provided as a default if the resource bundle is not available.
*
* @return String description
*/
public String getComponentDescription()
{
return componentDescription;
}
/**
* URL link to the wiki page that describes this component. This provides more information to the log reader
* on the operation of the component.
*
* @return String URL
*/
public String getComponentWikiURL()
{
return componentWikiURL;
}
@Override
public String toString()
{
return "ReportingComponent { " +
"id : " + this.componentId + ", " +
"name : " + this.componentName + ", " +
"description : " + this.componentDescription + ", " +
"url : " + this.componentWikiURL + " }";
}
@Override
public boolean equals(Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
OMRSAuditLogReportingComponent that = (OMRSAuditLogReportingComponent) o;
if (componentId != that.componentId)
{
return false;
}
if (componentName != null ? !componentName.equals(that.componentName) : that.componentName != null)
{
return false;
}
if (componentDescription != null ? !componentDescription.equals(that.componentDescription) : that.componentDescription != null)
{
return false;
}
return componentWikiURL != null ? componentWikiURL.equals(that.componentWikiURL) : that.componentWikiURL == null;
}
@Override
public int hashCode()
{
int result = componentId;
result = 31 * result + (componentName != null ? componentName.hashCode() : 0);
result = 31 * result + (componentDescription != null ? componentDescription.hashCode() : 0);
result = 31 * result + (componentWikiURL != null ? componentWikiURL.hashCode() : 0);
return result;
}
}
/*
* 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.omrs.auditlog.store;
import org.apache.atlas.omrs.ffdc.exception.PagingErrorException;
import org.apache.atlas.omrs.ffdc.exception.PropertyErrorException;
import java.util.ArrayList;
import java.util.Date;
/**
* OMRSAuditLogStore is the specialized data API for an Audit Log connector.
*/
public interface OMRSAuditLogStore
{
/**
* Store the audit log record in the audit log store.
*
* @param logRecord - log record to store
* @return unique identifier assigned to the log record
* @throws PropertyErrorException - indicates that the logRecord parameter is invalid.
*/
String storeLogRecord(OMRSAuditLogRecord logRecord) throws PropertyErrorException;
/**
* Retrieve a specific audit log record.
*
* @param logRecordId - unique identifier for the log record
* @return requested audit log record
* @throws PropertyErrorException - indicates that the logRecordId parameter is invalid.
*/
OMRSAuditLogRecord getAuditLogRecord(String logRecordId) throws PropertyErrorException;
/**
* Retrieve a list of log records written in a specified time period. The offset and maximumRecords
* parameters support a paging
*
* @param startDate - start of time period
* @param endDate - end of time period
* @param offset - offset of full collection to begin the return results
* @param maximumRecords - maximum number of log records to return
* @return list of log records from the specified time period
* @throws PropertyErrorException - indicates that the start and/or end date parameters are invalid.
* @throws PagingErrorException - indicates that the offset or the maximumRecords parameters are invalid.
*/
ArrayList<OMRSAuditLogRecord> getAuditLogRecordsByTimeStamp(Date startDate,
Date endDate,
int offset,
int maximumRecords) throws PropertyErrorException,
PagingErrorException;
/**
* Retrieve a list of log records that have specific severity. The offset and maximumRecords
* parameters support a paging model.
*
* @param severity - the severity value of messages to return
* @param startDate - start of time period
* @param endDate - end of time period
* @param offset - offset of full collection to begin the return results
* @param maximumRecords - maximum number of log records to return
* @return list of log records from the specified time period
* @throws PropertyErrorException - indicates that the severity, start and/or end date parameters are invalid.
* @throws PagingErrorException - indicates that the offset or the maximumRecords parameters are invalid.
*/
ArrayList<OMRSAuditLogRecord> getAuditLogRecordsBySeverity(String severity,
Date startDate,
Date endDate,
int offset,
int maximumRecords) throws PropertyErrorException,
PagingErrorException;
/**
* Retrieve a list of log records written by a specific component. The offset and maximumRecords
* parameters support a paging model.
*
* @param component - name of the component to retrieve events from
* @param startDate - start of time period
* @param endDate - end of time period
* @param offset - offset of full collection to begin the return results
* @param maximumRecords - maximum number of log records to return
* @return list of log records from the specified time period
* @throws PropertyErrorException - indicates that the component, start and/or end date parameters are invalid.
* @throws PagingErrorException - indicates that the offset or the maximumRecords parameters are invalid.
*/
ArrayList<OMRSAuditLogRecord> getAuditLogRecordsByComponent(String component,
Date startDate,
Date endDate,
int offset,
int maximumRecords) throws PropertyErrorException,
PagingErrorException;
}
/*
* 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.omrs.auditlog.store;
import org.apache.atlas.ocf.ConnectorBase;
/**
* OMRSAuditLogStoreConnectorBase is the base calss for connectors that support the OMRSAuditLog
*/
public abstract class OMRSAuditLogStoreConnectorBase extends ConnectorBase implements OMRSAuditLogStore
{
}
/*
* 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.omrs.auditlog.store;
import org.apache.atlas.ocf.ConnectorProviderBase;
/**
* The OMRSAuditLogStoreProviderBase provides a base class for the connector provider supporting OMRS
* audit log stores. It extends ConnectorProviderBase which does the creation of connector instances.
* The subclasses of OMRSAuditLogStoreProviderBase must initialize ConnectorProviderBase with the Java class
* name of the audit log connector implementation (by calling super.setConnectorClassName(className)).
* Then the connector provider will work.
*/
public abstract class OMRSAuditLogStoreProviderBase extends ConnectorProviderBase
{
/**
* Default Constructor
*/
public OMRSAuditLogStoreProviderBase()
{
/*
* Nothing to do
*/
}
}
/*
* 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.omrs.auditlog.store.file;
import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogRecord;
import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogStoreConnectorBase;
import org.apache.atlas.omrs.ffdc.exception.PagingErrorException;
import org.apache.atlas.omrs.ffdc.exception.PropertyErrorException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Date;
/**
* FileBasedAuditLogStoreConnector provides a connector implementation for a file based audit log.
* The audit log is stored in a directory and each audit log record is stored as a file with a filename build
* from the record's unique identifier (guid).
*/
public class FileBasedAuditLogStoreConnector extends OMRSAuditLogStoreConnectorBase
{
private static final Logger log = LoggerFactory.getLogger(FileBasedAuditLogStoreConnector.class);
/**
* Default constructor used by the connector provider.
*/
public FileBasedAuditLogStoreConnector()
{
}
/**
* Store the audit log record in the audit log store.
*
* @param logRecord - log record to store
* @return unique identifier assigned to the log record
* @throws PropertyErrorException - indicates that the logRecord parameter is invalid.
*/
public String storeLogRecord(OMRSAuditLogRecord logRecord) throws PropertyErrorException
{
if (logRecord == null)
{
// TODO Throw PropertyErrorException
}
if (log.isDebugEnabled())
{
log.debug("AuditLogRecord: ", logRecord.toString());
}
return null;
}
/**
* Retrieve a specific audit log record.
*
* @param logRecordId - unique identifier for the log record
* @return requested audit log record
* @throws PropertyErrorException - indicates that the logRecordId parameter is invalid.
*/
public OMRSAuditLogRecord getAuditLogRecord(String logRecordId) throws PropertyErrorException
{
if (logRecordId == null)
{
// TODO Throw PropertyErrorException
}
return null;
}
/**
* Retrieve a list of log records written in a specified time period. The offset and maximumRecords
* parameters support a paging
*
* @param startDate - start of time period
* @param endDate - end of time period
* @param offset - offset of full collection to begin the return results
* @param maximumRecords - maximum number of log records to return
* @return list of log records from the specified time period
* @throws PropertyErrorException - indicates that the start and/or end date parameters are invalid.
* @throws PagingErrorException - indicates that the offset or the maximumRecords parameters are invalid.
*/
public ArrayList<OMRSAuditLogRecord> getAuditLogRecordsByTimeStamp(Date startDate,
Date endDate,
int offset,
int maximumRecords) throws PropertyErrorException,
PagingErrorException
{
return null;
}
/**
* Retrieve a list of log records of a specific severity. The offset and maximumRecords
* parameters support a paging model.
*
* @param severity - the severity value of messages to return
* @param startDate - start of time period
* @param endDate - end of time period
* @param offset - offset of full collection to begin the return results
* @param maximumRecords - maximum number of log records to return
* @return list of log records from the specified time period
* @throws PropertyErrorException - indicates that the severity, start and/or end date parameters are invalid.
* @throws PagingErrorException - indicates that the offset or the maximumRecords parameters are invalid.
*/
public ArrayList<OMRSAuditLogRecord> getAuditLogRecordsBySeverity(String severity,
Date startDate,
Date endDate,
int offset,
int maximumRecords) throws PropertyErrorException,
PagingErrorException
{
return null;
}
/**
* Retrieve a list of log records written by a specific component. The offset and maximumRecords
* parameters support a paging model.
*
* @param component - name of the component to retrieve events from
* @param startDate - start of time period
* @param endDate - end of time period
* @param offset - offset of full collection to begin the return results
* @param maximumRecords - maximum number of log records to return
* @return list of log records from the specified time period
* @throws PropertyErrorException - indicates that the component, start and/or end date parameters are invalid.
* @throws PagingErrorException - indicates that the offset or the maximumRecords parameters are invalid.
*/
public ArrayList<OMRSAuditLogRecord> getAuditLogRecordsByComponent(String component,
Date startDate,
Date endDate,
int offset,
int maximumRecords) throws PropertyErrorException,
PagingErrorException
{
return null;
}
/**
* Free up any resources held since the connector is no longer needed.
*/
public void disconnect()
{
}
}
/*
* 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.omrs.auditlog.store.file;
import org.apache.atlas.omrs.auditlog.store.OMRSAuditLogStoreProviderBase;
/**
* FileBasedRegistryStoreProvider is the OCF connector provider for the file based cohort registry store.
*/
public class FileBasedAuditLogStoreProvider extends OMRSAuditLogStoreProviderBase
{
/**
* Constructor used to initialize the ConnectorProviderBase with the Java class name of the specific
* audit log store implementation.
*/
public FileBasedAuditLogStoreProvider()
{
Class connectorClass = FileBasedAuditLogStoreConnector.class;
super.setConnectorClassName(connectorClass.getName());
}
}
/*
* 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.omrs.enterprise.connectormanager;
import org.apache.atlas.ocf.ffdc.ConnectionCheckedException;
import org.apache.atlas.ocf.ffdc.ConnectorCheckedException;
import org.apache.atlas.ocf.properties.Connection;
/**
* OMRSConnectionConsumer provides the interfaces for a connection consumer. This is a component that needs to
* maintain a current list of connections to all of the repositories in the open metadata repository cohort.
*/
public interface OMRSConnectionConsumer
{
/**
* Pass details of the connection for one of the remote repositories registered in a connected
* open metadata repository cohort.
*
* @param cohortName - name of the cohort adding the remote connection.
* @param metadataCollectionId - Unique identifier for the metadata collection
* @param remoteConnection - Connection object providing properties necessary to create an
* OMRSRepositoryConnector for the remote repository.
* @throws ConnectionCheckedException - there are invalid properties in the Connection
* @throws ConnectorCheckedException - there is a problem initializing the Connector
*/
void addRemoteConnection(String cohortName,
String metadataCollectionId,
Connection remoteConnection) throws ConnectionCheckedException, ConnectorCheckedException;
/**
* Pass details of the connection for the repository that has left one of the open metadata repository cohorts.
*
* @param cohortName - name of the cohort removing the remote connection.
* @param metadataCollectionId - Unique identifier for the metadata collection.
*/
void removeRemoteConnection(String cohortName,
String metadataCollectionId);
/**
* Remove all of the remote connections for the requested open metadata repository cohort.
*
* @param cohortName - name of the cohort
*/
void removeCohort(String cohortName);
}
/*
* 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.omrs.enterprise.connectormanager;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnector;
/**
* OMRSConnectConsumer provides the interfaces for a connector consumer. This is a component that needs to
* maintain a current list of connectors to all of the remote repositories in the open metadata repository cohorts that
* the local server is a member of.
*/
public interface OMRSConnectorConsumer
{
/**
* Pass the connector for the local repository to the connector consumer.
*
* @param metadataCollectionId - Unique identifier for the metadata collection
* @param localConnector - OMRSRepositoryConnector object for the local repository.
*/
void setLocalConnector(String metadataCollectionId,
OMRSRepositoryConnector localConnector);
/**
* Pass the connector to one of the remote repositories in the metadata repository cohort.
*
* @param metadataCollectionId - Unique identifier for the metadata collection
* @param remoteConnector - OMRSRepositoryConnector object providing access to the remote repository.
*/
void addRemoteConnector(String metadataCollectionId,
OMRSRepositoryConnector remoteConnector);
/**
* Pass the metadata collection id for a repository that has just left the metadata repository cohort.
*
* @param metadataCollectionId - identifier of the metadata collection that is no longer available.
*/
void removeRemoteConnector(String metadataCollectionId);
/**
* Call disconnect on all registered connectors and stop calling them. The OMRS is about to shutdown.
*/
void disconnectAllConnectors();
}
/*
* 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.omrs.enterprise.connectormanager;
/**
* OMRSConnectorManager provides the methods for connector consumers to register with the connector manager.
*/
public interface OMRSConnectorManager
{
/**
* Register the supplied connector consumer with the connector manager. During the registration
* request, the connector manager will pass the connector to the local repository and
* the connectors to all currently registered remote repositories. Once successfully registered
* the connector manager will call the connector consumer each time the repositories in the
* metadata repository cluster changes.
*
* @param connectorConsumer OMRSConnectorConsumer interested in details of the connectors to
* all repositories registered in the metadata repository cluster.
* @return String identifier for the connectorConsumer - used for the unregister call.
*/
String registerConnectorConsumer(OMRSConnectorConsumer connectorConsumer);
/**
* Unregister a connector consumer from the connector manager so it is no longer informed of
* changes to the metadata repository cluster.
*
* @param connectorConsumerId String identifier of the connector consumer returned on the
* registerConnectorConsumer.
*/
void unregisterConnectorConsumer(String connectorConsumerId);
}
/*
* 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.omrs.enterprise.repositoryconnector;
import org.apache.atlas.ocf.properties.Connection;
import org.apache.atlas.ocf.properties.ConnectorType;
/**
* EnterpriseOMRSConnection provides a valid connection for the EnterpriseOMRSConnector.
*/
public class EnterpriseOMRSConnection extends Connection
{
final ConnectorType enterpriseConnectorType = new ConnectorType(null,
null,
null,
null,
null,
null,
null,
null,
null,
EnterpriseOMRSConnectorProvider.class.getName());
/**
* Default Constructor that sets up the connector
*/
public EnterpriseOMRSConnection()
{
super(null);
super.connectorType = enterpriseConnectorType;
}
}
/*
* 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.omrs.enterprise.repositoryconnector;
import org.apache.atlas.ocf.ffdc.PropertyServerException;
import org.apache.atlas.ocf.properties.ConnectedAssetProperties;
import org.apache.atlas.omrs.enterprise.connectormanager.OMRSConnectorManager;
/**
* EnterpriseOMRSConnectorProperties provides information about the connections and the metadata collections
* that the EnterpriseOMRSRepositoryConnector is retrieving information from.
*/
public class EnterpriseOMRSConnectorProperties extends ConnectedAssetProperties
{
public EnterpriseOMRSConnectorProperties(EnterpriseOMRSRepositoryConnector parentConnector,
OMRSConnectorManager connectorManager,
String enterpriseMetadataCollectionId,
String enterpriseMetadataCollectionName)
{
super();
// TODO not implemented yet
}
/**
* Request the values in the ConnectedAssetProperties are refreshed with the current values from the
* metadata repository. In the case of the
*
* @throws PropertyServerException - there is a problem connecting to the server to retrieve metadata.
*/
public void refresh() throws PropertyServerException
{
// TODO not implemented yet
}
}
/*
* 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.omrs.enterprise.repositoryconnector;
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.Connection;
import org.apache.atlas.omrs.enterprise.connectormanager.OMRSConnectorManager;
import org.apache.atlas.omrs.ffdc.OMRSErrorCode;
import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnectorProviderBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.UUID;
/**
* In the Open Connector Framework (OCF), a ConnectorProvider is a factory for a specific type of connector.
* The EnterpriseOMRSConnectorProvider is the connector provider for the EnterpriseOMRSRepositoryConnector.
*
* It will return new instances of the EnterpriseOMRSRepositoryConnector as long as it is configured with the connector
* manager. This should happen at server startup, which means the exception due to a lack of connector
* manager are unexpected.
*/
public class EnterpriseOMRSConnectorProvider extends OMRSRepositoryConnectorProviderBase
{
private final int hashCode = UUID.randomUUID().hashCode();
private static final Logger log = LoggerFactory.getLogger(EnterpriseOMRSConnectorProvider.class);
private static OMRSConnectorManager connectorManager = null;
private static String enterpriseMetadataCollectionId = null;
private static String enterpriseMetadataCollectionName = null;
/**
* Set up the connector manager. This call is used to control whether the EnterpriseOMRSConnectorProvider
* produces connectors or not. An EnterpriseOMRSRepositoryConnector needs the connector manager to maintain the
* list of connectors to the repositories in the cohort.
*
* @param connectorManager - manager of the list of connectors to remote repositories.
* @param enterpriseMetadataCollectionId - unique identifier for the combined metadata collection covered by the
* connected open metadata repositories.
* @param enterpriseMetadataCollectionName - name of the combined metadata collection covered by the connected open
* metadata repositories. Used for messages.
*/
public synchronized static void initialize(OMRSConnectorManager connectorManager,
String enterpriseMetadataCollectionId,
String enterpriseMetadataCollectionName)
{
EnterpriseOMRSConnectorProvider.connectorManager = connectorManager;
EnterpriseOMRSConnectorProvider.enterpriseMetadataCollectionId = enterpriseMetadataCollectionId;
EnterpriseOMRSConnectorProvider.enterpriseMetadataCollectionName = enterpriseMetadataCollectionName;
}
/**
* Typical constructor used with the connector broker. It sets up the class to use for the repository connector
* instance.
*/
public EnterpriseOMRSConnectorProvider()
{
super();
Class connectorClass = EnterpriseOMRSRepositoryConnector.class;
super.setConnectorClassName(connectorClass.getName());
}
/**
* Creates a new instance of an EnterpriseOMRSRepositoryConnector based on the information in the supplied connection.
*
* @param connection - connection that should have all of the properties needed by the Connector Provider
* to create a connector instance.
* @return Connector - instance of the connector.
* @throws ConnectionCheckedException - if there are missing or invalid properties in the connection
* @throws ConnectorCheckedException - if there are issues instantiating or initializing the connector
*/
public Connector getConnector(Connection connection) throws ConnectionCheckedException, ConnectorCheckedException
{
String methodName = "getConnector()";
if (log.isDebugEnabled())
{
log.debug(methodName + " called");
}
if (EnterpriseOMRSConnectorProvider.connectorManager == null)
{
/*
* If the cohort is not connected then throw an exception to indicate that the repositories are offline.
*/
OMRSErrorCode errorCode = OMRSErrorCode.COHORT_NOT_CONNECTED;
String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage();
throw new ConnectorCheckedException(errorCode.getHTTPErrorCode(),
this.getClass().getName(),
methodName,
errorMessage,
errorCode.getSystemAction(),
errorCode.getUserAction());
}
/*
* Create and initialize a new connector.
*/
EnterpriseOMRSRepositoryConnector connector = new EnterpriseOMRSRepositoryConnector(EnterpriseOMRSConnectorProvider.connectorManager,
enterpriseMetadataCollectionName);
connector.initialize(this.getNewConnectorGUID(), connection);
connector.setMetadataCollectionId(enterpriseMetadataCollectionId);
connector.initializeConnectedAssetProperties(new EnterpriseOMRSConnectorProperties(connector,
EnterpriseOMRSConnectorProvider.connectorManager,
enterpriseMetadataCollectionId,
enterpriseMetadataCollectionName));
if (log.isDebugEnabled())
{
log.debug(methodName + " returns: " + connector.getConnectorInstanceId() + ", " + connection.getConnectionName());
}
return connector;
}
/**
* Simple hashCode implementation
*
* @return hashCode
*/
public int hashCode()
{
return hashCode;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* 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.omrs.eventmanagement;
import org.apache.atlas.omrs.admin.properties.OpenMetadataExchangeRule;
import org.apache.atlas.omrs.metadatacollection.properties.instances.EntityDetail;
import org.apache.atlas.omrs.metadatacollection.properties.instances.Relationship;
import org.apache.atlas.omrs.metadatacollection.properties.typedefs.TypeDefSummary;
import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSTypeDefValidator;
import java.util.ArrayList;
/**
* OMRSRepositoryEventExchangeRule determines if particular types of events should be exchanged on the OMRS Topic.
*/
public class OMRSRepositoryEventExchangeRule
{
private String sourceName;
private OMRSTypeDefValidator typeDefValidator;
private OpenMetadataExchangeRule exchangeRule;
private ArrayList<TypeDefSummary> selectedTypesToProcess;
/**
* Constructor provides all of the objects used in the event exchange decision.
*
* @param sourceName - name of the caller
* @param typeDefValidator - local manager of the type definitions (TypeDefs) used by the local repository.
* @param exchangeRule - enum detailing the types of events to process.
* @param selectedTypesToProcess - supplementary list to support selective processing of events.
*/
public OMRSRepositoryEventExchangeRule(String sourceName,
OMRSTypeDefValidator typeDefValidator,
OpenMetadataExchangeRule exchangeRule,
ArrayList<TypeDefSummary> selectedTypesToProcess)
{
this.sourceName = sourceName;
this.typeDefValidator = typeDefValidator;
this.exchangeRule = exchangeRule;
this.selectedTypesToProcess = selectedTypesToProcess;
}
/**
* Determine if TypeDef events should be processed.
*
* @return boolean flag
*/
public boolean processTypeDefEvents()
{
if (exchangeRule != OpenMetadataExchangeRule.REGISTRATION_ONLY)
{
return true;
}
else
{
return false;
}
}
/**
* Determine from the type of the instance if an instance event should be processed.
*
* @param typeDefGUID - unique identifier of the type
* @param typeDefName - unique name of the type
* @return boolean flag
*/
public boolean processInstanceEvent(String typeDefGUID, String typeDefName)
{
if (typeDefValidator == null)
{
return false;
}
else
{
return typeDefValidator.isActiveType(sourceName, typeDefGUID, typeDefName);
}
}
/**
* Determine from the type of the instance if an instance event should be processed.
*
* @param typeDefSummary - details of the type
* @return boolean flag
*/
public boolean processInstanceEvent(TypeDefSummary typeDefSummary)
{
if (typeDefValidator == null)
{
return false;
}
if (typeDefSummary == null)
{
return false;
}
else
{
return typeDefValidator.isActiveType(sourceName, typeDefSummary.getGUID(), typeDefSummary.getName());
}
}
/**
* Determine from the type of the instance if an instance event should be processed.
*
* @param entity - details of the instance to test
* @return boolean flag
*/
public boolean processInstanceEvent(EntityDetail entity)
{
if (typeDefValidator == null)
{
return false;
}
else if (entity == null)
{
return false;
}
else
{
// TODO
return true;
}
}
/**
* Determine from the type of the instance if an instance event should be processed.
*
* @param relationship - details of the instance to test
* @return boolean flag
*/
public boolean processInstanceEvent(Relationship relationship)
{
if (typeDefValidator == null)
{
return false;
}
else if (relationship == null)
{
return false;
}
else
{
// TODO
return true;
}
}
}
/*
* 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.omrs.eventmanagement;
import org.apache.atlas.omrs.eventmanagement.events.OMRSInstanceEventProcessor;
import org.apache.atlas.omrs.eventmanagement.events.OMRSTypeDefEventProcessor;
/**
* OMRSRepositoryEventProcessor describes the interface of a component that can process both TypeDef and Instance
* events from an open metadata repository.
*/
public interface OMRSRepositoryEventProcessor extends OMRSTypeDefEventProcessor, OMRSInstanceEventProcessor
{
}
/*
* 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.omrs.eventmanagement.events;
/**
* OMRSEventCategory defines the different categories of events that pass through the OMRS Topic.
* <ul>
* <li>
* UNKNOWN - this is either an uninitialized event, or the incoming event is not supported by the
* local server.
* </li>
* <li>
* REGISTRY - this is an event used by the cohort registries to manage the membership
* of the cohort.
* </li>
* <li>
* TYPEDEF - this is an event used by the metadata repository connectors to synchronize the metadata types
* (stored in TypeDefs) across the metadata repository cohort.
* </li>
* </ul>
*/
public enum OMRSEventCategory
{
UNKNOWN (0, "Unknown Event", "Unknown event category"),
REGISTRY(1, "Registry Event", "Event used to manage the membership of the metadata repository cohort"),
TYPEDEF (2, "TypeDef Event", "Event used to manage the synchronization of TypeDefs within the metadata repository cohort"),
INSTANCE(3, "Instance Event", "Event used to manage the replication of metadata instances within the metadata repository cohort"),
GENERIC (99, "Generic Event", "Event used for sending generic messages - typically error messages.");
private int categoryCode;
private String categoryName;
private String categoryDescription;
/**
* Default constructor.
*
* @param categoryCode - int category code number
* @param categoryName - String category name
* @param categoryDescription - String category description
*/
OMRSEventCategory(int categoryCode,
String categoryName,
String categoryDescription)
{
this.categoryCode = categoryCode;
this.categoryName = categoryName;
this.categoryDescription = categoryDescription;
}
/**
* Return the code number for the event category.
*
* @return int code number
*/
public int getEventCategoryCode()
{
return categoryCode;
}
/**
* Return the name of the event category.
*
* @return String name
*/
public String getEventCategoryName()
{
return categoryName;
}
/**
* Return the default description of the event category. This description is in English and is a default
* value for the situation when the natural language resource bundle for Event Category is not available.
*
* @return String default description
*/
public String getEventCategoryDescription()
{
return categoryDescription;
}
}
/*
* 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.omrs.eventmanagement.events;
/**
* OMRSEventDirection defines the origin of an OMRSEvent. It is used primarily for logging and debug.
*/
public enum OMRSEventDirection
{
UNKNOWN (0, "<Unknown> ", "Uninitialized event direction"),
INBOUND (1, "Inbound Event ", "Event from a remote member of the open metadata repository cluster."),
OUTBOUND (2, "Outbound Event", "Event from local server to other members of the open metadata repository cluster.");
private int eventDirectionCode;
private String eventDirectionName;
private String eventDirectionDescription;
/**
* Default constructor - sets up the specific values for this enum instance.
*
* @param eventDirectionCode - int identifier for the enum, used for indexing arrays etc with the enum.
* @param eventDirectionName - String name for the enum, used for message content.
* @param eventDirectionDescription - String default description for the enum, used when there is not natural
* language resource bundle available.
*/
OMRSEventDirection(int eventDirectionCode, String eventDirectionName, String eventDirectionDescription)
{
this.eventDirectionCode = eventDirectionCode;
this.eventDirectionName = eventDirectionName;
this.eventDirectionDescription = eventDirectionDescription;
}
/**
* Return the identifier for the enum, used for indexing arrays etc with the enum.
*
* @return int identifier
*/
public int getEventDirectionCode()
{
return eventDirectionCode;
}
/**
* Return the name for the enum, used for message content.
*
* @return String name
*/
public String getEventDirectionName()
{
return eventDirectionName;
}
/**
* Return the default description for the enum, used when there is not natural
* language resource bundle available.
*
* @return String default description
*/
public String getEventDirectionDescription()
{
return eventDirectionDescription;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment