http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ConnectedAssetProperties.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ConnectedAssetProperties.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ConnectedAssetProperties.java deleted file mode 100644 index b9c8db1..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ConnectedAssetProperties.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - -import org.apache.atlas.ocf.ffdc.PropertyServerException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * ConnectedAssetProperties is associated with a Connector. Connectors provide access to - * assets. ConnectedAssetProperties returns properties (metadata) about the connector's asset. - * - * It is a generic interface for all types of open metadata assets. However, it assumes the asset's metadata model - * inherits from <b>Asset</b> (see model 0010 in Area 0). - * - * The ConnectedAssetProperties returns metadata about the asset at three levels of detail: - * <ul> - * <li><b>assetSummary</b> - used for displaying details of the asset in summary lists or hover text</li> - * <li><b>assetDetail</b> - used to display all of the information known about the asset with summaries - * of the relationships to other metadata entities</li> - * <li><b>assetUniverse</b> - used to define the broader context for the asset</li> - * </ul> - * - * ConnectedAssetProperties is a base class for the connector's metadata API that returns null, - * for the asset's properties. Metadata repository implementations extend this class to add their - * implementation of the refresh() method that calls to the metadata repository to populate the metadata properties. - */ -public abstract class ConnectedAssetProperties extends PropertyBase -{ - /* - * AssetUniverse extends AssetDetails which extends AssetSummary. The interaction with the metadata repository - * pulls the asset universe in one single network interaction and the caller can then explore the metadata - * property by property without incurring many network interactions (unless there are too many instances - * of a particular type of property and one of the iterators is forced to use paging). - * - * If null is returned, the connector is not linked to a metadata repository. - */ - protected AssetUniverse assetProperties = null; - - private static final Logger log = LoggerFactory.getLogger(ConnectedAssetProperties.class); - - /** - * Typical constructor. - */ - public ConnectedAssetProperties() - { - /* - * Nothing to do except initialize superclass. - */ - super(); - } - - - /** - * Copy/clone constructor. - * - * @param templateProperties - template to copy. - */ - public ConnectedAssetProperties(ConnectedAssetProperties templateProperties) - { - super(templateProperties); - - if (templateProperties != null) - { - AssetUniverse templateAssetUniverse = templateProperties.getAssetUniverse(); - if (templateAssetUniverse != null) - { - assetProperties = new AssetUniverse(templateAssetUniverse); - } - } - } - - - /** - * Returns the summary information organized in the assetSummary structure. - * - * @return AssetSummary - summary object - */ - public AssetSummary getAssetSummary() { return assetProperties; } - - - - /** - * Returns detailed information about the asset organized in the assetDetail structure. - * - * @return AssetDetail - detail object - */ - public AssetDetail getAssetDetail() { return assetProperties; } - - - /** - * Returns all of the detail of the asset and information connected to it in organized in the assetUniverse - * structure. - * - * @return AssetUniverse - universe object - */ - public AssetUniverse getAssetUniverse() { return assetProperties; } - - - /** - * Request the values in the ConnectedAssetProperties are refreshed with the current values from the - * metadata repository. - * - * @throws PropertyServerException - there is a problem connecting to the server to retrieve metadata. - */ - public abstract void refresh() throws PropertyServerException; - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ConnectedAssetProperties{" + - "assetProperties=" + assetProperties + - '}'; - } -} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Connection.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Connection.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Connection.java deleted file mode 100644 index d5ae7d1..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Connection.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - - -/** - * The connection is an object that contains the properties needed to create and initialise a connector to access a - * specific data assets. - * - * The properties for a connection are defined in model 0201. They include the following options for connector name: - * <ul> - * <li> - * guid - Globally unique identifier for the connection. - * </li> - * <li> - * url - URL of the connection definition in the metadata repository. - * This URL can be stored as a property in another entity to create an explicit link to this connection. - * </li> - * <li> - * qualifiedName - The official (unique) name for the connection. - * This is often defined by the IT systems management organization and should be used (when available) on - * audit logs and error messages. The qualifiedName is defined in the 0010 model as part of Referenceable. - * </li> - * <li> - * displayName - A consumable name for the connection. Often a shortened form of the qualifiedName for use - * on user interfaces and messages. The displayName should be only be used for audit logs and error messages - * if the qualifiedName is not set. - * </li> - * </ul> - * Either the guid, qualifiedName or displayName can be used to specify the name for a connection. - * - * Other properties for the connection include: - * - * <ul> - * <li> - * type - information about the TypeDef for Connection - * </li> - * <li> - * description - A full description of the connection covering details of the assets it connects to - * along with usage and versioning information. - * </li> - * <li> - * additionalProperties - Any additional properties associated with the connection. - * </li> - * <li> - * securedProperties - Protected properties for secure log on by connector to back end server. These - * are protected properties that can only be retrieved by privileged connector code. - * </li> - * <li> - * connectorType - Properties that describe the connector type for the connector. - * </li> - * <li> - * endpoint - Properties that describe the server endpoint where the connector will retrieve the assets. - * </li> - * </ul> - - * The connection class is simply used to cache the properties for an connection. - * It is used by other classes to exchange this information between a metadata repository and a consumer. - */ -public class Connection extends Referenceable -{ - /* - * Attributes of a connector - */ - 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. - */ - protected AdditionalProperties securedProperties = null; - - /** - * Typical Constructor - for constructing a new, independent populated Connection. - * - * @param type - details of the metadata type for this properties object - * @param guid - String - unique id - * @param url - String - URL - * @param classifications - enumeration of classifications - * @param qualifiedName - unique name - * @param additionalProperties - additional properties for the referenceable object. - * @param meanings - list of glossary terms (summary) - * @param displayName - consumable name - * @param description - stored description property for the connection. - * @param connectorType - connector type to copy - * @param endpoint - endpoint properties - * @param securedProperties - typically user credentials for the connection - */ - public Connection(ElementType type, - String guid, - String url, - Classifications classifications, - String qualifiedName, - AdditionalProperties additionalProperties, - Meanings meanings, - String displayName, - String description, - ConnectorType connectorType, - Endpoint endpoint, - AdditionalProperties securedProperties) - { - super(null, type, guid, url, classifications, qualifiedName, additionalProperties, meanings); - - this.displayName = displayName; - this.description = description; - this.connectorType = connectorType; - this.endpoint = endpoint; - this.securedProperties = securedProperties; - } - - - /** - * Typical Constructor - for constructing a new, populated Connection as part of connected asset properties. - * - * @param parentAsset - descriptor for parent asset - * @param type - details of the metadata type for this properties object - * @param guid - String - unique id - * @param url - String - URL - * @param classifications - enumeration of classifications - * @param qualifiedName - unique name - * @param additionalProperties - additional properties for the referenceable object - * @param meanings - list of glossary terms (summary) - * @param displayName - consumable name - * @param description - stored description property for the connection. - * @param connectorType - connector type to copy - * @param endpoint - endpoint properties - * @param securedProperties - typically user credentials for the connection - */ - public Connection(AssetDescriptor parentAsset, - ElementType type, - String guid, - String url, - Classifications classifications, - String qualifiedName, - AdditionalProperties additionalProperties, - Meanings meanings, - String displayName, - String description, - ConnectorType connectorType, - Endpoint endpoint, - AdditionalProperties securedProperties) - { - super(parentAsset, type, guid, url, classifications, qualifiedName, additionalProperties, meanings); - - this.displayName = displayName; - this.description = description; - this.connectorType = connectorType; - this.endpoint = endpoint; - this.securedProperties = securedProperties; - } - - - /** - * Copy/clone Constructor to return a copy of a connection object that is not connected to an asset. - * - * @param templateConnection - Connection to copy - */ - public Connection(Connection templateConnection) - { - /* - * Set parentAsset to null - */ - this(null, templateConnection); - } - - /** - * Copy/clone Constructor to return a copy of a connection object that is connected to an asset. - * - * @param parentAsset - description of the asset that this connection is attached to. - * @param templateConnection - template object to copy. - */ - public Connection(AssetDescriptor parentAsset, Connection templateConnection) - { - /* - * Save parentAsset - */ - super(parentAsset, templateConnection); - - /* - * Copy over properties from the template. - */ - if (templateConnection != null) - { - displayName = templateConnection.getDisplayName(); - description = templateConnection.getDescription(); - - ConnectorType templateConnectorType = templateConnection.getConnectorType(); - Endpoint templateEndpoint = templateConnection.getEndpoint(); - AdditionalProperties templateSecuredProperties = templateConnection.getSecuredProperties(); - - if (templateConnectorType != null) - { - connectorType = new ConnectorType(parentAsset, templateConnectorType); - } - if (templateEndpoint != null) - { - endpoint = new Endpoint(parentAsset, templateEndpoint); - } - if (templateSecuredProperties != null) - { - securedProperties = new AdditionalProperties(parentAsset, templateSecuredProperties); - } - } - } - - - /** - * Returns the stored display name property for the connection. - * Null means no displayName is available. - * - * @return displayName - */ - public String getDisplayName() { return displayName; } - - - /** - * Returns a formatted string with the connection name. It is used in formatting error messages for the - * exceptions thrown by consuming components. It is extremely cautious because most of the exceptions - * are reporting a malformed connection object so who knows what else is wrong with it. - * - * Within the connection are 2 possible properties that could - * contain the connection name: - * ** qualifiedName - this is a uniqueName and should be there - * ** displayName - shorter simpler name but may not be unique - so may not identify the connection in error - * - * This method inspects these properties and builds up a string to represent the connection name - * - * @return connection name - */ - public String getConnectionName() - { - String connectionName = "<Unknown>"; /* if all properties are blank */ - - /* - * The qualifiedName is preferred because it is unique. - */ - if (qualifiedName != null && (!qualifiedName.equals(""))) - { - /* - * Use qualified name. - */ - connectionName = qualifiedName; - } - else if (displayName != null && (!displayName.equals(""))) - { - /* - * The qualifiedName is not set but the displayName is available so use it. - */ - connectionName = displayName; - } - - return connectionName; - } - - - /** - * Returns the stored description property for the connection. - * If no description is provided then null is returned. - * - * @return description - */ - public String getDescription() - { - return description; - } - - - /** - * Returns a copy of the properties for this connection's connector type. - * A null means there is no connection type. - * - * @return connector type for the connection - */ - public ConnectorType getConnectorType() - { - if (connectorType == null) - { - return connectorType; - } - else - { - return new ConnectorType(super.getParentAsset(), connectorType); - } - } - - - /** - * Returns a copy of the properties for this connection's endpoint. - * Null means no endpoint information available. - * - * @return endpoint for the connection - */ - public Endpoint getEndpoint() - { - if (endpoint == null) - { - return endpoint; - } - else - { - return new Endpoint(super.getParentAsset(), endpoint); - } - } - - - /** - * 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 (securedProperties == null) - { - return securedProperties; - } - else - { - return new AdditionalProperties(super.getParentAsset(), securedProperties); - } - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "Connection{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", connectorType=" + connectorType + - ", endpoint=" + endpoint + - ", securedProperties=" + securedProperties + - ", qualifiedName='" + qualifiedName + '\'' + - ", additionalProperties=" + additionalProperties + - ", meanings=" + meanings + - ", type=" + type + - ", guid='" + guid + '\'' + - ", url='" + url + '\'' + - '}'; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Connections.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Connections.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Connections.java deleted file mode 100644 index 8cdb2e1..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Connections.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - -import java.util.Iterator; - -/** - * Connections supports an iterator over a list of connections. Callers can use it to step through the list - * just once. If they want to parse the list again, they could use the copy/clone constructor to create - * a new iterator. - */ -public abstract class Connections extends AssetPropertyIteratorBase implements Iterator<Connection> -{ - /** - * Typical Constructor creates an iterator with the supplied list of elements. - * - * @param parentAsset - descriptor of parent asset - * @param totalElementCount - the total number of elements to process. A negative value is converted to 0. - * @param maxCacheSize - maximum number of elements that should be retrieved from the property server and - * cached in the element list at any one time. If a number less than one is supplied, 1 is used. - */ - public Connections(AssetDescriptor parentAsset, - int totalElementCount, - int maxCacheSize) - { - super(parentAsset, totalElementCount, maxCacheSize); - } - - - /** - * Copy/clone constructor. Used to reset iterator element pointer to 0; - * - * @param parentAsset - descriptor of parent asset - * @param template - type-specific iterator to copy; null to create an empty iterator - */ - public Connections(AssetDescriptor parentAsset, Connections template) - { - super(parentAsset, template); - } - - - /** - * Provides a concrete implementation of cloneElement for the specific iterator type. - * - * @param parentAsset - descriptor of parent asset - * @param template - object to clone - * @return new cloned object. - */ - protected AssetPropertyBase cloneElement(AssetDescriptor parentAsset, AssetPropertyBase template) - { - return new Connection(parentAsset, (Connection)template); - } - - - /** - * Clones this iterator. - * - * @param parentAsset - descriptor of parent asset - * @return new cloned object. - */ - protected abstract Connections cloneIterator(AssetDescriptor parentAsset); - - - /** - * The iterator can only be used once to step through the elements. This method returns - * a boolean to indicate if it has got to the end of the list yet. - * - * @return boolean indicating whether there are more elements. - */ - @Override - public boolean hasNext() - { - return super.pagingIterator.hasNext(); - } - - - /** - * Return the next element in the iteration. - * - * @return Connection - next element object that has been cloned. - */ - @Override - public Connection next() - { - return (Connection)super.pagingIterator.next(); - } - - - /** - * Remove the current element in the iterator. (Null implementation since this iterator works off of cached - * elements from the property (metadata) server.) - */ - @Override - public void remove() - { - super.pagingIterator.remove(); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "Connections{" + - "pagingIterator=" + pagingIterator + - '}'; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ConnectorType.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ConnectorType.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ConnectorType.java deleted file mode 100644 index 889cefc..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ConnectorType.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - - -/** - * The ConnectorType describe the implementation details of a particular type of OCF connector. - * The properties for a connector type are defined in model 0201. - * They include: - * - * <ul> - * <li> - * guid - Globally unique identifier for the connector type. - * </li> - * <li> - * url - External link address for the connector type properties in the metadata repository. This URL can be - * stored as a property in another entity to create an explicit link to this connector type. - * </li> - * <li> - * qualifiedName - The official (unique) name for the connector type. This is often defined by the IT - * systems management organization and should be used (when available) on audit logs and error messages. - * </li> - * <li> - * displayName - A consumable name for the connector type. Often a shortened form of the qualifiedName for use - * on user interfaces and messages. The displayName should be only be used for audit logs and error messages - * if the qualifiedName is not set. - * </li> - * <li> - * description - A full description of the connector type covering details of the assets it connects to - * along with usage and versioning information. - * </li> - * <li> - * connectorProviderClassName - The connector provider is the factory for a particular type of connector. - * This property defines the class name for the connector provider that the Connector Broker should use to request - * new connector instances. - * </li> - * <li> - * additionalProperties - Any additional properties that the connector provider needs to know in order to - * create connector instances. - * </li> - * </ul> - * - * The connectorTypeProperties class is simply used to cache the properties for an connector type. - * It is used by other classes to exchange this information between a metadata repository and a consumer. - */ -public class ConnectorType extends Referenceable -{ - /* - * Attributes of a connector type - */ - protected String displayName = null; - protected String description = null; - protected String connectorProviderClassName = null; - - /** - * Typical Constructor - used when Connector Type is used inside a connection object which is itself - * not yet connected to an asset. In this case the ParentAsset is null. - * - * @param type - details of the metadata type for this properties object - * @param guid - String - unique id - * @param url - String - URL - * @param classifications - enumeration of classifications - * @param qualifiedName - unique name - * @param additionalProperties - additional properties for the referenceable object. - * @param meanings - list of glossary terms (summary) - * @param displayName - consumable name property stored for the connector type. - * @param description - description property stored for the connector type. - * @param connectorProviderClassName - class name (including package name) - */ - public ConnectorType(ElementType type, - String guid, - String url, - Classifications classifications, - String qualifiedName, - AdditionalProperties additionalProperties, - Meanings meanings, - String displayName, - String description, - String connectorProviderClassName) - { - super(null, type, guid, url, classifications, qualifiedName, additionalProperties, meanings); - - this.displayName = displayName; - this.description = description; - this.connectorProviderClassName = connectorProviderClassName; - } - - - /** - * Typical constructor for creating a connectorType linked to an asset. - * - * @param parentAsset - descriptor for parent asset - * @param type - details of the metadata type for this properties object - * @param guid - String - unique id - * @param url - String - URL - * @param classifications - enumeration of classifications - * @param qualifiedName - unique name - * @param additionalProperties - additional properties for the referenceable object. - * @param meanings - list of glossary terms (summary) - * @param displayName - consumable name property stored for the connector type. - * @param description - description property stored for the connector type. - * @param connectorProviderClassName - class name (including package name) - */ - public ConnectorType(AssetDescriptor parentAsset, ElementType type, String guid, String url, Classifications classifications, String qualifiedName, AdditionalProperties additionalProperties, Meanings meanings, String displayName, String description, String connectorProviderClassName) - { - super(parentAsset, type, guid, url, classifications, qualifiedName, additionalProperties, meanings); - - this.displayName = displayName; - this.description = description; - this.connectorProviderClassName = connectorProviderClassName; - } - - /** - * Copy/clone constructor for a connectorType that is not connected to an asset (either directly or indirectly). - * - * @param templateConnectorType - template object to copy. - */ - public ConnectorType(ConnectorType templateConnectorType) - { - this(null, templateConnectorType); - } - - - /** - * Copy/clone constructor for a connectorType that is connected to an asset (either directly or indirectly). - * - * @param parentAsset - description of the asset that this connector type is attached to. - * @param templateConnectorType - template object to copy. - */ - public ConnectorType(AssetDescriptor parentAsset, ConnectorType templateConnectorType) - { - /* - * Save parentAsset. - */ - super(parentAsset, templateConnectorType); - - /* - * All properties are initialised as null so only change their default setting if the template is - * not null - */ - if (templateConnectorType != null) - { - displayName = templateConnectorType.getDisplayName(); - description = templateConnectorType.getDescription(); - connectorProviderClassName = templateConnectorType.getConnectorProviderClassName(); - } - } - - - /** - * Returns the stored display name property for the connector type. - * If no display name is available then null is returned. - * - * @return displayName - */ - public String getDisplayName() - { - return displayName; - } - - - /** - * Returns the stored description property for the connector type. - * If no description is available then null is returned. - * - * @return description - */ - public String getDescription() - { - return description; - } - - - /** - * Returns the stored connectorProviderClassName property for the connector type. - * If no connectorProviderClassName is available then null is returned. - * - * @return connectorProviderClassName - class name (including package name) - */ - public String getConnectorProviderClassName() - { - return connectorProviderClassName; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ConnectorType{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", connectorProviderClassName='" + connectorProviderClassName + '\'' + - ", qualifiedName='" + qualifiedName + '\'' + - ", additionalProperties=" + additionalProperties + - ", meanings=" + meanings + - ", type=" + type + - ", guid='" + guid + '\'' + - ", url='" + url + '\'' + - '}'; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/DerivedSchemaElement.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/DerivedSchemaElement.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/DerivedSchemaElement.java deleted file mode 100644 index 29c8972..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/DerivedSchemaElement.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - - -/** - * Derived schema elements are used in views to define elements that are calculated using data from other sources. - * It contains a list of queries and a formula to combine the resulting values. - */ -public class DerivedSchemaElement extends PrimitiveSchemaElement -{ - private String formula = null; - private SchemaImplementationQueries queries = null; - - /** - * Typical constructor - * - * @param parentAsset - descriptor for parent asset - * @param type - details of the metadata type for this properties object - * @param guid - String - unique id - * @param url - String - URL - * @param classifications - enumeration of classifications - * @param qualifiedName - unique name - * @param additionalProperties - additional properties for the referenceable object. - * @param meanings - list of glossary terms (summary) - * @param versionNumber - the version number of the schema element - null means no version number. - * @param author - the name of the author of the schema element. Null means the author is unknown. - * @param usage - the usage guidance for this schema element. Null means no guidance available. - * @param encodingStandard - encoding standard used for this schema. It may be XML, JSON, SQL DDL or something else. - * Null means the encoding standard is unknown or there are many choices. - * @param dataType - the name of the data type for this element. Null means unknown data type. - * @param defaultValue - String containing default value for the element - * @param formula - the formula used to combine the values of the queries. Each query is numbers 0, 1, ... and the - * formula has placeholders in it to show how the query results are combined. - * @param queries - list of queries that are used to create the derived schema element. - */ - public DerivedSchemaElement(AssetDescriptor parentAsset, - ElementType type, - String guid, - String url, - Classifications classifications, - String qualifiedName, - AdditionalProperties additionalProperties, - Meanings meanings, - String versionNumber, - String author, - String usage, - String encodingStandard, - String dataType, - String defaultValue, - String formula, - SchemaImplementationQueries queries) - { - super(parentAsset, - type, - guid, - url, - classifications, - qualifiedName, - additionalProperties, - meanings, - versionNumber, - author, - usage, - encodingStandard, - dataType, - defaultValue); - - this.formula = formula; - this.queries = queries; - } - - /** - * Copy/clone Constructor - the parentAsset is passed separately to the template because it is also - * likely to be being cloned in the same operation and we want the definitions clone to point to the - * asset clone and not the original asset. - * - * @param parentAsset - description of the asset that this schema element is attached to. - * @param templateSchemaElement - template object to copy. - */ - public DerivedSchemaElement(AssetDescriptor parentAsset, DerivedSchemaElement templateSchemaElement) - { - super(parentAsset, templateSchemaElement); - - if (templateSchemaElement != null) - { - SchemaImplementationQueries templateQueries = templateSchemaElement.getQueries(); - - formula = templateSchemaElement.getFormula(); - queries = templateQueries.cloneIterator(super.getParentAsset()); - } - } - - - /** - * Return the formula used to combine the values of the queries. Each query is numbers 0, 1, ... and the - * formula has placeholders in it to show how the query results are combined. - * - * @return String formula - */ - public String getFormula() { return formula; } - - - /** - * Return the list of queries that are used to create the derived schema element. - * - * @return SchemaImplementationQueries - list of queries - */ - public SchemaImplementationQueries getQueries() - { - if (queries == null) - { - return queries; - } - else - { - return queries.cloneIterator(super.getParentAsset()); - } - } - - - /** - * Returns a clone of this object as the abstract SchemaElement class. - * - * @param parentAsset - description of the asset that this schema element is attached to. - * @return PrimitiveSchemaElement object - */ - @Override - public SchemaElement cloneSchemaElement(AssetDescriptor parentAsset) - { - return new DerivedSchemaElement(parentAsset, this); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "DerivedSchemaElement{" + - "formula='" + formula + '\'' + - ", queries=" + queries + - ", qualifiedName='" + qualifiedName + '\'' + - ", additionalProperties=" + additionalProperties + - ", meanings=" + meanings + - ", type=" + type + - ", guid='" + guid + '\'' + - ", url='" + url + '\'' + - '}'; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementHeader.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementHeader.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementHeader.java deleted file mode 100644 index fea85c5..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementHeader.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - -/** - * ElementHeader provides the common identifier and type information for all properties objects - * that link off of the asset and have a guid associated with them. This typically means it is - * represented by an entity in the metadata repository. - */ -public abstract class ElementHeader extends AssetPropertyBase -{ - /* - * Common header for first class elements from a metadata repository - */ - protected ElementType type = null; - protected String guid = null; - protected String url = null; - - /* - * Attached classifications - */ - protected Classifications classifications = null; - - - /** - * Typical Constructor - * - * @param parentAsset - descriptor for parent asset - * @param type - details of the metadata type for this properties object - * @param guid - String - unique id - * @param url - String - URL - * @param classifications - enumeration of classifications - */ - public ElementHeader(AssetDescriptor parentAsset, - ElementType type, - String guid, - String url, - Classifications classifications) - { - super(parentAsset); - - this.type = type; - this.guid = guid; - this.url = url; - this.classifications = classifications; - } - - - /** - * Copy/clone constructor. - * - * @param parentAsset - descriptor for parent asset - * @param templateHeader - element to copy - */ - public ElementHeader(AssetDescriptor parentAsset, ElementHeader templateHeader) - { - /* - * Save the parent asset description. - */ - super(parentAsset, templateHeader); - - if (templateHeader != null) - { - /* - * Copy the values from the supplied parameters. - */ - type = templateHeader.getType(); - guid = templateHeader.getGUID(); - url = templateHeader.getURL(); - - Classifications templateClassifications = templateHeader.getClassifications(); - if (templateClassifications != null) - { - classifications = templateClassifications.cloneIterator(parentAsset); - } - } - } - - - /** - * Return the element type properties for this properties object. These values are set up by the metadata repository - * and define details to the metadata entity used to represent this element. - * - * @return ElementType - type information. - */ - public ElementType getType() { - return type; - } - - - /** - * Return the unique id for the properties object. Null means no guid is assigned. - * - * @return String - unique id - */ - public String getGUID() { - return guid; - } - - - /** - * Returns the URL to access the properties object in the metadata repository. - * If no url is available then null is returned. - * - * @return String - URL - */ - public String getURL() { - return url; - } - - - /** - * Return the list of classifications associated with the asset. This is an enumeration and the - * pointers are set to the start of the list of classifications - * - * @return Classifications - enumeration of classifications - */ - public Classifications getClassifications() - { - if (classifications == null) - { - return classifications; - } - else - { - return classifications.cloneIterator(super.getParentAsset()); - } - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ElementHeader{" + - "type=" + type + - ", guid='" + guid + '\'' + - ", url='" + url + '\'' + - ", classifications=" + classifications + - '}'; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementOrigin.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementOrigin.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementOrigin.java deleted file mode 100644 index dac4e6e..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementOrigin.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.io.Serializable; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * ElementOrigin defines where the metadata comes from and, hence if it can be updated. - * <ul> - * <li> - * LOCAL_COHORT - the element is being maintained within the local cohort. - * The metadata collection id is for one of the repositories in the cohort. - * This metadata collection id identifies the home repository for this element. - * </li> - * <li> - * EXPORT_ARCHIVE - the element was created from an export archive. - * The metadata collection id for the element is the metadata collection id of the originating server. - * If the originating server later joins the cohort with the same metadata collection id then these - * elements will be refreshed from the originating serverâs current repository. - * </li> - * <li> - * CONTENT_PACK - the element comes from an open metadata content pack. - * The metadata collection id of the elements is set to the GUID of the pack. - * </li> - * <li> - * DEREGISTERED_REPOSITORY - the element comes from a metadata repository that used to be a part - * of the repository cohort but has been deregistered. The metadata collection id remains the same. - * If the repository rejoins the cohort then these elements can be refreshed from the rejoining repository. - * </li> - * </ul> - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public enum ElementOrigin implements Serializable -{ - LOCAL_COHORT(0, "Local to cohort", "The element is being maintained within one of the local cohort members. " + - "The metadata collection id is for one of the repositories in the cohort. " + - "This metadata collection id identifies the home repository for this element. "), - EXPORT_ARCHIVE(1, "Export Archive", "The element was created from an export archive. " + - "The metadata collection id for the element is the metadata collection id of the originating server. " + - "If the originating server later joins the cohort with the same metadata collection Id " + - "then these elements will be refreshed from the originating serverâs current repository."), - CONTENT_PACK(2, "Content Pack", "The element comes from an open metadata content pack. " + - "The metadata collection id of the elements is set to the GUID of the pack."), - DEREGISTERED_REPOSITORY(3, "Deregistered Repository", "The element comes from a metadata repository that " + - "used to be a member of the one of the local repository's cohorts but it has been deregistered. " + - "The metadata collection id remains the same. If the repository rejoins the cohort " + - "then these elements can be refreshed from the rejoining repository."), - CONFIGURATION(4, "Configuration", - "The element is part of a service's configuration. The metadata collection id is null."); - - private static final long serialVersionUID = 1L; - - private int originCode; - private String originName; - private String originDescription; - - - /** - * Constructor for the enum. - * - * @param originCode - code number for origin - * @param originName - name for origin - * @param originDescription - description for origin - */ - ElementOrigin(int originCode, String originName, String originDescription) - { - this.originCode = originCode; - this.originName = originName; - this.originDescription = originDescription; - } - - - /** - * Return the code for metadata element. - * - * @return int code for the origin - */ - public int getOriginCode() - { - return originCode; - } - - - /** - * Return the name of the metadata element origin. - * - * @return String name - */ - public String getOriginName() - { - return originName; - } - - - /** - * Return the description of the metadata element origin. - * - * @return String description - */ - public String getOriginDescription() - { - return originDescription; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ElementOrigin{" + - "originCode=" + originCode + - ", originName='" + originName + '\'' + - ", originDescription='" + originDescription + '\'' + - '}'; - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java deleted file mode 100644 index 5c84894..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/ElementType.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - - -/** - * The ElementType provide details of the type information associated with the element. Most consumers - * of the properties do not need this information. It is provided to asset consumers primarily as diagnostic - * information. - */ -public class ElementType extends PropertyBase -{ - protected String elementTypeId = null; - protected String elementTypeName = null; - protected long elementTypeVersion = 0; - protected String elementTypeDescription = null; - protected String elementSourceServer = null; - protected ElementOrigin elementOrigin = null; - protected String elementHomeMetadataCollectionId = null; - - - /** - * Typical Constructor - * - * @param elementTypeId - identifier for the element's type - * @param elementTypeName - element type name - * @param elementTypeVersion - version number for the element type - * @param elementTypeDescription - description of element type - * @param elementSourceServer - url of the OMAS server - * @param elementOrigin - enum describing type of origin - * @param elementHomeMetadataCollectionId - metadata collection id - */ - public ElementType(String elementTypeId, - String elementTypeName, - long elementTypeVersion, - String elementTypeDescription, - String elementSourceServer, - ElementOrigin elementOrigin, - String elementHomeMetadataCollectionId) - { - super(); - - this.elementTypeId = elementTypeId; - this.elementTypeName = elementTypeName; - this.elementTypeVersion = elementTypeVersion; - this.elementTypeDescription = elementTypeDescription; - this.elementSourceServer = elementSourceServer; - this.elementOrigin = elementOrigin; - this.elementHomeMetadataCollectionId = elementHomeMetadataCollectionId; - } - - - /** - * Copy/clone constructor - * - * @param templateType - type to clone - */ - public ElementType(ElementType templateType) - { - super(templateType); - - if (templateType != null) - { - /* - * Copy the properties from the supplied template - */ - this.elementTypeId = templateType.getElementTypeId(); - this.elementTypeName = templateType.getElementTypeName(); - this.elementTypeVersion = templateType.getElementTypeVersion(); - this.elementTypeDescription = templateType.getElementTypeDescription(); - this.elementSourceServer = templateType.getElementSourceServer(); - this.elementOrigin = templateType.getElementOrigin(); - this.elementHomeMetadataCollectionId = templateType.getElementHomeMetadataCollectionId(); - } - } - - - /** - * Return unique identifier for the element's type. - * - * @return element type id - */ - public String getElementTypeId() - { - return elementTypeId; - } - - - /** - * Return name of element's type. - * - * @return - elementTypeName - */ - public String getElementTypeName() - { - return elementTypeName; - } - - - /** - * Return the version number for this element's type. - * - * @return elementTypeVersion - version number for the element type. - */ - public long getElementTypeVersion() - { - return elementTypeVersion; - } - - - /** - * Return the description for this element's type. - * - * @return elementTypeDescription - String description for the element type - */ - public String getElementTypeDescription() - { - return elementTypeDescription; - } - - - /** - * Return the URL of the server where the element was retrieved from. Typically this is - * a server where the OMAS interfaces are activated. If no URL is known for the server then null is returned. - * - * @return elementSourceServerURL - the url of the server where the element came from - */ - public String getElementSourceServer() - { - return elementSourceServer; - } - - - /** - * Return the origin of the metadata element. - * - * @return ElementOrigin enum - */ - public ElementOrigin getElementOrigin() { return elementOrigin; } - - - /** - * Returns the OMRS identifier for the metadata collection that is managed by the repository - * where the element originates (its home repository). - * - * @return String metadata collection id - */ - public String getElementHomeMetadataCollectionId() - { - return elementHomeMetadataCollectionId; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ElementType{" + - "elementTypeId='" + elementTypeId + '\'' + - ", elementTypeName='" + elementTypeName + '\'' + - ", elementTypeVersion=" + elementTypeVersion + - ", elementTypeDescription='" + elementTypeDescription + '\'' + - ", elementSourceServer='" + elementSourceServer + '\'' + - ", elementOrigin=" + elementOrigin + - ", elementHomeMetadataCollectionId='" + elementHomeMetadataCollectionId + '\'' + - '}'; - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/EmbeddedConnection.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/EmbeddedConnection.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/EmbeddedConnection.java deleted file mode 100644 index 5278f95..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/EmbeddedConnection.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.atlas.ocf.properties; - - -/** - * The EmbeddedConnection is used within a VirtualConnection. It contains a connection and additional properties - * the VirtualConnection uses when working with the EmbeddedConnection. - */ -public class EmbeddedConnection extends AssetPropertyBase -{ - /* - * Attributes of an embedded connection - */ - private AdditionalProperties embeddedConnectionProperties = null; - private Connection embeddedConnection = null; - - - /** - * Typical Constructor - * - * @param parentAsset - descriptor for parent asset - * @param embeddedConnectionProperties - Additional properties - * @param embeddedConnection - Connection - */ - public EmbeddedConnection(AssetDescriptor parentAsset, - AdditionalProperties embeddedConnectionProperties, - Connection embeddedConnection) - { - super(parentAsset); - - this.embeddedConnectionProperties = embeddedConnectionProperties; - this.embeddedConnection = embeddedConnection; - } - - /** - * Copy/clone constructor. - * - * @param parentAsset - descriptor for parent asset - * @param templateEmbeddedConnection - element to copy - */ - public EmbeddedConnection(AssetDescriptor parentAsset, EmbeddedConnection templateEmbeddedConnection) - { - /* - * Save the parent asset description. - */ - super(parentAsset, templateEmbeddedConnection); - - if (templateEmbeddedConnection != null) - { - AdditionalProperties templateConnectionProperties = templateEmbeddedConnection.getEmbeddedConnectionProperties(); - Connection templateConnection = templateEmbeddedConnection.getEmbeddedConnection(); - - if (templateConnectionProperties != null) - { - embeddedConnectionProperties = new AdditionalProperties(parentAsset, templateConnectionProperties); - } - if (templateConnection != null) - { - embeddedConnection = new Connection(parentAsset, templateConnection); - } - } - } - - - /** - * Return the properties for the embedded connection. - * - * @return AdditionalProperties - */ - public AdditionalProperties getEmbeddedConnectionProperties() - { - if (embeddedConnectionProperties == null) - { - return embeddedConnectionProperties; - } - else - { - return new AdditionalProperties(this.getParentAsset(), embeddedConnectionProperties); - } - } - - - /** - * Return the embedded connection. - * - * @return Connection object. - */ - public Connection getEmbeddedConnection() - { - if (embeddedConnection == null) - { - return embeddedConnection; - } - else - { - return new Connection(this.getParentAsset(), embeddedConnection); - } - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "EmbeddedConnection{" + - "embeddedConnectionProperties=" + embeddedConnectionProperties + - ", embeddedConnection=" + embeddedConnection + - '}'; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/EmbeddedConnections.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/EmbeddedConnections.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/EmbeddedConnections.java deleted file mode 100644 index c2e22c1..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/EmbeddedConnections.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - -import java.util.Iterator; - -/** - * EmbeddedConnections supports an iterator over a list of connections that are embedded in a virtual connection. - * Callers can use it to step through the list just once. If they want to parse the list again, - * they could use the copy/clone constructor to create a new iterator. - */ -public abstract class EmbeddedConnections extends AssetPropertyIteratorBase implements Iterator<EmbeddedConnection> -{ - /** - * Typical Constructor creates an iterator with the supplied list of elements. - * - * @param parentAsset - descriptor of parent asset - * @param totalElementCount - the total number of elements to process. A negative value is converted to 0. - * @param maxCacheSize - maximum number of elements that should be retrieved from the property server and - * cached in the element list at any one time. If a number less than one is supplied, 1 is used. - */ - public EmbeddedConnections(AssetDescriptor parentAsset, - int totalElementCount, - int maxCacheSize) - { - super(parentAsset, totalElementCount, maxCacheSize); - } - - - /** - * Copy/clone constructor. Used to reset iterator element pointer to 0; - * - * @param parentAsset - descriptor of parent asset - * @param template - type-specific iterator to copy; null to create an empty iterator - */ - public EmbeddedConnections(AssetDescriptor parentAsset, EmbeddedConnections template) - { - super(parentAsset, template); - } - - - /** - * Provides a concrete implementation of cloneElement for the specific iterator type. - * - * @param parentAsset - descriptor of parent asset - * @param template - object to clone - * @return new cloned object. - */ - protected AssetPropertyBase cloneElement(AssetDescriptor parentAsset, AssetPropertyBase template) - { - return new EmbeddedConnection(parentAsset, (EmbeddedConnection)template); - } - - - /** - * Clones this iterator. - * - * @param parentAsset - descriptor of parent asset - * @return new cloned object. - */ - protected abstract EmbeddedConnections cloneIterator(AssetDescriptor parentAsset); - - - /** - * The iterator can only be used once to step through the elements. This method returns - * a boolean to indicate if it has got to the end of the list yet. - * - * @return boolean indicating whether there are more elements. - */ - @Override - public boolean hasNext() - { - return super.pagingIterator.hasNext(); - } - - - /** - * Return the next element in the iteration. - * - * @return EmbeddedConnection - next element object that has been cloned. - */ - @Override - public EmbeddedConnection next() - { - return (EmbeddedConnection)super.pagingIterator.next(); - } - - - /** - * Remove the current element in the iterator. (Null implementation since this iterator works off of cached - * elements from the property (metadata) server.) - */ - @Override - public void remove() - { - super.pagingIterator.remove(); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "EmbeddedConnections{" + - "pagingIterator=" + pagingIterator + - '}'; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/b0ecc36a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Endpoint.java ---------------------------------------------------------------------- diff --git a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Endpoint.java b/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Endpoint.java deleted file mode 100644 index b83f22a..0000000 --- a/om-fwk-ocf/src/main/java/org/apache/atlas/ocf/properties/Endpoint.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.ocf.properties; - - -/** - * The Endpoint describes the network information necessary for a connector to connect to the server - * where the Asset is accessible from. The properties for an endpoint are defined in model 0040. - * They include: - * <ul> - * <li> - * type - definition of the specific metadata type for the endpoint. - * </li> - * <li> - * guid - Globally unique identifier for the endpoint. - * </li> - * <li> - * url - External link address for the endpoint properties in the metadata repository. - * This URL can be stored as a property in another entity to create an explicit link to this endpoint. - * </li> - * <li> - * qualifiedName - The official (unique) name for the endpoint. This is often defined by the IT systems management - * organization and should be used (when available) on audit logs and error messages. - * </li> - * <li> - * displayName - A consumable name for the endpoint. Often a shortened form of the qualifiedName for use - * on user interfaces and messages. The displayName should be only be used for audit logs and error messages - * if the qualifiedName is not set. - * </li> - * <li> - * description - A description for the endpoint. - * </li> - * <li> - * address - The location of the asset. For network connected resources, this is typically the - * URL and port number (if needed) for the server where the asset is located - * (or at least accessible by the connector). For file-based resources, this is typically the name of the file. - * </li> - * <li> - * protocol - The communication protocol that the connection should use to connect to the server. - * </li> - * <li> - * encryptionMethod - Describes the encryption method to use (if any). This is an open value allowing - * information needed by the connector user to retrieve all of the information they need to work with - * the endpoint. - * </li> - * <li> - * additionalProperties - Any additional properties that the connector need to know in order to - * access the Asset. - * </li> - * </ul> - * - * The Endpoint class is simply used to cache the properties for an endpoint. - * It is used by other classes to exchange this information between a metadata repository and a consumer. - */ -public class Endpoint extends Referenceable -{ - /* - * Properties of an Endpoint - */ - protected String displayName = null; - protected String description = null; - protected String address = null; - protected String protocol = null; - protected String encryptionMethod = null; - - /** - * Admin Constructor - used when Endpoint is inside a Connection that is not part of the connected asset - * properties. In this case there is no parent asset. - * - * @param type - details of the metadata type for this properties object - * @param guid - String - unique id - * @param url - String - URL - * @param classifications - enumeration of classifications - * @param qualifiedName - unique name - * @param additionalProperties - additional properties for the referenceable object. - * @param meanings - list of glossary terms (summary) - * @param displayName - simple name for the endpoint - * @param description - String description for the endpoint - * @param address - network url for the server/resource - * @param protocol - endpoint protocol - * @param encryptionMethod - encryption mechanism in use by the endpoint - */ - public Endpoint(ElementType type, - String guid, - String url, - Classifications classifications, - String qualifiedName, - AdditionalProperties additionalProperties, - Meanings meanings, - String displayName, - String description, - String address, - String protocol, - String encryptionMethod) - { - this(null, - type, - guid, - url, - classifications, - qualifiedName, - additionalProperties, - meanings, - displayName, - description, - address, - protocol, - encryptionMethod); - } - - - /** - * Typical Constructor for a new endpoint that is connected to an asset (either directly or indirectly.) - * - * @param parentAsset - descriptor for parent asset - * @param type - details of the metadata type for this properties object - * @param guid - String - unique id - * @param url - String - URL - * @param classifications - enumeration of classifications - * @param qualifiedName - unique name - * @param additionalProperties - additional properties for the referenceable object. - * @param meanings - list of glossary terms (summary) - * @param displayName - simple name for the endpoint - * @param description - String description for the endpoint - * @param address - network url for the server/resource - * @param protocol - endpoint protocol - * @param encryptionMethod - encryption mechanism in use by the endpoint - */ - public Endpoint(AssetDescriptor parentAsset, - ElementType type, - String guid, - String url, - Classifications classifications, - String qualifiedName, - AdditionalProperties additionalProperties, - Meanings meanings, - String displayName, - String description, - String address, - String protocol, - String encryptionMethod) - { - super(parentAsset, type, guid, url, classifications, qualifiedName, additionalProperties, meanings); - - this.displayName = displayName; - this.description = description; - this.address = address; - this.protocol = protocol; - this.encryptionMethod = encryptionMethod; - } - - - /** - * Copy/clone constructor for an Endpoint not connected to an asset. - * - * @param templateEndpoint - template object to copy. - */ - public Endpoint(Endpoint templateEndpoint) - { - this(null, templateEndpoint); - } - - - /** - * Copy/clone constructor for an Endpoint that is connected to an Asset (either directly or indirectly). - * - * @param parentAsset - description of the asset that this endpoint is attached to. - * @param templateEndpoint - template object to copy. - */ - public Endpoint(AssetDescriptor parentAsset, Endpoint templateEndpoint) - { - /* - * Save the parent asset description. - */ - super(parentAsset, templateEndpoint); - - /* - * All properties are initialised as null so only change their default setting if the template is - * not null - */ - if (templateEndpoint != null) - { - displayName = templateEndpoint.getDisplayName(); - address = templateEndpoint.getAddress(); - protocol = templateEndpoint.getProtocol(); - encryptionMethod = templateEndpoint.getEncryptionMethod(); - - AdditionalProperties templateAdditionalProperties = templateEndpoint.getAdditionalProperties(); - - if (templateAdditionalProperties != null) - { - additionalProperties = new AdditionalProperties(parentAsset, templateAdditionalProperties); - } - } - } - - - /** - * Returns the stored display name property for the endpoint. - * If no display name is available then null is returned. - * - * @return displayName - */ - public String getDisplayName() - { - return displayName; - } - - - /** - * Return the description for the endpoint. - * - * @return String description - */ - public String getDescription() - { - return description; - } - - - /** - * Returns the stored address property for the endpoint. - * If no network address is available then null is returned. - * - * @return address - */ - public String getAddress() - { - return address; - } - - - /** - * Returns the stored protocol property for the endpoint. - * If no protocol is available then null is returned. - * - * @return protocol - */ - public String getProtocol() - { - return protocol; - } - - - /** - * Returns the stored encryptionMethod property for the endpoint. This is an open type allowing the information - * needed to work with a specific encryption mechanism used by the endpoint to be defined. - * If no encryptionMethod property is available (typically because this is an unencrypted endpoint) - * then null is returned. - * - * @return encryption method information - */ - public String getEncryptionMethod() - { - return encryptionMethod; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "Endpoint{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", address='" + address + '\'' + - ", protocol='" + protocol + '\'' + - ", encryptionMethod='" + encryptionMethod + '\'' + - ", qualifiedName='" + qualifiedName + '\'' + - ", additionalProperties=" + additionalProperties + - ", meanings=" + meanings + - ", type=" + type + - ", guid='" + guid + '\'' + - ", url='" + url + '\'' + - '}'; - } -} \ No newline at end of file