http://git-wip-us.apache.org/repos/asf/atlas/blob/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSConnectorErrorException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSConnectorErrorException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSConnectorErrorException.java new file mode 100644 index 0000000..eae658a --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSConnectorErrorException.java @@ -0,0 +1,184 @@ +/* + * 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; + +/** + * OMRSConnectorErrorException is used for all runtime exceptions generated by the Open Metadata Repository Services (OMRS) + * components that indicate a problem with one of its connectors. It is typically wrapping an OCF checked exception. + */ +public class OMRSConnectorErrorException extends OMRSRuntimeException +{ + /* + * These default values are only seen if this exception is initialized using one of its superclass constructors. + */ + private int reportedHTTPCode = 500; + private String reportingClassName = "<Unknown>"; + private String reportingActionDescription = "<Unknown>"; + private String reportedErrorMessage = "<Unknown>"; + private String reportedSystemAction = "<Unknown>"; + private String reportedUserAction = "<Unknown>"; + private Throwable [] reportedCaughtExceptions = null; + + + /** + * This is the typical constructor used for creating an OMRSLogicErrorException. + * + * @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 OMRSConnectorErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) + { + super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); + + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + } + + + /** + * This is the constructor used for creating a OMRSLogicErrorException when an unexpected exception has been caught. + * + * @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 - previous error causing this exception + */ + public OMRSConnectorErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtError) + { + super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtError); + + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + this.reportedCaughtExceptions = new Throwable[1]; + this.reportedCaughtExceptions[0] = caughtError; + } + + /** + * This is the constructor used for creating a OMRSLogicErrorException when multiple unexpected errors + * have been caught. + * + * @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 caughtErrors - previous errors causing this exception + */ + public OMRSConnectorErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable[] caughtErrors) + { + super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtErrors); + + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + this.reportedCaughtExceptions = caughtErrors; + } + + /** + * Return the HTTP response code to use with this exception. + * + * @return reportedHTTPCode + */ + public int getReportedHTTPCode() + { + return reportedHTTPCode; + } + + /** + * The class that created this exception. + * + * @return reportingClassName + */ + public String getReportingClassName() + { + return reportingClassName; + } + + + /** + * The type of request that the class was performing when the condition occurred that resulted in this + * exception. + * + * @return reportingActionDescription + */ + public String getReportingActionDescription() + { + return reportingActionDescription; + } + + + /** + * A formatted short description of the cause of the condition that resulted in this exception. + * + * @return reportedErrorMessage + */ + public String getErrorMessage() + { + return reportedErrorMessage; + } + + + /** + * A description of the action that the system took as a result of the error condition. + * + * @return reportedSystemAction + */ + public String getReportedSystemAction() + { + return reportedSystemAction; + } + + + /** + * A description of the action necessary to correct the error. + * + * @return reportedUserAction + */ + public String getReportedUserAction() + { + return reportedUserAction; + } + + + /** + * An exception that was caught and wrapped by this exception. If a null is returned, then this exception is + * newly created and not the result of a previous exception. + * + * @return reportedCaughtException + */ + public Throwable[] getReportedCaughtExceptions() { return reportedCaughtExceptions; } +}
http://git-wip-us.apache.org/repos/asf/atlas/blob/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSLogicErrorException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSLogicErrorException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSLogicErrorException.java new file mode 100644 index 0000000..7935140 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSLogicErrorException.java @@ -0,0 +1,185 @@ +/* + * 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; + +/** + * OMRSLogicErrorException is used for all runtime exceptions generated by the Open Metadata Repository Services (OMRS) + * components that indicate a logic error. Effectively this exception should never be seen. + * It is used in conjunction with the OMRSErrorCode to provide first failure data capture for these errors. + */ +public class OMRSLogicErrorException extends OMRSRuntimeException +{ + /* + * These default values are only seen if this exception is initialized using one of its superclass constructors. + */ + private int reportedHTTPCode = 500; + private String reportingClassName = "<Unknown>"; + private String reportingActionDescription = "<Unknown>"; + private String reportedErrorMessage = "<Unknown>"; + private String reportedSystemAction = "<Unknown>"; + private String reportedUserAction = "<Unknown>"; + private Throwable [] reportedCaughtExceptions = null; + + + /** + * This is the typical constructor used for creating an OMRSLogicErrorException. + * + * @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 OMRSLogicErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) + { + super(httpCode, className, actionDescription, errorMessage, systemAction, userAction); + + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + } + + + /** + * This is the constructor used for creating a OMRSLogicErrorException when an unexpected exception has been caught. + * + * @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 - previous error causing this exception + */ + public OMRSLogicErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtError) + { + super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtError); + + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + this.reportedCaughtExceptions = new Throwable[1]; + this.reportedCaughtExceptions[0] = caughtError; + } + + /** + * This is the constructor used for creating a OMRSLogicErrorException when multiple unexpected errors + * have been caught. + * + * @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 caughtErrors - previous errors causing this exception + */ + public OMRSLogicErrorException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable[] caughtErrors) + { + super(httpCode, className, actionDescription, errorMessage, systemAction, userAction, caughtErrors); + + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + this.reportedCaughtExceptions = caughtErrors; + } + + /** + * Return the HTTP response code to use with this exception. + * + * @return reportedHTTPCode + */ + public int getReportedHTTPCode() + { + return reportedHTTPCode; + } + + /** + * The class that created this exception. + * + * @return reportingClassName + */ + public String getReportingClassName() + { + return reportingClassName; + } + + + /** + * The type of request that the class was performing when the condition occurred that resulted in this + * exception. + * + * @return reportingActionDescription + */ + public String getReportingActionDescription() + { + return reportingActionDescription; + } + + + /** + * A formatted short description of the cause of the condition that resulted in this exception. + * + * @return reportedErrorMessage + */ + public String getErrorMessage() + { + return reportedErrorMessage; + } + + + /** + * A description of the action that the system took as a result of the error condition. + * + * @return reportedSystemAction + */ + public String getReportedSystemAction() + { + return reportedSystemAction; + } + + + /** + * A description of the action necessary to correct the error. + * + * @return reportedUserAction + */ + public String getReportedUserAction() + { + return reportedUserAction; + } + + + /** + * An exception that was caught and wrapped by this exception. If a null is returned, then this exception is + * newly created and not the result of a previous exception. + * + * @return reportedCaughtException + */ + public Throwable[] getReportedCaughtExceptions() { return reportedCaughtExceptions; } +} http://git-wip-us.apache.org/repos/asf/atlas/blob/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSRuntimeException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSRuntimeException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSRuntimeException.java new file mode 100644 index 0000000..c72aaf6 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/OMRSRuntimeException.java @@ -0,0 +1,181 @@ +/* + * 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; + +/** + * OMRSRuntimeException is used for all runtime exceptions generated by the Open Metadata Repository Services (OMRS). + * It is used in conjunction with the OMRSErrorCode to provide first failure data capture for these errors. + */ +public class OMRSRuntimeException extends RuntimeException +{ + /* + * These default values are only seen if this exception is initialized using one of its superclass constructors. + */ + private int reportedHTTPCode = 500; + private String reportingClassName = "<Unknown>"; + private String reportingActionDescription = "<Unknown>"; + private String reportedErrorMessage = "<Unknown>"; + private String reportedSystemAction = "<Unknown>"; + private String reportedUserAction = "<Unknown>"; + private Throwable [] reportedCaughtExceptions = null; + + + /** + * This is the typical constructor used for creating an OMRSRuntimeException. + * + * @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 OMRSRuntimeException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction) + { + super(errorMessage); + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + } + + + /** + * This is the constructor used for creating a OMRSRuntimeException when an unexpected error has been caught. + * + * @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 - previous error causing this exception + */ + public OMRSRuntimeException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable caughtError) + { + super(errorMessage, caughtError); + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + this.reportedCaughtExceptions = new Throwable[1]; + this.reportedCaughtExceptions[0] = caughtError; + } + + /** + * This is the constructor used for creating a OMRSRuntimeException when multiple unexpected errors + * have been caught. + * + * @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 caughtErrors - previous errors causing this exception + */ + public OMRSRuntimeException(int httpCode, String className, String actionDescription, String errorMessage, String systemAction, String userAction, Throwable[] caughtErrors) + { + super(errorMessage, caughtErrors[0]); + this.reportedHTTPCode = httpCode; + this.reportingClassName = className; + this.reportingActionDescription = actionDescription; + this.reportedErrorMessage = errorMessage; + this.reportedSystemAction = systemAction; + this.reportedUserAction = userAction; + this.reportedCaughtExceptions = caughtErrors; + } + + /** + * Return the HTTP response code to use with this exception. + * + * @return reportedHTTPCode + */ + public int getReportedHTTPCode() + { + return reportedHTTPCode; + } + + /** + * The class that created this exception. + * + * @return reportingClassName + */ + public String getReportingClassName() + { + return reportingClassName; + } + + + /** + * The type of request that the class was performing when the condition occurred that resulted in this + * exception. + * + * @return reportingActionDescription + */ + public String getReportingActionDescription() + { + return reportingActionDescription; + } + + + /** + * A formatted short description of the cause of the condition that resulted in this exception. + * + * @return reportedErrorMessage + */ + public String getErrorMessage() + { + return reportedErrorMessage; + } + + + /** + * A description of the action that the system took as a result of the error condition. + * + * @return reportedSystemAction + */ + public String getReportedSystemAction() + { + return reportedSystemAction; + } + + + /** + * A description of the action necessary to correct the error. + * + * @return reportedUserAction + */ + public String getReportedUserAction() + { + return reportedUserAction; + } + + + /** + * An exception that was caught and wrapped by this exception. If a null is returned, then this exception is + * newly created and not the result of a previous exception. + * + * @return reportedCaughtException + */ + public Throwable[] getReportedCaughtExceptions() { return reportedCaughtExceptions; } +} http://git-wip-us.apache.org/repos/asf/atlas/blob/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PagingErrorException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PagingErrorException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PagingErrorException.java new file mode 100644 index 0000000..5e91a58 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PagingErrorException.java @@ -0,0 +1,57 @@ +/* + * 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 PagingErrorException is thrown by an OMRS Connector when the caller has passed invalid paging attributes + * on a search call. + */ +public class PagingErrorException extends OMRSCheckedExceptionBase +{ + /** + * This is the typical constructor used for creating a PagingErrorException. + * + * @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 PagingErrorException(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 PagingErrorException 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 PagingErrorException(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/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PatchErrorException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PatchErrorException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PatchErrorException.java new file mode 100644 index 0000000..80e806b --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PatchErrorException.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** + * PatchErrorException provides a checked exception for reporting that a typedef can not be updated because there are + * problems with the supplied TypeDefPatch. The OMRSErrorCode adds specific details for the cause/effect of the error. + */ +public class PatchErrorException extends OMRSCheckedExceptionBase +{ + /** + * This is the typical constructor for creating an PatchErrorException. 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 PatchErrorException(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 + * PatchErrorException 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 PatchErrorException(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/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PropertyErrorException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PropertyErrorException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PropertyErrorException.java new file mode 100644 index 0000000..9be99c2 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/PropertyErrorException.java @@ -0,0 +1,57 @@ +/* + * 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 PropertyErrorException is thrown by an OMRS Connector when the properties defined for a specific entity + * or relationship instance do not match the TypeDefs for the metadata collection. + */ +public class PropertyErrorException extends OMRSCheckedExceptionBase +{ + /** + * This is the typical constructor used for creating a PropertyErrorException. + * + * @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 PropertyErrorException(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 PropertyErrorException 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 PropertyErrorException(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/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipConflictException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipConflictException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipConflictException.java new file mode 100644 index 0000000..c0b76c9 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipConflictException.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** + * RelationshipConflictException provides a checked exception for reporting that a relationship can not be added because + * it conflicts with a relationship already stored. The OMRSErrorCode adds specific details for the cause/effect of the error. + */ +public class RelationshipConflictException extends OMRSCheckedExceptionBase +{ + /** + * This is the typical constructor for creating a RelationshipConflictException. 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 RelationshipConflictException(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 + * RelationshipConflictException 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 RelationshipConflictException(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/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipKnownException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipKnownException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipKnownException.java new file mode 100644 index 0000000..bf8559f --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipKnownException.java @@ -0,0 +1,57 @@ +/* + * 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 RelationshipKnownException is thrown by an OMRS Connector when a specific relationship instance is added but this + * relationship is already stored in the metadata collection. + */ +public class RelationshipKnownException extends OMRSCheckedExceptionBase +{ + /** + * This is the typical constructor used for creating a RelationshipKnownException. + * + * @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 RelationshipKnownException(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 RelationshipKnownException 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 RelationshipKnownException(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/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipNotDeletedException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipNotDeletedException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipNotDeletedException.java new file mode 100644 index 0000000..bc3f5c0 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipNotDeletedException.java @@ -0,0 +1,58 @@ +/* + * 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; + +/** + * RelationshipNotDeletedException is thrown by an OMRS Connector when a request is made to purge or restore a specific + * relationship instance and the entity is not in DELETED status. + * + */ +public class RelationshipNotDeletedException extends OMRSCheckedExceptionBase +{ + /** + * This is the typical constructor used for creating an RelationshipNotDeletedException. + * + * @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 RelationshipNotDeletedException(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 an RelationshipNotDeletedException 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 RelationshipNotDeletedException(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/8a57e657/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipNotKnownException.java ---------------------------------------------------------------------- diff --git a/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipNotKnownException.java b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipNotKnownException.java new file mode 100644 index 0000000..209e675 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RelationshipNotKnownException.java @@ -0,0 +1,61 @@ +/* + * 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; + +/** + * RelationshipNotKnownException provides a checked exception for reporting when a requested relationship + * instance can not be found in the metadata collection. + * The OMRSErrorCode adds specific details for the cause/effect of the error. + */ +public class RelationshipNotKnownException extends OMRSCheckedExceptionBase +{ + /** + * This is the typical constructor for creating a RelationshipNotKnownException. 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 RelationshipNotKnownException(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 + * RelationshipNotKnownException 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 RelationshipNotKnownException(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/8a57e657/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 new file mode 100644 index 0000000..85d8821 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/RepositoryErrorException.java @@ -0,0 +1,61 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..916edf1 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/StatusNotSupportedException.java @@ -0,0 +1,61 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..5831538 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefConflictException.java @@ -0,0 +1,60 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..9f9019e --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefInUseException.java @@ -0,0 +1,60 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..96f2374 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefKnownException.java @@ -0,0 +1,60 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..063dfdc --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotKnownException.java @@ -0,0 +1,60 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..46bf124 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeDefNotSupportedException.java @@ -0,0 +1,60 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..e56f824 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/TypeErrorException.java @@ -0,0 +1,57 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..3404056 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/ffdc/exception/UserNotAuthorizedException.java @@ -0,0 +1,57 @@ +/* + * 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/8a57e657/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 new file mode 100644 index 0000000..459eaa9 --- /dev/null +++ b/omrs/src/main/java/org/apache/atlas/omrs/localrepository/OMRSLocalRepository.java @@ -0,0 +1,83 @@ +/* + * 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.Connection; +import org.apache.atlas.omrs.eventmanagement.events.OMRSInstanceEventProcessor; +import org.apache.atlas.omrs.eventmanagement.OMRSRepositoryEventManager; +import org.apache.atlas.omrs.eventmanagement.events.OMRSTypeDefEventProcessor; +import org.apache.atlas.omrs.localrepository.repositorycontentmanager.OMRSTypeDefValidator; + + +/** + * 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 TypeDefManager. This is used to validate that a list of type definitions (TypeDefs) are + * compatible with the local repository. + * + * @return OMRSTypeDefValidator object for the local repository. + */ + OMRSTypeDefValidator getTypeDefValidator(); + + + /** + * 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(); +}
