You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by da...@apache.org on 2018/04/06 08:28:23 UTC

[19/31] atlas git commit: ATLAS-2122 OMAG Server Application and OMRS APIs

http://git-wip-us.apache.org/repos/asf/atlas/blob/a1fd4068/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java
----------------------------------------------------------------------
diff --git a/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java b/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java
index 12a6ea5..b5798c6 100644
--- a/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java
+++ b/omrs/src/main/java/org/apache/atlas/omrs/enterprise/repositoryconnector/EnterpriseOMRSMetadataCollection.java
@@ -19,6 +19,7 @@ package org.apache.atlas.omrs.enterprise.repositoryconnector;
 
 import org.apache.atlas.omrs.ffdc.OMRSErrorCode;
 import org.apache.atlas.omrs.ffdc.exception.*;
+import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSRepositoryHelper;
 import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSRepositoryValidator;
 import org.apache.atlas.omrs.metadatacollection.OMRSMetadataCollection;
 import org.apache.atlas.omrs.metadatacollection.properties.MatchCriteria;
@@ -26,6 +27,7 @@ import org.apache.atlas.omrs.metadatacollection.properties.SequencingOrder;
 import org.apache.atlas.omrs.metadatacollection.properties.instances.*;
 import org.apache.atlas.omrs.metadatacollection.properties.typedefs.*;
 
+import java.util.List;
 import java.util.ArrayList;
 import java.util.Date;
 
@@ -67,9 +69,8 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
     private EnterpriseOMRSRepositoryConnector parentConnector;
     private String                            enterpriseMetadataCollectionId;
     private String                            enterpriseMetadataCollectionName;
-
-
-    private final OMRSRepositoryValidator     repositoryValidator = new OMRSRepositoryValidator();
+    private OMRSRepositoryValidator           repositoryValidator;
+    private OMRSRepositoryHelper              repositoryHelper;
 
 
     /**
@@ -81,6 +82,8 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param enterpriseMetadataCollectionName - name of the metadata collection - used for messages.
      */
     public EnterpriseOMRSMetadataCollection(EnterpriseOMRSRepositoryConnector parentConnector,
+                                            OMRSRepositoryHelper              repositoryHelper,
+                                            OMRSRepositoryValidator           repositoryValidator,
                                             String                            enterpriseMetadataCollectionId,
                                             String                            enterpriseMetadataCollectionName)
     {
@@ -92,10 +95,12 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
         this.enterpriseMetadataCollectionName = enterpriseMetadataCollectionName;
 
         /*
-         * Save parentConnector since this has the connection information and access to the metadata about the
-         * metadata cohort.
+         * Save parentConnector and associated helper and validator since this has the connection information and
+         * access to the metadata about the open metadata repository cohort.
          */
         this.parentConnector = parentConnector;
+        this.repositoryHelper = repositoryHelper;
+        this.repositoryValidator = repositoryValidator;
     }
 
 
@@ -147,8 +152,8 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * Some repositories may produce exceptions.  These exceptions are saved and may be returned if
          * there are no results from any repository.
          */
-        ArrayList<TypeDef>          combinedTypeDefResults          = new ArrayList<>();
-        ArrayList<AttributeTypeDef> combinedAttributeTypeDefResults = new ArrayList<>();
+        List<TypeDef>               combinedTypeDefResults          = new ArrayList<>();
+        List<AttributeTypeDef>      combinedAttributeTypeDefResults = new ArrayList<>();
         UserNotAuthorizedException  userNotAuthorizedException      = null;
         RepositoryErrorException    repositoryErrorException        = null;
         RuntimeException            anotherException                = null;
