http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RepositoryErrorException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RepositoryErrorException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RepositoryErrorException.java deleted file mode 100644 index 85d8821..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RepositoryErrorException.java +++ /dev/null @@ -1,61 +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.ffdc.exception; - -/** - * RepositoryErrorException provides a checked exception for reporting situations where the metadata - * repository hosting a metadata collection is unable to perform a request. - * The OMRSErrorCode adds specific details for the cause/effect of the error. - */ -public class RepositoryErrorException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor for creating a RepositoryErrorException. It captures the essential details - * about the error, where it occurred and how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - */ - public RepositoryErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This constructor is used when an unexpected exception has been caught that needs to be wrapped in a - * RepositoryErrorException in order to add the essential details about the error, where it occurred and - * how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - * @param caughtException the exception/error that caused this exception to be raised - */ - public RepositoryErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtException) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtException); - } -}
http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/StatusNotSupportedException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/StatusNotSupportedException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/StatusNotSupportedException.java deleted file mode 100644 index 916edf1..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/StatusNotSupportedException.java +++ /dev/null @@ -1,61 +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.ffdc.exception; - -/** - * StatusNotSupportedException provides a checked exception for reporting that the metadata repository hosting - * a metadata collection is not able to support the requested status. - * The OMRSErrorCode adds specific details for the cause/effect of the error. - */ -public class StatusNotSupportedException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor for creating an StatusNotSupportedException. It captures the essential details - * about the error, where it occurred and how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - */ - public StatusNotSupportedException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This constructor is used when an unexpected exception has been caught that needs to be wrapped in an - * StatusNotSupportedException in order to add the essential details about the error, where it occurred and - * how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - * @param caughtException the exception/error that caused this exception to be raised - */ - public StatusNotSupportedException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtException) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtException); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefConflictException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefConflictException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefConflictException.java deleted file mode 100644 index 5831538..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefConflictException.java +++ /dev/null @@ -1,60 +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.ffdc.exception; - -/** - * TypeDefConflictException provides a checked exception for reporting that a typedef can not be added because - * it conflicts with a TypeDef already stored. The OMRSErrorCode adds specific details for the cause/effect of the error. - */ -public class TypeDefConflictException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor for creating a TypeDefConflictException. It captures the essential details - * about the error, where it occurred and how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - */ - public TypeDefConflictException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This constructor is used when an unexpected exception has been caught that needs to be wrapped in a - * TypeDefConflictException in order to add the essential details about the error, where it occurred and - * how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - * @param caughtException the exception/error that caused this exception to be raised - */ - public TypeDefConflictException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtException) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtException); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefInUseException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefInUseException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefInUseException.java deleted file mode 100644 index 9f9019e..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefInUseException.java +++ /dev/null @@ -1,60 +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.ffdc.exception; - -/** - * TypeDefInUseException provides a checked exception for reporting that a typedef can not be deleted because there are - * instances currently using it. The OMRSErrorCode adds specific details for the cause/effect of the error. - */ -public class TypeDefInUseException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor for creating an TypeDefInUseException. It captures the essential details - * about the error, where it occurred and how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - */ - public TypeDefInUseException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This constructor is used when an unexpected exception has been caught that needs to be wrapped in a - * TypeDefInUseException in order to add the essential details about the error, where it occurred and - * how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - * @param caughtException the exception/error that caused this exception to be raised - */ - public TypeDefInUseException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtException) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtException); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefKnownException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefKnownException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefKnownException.java deleted file mode 100644 index 96f2374..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefKnownException.java +++ /dev/null @@ -1,60 +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.ffdc.exception; - -/** - * TypeDefKnownException provides a checked exception for reporting that a type definition (TypeDef) can not be added because - * it is already known to the repository. The OMRSErrorCode adds specific details for the cause/effect of the error. - */ -public class TypeDefKnownException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor for creating an TypeDefKnownException. It captures the essential details - * about the error, where it occurred and how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - */ - public TypeDefKnownException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This constructor is used when an unexpected exception has been caught that needs to be wrapped in a - * TypeDefKnownException in order to add the essential details about the error, where it occurred and - * how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - * @param caughtException the exception/error that caused this exception to be raised - */ - public TypeDefKnownException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtException) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtException); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotKnownException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotKnownException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotKnownException.java deleted file mode 100644 index 063dfdc..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotKnownException.java +++ /dev/null @@ -1,60 +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.ffdc.exception; - -/** - * TypeDefNotKnownException provides a checked exception for reporting that a requested typedef can not be found. - * The OMRSErrorCode adds specific details for the cause/effect of the error. - */ -public class TypeDefNotKnownException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor for creating a TypeDefNotKnownException. It captures the essential details - * about the error, where it occurred and how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - */ - public TypeDefNotKnownException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This constructor is used when an unexpected exception has been caught that needs to be wrapped in a - * TypeDefNotKnownException in order to add the essential details about the error, where it occurred and - * how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - * @param caughtException the exception/error that caused this exception to be raised - */ - public TypeDefNotKnownException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtException) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtException); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotSupportedException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotSupportedException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotSupportedException.java deleted file mode 100644 index 46bf124..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotSupportedException.java +++ /dev/null @@ -1,60 +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.ffdc.exception; - -/** - * TypeDefNotSupportedException provides a checked exception for reporting that a typedef can not be added because - * the local repository can not support it. The OMRSErrorCode adds specific details for the cause/effect of the error. - */ -public class TypeDefNotSupportedException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor for creating a TypeDefNotSupportedException. It captures the essential details - * about the error, where it occurred and how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - */ - public TypeDefNotSupportedException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This constructor is used when an unexpected exception has been caught that needs to be wrapped in a - * TypeDefNotSupportedException in order to add the essential details about the error, where it occurred and - * how to fix it. - * - * @param httpCode code to use across a REST interface - * @param className name of class reporting error - * @param actionDescription description of function it was performing when error detected - * @param errorMessage description of error - * @param systemAction actions of the system as a result of the error - * @param userAction instructions for correcting the error - * @param caughtException the exception/error that caused this exception to be raised - */ - public TypeDefNotSupportedException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtException) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtException); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeErrorException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeErrorException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeErrorException.java deleted file mode 100644 index e56f824..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeErrorException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.omrs.ffdc.exception; - -/** - * The TypeErrorException is thrown by an OMRS Connector when the requested type for an instance is not represented by - * a known TypeDef. - */ -public class TypeErrorException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor used for creating a TypeErrorException. - * - * @param httpCode - http response code to use if this exception flows over a REST call - * @param className - name of class reporting error - * @param actionDescription - description of function it was performing when error detected - * @param errorMessage - description of error - * @param systemAction - actions of the system as a result of the error - * @param userAction - instructions for correcting the error - */ - public TypeErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This is the constructor used for creating a TypeErrorException that resulted from a previous error. - * - * @param httpCode - http response code to use if this exception flows over a REST call - * @param className - name of class reporting error - * @param actionDescription - description of function it was performing when error detected - * @param errorMessage - description of error - * @param systemAction - actions of the system as a result of the error - * @param userAction - instructions for correcting the error - * @param caughtError - the error that resulted in this exception. - * */ - public TypeErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtError) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtError); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/UserNotAuthorizedException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/UserNotAuthorizedException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/UserNotAuthorizedException.java deleted file mode 100644 index 3404056..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/UserNotAuthorizedException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.atlas.omrs.ffdc.exception; - -/** - * The UserNotAuthorizedException is thrown by an OMRS Connector when the supplied UserId is not permitted to - * perform a specific operation on the metadata collection. - */ -public class UserNotAuthorizedException extends OMRSCheckedExceptionBase -{ - /** - * This is the typical constructor used for creating a UserNotAuthorizedException. - * - * @param httpCode - http response code to use if this exception flows over a REST call - * @param className - name of class reporting error - * @param actionDescription - description of function it was performing when error detected - * @param errorMessage - description of error - * @param systemAction - actions of the system as a result of the error - * @param userAction - instructions for correcting the error - */ - public UserNotAuthorizedException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); - } - - - /** - * This is the constructor used for creating a UserNotAuthorizedException that resulted from a previous error. - * - * @param httpCode - http response code to use if this exception flows over a REST call - * @param className - name of class reporting error - * @param actionDescription - description of function it was performing when error detected - * @param errorMessage - description of error - * @param systemAction - actions of the system as a result of the error - * @param userAction - instructions for correcting the error - * @param caughtError - the error that resulted in this exception. - * */ - public UserNotAuthorizedException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtError) - { - super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtError); - } -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/localrepository/OMRSLocalRepository.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/OMRSLocalRepository.java b/omrs/src/main/java/org/apache/atlas/omrs/localrepository/OMRSLocalRepository.java deleted file mode 100644 index 53553f9..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/OMRSLocalRepository.java +++ /dev/null @@ -1,97 +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; - -import org.apache.atlas.ocf.properties.beans.Connection; -import org.apache.atlas.omrs.eventmanagement.events.OMRSInstanceEventProcessor; -import org.apache.atlas.omrs.eventmanagement.OMRSRepositoryEventManager; -import org.apache.atlas.omrs.eventmanagement.events.OMRSTypeDefEventProcessor; - - -/** - * OMRSLocalRepository is an interface used by the OMRS components to retrieve information about the local - * repository, to register listeners and to get access to the connector for the local repository. - */ -public interface OMRSLocalRepository -{ - /** - * Returns the unique identifier (guid) of the local repository's metadata collection. - * - * @return String guid - */ - String getMetadataCollectionId(); - - - /** - * Returns the Connection to the local repository that can be used by remote servers to create - * an OMRS repository connector to call this server in order to access the local repository. - * - * @return Connection object - */ - Connection getLocalRepositoryRemoteConnection(); - - - /** - * Return the event manager that the local repository uses to - * - * @return outbound repository event manager - */ - OMRSRepositoryEventManager getOutboundRepositoryEventManager(); - - - /** - * Return the TypeDef event processor that should be passed all incoming TypeDef events received - * from the cohorts that this server is a member of. - * - * @return OMRSTypeDefEventProcessor for the local repository. - */ - OMRSTypeDefEventProcessor getIncomingTypeDefEventProcessor(); - - - /** - * Return the instance event processor that should be passed all incoming instance events received - * from the cohorts that this server is a member of. - * - * @return OMRSInstanceEventProcessor for the local repository. - */ - OMRSInstanceEventProcessor getIncomingInstanceEventProcessor(); - - - /** - * Return the local server name - used for outbound events. - * - * @return String name - */ - String getLocalServerName(); - - - /** - * Return the local server type - used for outbound events. - * - * @return String name - */ - String getLocalServerType(); - - - /** - * Return the name of the organization that owns this local repository. - * - * @return String name - */ - String getOrganizationName(); -} http://git-wip-us.apache.org/repos/asf/atlas/blob/68b47923/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositoryconnector/LocalOMRSConnectorProvider.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositoryconnector/LocalOMRSConnectorProvider.java b/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositoryconnector/LocalOMRSConnectorProvider.java deleted file mode 100644 index 4d3ddb4..0000000 --- a/omrs/src/main/java/org/apache/atlas/omrs/localrepository/repositoryconnector/LocalOMRSConnectorProvider.java +++ /dev/null @@ -1,190 +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.repositoryconnector; - -import org.apache.atlas.ocf.Connector; -import org.apache.atlas.ocf.ConnectorBroker; -import org.apache.atlas.ocf.ConnectorProvider; -import org.apache.atlas.ocf.ffdc.ConnectionCheckedException; -import org.apache.atlas.ocf.ffdc.ConnectorCheckedException; -import org.apache.atlas.ocf.properties.Connection; -import org.apache.atlas.omrs.eventmanagement.OMRSRepositoryEventExchangeRule; -import org.apache.atlas.omrs.eventmanagement.OMRSRepositoryEventManager; -import org.apache.atlas.omrs.eventmanagement.repositoryeventmapper.OMRSRepositoryEventMapper; -import org.apache.atlas.omrs.eventmanagement.repositoryeventmapper.OMRSRepositoryEventMapperConnector; -import org.apache.atlas.omrs.ffdc.OMRSErrorCode; -import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSRepositoryContentManager; -import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSRepositoryHelper; -import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSRepositoryValidator; -import org.apache.atlas.omrs.metadatacollection.repositoryconnector.OMRSRepositoryConnector; - -import java.util.UUID; - - -/** - * LocalOMRSConnectorProvider implements the connector provider for LocalOMRSRepositoryConnector. Since a server only - * has one LocalOMRSRepositoryConnector, this connector provider returns the singleton connector for the local repository. - */ -public class LocalOMRSConnectorProvider extends ConnectorProvider -{ - private String localMetadataCollectionId = null; - private Connection localRepositoryRemoteConnection = null; - private OMRSRepositoryEventMapperConnector realEventMapper = null; - private OMRSRepositoryEventManager outboundRepositoryEventManager = null; - private OMRSRepositoryContentManager repositoryContentManager = null; - private OMRSRepositoryEventExchangeRule saveExchangeRule = null; - private LocalOMRSRepositoryConnector localRepositoryConnector = null; - - - - /** - * Constructor used by OMRSOperationalServices during server start-up - it - * provides the configuration information about the local server that is used to set up the - * local repository connector. - * - * @param localMetadataCollectionId - metadata collection Id for the local repository - * @param localRepositoryRemoteConnection - connection object for creating a remote connector to this repository. - * @param realEventMapper - optional event mapper for local repository - * @param outboundRepositoryEventManager - event manager to call for outbound events. - * @param repositoryContentManager - repositoryContentManager for supporting OMRS in managing TypeDefs. - * @param saveExchangeRule - rule to determine what events to save to the local repository. - */ - public LocalOMRSConnectorProvider(String localMetadataCollectionId, - Connection localRepositoryRemoteConnection, - OMRSRepositoryEventMapperConnector realEventMapper, - OMRSRepositoryEventManager outboundRepositoryEventManager, - OMRSRepositoryContentManager repositoryContentManager, - OMRSRepositoryEventExchangeRule saveExchangeRule) - { - this.localMetadataCollectionId = localMetadataCollectionId; - this.localRepositoryRemoteConnection = localRepositoryRemoteConnection; - this.realEventMapper = realEventMapper; - this.outboundRepositoryEventManager = outboundRepositoryEventManager; - this.repositoryContentManager = repositoryContentManager; - this.saveExchangeRule = saveExchangeRule; - } - - - /** - * Constructor used by the OCF ConnectorBroker. This approach will result in an exception - * when getConnector is called because there is no localMetadataCollectionId (amongst other things). - */ - public LocalOMRSConnectorProvider() - { - } - - - /** - * Creates a new instance of a connector based on the information in the supplied connection. - * - * @param realLocalConnection - connection that should have all of the properties needed by the Connector Provider - * to create a connector instance. - * @return Connector - instance of the LocalOMRSRepositoryConnector wrapping the real local connector. - * @throws ConnectionCheckedException - if there are missing or invalid properties in the connection - * @throws ConnectorCheckedException - if there are issues instantiating or initializing the connector - */ - public synchronized Connector getConnector(Connection realLocalConnection) throws ConnectionCheckedException, - ConnectorCheckedException - { - String methodName = "getConnector()"; - - if (localMetadataCollectionId == null) - { - /* - * Throw checked exception to indicate that the local repository is not available. This - * is likely to be a configuration error. - */ - OMRSErrorCode errorCode = OMRSErrorCode.LOCAL_REPOSITORY_CONFIGURATION_ERROR; - String errorMessage = errorCode.getErrorMessageId() - + errorCode.getFormattedErrorMessage(); - - throw new ConnectorCheckedException(errorCode.getHTTPErrorCode(), - this.getClass().getName(), - methodName, - errorMessage, - errorCode.getSystemAction(), - errorCode.getUserAction()); - } - - /* - * Only create one instance of the connector - */ - if (localRepositoryConnector == null) - { - OMRSRepositoryConnector realLocalConnector; - - /* - * Any problems creating the connector to the local repository are passed to the caller as exceptions. - */ - ConnectorBroker connectorBroker = new ConnectorBroker(); - Connector connector = connectorBroker.getConnector(realLocalConnection); - - /* - * Try casting the returned connector to a repository connector. This should work unless the connection - * passed is for a different type of connector. - */ - try - { - realLocalConnector = (OMRSRepositoryConnector) connector; - } - catch (Throwable error) - { - OMRSErrorCode errorCode = OMRSErrorCode.BAD_LOCAL_REPOSITORY_CONNECTION; - String errorMessage = errorCode.getErrorMessageId() - + errorCode.getFormattedErrorMessage(); - - throw new ConnectionCheckedException(errorCode.getHTTPErrorCode(), - this.getClass().getName(), - methodName, - errorMessage, - errorCode.getSystemAction(), - errorCode.getUserAction(), - error); - } - - /* - * With the connection to the real local repository established it is possible to create the wrapper - * for the local repository. This wrapper is seen by most OMRS Components as the local repository - * connector. The exceptions are the inbound event processors that work with the real local connector. - */ - localRepositoryConnector = new LocalOMRSRepositoryConnector(realLocalConnector, - realEventMapper, - outboundRepositoryEventManager, - repositoryContentManager, - saveExchangeRule); - localRepositoryConnector.initialize(this.getNewConnectorGUID(), localRepositoryRemoteConnection); - } - - return localRepositoryConnector; - } - - - /** - * Each connector has a guid to make it easier to correlate log messages from the various components that - * serve it. It uses a type 4 (pseudo randomly generated) UUID. - * The UUID is generated using a cryptographically strong pseudo random number generator. - * - * @return guid for a new connector instance - */ - private String getNewConnectorGUID() - { - UUID newUUID = UUID.randomUUID(); - - return newUUID.toString(); - } -}
