Adding new exceptions to handle specific errors in rest API
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2fb25df9 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2fb25df9 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2fb25df9 Branch: refs/heads/master Commit: 2fb25df936b633ba56d1f7ceb21284a1a86c6eec Parents: 8f20bc4 Author: Lahiru Sandaruwan <[email protected]> Authored: Wed Apr 29 15:14:37 2015 +0530 Committer: Lahiru Sandaruwan <[email protected]> Committed: Wed Apr 29 15:38:10 2015 +0530 ---------------------------------------------------------------------- .../ApplicationPolicyIdIsEmptyException.java | 70 ++++++++++++++++++++ .../ApplicationPolicyIsEmptyException.java | 70 ++++++++++++++++++++ .../exception/ClusterIdIsEmptyException.java | 70 ++++++++++++++++++++ .../exception/InvalidDomainException.java | 10 +++ 4 files changed, 220 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/2fb25df9/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ApplicationPolicyIdIsEmptyException.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ApplicationPolicyIdIsEmptyException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ApplicationPolicyIdIsEmptyException.java new file mode 100644 index 0000000..a7e0e8f --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ApplicationPolicyIdIsEmptyException.java @@ -0,0 +1,70 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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.stratos.rest.endpoint.exception; + +import javax.ws.rs.core.Response; + +public class ApplicationPolicyIdIsEmptyException extends RestAPIException { + + private static final long serialVersionUID = 1L; + + private String message; + private Response.Status httpStatusCode; + + public ApplicationPolicyIdIsEmptyException() { + super(); + } + + public ApplicationPolicyIdIsEmptyException(String message, Throwable cause) { + super(message, cause); + this.message = message; + } + + public ApplicationPolicyIdIsEmptyException(Response.Status httpStatusCode, String message, Throwable cause) { + super(message, cause); + this.message = message; + this.httpStatusCode = httpStatusCode; + } + + public ApplicationPolicyIdIsEmptyException(String message) { + super(message); + this.message = message; + } + + public ApplicationPolicyIdIsEmptyException(Response.Status httpStatusCode, String message) { + super(message); + this.message = message; + this.httpStatusCode = httpStatusCode; + } + + public ApplicationPolicyIdIsEmptyException(Throwable cause) { + super(cause); + } + + public String getMessage() { + return message; + } + + public Response.Status getHTTPStatusCode() { + return httpStatusCode; + } + + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/2fb25df9/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ApplicationPolicyIsEmptyException.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ApplicationPolicyIsEmptyException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ApplicationPolicyIsEmptyException.java new file mode 100644 index 0000000..27488fa --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ApplicationPolicyIsEmptyException.java @@ -0,0 +1,70 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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.stratos.rest.endpoint.exception; + +import javax.ws.rs.core.Response; + +public class ApplicationPolicyIsEmptyException extends RestAPIException { + + private static final long serialVersionUID = 1L; + + private String message; + private Response.Status httpStatusCode; + + public ApplicationPolicyIsEmptyException() { + super(); + } + + public ApplicationPolicyIsEmptyException(String message, Throwable cause) { + super(message, cause); + this.message = message; + } + + public ApplicationPolicyIsEmptyException(Response.Status httpStatusCode, String message, Throwable cause) { + super(message, cause); + this.message = message; + this.httpStatusCode = httpStatusCode; + } + + public ApplicationPolicyIsEmptyException(String message) { + super(message); + this.message = message; + } + + public ApplicationPolicyIsEmptyException(Response.Status httpStatusCode, String message) { + super(message); + this.message = message; + this.httpStatusCode = httpStatusCode; + } + + public ApplicationPolicyIsEmptyException(Throwable cause) { + super(cause); + } + + public String getMessage() { + return message; + } + + public Response.Status getHTTPStatusCode() { + return httpStatusCode; + } + + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/2fb25df9/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ClusterIdIsEmptyException.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ClusterIdIsEmptyException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ClusterIdIsEmptyException.java new file mode 100644 index 0000000..804031f --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/ClusterIdIsEmptyException.java @@ -0,0 +1,70 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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.stratos.rest.endpoint.exception; + +import javax.ws.rs.core.Response; + +public class ClusterIdIsEmptyException extends RestAPIException { + + private static final long serialVersionUID = 1L; + + private String message; + private Response.Status httpStatusCode; + + public ClusterIdIsEmptyException() { + super(); + } + + public ClusterIdIsEmptyException(String message, Throwable cause) { + super(message, cause); + this.message = message; + } + + public ClusterIdIsEmptyException(Response.Status httpStatusCode, String message, Throwable cause) { + super(message, cause); + this.message = message; + this.httpStatusCode = httpStatusCode; + } + + public ClusterIdIsEmptyException(String message) { + super(message); + this.message = message; + } + + public ClusterIdIsEmptyException(Response.Status httpStatusCode, String message) { + super(message); + this.message = message; + this.httpStatusCode = httpStatusCode; + } + + public ClusterIdIsEmptyException(Throwable cause) { + super(cause); + } + + public String getMessage() { + return message; + } + + public Response.Status getHTTPStatusCode() { + return httpStatusCode; + } + + +} http://git-wip-us.apache.org/repos/asf/stratos/blob/2fb25df9/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/InvalidDomainException.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/InvalidDomainException.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/InvalidDomainException.java new file mode 100644 index 0000000..56125a3 --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/exception/InvalidDomainException.java @@ -0,0 +1,10 @@ +package org.apache.stratos.rest.endpoint.exception; + +/** + * Created by lahiru on 4/28/15. + */ +public class InvalidDomainException extends RestAPIException{ + public InvalidDomainException(String msg) { + super(msg); + } +}