@@ -188,8 +193,8 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
                  */
                 if (results != null)
                 {
-                    ArrayList<TypeDef>           typeDefResults     = results.getTypeDefs();
-                    ArrayList<AttributeTypeDef>  attributeResults   = results.getAttributeTypeDefs();
+                    List<TypeDef>           typeDefResults     = results.getTypeDefs();
+                    List<AttributeTypeDef>  attributeResults   = results.getAttributeTypeDefs();
 
                     if (typeDefResults != null)
                     {
@@ -323,7 +328,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * The list of metadata collections are retrieved for each request to ensure that any changes in
          * the shape of the cohort are reflected immediately.
          */
-        ArrayList<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
+        List<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
 
         if (metadataCollections == null)
         {
@@ -347,8 +352,8 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * Some repositories may produce exceptions.  These exceptions are saved and may be returned if
          * there are no results from any repository.
          */
-        ArrayList<TypeDef>          combinedTypeDefResults          = new ArrayList<>();
-        ArrayList<AttributeTypeDef> combinedAttributeTypeDefResults = new ArrayList<>();
+        List<TypeDef>               combinedTypeDefResults          = new ArrayList<>();
+        List<AttributeTypeDef>      combinedAttributeTypeDefResults = new ArrayList<>();
         InvalidParameterException   invalidParameterException       = null;
         UserNotAuthorizedException  userNotAuthorizedException      = null;
         RepositoryErrorException    repositoryErrorException        = null;
@@ -390,8 +395,8 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
                  */
                 if (results != null)
                 {
-                    ArrayList<TypeDef>           typeDefResults     = results.getTypeDefs();
-                    ArrayList<AttributeTypeDef>  attributeResults   = results.getAttributeTypeDefs();
+                    List<TypeDef>           typeDefResults     = results.getTypeDefs();
+                    List<AttributeTypeDef>  attributeResults   = results.getAttributeTypeDefs();
 
                     if (typeDefResults != null)
                     {
@@ -488,10 +493,10 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws RepositoryErrorException - there is a problem communicating with the metadata repository.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
-    public ArrayList<TypeDef> findTypeDefsByCategory(String          userId,
-                                                     TypeDefCategory typeDefCategory) throws InvalidParameterException,
-                                                                                             RepositoryErrorException,
-                                                                                             UserNotAuthorizedException
+    public List<TypeDef> findTypeDefsByCategory(String          userId,
+                                                TypeDefCategory typeDefCategory) throws InvalidParameterException,
+                                                                                        RepositoryErrorException,
+                                                                                        UserNotAuthorizedException
     {
         final String                       methodName = "findTypeDefsByCategory()";
 
@@ -515,7 +520,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * The list of metadata collections are retrieved for each request to ensure that any changes in
          * the shape of the cohort are reflected immediately.
          */
-        ArrayList<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
+        List<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
 
         if (metadataCollections == null)
         {
@@ -539,7 +544,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * Some repositories may produce exceptions.  These exceptions are saved and may be returned if
          * there are no results from any repository.
          */
-        ArrayList<TypeDef>         combinedResults            = new ArrayList<>();
+        List<TypeDef>              combinedResults            = new ArrayList<>();
         InvalidParameterException  invalidParameterException  = null;
         UserNotAuthorizedException userNotAuthorizedException = null;
         RepositoryErrorException   repositoryErrorException   = null;
@@ -573,8 +578,8 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
              */
             try
             {
-                ArrayList<TypeDef> results              = metadataCollection.findTypeDefsByCategory(userId, typeDefCategory);
-                String             metadataCollectionId = metadataCollection.getMetadataCollectionId();
+                List<TypeDef>    results              = metadataCollection.findTypeDefsByCategory(userId, typeDefCategory);
+                String           metadataCollectionId = metadataCollection.getMetadataCollectionId();
 
                 /*
                  * Step through the list of returned TypeDefs and remove duplicates.
@@ -665,10 +670,10 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws RepositoryErrorException - there is a problem communicating with the metadata repository.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
-    public ArrayList<AttributeTypeDef> findAttributeTypeDefsByCategory(String                   userId,
-                                                                       AttributeTypeDefCategory category) throws InvalidParameterException,
-                                                                                                                 RepositoryErrorException,
-                                                                                                                 UserNotAuthorizedException
+    public List<AttributeTypeDef> findAttributeTypeDefsByCategory(String                   userId,
+                                                                  AttributeTypeDefCategory category) throws InvalidParameterException,
+                                                                                                            RepositoryErrorException,
+                                                                                                            UserNotAuthorizedException
     {
         return null;
     }
@@ -684,10 +689,10 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws RepositoryErrorException - there is a problem communicating with the metadata repository.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
-    public ArrayList<TypeDef> findTypeDefsByProperty(String            userId,
-                                                     TypeDefProperties matchCriteria) throws InvalidParameterException,
-                                                                                             RepositoryErrorException,
-                                                                                             UserNotAuthorizedException
+    public List<TypeDef> findTypeDefsByProperty(String            userId,
+                                                TypeDefProperties matchCriteria) throws InvalidParameterException,
+                                                                                        RepositoryErrorException,
+                                                                                        UserNotAuthorizedException
     {
         final String                       methodName = "findTypeDefsByProperty()";
 
@@ -711,7 +716,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * The list of metadata collections are retrieved for each request to ensure that any changes in
          * the shape of the cohort are reflected immediately.
          */
-        ArrayList<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
+        List<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
 
         if (metadataCollections == null)
         {
@@ -735,7 +740,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * Some repositories may produce exceptions.  These exceptions are saved and may be returned if
          * there are no results from any repository.
          */
-        ArrayList<TypeDef>         combinedResults            = new ArrayList<>();
+        List<TypeDef>              combinedResults            = new ArrayList<>();
         InvalidParameterException  invalidParameterException  = null;
         UserNotAuthorizedException userNotAuthorizedException = null;
         RepositoryErrorException   repositoryErrorException   = null;
@@ -769,7 +774,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
              */
             try
             {
-                ArrayList<TypeDef> results              = metadataCollection.findTypeDefsByProperty(userId, matchCriteria);
+                List<TypeDef>      results              = metadataCollection.findTypeDefsByProperty(userId, matchCriteria);
                 String             metadataCollectionId = metadataCollection.getMetadataCollectionId();
 
                 /*
@@ -864,7 +869,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws RepositoryErrorException - there is a problem communicating with the metadata repository.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
-    public TypeDefGallery findTypesByExternalID(String    userId,
+    public List<TypeDef> findTypesByExternalID(String    userId,
                                                 String    standard,
                                                 String    organization,
                                                 String    identifier) throws InvalidParameterException,
@@ -889,165 +894,9 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
                                                 errorCode.getUserAction());
         }
 
-        /*
-         * The list of metadata collections are retrieved for each request to ensure that any changes in
-         * the shape of the cohort are reflected immediately.
-         */
-        ArrayList<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
-
-        if (metadataCollections == null)
-        {
-            /*
-             * No repositories available
-             */
-            OMRSErrorCode errorCode = OMRSErrorCode.NO_REPOSITORIES;
-            String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage();
-
-            throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                               this.getClass().getName(),
-                                               methodName,
-                                               errorMessage,
-                                               errorCode.getSystemAction(),
-                                               errorCode.getUserAction());
-        }
-
-        /*
-         * Ready to process the request.  Search results need to come from all members of the cohort.
-         * They need to be combined and then duplicates removed to create the final list of results.
-         * Some repositories may produce exceptions.  These exceptions are saved and may be returned if
-         * there are no results from any repository.
-         */
-        ArrayList<TypeDef>          combinedTypeDefResults          = new ArrayList<>();
-        ArrayList<AttributeTypeDef> combinedAttributeTypeDefResults = new ArrayList<>();
-        InvalidParameterException   invalidParameterException       = null;
-        UserNotAuthorizedException  userNotAuthorizedException      = null;
-        RepositoryErrorException    repositoryErrorException        = null;
-        RuntimeException            anotherException                = null;
-
-        /*
-         * Loop through the metadata collections extracting the typedefs from each repository.
-         */
-        for (OMRSMetadataCollection metadataCollection : metadataCollections)
-        {
-            if (metadataCollection == null)
-            {
-                /*
-                 * A problem in the set up of the metadata collection list.  Repository connectors implemented
-                 * with no metadata collection are tested for in the OMRSEnterpriseConnectorManager so something
-                 * else has gone wrong.
-                 */
-                OMRSErrorCode errorCode = OMRSErrorCode.NULL_ENTERPRISE_METADATA_COLLECTION;
-                String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage();
-
-                throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                                   this.getClass().getName(),
-                                                   methodName,
-                                                   errorMessage,
-                                                   errorCode.getSystemAction(),
-                                                   errorCode.getUserAction());
-            }
-
-            /*
-             * Process the retrieved metadata collection
-             */
-            try
-            {
-                TypeDefGallery results  = metadataCollection.findTypesByExternalID(userId,
-                                                                                   standard,
-                                                                                   organization,
-                                                                                   identifier);
-                String             metadataCollectionId = metadataCollection.getMetadataCollectionId();
-
-                /*
-                 * Combine the results from the metadata collection with those elements previously retrieved.
-                 */
-                if (results != null)
-                {
-                    ArrayList<TypeDef>           typeDefResults     = results.getTypeDefs();
-                    ArrayList<AttributeTypeDef>  attributeResults   = results.getAttributeTypeDefs();
-
-                    if (typeDefResults != null)
-                    {
-                        combinedTypeDefResults.addAll(typeDefResults);
-                    }
-
-                    if (attributeResults != null)
-                    {
-                        combinedAttributeTypeDefResults.addAll(attributeResults);
-                    }
-                }
-            }
-            catch (InvalidParameterException  error)
-            {
-                invalidParameterException = error;
-            }
-            catch (RepositoryErrorException  error)
-            {
-                repositoryErrorException = error;
-            }
-            catch (UserNotAuthorizedException  error)
-            {
-                userNotAuthorizedException = error;
-            }
-            catch (RuntimeException   error)
-            {
-                anotherException = error;
-            }
-        }
-
-        int  resultCount = (combinedTypeDefResults.size() + combinedAttributeTypeDefResults.size());
-
-        /*
-         * Return any results, or exception if nothing is found.
-         */
-        if (resultCount > 0)
-        {
-            TypeDefGallery combinedResults = new TypeDefGallery();
-
-            combinedResults.setAttributeTypeDefs(combinedAttributeTypeDefResults);
-            combinedResults.setTypeDefs(combinedTypeDefResults);
-
-            if (repositoryValidator.validateEnterpriseTypeDefs(enterpriseMetadataCollectionName,
-                                                               combinedTypeDefResults))
-            {
-                return combinedResults;
-            }
-            else
-            {
-                OMRSErrorCode errorCode = OMRSErrorCode.CONFLICTING_ENTERPRISE_TYPEDEFS;
-                String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage();
+        // todo
 
-                throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                                   this.getClass().getName(),
-                                                   methodName,
-                                                   errorMessage,
-                                                   errorCode.getSystemAction(),
-                                                   errorCode.getUserAction());
-            }
-        }
-        else
-        {
-            if (userNotAuthorizedException != null)
-            {
-                throw userNotAuthorizedException;
-            }
-            else if (repositoryErrorException != null)
-            {
-                throw repositoryErrorException;
-            }
-            else if (invalidParameterException != null)
-            {
-                throw invalidParameterException;
-            }
-            else if (anotherException != null)
-            {
-                throw anotherException;
-            }
-            else
-            {
-                return null;
-            }
-        }
+        return null;
     }
 
 
@@ -1062,10 +911,10 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws RepositoryErrorException - there is a problem communicating with the metadata repository.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
-    public ArrayList<TypeDef> searchForTypeDefs(String userId,
-                                                String searchCriteria) throws InvalidParameterException,
-                                                                              RepositoryErrorException,
-                                                                              UserNotAuthorizedException
+    public List<TypeDef> searchForTypeDefs(String userId,
+                                           String searchCriteria) throws InvalidParameterException,
+                                                                         RepositoryErrorException,
+                                                                         UserNotAuthorizedException
     {
         final String                       methodName = "searchForTypeDefs()";
 
@@ -1089,7 +938,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * The list of metadata collections are retrieved for each request to ensure that any changes in
          * the shape of the cohort are reflected immediately.
          */
-        ArrayList<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
+        List<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
 
         if (metadataCollections == null)
         {
@@ -1113,7 +962,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
          * Some repositories may produce exceptions.  These exceptions are saved and may be returned if
          * there are no results from any repository.
          */
-        ArrayList<TypeDef>         combinedResults            = new ArrayList<>();
+        List<TypeDef>              combinedResults            = new ArrayList<>();
         InvalidParameterException  invalidParameterException  = null;
         UserNotAuthorizedException userNotAuthorizedException = null;
         RepositoryErrorException   repositoryErrorException   = null;
@@ -1147,8 +996,8 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
              */
             try
             {
-                ArrayList<TypeDef> results              = metadataCollection.searchForTypeDefs(userId, searchCriteria);
-                String             metadataCollectionId = metadataCollection.getMetadataCollectionId();
+                List<TypeDef> results              = metadataCollection.searchForTypeDefs(userId, searchCriteria);
+                String        metadataCollectionId = metadataCollection.getMetadataCollectionId();
 
                 /*
                  * Step through the list of returned TypeDefs and remove duplicates.
@@ -1265,7 +1114,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
                                                 errorCode.getUserAction());
         }
 
-        ArrayList<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
+        List<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
 
         if (metadataCollections == null)
         {
@@ -1348,8 +1197,9 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
             /*
              * All of the repositories have returned a null TypeDef so default to TypeDefNotKnownException.
              */
+            // todo - bad parms for message
             OMRSErrorCode errorCode = OMRSErrorCode.TYPEDEF_NOT_KNOWN;
-            String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage();
+            String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(guid);
 
             throw new TypeDefNotKnownException(errorCode.getHTTPErrorCode(),
                                                this.getClass().getName(),
@@ -1419,7 +1269,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
                                                 errorCode.getUserAction());
         }
 
-        ArrayList<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
+        List<OMRSMetadataCollection>  metadataCollections = parentConnector.getMetadataCollections();
 
         if (metadataCollections == null)
         {
@@ -1502,8 +1352,9 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
             /*
              * All of the repositories have returned a null TypeDef so default to TypeDefNotKnownException.
              */
+            // todo - bad parms for message
             OMRSErrorCode errorCode = OMRSErrorCode.TYPEDEF_NOT_KNOWN;
-            String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage();
+            String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(name);
 
             throw new TypeDefNotKnownException(errorCode.getHTTPErrorCode(),
                                                this.getClass().getName(),
@@ -1541,26 +1392,16 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * Create a collection of related types.
      *
      * @param userId - unique identifier for requesting user.
-     * @param newTypes - TypeDefGallery structure describing the new AttributeTypeDefs and TypeDefs.
-     * @throws InvalidParameterException - the new TypeDef is null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                  the metadata collection is stored.
-     * @throws TypeDefNotSupportedException - the repository is not able to support this TypeDef.
-     * @throws TypeDefKnownException - the TypeDef is already stored in the repository.
-     * @throws TypeDefConflictException - the new TypeDef conflicts with an existing TypeDef.
-     * @throws InvalidTypeDefException - the new TypeDef has invalid contents.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     * @param newTypes - TypeDefGalleryResponse structure describing the new AttributeTypeDefs and TypeDefs.
+     * @throws FunctionNotSupportedException - the repository does not support this call.
      */
     public  void addTypeDefGallery(String          userId,
-                                   TypeDefGallery  newTypes) throws InvalidParameterException,
-                                                                    RepositoryErrorException,
-                                                                    TypeDefNotSupportedException,
-                                                                    TypeDefKnownException,
-                                                                    TypeDefConflictException,
-                                                                    InvalidTypeDefException,
-                                                                    UserNotAuthorizedException
+                                   TypeDefGallery  newTypes) throws FunctionNotSupportedException
+
     {
+        final String    methodName = "addTypeDefGallery()";
 
+        throwNotEnterpriseFunction(methodName);
     }
 
 
@@ -1570,73 +1411,30 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      *
      * @param userId - unique identifier for requesting user.
      * @param newTypeDef - TypeDef structure describing the new TypeDef.
-     * @throws InvalidParameterException - the new TypeDef is null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                  the metadata collection is stored.
-     * @throws TypeDefNotSupportedException - the repository is not able to support this TypeDef.
-     * @throws TypeDefKnownException - the TypeDef is already stored in the repository.
-     * @throws TypeDefConflictException - the new TypeDef conflicts with an existing TypeDef.
-     * @throws InvalidTypeDefException - the new TypeDef has invalid contents.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     * @throws FunctionNotSupportedException - the repository does not support this call.
      */
     public void addTypeDef(String       userId,
-                           TypeDef      newTypeDef) throws InvalidParameterException,
-                                                           RepositoryErrorException,
-                                                           TypeDefNotSupportedException,
-                                                           TypeDefKnownException,
-                                                           TypeDefConflictException,
-                                                           InvalidTypeDefException,
-                                                           UserNotAuthorizedException
+                           TypeDef      newTypeDef) throws FunctionNotSupportedException
     {
         final String    methodName = "addTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
-
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        throwNotEnterpriseFunction(methodName);
     }
 
+
     /**
      * Create a definition of a new AttributeTypeDef.
      *
      * @param userId - unique identifier for requesting user.
      * @param newAttributeTypeDef - TypeDef structure describing the new TypeDef.
-     * @throws InvalidParameterException - the new TypeDef is null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                  the metadata collection is stored.
-     * @throws TypeDefNotSupportedException - the repository is not able to support this TypeDef.
-     * @throws TypeDefKnownException - the TypeDef is already stored in the repository.
-     * @throws TypeDefConflictException - the new TypeDef conflicts with an existing TypeDef.
-     * @throws InvalidTypeDefException - the new TypeDef has invalid contents.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     * @throws FunctionNotSupportedException - the repository does not support this call.
      */
     public  void addAttributeTypeDef(String             userId,
-                                     AttributeTypeDef   newAttributeTypeDef) throws InvalidParameterException,
-                                                                                    RepositoryErrorException,
-                                                                                    TypeDefNotSupportedException,
-                                                                                    TypeDefKnownException,
-                                                                                    TypeDefConflictException,
-                                                                                    InvalidTypeDefException,
-                                                                                    UserNotAuthorizedException
+                                     AttributeTypeDef   newAttributeTypeDef) throws FunctionNotSupportedException
     {
         final String    methodName = "addAttributeTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
-
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        throwNotEnterpriseFunction(methodName);
     }
 
 
@@ -1664,16 +1462,9 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
     {
         final String                       methodName = "verifyTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
+        // todo
 
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        return true;
     }
 
 
@@ -1701,16 +1492,9 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
     {
         final String                       methodName = "verifyAttributeTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
+        // todo
 
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        return true;
     }
 
 
@@ -1721,33 +1505,17 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param userId - unique identifier for requesting user.
      * @param typeDefPatch - TypeDef patch describing change to TypeDef.
      * @return updated TypeDef
-     * @throws InvalidParameterException - the TypeDefPatch is null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                    the metadata collection is stored.
-     * @throws TypeDefNotKnownException - the requested TypeDef is not found in the metadata collection.
-     * @throws PatchErrorException - the TypeDef can not be updated because the supplied patch is incompatible
-     *                               with the stored TypeDef.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     * @throws FunctionNotSupportedException - the repository does not support this call.
+
      */
     public TypeDef updateTypeDef(String       userId,
-                                 TypeDefPatch typeDefPatch) throws InvalidParameterException,
-                                                                   RepositoryErrorException,
-                                                                   TypeDefNotKnownException,
-                                                                   PatchErrorException,
-                                                                   UserNotAuthorizedException
+                                 TypeDefPatch typeDefPatch) throws FunctionNotSupportedException
     {
         final String                       methodName = "updateTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
+        throwNotEnterpriseFunction(methodName);
 
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        return null;
     }
 
 
@@ -1758,35 +1526,15 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param userId - unique identifier for requesting user.
      * @param obsoleteTypeDefGUID - String unique identifier for the TypeDef.
      * @param obsoleteTypeDefName - String unique name for the TypeDef.
-     * @throws InvalidParameterException - the one of TypeDef identifiers is null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                    the metadata collection is stored.
-     * @throws TypeDefNotKnownException - the requested TypeDef is not found in the metadata collection.
-     * @throws TypeDefInUseException - the TypeDef can not be deleted because there are instances of this type in the
-     *                                 the metadata collection.  These instances need to be purged before the
-     *                                 TypeDef can be deleted.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     * @throws FunctionNotSupportedException - the repository does not support this call.
      */
     public void deleteTypeDef(String    userId,
                               String    obsoleteTypeDefGUID,
-                              String    obsoleteTypeDefName) throws InvalidParameterException,
-                                                                    RepositoryErrorException,
-                                                                    TypeDefNotKnownException,
-                                                                    TypeDefInUseException,
-                                                                    UserNotAuthorizedException
+                              String    obsoleteTypeDefName) throws FunctionNotSupportedException
     {
         final String                       methodName = "deleteTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
-
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        throwNotEnterpriseFunction(methodName);
     }
 
 
@@ -1797,35 +1545,15 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param userId - unique identifier for requesting user.
      * @param obsoleteTypeDefGUID - String unique identifier for the AttributeTypeDef.
      * @param obsoleteTypeDefName - String unique name for the AttributeTypeDef.
-     * @throws InvalidParameterException - the one of AttributeTypeDef identifiers is null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                    the metadata collection is stored.
-     * @throws TypeDefNotKnownException - the requested AttributeTypeDef is not found in the metadata collection.
-     * @throws TypeDefInUseException - the AttributeTypeDef can not be deleted because there are instances of this type in the
-     *                                 the metadata collection.  These instances need to be purged before the
-     *                                 AttributeTypeDef can be deleted.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     * @throws FunctionNotSupportedException - the repository does not support this call.
      */
     public void deleteAttributeTypeDef(String    userId,
                                        String    obsoleteTypeDefGUID,
-                                       String    obsoleteTypeDefName) throws InvalidParameterException,
-                                                                             RepositoryErrorException,
-                                                                             TypeDefNotKnownException,
-                                                                             TypeDefInUseException,
-                                                                             UserNotAuthorizedException
+                                       String    obsoleteTypeDefName) throws FunctionNotSupportedException
     {
         final String                       methodName = "deleteAttributeTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
-
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        throwNotEnterpriseFunction(methodName);
     }
 
 
@@ -1840,34 +1568,19 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param newTypeDefGUID - the new identifier for the TypeDef.
      * @param newTypeDefName - new name for this TypeDef.
      * @return typeDef - new values for this TypeDef, including the new guid/name.
-     * @throws InvalidParameterException - one of the parameters is invalid or null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                    the metadata collection is stored.
-     * @throws TypeDefNotKnownException - the TypeDef identified by the original guid/name is not found
-     *                                    in the metadata collection.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     * @throws FunctionNotSupportedException - the repository does not support this call.
      */
     public  TypeDef reIdentifyTypeDef(String     userId,
                                       String     originalTypeDefGUID,
                                       String     originalTypeDefName,
                                       String     newTypeDefGUID,
-                                      String     newTypeDefName) throws InvalidParameterException,
-                                                                        RepositoryErrorException,
-                                                                        TypeDefNotKnownException,
-                                                                        UserNotAuthorizedException
+                                      String     newTypeDefName) throws FunctionNotSupportedException
     {
         final String                       methodName = "reIdentifyTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
+        throwNotEnterpriseFunction(methodName);
 
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        return null;
     }
 
 
@@ -1882,34 +1595,19 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param newAttributeTypeDefGUID - the new identifier for the AttributeTypeDef.
      * @param newAttributeTypeDefName - new name for this AttributeTypeDef.
      * @return attributeTypeDef - new values for this AttributeTypeDef, including the new guid/name.
-     * @throws InvalidParameterException - one of the parameters is invalid or null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                    the metadata collection is stored.
-     * @throws TypeDefNotKnownException - the AttributeTypeDef identified by the original guid/name is not
-     *                                    found in the metadata collection.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     * @throws FunctionNotSupportedException - the repository does not support this call.
      */
     public  AttributeTypeDef reIdentifyAttributeTypeDef(String     userId,
                                                         String     originalAttributeTypeDefGUID,
                                                         String     originalAttributeTypeDefName,
                                                         String     newAttributeTypeDefGUID,
-                                                        String     newAttributeTypeDefName) throws InvalidParameterException,
-                                                                                                   RepositoryErrorException,
-                                                                                                   TypeDefNotKnownException,
-                                                                                                   UserNotAuthorizedException
+                                                        String     newAttributeTypeDefName) throws FunctionNotSupportedException
     {
         final String                       methodName = "reIdentifyAttributeTypeDef()";
 
-        OMRSErrorCode errorCode = OMRSErrorCode.ENTERPRISE_NOT_SUPPORTED;
-
-        String errorMessage = errorCode.getErrorMessageId() + errorCode.getFormattedErrorMessage(methodName);
+        throwNotEnterpriseFunction(methodName);
 
-        throw new RepositoryErrorException(errorCode.getHTTPErrorCode(),
-                                           this.getClass().getName(),
-                                           methodName,
-                                           errorMessage,
-                                           errorCode.getSystemAction(),
-                                           errorCode.getUserAction());
+        return null;
     }
 
 
@@ -1993,12 +1691,14 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
      *                                 the metadata collection is stored.
      * @throws EntityNotKnownException - the requested entity instance is not known in the metadata collection.
+     * @throws EntityProxyOnlyException - the requested entity instance is only a proxy in the metadata collection.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
     public EntityDetail getEntityDetail(String    userId,
                                         String    guid) throws InvalidParameterException,
                                                                RepositoryErrorException,
                                                                EntityNotKnownException,
+                                                               EntityProxyOnlyException,
                                                                UserNotAuthorizedException
     {
         EntityDetail     entity = this.isEntityKnown(userId, guid);
@@ -2031,12 +1731,13 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param guid - String unique identifier for the entity.
      * @param asOfTime - the time used to determine which versionName of the entity that is desired.
      * @return EntityDetail structure.
-     * @throws InvalidParameterException - the guid or date is null.
+     * @throws InvalidParameterException - the guid or date is null or the date is for a future time.
      * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
      *                                 the metadata collection is stored.
      * @throws EntityNotKnownException - the requested entity instance is not known in the metadata collection
      *                                   at the time requested.
-     * @throws PropertyErrorException - the asOfTime property is for a future time
+     * @throws EntityProxyOnlyException - the requested entity instance is only a proxy in the metadata collection.
+     * @throws FunctionNotSupportedException - the repository does not support the asOfTime parameter.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
     public  EntityDetail getEntityDetail(String    userId,
@@ -2044,41 +1745,18 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
                                          Date      asOfTime) throws InvalidParameterException,
                                                                     RepositoryErrorException,
                                                                     EntityNotKnownException,
-                                                                    PropertyErrorException,
+                                                                    EntityProxyOnlyException,
+                                                                    FunctionNotSupportedException,
                                                                     UserNotAuthorizedException
     {
         final String                       methodName = "isEntityKnown()";
 
-        // TODO - missing implementation
-
-        return null;
-    }
+        EntityDetail entity = null;
 
+        // TODO - missing implementation
 
 
-    /**
-     * Return the header, classifications, properties and relationships for a specific entity.  The entity
-     * detail can come from any server.  The relationships may be distributed over all of the repositories.
-     *
-     * @param userId - unique identifier for requesting user.
-     * @param guid - String unique identifier for the entity.
-     * @return EntityUniverse structure.
-     * @throws InvalidParameterException - the guid is null.
-     * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
-     *                                    the metadata collection is stored.
-     * @throws EntityNotKnownException - the requested entity instance is not known in the metadata collection.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
-     */
-    public EntityUniverse getEntityUniverse(String    userId,
-                                            String    guid) throws InvalidParameterException,
-                                                                   RepositoryErrorException,
-                                                                   EntityNotKnownException,
-                                                                   UserNotAuthorizedException
-    {
-        final String     methodName     = "getEntityUniverse()";
-        EntityDetail     entityDetail   = this.isEntityKnown(userId, guid);
-
-        if (entityDetail == null)
+        if (entity == null)
         {
             OMRSErrorCode  errorCode = OMRSErrorCode.ENTITY_NOT_KNOWN;
             String         errorMessage = errorCode.getErrorMessageId()
@@ -2094,65 +1772,17 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
                                               errorCode.getUserAction());
         }
 
-        /*
-         * Step through the registered open metadata repositories to locate all of the active relationships.
-         */
-        ArrayList<Relationship>    relationships = null;
-
-        try
-        {
-            ArrayList<InstanceStatus>   instanceStatuses = new ArrayList<>();
-
-            instanceStatuses.add(InstanceStatus.ACTIVE);
-            relationships = this.getRelationshipsForEntity(userId,
-                                                           guid,
-                                                           0,
-                                                           instanceStatuses,
-                                                           null,
-                                                           null,
-                                                           null,
-                                                           0);
-        }
-        catch (RepositoryErrorException  error)
-        {
-            throw error;
-        }
-        catch (UserNotAuthorizedException error)
-        {
-            /*
-             * The user does not have access to the relationships so just return the entity detail
-             */
-            relationships = null;
-        }
-        catch (EntityNotKnownException  error)
-        {
-            // logic error
-        }
-        catch (PropertyErrorException  error)
-        {
-            // Turn into Repository Error Exception
-        }
-        catch (PagingErrorException   error)
-        {
-            // Turn into Repository Error Exception
-        }
-
-        /*
-         * The entity universe combines the entity detail and the relationship list.
-         */
-
-        EntityUniverse   entityUniverse = new EntityUniverse(entityDetail);
-        entityUniverse.setEntityRelationships(relationships);
-
-        return entityUniverse;
+        return null;
     }
 
 
+
     /**
      * Return the relationships for a specific entity.
      *
      * @param userId - unique identifier for requesting user.
      * @param entityGUID - String unique identifier for the entity.
+     * @param relationshipTypeGUID - String GUID of the the type of relationship required (null for all).
      * @param fromRelationshipElement - the starting element number of the relationships to return.
      *                                This is used when retrieving elements
      *                                beyond the first page of results. Zero means start from the first element.
@@ -2173,21 +1803,24 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws EntityNotKnownException - the requested entity instance is not known in the metadata collection.
      * @throws PropertyErrorException - the sequencing property is not valid for the attached classifications.
      * @throws PagingErrorException - the paging/sequencing parameters are set up incorrectly.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
-     */
-    public ArrayList<Relationship> getRelationshipsForEntity(String                     userId,
-                                                             String                     entityGUID,
-                                                             int                        fromRelationshipElement,
-                                                             ArrayList<InstanceStatus>  limitResultsByStatus,
-                                                             Date                       asOfTime,
-                                                             String                     sequencingProperty,
-                                                             SequencingOrder            sequencingOrder,
-                                                             int                        pageSize) throws InvalidParameterException,
-                                                                                                         RepositoryErrorException,
-                                                                                                         EntityNotKnownException,
-                                                                                                         PropertyErrorException,
-                                                                                                         PagingErrorException,
-                                                                                                         UserNotAuthorizedException
+     * @throws FunctionNotSupportedException - the repository does not support the asOfTime parameter.
+     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     */
+    public List<Relationship> getRelationshipsForEntity(String                     userId,
+                                                        String                     entityGUID,
+                                                        String                     relationshipTypeGUID,
+                                                        int                        fromRelationshipElement,
+                                                        List<InstanceStatus>       limitResultsByStatus,
+                                                        Date                       asOfTime,
+                                                        String                     sequencingProperty,
+                                                        SequencingOrder            sequencingOrder,
+                                                        int                        pageSize) throws InvalidParameterException,
+                                                                                                    RepositoryErrorException,
+                                                                                                    EntityNotKnownException,
+                                                                                                    PropertyErrorException,
+                                                                                                    PagingErrorException,
+                                                                                                    FunctionNotSupportedException,
+                                                                                                    UserNotAuthorizedException
     {
         final String                       methodName = "getRelationshipsForEntity()";
 
@@ -2205,7 +1838,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param entityTypeGUID - String unique identifier for the entity type of interest (null means any entity type).
      * @param matchProperties - List of entity properties to match to (null means match on entityTypeGUID only).
      * @param matchCriteria - Enum defining how the properties should be matched to the entities in the repository.
-     * @param fromEntityDetailElement - the starting element number of the entities to return.
+     * @param fromEntityElement - the starting element number of the entities to return.
      *                                This is used when retrieving elements
      *                                beyond the first page of results. Zero means start from the first element.
      * @param limitResultsByStatus - By default, entities in all statuses are returned.  However, it is possible
@@ -2228,24 +1861,26 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws PropertyErrorException - the properties specified are not valid for any of the requested types of
      *                                  entity.
      * @throws PagingErrorException - the paging/sequencing parameters are set up incorrectly.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
-     */
-    public  ArrayList<EntityDetail> findEntitiesByProperty(String                    userId,
-                                                           String                    entityTypeGUID,
-                                                           InstanceProperties        matchProperties,
-                                                           MatchCriteria             matchCriteria,
-                                                           int                       fromEntityDetailElement,
-                                                           ArrayList<InstanceStatus> limitResultsByStatus,
-                                                           ArrayList<String>         limitResultsByClassification,
-                                                           Date                      asOfTime,
-                                                           String                    sequencingProperty,
-                                                           SequencingOrder           sequencingOrder,
-                                                           int                       pageSize) throws InvalidParameterException,
-                                                                                                      RepositoryErrorException,
-                                                                                                      TypeErrorException,
-                                                                                                      PropertyErrorException,
-                                                                                                      PagingErrorException,
-                                                                                                      UserNotAuthorizedException
+     * @throws FunctionNotSupportedException - the repository does not support the asOfTime parameter.
+     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     */
+    public  List<EntityDetail> findEntitiesByProperty(String                    userId,
+                                                      String                    entityTypeGUID,
+                                                      InstanceProperties        matchProperties,
+                                                      MatchCriteria             matchCriteria,
+                                                      int                       fromEntityElement,
+                                                      List<InstanceStatus>      limitResultsByStatus,
+                                                      List<String>              limitResultsByClassification,
+                                                      Date                      asOfTime,
+                                                      String                    sequencingProperty,
+                                                      SequencingOrder           sequencingOrder,
+                                                      int                       pageSize) throws InvalidParameterException,
+                                                                                                 RepositoryErrorException,
+                                                                                                 TypeErrorException,
+                                                                                                 PropertyErrorException,
+                                                                                                 PagingErrorException,
+                                                                                                 FunctionNotSupportedException,
+                                                                                                 UserNotAuthorizedException
     {
         final String                       methodName = "findEntitiesByProperty()";
 
@@ -2263,7 +1898,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param classificationName - name of the classification - a null is not valid.
      * @param matchClassificationProperties - list of classification properties used to narrow the search.
      * @param matchCriteria - Enum defining how the properties should be matched to the classifications in the repository.
-     * @param fromEntityDetailElement - the starting element number of the entities to return.
+     * @param fromEntityElement - the starting element number of the entities to return.
      *                                This is used when retrieving elements
      *                                beyond the first page of results. Zero means start from the first element.
      * @param limitResultsByStatus - By default, entities in all statuses are returned.  However, it is possible
@@ -2286,25 +1921,27 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws PropertyErrorException - the properties specified are not valid for the requested type of
      *                                  classification.
      * @throws PagingErrorException - the paging/sequencing parameters are set up incorrectly.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
-     */
-    public  ArrayList<EntityDetail> findEntitiesByClassification(String                    userId,
-                                                                 String                    entityTypeGUID,
-                                                                 String                    classificationName,
-                                                                 InstanceProperties        matchClassificationProperties,
-                                                                 MatchCriteria             matchCriteria,
-                                                                 ArrayList<InstanceStatus> limitResultsByStatus,
-                                                                 Date                      asOfTime,
-                                                                 String                    sequencingProperty,
-                                                                 SequencingOrder           sequencingOrder,
-                                                                 int                       fromEntityDetailElement,
-                                                                 int                       pageSize) throws InvalidParameterException,
-                                                                                                            RepositoryErrorException,
-                                                                                                            TypeErrorException,
-                                                                                                            ClassificationErrorException,
-                                                                                                            PropertyErrorException,
-                                                                                                            PagingErrorException,
-                                                                                                            UserNotAuthorizedException
+     * @throws FunctionNotSupportedException - the repository does not support the asOfTime parameter.
+     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     */
+    public  List<EntityDetail> findEntitiesByClassification(String                    userId,
+                                                            String                    entityTypeGUID,
+                                                            String                    classificationName,
+                                                            InstanceProperties        matchClassificationProperties,
+                                                            MatchCriteria             matchCriteria,
+                                                            int                       fromEntityElement,
+                                                            List<InstanceStatus>      limitResultsByStatus,
+                                                            Date                      asOfTime,
+                                                            String                    sequencingProperty,
+                                                            SequencingOrder           sequencingOrder,
+                                                            int                       pageSize) throws InvalidParameterException,
+                                                                                                       RepositoryErrorException,
+                                                                                                       TypeErrorException,
+                                                                                                       ClassificationErrorException,
+                                                                                                       PropertyErrorException,
+                                                                                                       PagingErrorException,
+                                                                                                       FunctionNotSupportedException,
+                                                                                                       UserNotAuthorizedException
     {
         final String                       methodName = "findEntitiesByProperty()";
 
@@ -2319,7 +1956,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      *
      * @param userId - unique identifier for requesting user.
      * @param searchCriteria - String expression of the characteristics of the required relationships.
-     * @param fromEntityDetailElement - the starting element number of the entities to return.
+     * @param fromEntityElement - the starting element number of the entities to return.
      *                                This is used when retrieving elements
      *                                beyond the first page of results. Zero means start from the first element.
      * @param limitResultsByStatus - By default, entities in all statuses are returned.  However, it is possible
@@ -2340,21 +1977,23 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws PropertyErrorException - the sequencing property specified is not valid for any of the requested types of
      *                                  entity.
      * @throws PagingErrorException - the paging/sequencing parameters are set up incorrectly.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
-     */
-    public  ArrayList<EntityDetail> searchForEntities(String                          userId,
-                                                      String                          searchCriteria,
-                                                      int                             fromEntityDetailElement,
-                                                      ArrayList<InstanceStatus>       limitResultsByStatus,
-                                                      ArrayList<String>               limitResultsByClassification,
-                                                      Date                            asOfTime,
-                                                      String                          sequencingProperty,
-                                                      SequencingOrder                 sequencingOrder,
-                                                      int                             pageSize) throws InvalidParameterException,
-                                                                                                       RepositoryErrorException,
-                                                                                                       PropertyErrorException,
-                                                                                                       PagingErrorException,
-                                                                                                       UserNotAuthorizedException
+     * @throws FunctionNotSupportedException - the repository does not support the asOfTime parameter.
+     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     */
+    public  List<EntityDetail> searchForEntities(String                     userId,
+                                                 String                     searchCriteria,
+                                                 int                        fromEntityElement,
+                                                 List<InstanceStatus>       limitResultsByStatus,
+                                                 List<String>               limitResultsByClassification,
+                                                 Date                       asOfTime,
+                                                 String                     sequencingProperty,
+                                                 SequencingOrder            sequencingOrder,
+                                                 int                        pageSize) throws InvalidParameterException,
+                                                                                             RepositoryErrorException,
+                                                                                             PropertyErrorException,
+                                                                                             PagingErrorException,
+                                                                                             FunctionNotSupportedException,
+                                                                                             UserNotAuthorizedException
     {
         final String                       methodName = "searchForEntities()";
 
@@ -2431,18 +2070,18 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
 
 
     /**
-     * Return a historical versionName of a relationship.
+     * Return a historical version of a relationship.
      *
      * @param userId - unique identifier for requesting user.
      * @param guid - String unique identifier for the relationship.
      * @param asOfTime - the time used to determine which versionName of the entity that is desired.
-     * @return EntityDetail structure.
-     * @throws InvalidParameterException - the guid or date is null.
+     * @return Relationship structure.
+     * @throws InvalidParameterException - the guid or date is null or the date is for a future time.
      * @throws RepositoryErrorException - there is a problem communicating with the metadata repository where
      *                                 the metadata collection is stored.
      * @throws RelationshipNotKnownException - the requested entity instance is not known in the metadata collection
      *                                   at the time requested.
-     * @throws PropertyErrorException - the asOfTime property is for a future time
+     * @throws FunctionNotSupportedException - the repository does not support the asOfTime parameter.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
     public  Relationship getRelationship(String    userId,
@@ -2450,7 +2089,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
                                          Date      asOfTime) throws InvalidParameterException,
                                                                     RepositoryErrorException,
                                                                     RelationshipNotKnownException,
-                                                                    PropertyErrorException,
+                                                                    FunctionNotSupportedException,
                                                                     UserNotAuthorizedException
     {
         final String                       methodName = "getRelationship()";
@@ -2469,7 +2108,7 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @param relationshipTypeGUID - unique identifier (guid) for the new relationship's type.
      * @param matchProperties - list of  properties used to narrow the search.
      * @param matchCriteria - Enum defining how the properties should be matched to the relationships in the repository.
-     * @param fromEntityDetailElement - the starting element number of the entities to return.
+     * @param fromRelationshipElement - the starting element number of the entities to return.
      *                                This is used when retrieving elements
      *                                beyond the first page of results. Zero means start from the first element.
      * @param limitResultsByStatus - By default, relationships in all statuses are returned.  However, it is possible
@@ -2491,23 +2130,25 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws PropertyErrorException - the properties specified are not valid for any of the requested types of
      *                                  relationships.
      * @throws PagingErrorException - the paging/sequencing parameters are set up incorrectly.
+     * @throws FunctionNotSupportedException - the repository does not support the asOfTime parameter.
      * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
      */
-    public  ArrayList<Relationship> findRelationshipsByProperty(String                    userId,
-                                                                String                    relationshipTypeGUID,
-                                                                InstanceProperties        matchProperties,
-                                                                MatchCriteria             matchCriteria,
-                                                                int                       fromEntityDetailElement,
-                                                                ArrayList<InstanceStatus> limitResultsByStatus,
-                                                                Date                      asOfTime,
-                                                                String                    sequencingProperty,
-                                                                SequencingOrder           sequencingOrder,
-                                                                int                       pageSize) throws InvalidParameterException,
-                                                                                                           RepositoryErrorException,
-                                                                                                           TypeErrorException,
-                                                                                                           PropertyErrorException,
-                                                                                                           PagingErrorException,
-                                                                                                           UserNotAuthorizedException
+    public  List<Relationship> findRelationshipsByProperty(String                    userId,
+                                                           String                    relationshipTypeGUID,
+                                                           InstanceProperties        matchProperties,
+                                                           MatchCriteria             matchCriteria,
+                                                           int                       fromRelationshipElement,
+                                                           List<InstanceStatus>      limitResultsByStatus,
+                                                           Date                      asOfTime,
+                                                           String                    sequencingProperty,
+                                                           SequencingOrder           sequencingOrder,
+                                                           int                       pageSize) throws InvalidParameterException,
+                                                                                                      RepositoryErrorException,
+                                                                                                      TypeErrorException,
+                                                                                                      PropertyErrorException,
+                                                                                                      PagingErrorException,
+                                                                                                      FunctionNotSupportedException,
+                                                                                                      UserNotAuthorizedException
     {
         final String                       methodName = "findRelationshipsByProperty()";
 
@@ -2541,20 +2182,22 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      *                                  the metadata collection is stored.
      * @throws PropertyErrorException - there is a problem with one of the other parameters.
      * @throws PagingErrorException - the paging/sequencing parameters are set up incorrectly.
-     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
-     */
-    public  ArrayList<Relationship> searchForRelationships(String                    userId,
-                                                           String                    searchCriteria,
-                                                           int                       fromRelationshipElement,
-                                                           ArrayList<InstanceStatus> limitResultsByStatus,
-                                                           Date                      asOfTime,
-                                                           String                    sequencingProperty,
-                                                           SequencingOrder           sequencingOrder,
-                                                           int                       pageSize) throws InvalidParameterException,
-                                                                                                      RepositoryErrorException,
-                                                                                                      PropertyErrorException,
-                                                                                                      PagingErrorException,
-                                                                                                      UserNotAuthorizedException
+     * @throws FunctionNotSupportedException - the repository does not support the asOfTime parameter.
+     * @throws UserNotAuthorizedException - the userId is not permitted to perform this operation.
+     */
+    public  List<Relationship> searchForRelationships(String                    userId,
+                                                      String                    searchCriteria,
+                                                      int                       fromRelationshipElement,
+                                                      List<InstanceStatus>      limitResultsByStatus,
+                                                      Date                      asOfTime,
+                                                      String                    sequencingProperty,
+                                                      SequencingOrder           sequencingOrder,
+                                                      int                       pageSize) throws InvalidParameterException,
+                                                                                                 RepositoryErrorException,
+                                                                                                 PropertyErrorException,
+                                                                                                 PagingErrorException,
+                                                                                                 FunctionNotSupportedException,
+                                                                                                 UserNotAuthorizedException
     {
         final String                       methodName = "searchForRelationships()";
 
@@ -2582,16 +2225,18 @@ public class EnterpriseOMRSMetadataCollection extends OMRSMetadataCollection
      * @throws EntityNotKnownException - the entity identified by either the startEntityGUID or the endEntityGUID
      *                                   is not found in the metadata collection.
      * @throws PropertyErrorException - there is a problem with one of the other parameters.
+     * @throws FunctionNotSupportedException - the repository does not support the asOf

<TRUNCATED>