http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefHelper.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefHelper.java b/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefHelper.java deleted file mode 100644 index ed2ed81..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefHelper.java +++ /dev/null @@ -1,155 +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.omrs.localrepository.repositorycontentmanager; - -import org.apache.atlas.omrs.ffdc.exception.TypeErrorException; -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.TypeDefGallery; - - -/** - * OMRSTypeDefHelper provides methods for manipulating TypeDefs and creating metadata instances with the correct TypeDef - * headers - */ -public interface OMRSTypeDefHelper -{ - /** - * Return the list of typedefs active in the local repository. - * - * @return TypeDef gallery - */ - TypeDefGallery getActiveTypeDefGallery(); - - - /** - * Return the list of typedefs known by the local repository. - * - * @return TypeDef gallery - */ - TypeDefGallery getKnownTypeDefGallery(); - - - /** - * Return the TypeDef identified by the name supplied by the caller. This is used in the connectors when - * validating the actual types of the repository with the known open metadata types - looking specifically - * for types of the same name but with different content. - * - * @param sourceName - source of the request (used for logging) - * @param typeDefName - unique name for the TypeDef - * @return TypeDef object or null if TypeDef is not known. - */ - TypeDef getTypeDefByName (String sourceName, - String typeDefName); - - - /** - * Return the AttributeTypeDef identified by the name supplied by the caller. This is used in the connectors when - * validating the actual types of the repository with the known open metadata types - looking specifically - * for types of the same name but with different content. - * - * @param sourceName - source of the request (used for logging) - * @param attributeTypeDefName - unique name for the TypeDef - * @return AttributeTypeDef object or null if AttributeTypeDef is not known. - */ - AttributeTypeDef getAttributeTypeDefByName (String sourceName, - String attributeTypeDefName); - - - /** - * Return the TypeDefs identified by the name supplied by the caller. The TypeDef name may have wild - * card characters in it which is why the results are returned in a list. - * - * @param sourceName - source of the request (used for logging) - * @param typeDefName - unique name for the TypeDef - * @return TypeDef object or null if TypeDef is not known. - */ - TypeDefGallery getActiveTypesByWildCardName (String sourceName, - String typeDefName); - - - /** - * Return the TypeDef identified by the guid supplied by the caller. This call is used when - * retrieving a type that only the guid is known. - * - * @param sourceName - source of the request (used for logging) - * @param parameterName - name of parameter - * @param typeDefGUID - unique identifier for the TypeDef - * @param methodName - calling method - * @return TypeDef object - * @throws TypeErrorException - unknown or invalid type - */ - TypeDef getTypeDef (String sourceName, - String parameterName, - String typeDefGUID, - String methodName) throws TypeErrorException; - - - /** - * Return the AttributeTypeDef identified by the guid and name supplied by the caller. This call is used when - * retrieving a type that only the guid is known. - * - * @param sourceName - source of the request (used for logging) - * @param attributeTypeDefGUID - unique identifier for the AttributeTypeDef - * @return TypeDef object - * @throws TypeErrorException - unknown or invalid type - */ - AttributeTypeDef getAttributeTypeDef (String sourceName, - String attributeTypeDefGUID, - String methodName) throws TypeErrorException; - - - - /** - * Return the TypeDef identified by the guid and name supplied by the caller. This call is used when - * retrieving a type that should exist. For example, retrieving the type of a metadata instance. - * - * @param sourceName - source of the request (used for logging) - * @param guidParameterName - name of guid parameter - * @param nameParameterName - name of name parameter - * @param typeDefGUID - unique identifier for the TypeDef - * @param typeDefName - unique name for the TypeDef - * @param methodName - calling method - * @return TypeDef object - * @throws TypeErrorException - unknown or invalid type - */ - TypeDef getTypeDef (String sourceName, - String guidParameterName, - String nameParameterName, - String typeDefGUID, - String typeDefName, - String methodName) throws TypeErrorException; - - - /** - * Return the AttributeTypeDef identified by the guid and name supplied by the caller. This call is used when - * retrieving a type that should exist. For example, retrieving the type definition of a metadata instance's - * property. - * - * @param sourceName - source of the request (used for logging) - * @param attributeTypeDefGUID - unique identifier for the AttributeTypeDef - * @param attributeTypeDefName - unique name for the AttributeTypeDef - * @param methodName - calling method - * @return TypeDef object - * @throws TypeErrorException - unknown or invalid type - */ - AttributeTypeDef getAttributeTypeDef (String sourceName, - String attributeTypeDefGUID, - String attributeTypeDefName, - String methodName) throws TypeErrorException; -}
http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefManager.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefManager.java b/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefManager.java deleted file mode 100644 index c4f125a..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefManager.java +++ /dev/null @@ -1,196 +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.omrs.localrepository.repositorycontentmanager; - -import org.apache.atlas.omrs.ffdc.exception.TypeErrorException; -import org.apache.atlas.omrs.metadatacollection.properties.instances.InstanceStatus; -import org.apache.atlas.omrs.metadatacollection.properties.instances.InstanceType; -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.TypeDefCategory; - - -/** - * OMRSTypeDefManager provides maintenance methods for managing the TypeDefs in the local cache. - */ -public interface OMRSTypeDefManager -{ - /** - * Cache a definition of a new TypeDef. - * - * @param sourceName - source of the request (used for logging) - * @param newTypeDef - TypeDef structure describing the new TypeDef. - */ - void addTypeDef(String sourceName, TypeDef newTypeDef); - - - /** - * Cache a definition of a new AttributeTypeDef. - * - * @param sourceName - source of the request (used for logging) - * @param newAttributeTypeDef - AttributeTypeDef structure describing the new TypeDef. - */ - void addAttributeTypeDef(String sourceName, AttributeTypeDef newAttributeTypeDef); - - - /** - * Update one or more properties of a cached TypeDef. - * - * @param sourceName - source of the request (used for logging) - * @param typeDef - TypeDef structure. - */ - void updateTypeDef(String sourceName, TypeDef typeDef); - - - /** - * Delete a cached TypeDef. - * - * @param sourceName - source of the request (used for logging) - * @param obsoleteTypeDefGUID - String unique identifier for the TypeDef. - * @param obsoleteTypeDefName - String unique name for the TypeDef. - */ - void deleteTypeDef(String sourceName, - String obsoleteTypeDefGUID, - String obsoleteTypeDefName); - - - /** - * Delete a cached AttributeTypeDef. - * - * @param sourceName - source of the request (used for logging) - * @param obsoleteAttributeTypeDefGUID - String unique identifier for the AttributeTypeDef. - * @param obsoleteAttributeTypeDefName - String unique name for the AttributeTypeDef. - */ - void deleteAttributeTypeDef(String sourceName, - String obsoleteAttributeTypeDefGUID, - String obsoleteAttributeTypeDefName); - - - /** - * Change the identifiers for a TypeDef. - * - * @param sourceName - source of the request (used for logging). - * @param originalTypeDefGUID - TypeDef's original unique identifier. - * @param originalTypeDefName - TypeDef's original unique name. - * @param newTypeDef - updated TypeDef with new identifiers. - */ - void reIdentifyTypeDef(String sourceName, - String originalTypeDefGUID, - String originalTypeDefName, - TypeDef newTypeDef); - - - /** - * Change the identifiers for an AttributeTypeDef. - * - * @param sourceName - source of the request (used for logging). - * @param originalAttributeTypeDefGUID - AttributeTypeDef's original unique identifier. - * @param originalAttributeTypeDefName - AttributeTypeDef's original unique name. - * @param newAttributeTypeDef - updated AttributeTypeDef with new identifiers - */ - void reIdentifyAttributeTypeDef(String sourceName, - String originalAttributeTypeDefGUID, - String originalAttributeTypeDefName, - AttributeTypeDef newAttributeTypeDef); - - - /** - * Return a boolean indicating that the type name matches the category. - * - * @param sourceName - source of the request (used for logging) - * @param category - TypeDefCategory enum value to test - * @param typeName - type name to test - * @param methodName - name of calling method. - * @return - boolean flag indicating that the type name is of the specified category - * @throws TypeErrorException - the type name is not a recognized type or the category is incorrect or there - * is an error in the type definition (TypeDef) cached. - */ - boolean isValidTypeCategory(String sourceName, - TypeDefCategory category, - String typeName, - String methodName) throws TypeErrorException; - - - /** - * Return boolean indicating if a classification type can be applied to a specified entity. This - * uses the list of valid entity types located in the ClassificationDef. - * - * @param sourceName - source of the request (used for logging) - * @param classificationTypeName - name of the classification's type (ClassificationDef) - * @param entityTypeName - name of the entity's type (EntityDef) - * @param methodName - name of calling method. - * @return boolean indicating if the classification is valid for the entity. - * @throws TypeErrorException - the type name is not a recognized type or the category is incorrect or there - * is an error in the type definition (TypeDef) cached. - */ - boolean isValidClassificationForEntity(String sourceName, - String classificationTypeName, - String entityTypeName, - String methodName) throws TypeErrorException; - - - /** - * Return identifiers for the TypeDef that matches the supplied type name. If the type name is not recognized, - * null is returned. - * - * @param sourceName - source of the request (used for logging) - * @param category - category of type - * @param typeName - String type name - the type name is not recognized or of the wrong category. - * @param methodName - name of calling method. - * @return InstanceType object containing TypeDef unique identifier (guid), typeDef name and version - * @throws TypeErrorException - the type name is not a recognized type or the category is incorrect or there - * is an error in the type definition (TypeDef) cached. - */ - InstanceType getInstanceType(String sourceName, - TypeDefCategory category, - String typeName, - String methodName) throws TypeErrorException; - - - /** - * Return the initial status set up for the instance. - * - * @param sourceName - source of the request (used for logging) - * @param typeName - name of the type to extract the initial status from. - * @return InstanceStatus enum - * @throws TypeErrorException - the type name is not recognized. - */ - InstanceStatus getInitialStatus(String sourceName, - String typeName, - String methodName) throws TypeErrorException; - - - /** - * Return the URL string to use for direct access to the metadata instance. - * - * @param sourceName - source of the request (used for logging) - * @param guid - unique identifier for the instance. - * @return String URL with placeholder for variables such as userId. - */ - String getEntityURL(String sourceName, String guid); - - - /** - * Return the URL string to use for direct access to the metadata instance. - * - * @param sourceName - source of the request (used for logging) - * @param guid - unique identifier for the instance. - * @return String URL with placeholder for variables such as userId. - */ - String getRelationshipURL(String sourceName, String guid); -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefValidator.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefValidator.java b/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefValidator.java deleted file mode 100644 index fc58cdf..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositorycontentmanager/OMRSTypeDefValidator.java +++ /dev/null @@ -1,236 +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.omrs.localrepository.repositorycontentmanager; - -import org.apache.atlas.omrs.ffdc.exception.RepositoryErrorException; -import org.apache.atlas.omrs.metadatacollection.properties.typedefs.*; - -import java.util.List; - -/** - * OMRSTypeDefValidator describes a component that is able to manage TypeDefs for the local metadata repository. - */ -public interface OMRSTypeDefValidator -{ - /** - * Return a boolean flag indicating whether the list of TypeDefs passed are compatible with the - * all known typedefs. - * - * A valid TypeDef is one that matches name, GUID and version to the full list of TypeDefs. - * If a new TypeDef is present, it is added to the enterprise list. - * - * @param sourceName - source of the TypeDef (used for logging) - * @param typeDefs - list of TypeDefs. - * @param methodName - name of calling method - * @throws RepositoryErrorException - a conflicting or invalid TypeDef has been returned - */ - void validateEnterpriseTypeDefs(String sourceName, - List<TypeDef> typeDefs, - String methodName) throws RepositoryErrorException; - - - /** - * Return a boolean flag indicating whether the list of TypeDefs passed are compatible with the - * all known typedefs. - * - * A valid TypeDef is one that matches name, GUID and version to the full list of TypeDefs. - * If a new TypeDef is present, it is added to the enterprise list. - * - * @param sourceName - source of the TypeDef (used for logging) - * @param attributeTypeDefs - list of AttributeTypeDefs. - * @param methodName - name of calling method - * @throws RepositoryErrorException - a conflicting or invalid AttributeTypeDef has been returned - */ - void validateEnterpriseAttributeTypeDefs(String sourceName, - List<AttributeTypeDef> attributeTypeDefs, - String methodName) throws RepositoryErrorException; - - - /** - * Return boolean indicating whether the TypeDef is one of the standard open metadata types. - * - * @param sourceName - source of the request (used for logging) - * @param typeGUID - unique identifier of the type - * @param typeName - unique name of the type - * @return boolean result - */ - boolean isOpenType(String sourceName, String typeGUID, String typeName); - - - /** - * Return boolean indicating whether the TypeDef is one of the standard open metadata types. - * - * @param sourceName - source of the request (used for logging) - * @param typeGUID - unique identifier of the type - * @return boolean result - */ - boolean isOpenTypeId(String sourceName, String typeGUID); - - - /** - * Return boolean indicating whether the TypeDef/AttributeTypeDef is known, either as an open type, or one defined - * by one or more of the members of the cohort. - * - * @param sourceName - source of the request (used for logging) - * @param typeGUID - unique identifier of the type - * @param typeName - unique name of the type - * @return boolean result - */ - boolean isKnownType(String sourceName, String typeGUID, String typeName); - - - /** - * Return boolean indicating whether the TypeDef/AttributeTypeDef is known, either as an open type, or one defined - * by one or more of the members of the cohort. - * - * @param sourceName - source of the request (used for logging) - * @param typeGUID - unique identifier of the type - * @return boolean result - */ - boolean isKnownTypeId(String sourceName, String typeGUID); - - - /** - * Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the local repository. - * - * @param sourceName - source of the request (used for logging) - * @param typeGUID - unique identifier of the type - * @param typeName - unique name of the type - * @return boolean result - */ - boolean isActiveType(String sourceName, String typeGUID, String typeName); - - - /** - * Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the local repository. - * - * @param sourceName - source of the request (used for logging) - * @param typeGUID - unique identifier of the type - * @return boolean result - */ - boolean isActiveTypeId(String sourceName, String typeGUID); - - - /** - * Return boolean indicating whether the TypeDef/AttributeTypeDef identifiers are from a single known type or not. - * - * @param sourceName - source of the request (used for logging) - * @param typeGUID - unique identifier of the TypeDef - * @param typeName - unique name of the TypeDef - * @return boolean result - */ - boolean validTypeId(String sourceName, - String typeGUID, - String typeName); - - - /** - * Return boolean indicating whether the TypeDef identifiers are from a single known type or not. - * - * @param sourceName - source of the request (used for logging) - * @param typeDefGUID - unique identifier of the TypeDef - * @param typeDefName - unique name of the TypeDef - * @param category - category for the TypeDef - * @return boolean result - */ - boolean validTypeDefId(String sourceName, - String typeDefGUID, - String typeDefName, - TypeDefCategory category); - - - /** - * Return boolean indicating whether the AttributeTypeDef identifiers are from a single known type or not. - * - * @param sourceName - source of the request (used for logging) - * @param attributeTypeDefGUID - unique identifier of the AttributeTypeDef - * @param attributeTypeDefName - unique name of the AttributeTypeDef - * @param category - category for the AttributeTypeDef - * @return boolean result - */ - boolean validAttributeTypeDefId(String sourceName, - String attributeTypeDefGUID, - String attributeTypeDefName, - AttributeTypeDefCategory category); - - - /** - * Return boolean indicating whether the TypeDef identifiers are from a single known type or not. - * - * @param sourceName - source of the request (used for logging) - * @param typeDefGUID - unique identifier of the TypeDef - * @param typeDefName - unique name of the TypeDef - * @param typeDefVersion - version of the type - * @param category - category for the TypeDef - * @return boolean result - */ - boolean validTypeDefId(String sourceName, - String typeDefGUID, - String typeDefName, - long typeDefVersion, - TypeDefCategory category); - - - /** - * Return boolean indicating whether the TypeDef identifiers are from a single known type or not. - * - * @param sourceName - source of the request (used for logging) - * @param attributeTypeDefGUID - unique identifier of the TypeDef - * @param attributeTypeDefName - unique name of the TypeDef - * @param attributeTypeDefVersion - version of the type - * @param category - category for the TypeDef - * @return boolean result - */ - boolean validAttributeTypeDefId(String sourceName, - String attributeTypeDefGUID, - String attributeTypeDefName, - long attributeTypeDefVersion, - AttributeTypeDefCategory category); - - - /** - * Return boolean indicating whether the supplied TypeDef is valid or not. - * - * @param sourceName - source of the request (used for logging) - * @param typeDef - TypeDef to test - * @return boolean result - */ - boolean validTypeDef(String sourceName, - TypeDef typeDef); - - - /** - * Return boolean indicating whether the supplied AttributeTypeDef is valid or not. - * - * @param sourceName - source of the request (used for logging) - * @param attributeTypeDef - TypeDef to test - * @return boolean result - */ - boolean validAttributeTypeDef(String sourceName, - AttributeTypeDef attributeTypeDef); - - /** - * Return boolean indicating whether the supplied TypeDefSummary is valid or not. - * - * @param sourceName - source of the TypeDefSummary (used for logging) - * @param typeDefSummary - TypeDefSummary to test. - * @return boolean result. - */ - boolean validTypeDefSummary(String sourceName, - TypeDefSummary typeDefSummary); -}
