You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2019/10/03 07:31:17 UTC

[GitHub] [cxf] ashakirin commented on a change in pull request #580: CXF-8121 Improve STS REST interface

ashakirin commented on a change in pull request #580: CXF-8121 Improve STS REST interface
URL: https://github.com/apache/cxf/pull/580#discussion_r330897908
 
 

 ##########
 File path: services/sts/sts-rest/src/main/java/org/apache/cxf/sts/rest/api/BaseResponse.java
 ##########
 @@ -0,0 +1,77 @@
+/**
+ * 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.cxf.sts.rest.api;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "BaseResponse", propOrder = {
+        "status",
+        "message"
+})
+@XmlRootElement(name = "BaseResponse")
+public class BaseResponse implements Serializable {
+    private static final long serialVersionUID = 100L;
+
+    public enum StatusType {
+        // The service call has been successful
+        SUCCESS,
+        // The service call has been failed.
+        ERROR;
+    }
+
+    @XmlElement(required = true)
+    String status;
+
+    @XmlElement
+    String message;
+
+    public BaseResponse() {
+        this.status = StatusType.SUCCESS.name();
+    }
+
+    public BaseResponse(final String message) {
+        this.status = StatusType.ERROR.name();
 
 Review comment:
   Looks strange to have an error as default value, I find it no intuitive

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services