You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sirona.apache.org by ol...@apache.org on 2014/08/28 02:38:21 UTC

svn commit: r1621005 - in /incubator/sirona/trunk/server/reporting: reporting-api/src/main/java/org/apache/sirona/reporting/web/status/ reporting-webapp/src/main/java/org/apache/sirona/reporting/web/plugin/status/

Author: olamy
Date: Thu Aug 28 00:38:20 2014
New Revision: 1621005

URL: http://svn.apache.org/r1621005
Log:
start status with rest api

Added:
    incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/status/
    incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/status/StatusHelper.java   (with props)
Modified:
    incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/plugin/status/StatusEndpoints.java

Added: incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/status/StatusHelper.java
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/status/StatusHelper.java?rev=1621005&view=auto
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/status/StatusHelper.java (added)
+++ incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/status/StatusHelper.java Thu Aug 28 00:38:20 2014
@@ -0,0 +1,44 @@
+/*
+ * 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.sirona.reporting.web.status;
+
+import org.apache.sirona.status.Status;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public final class StatusHelper
+{
+    private static final Map<Status, String> MAPPING = new HashMap<Status, String>( 3 );
+
+    static
+    {
+        MAPPING.put( Status.OK, "success" );
+        MAPPING.put( Status.DEGRADED, "warning" );
+        MAPPING.put( Status.KO, "danger" );
+    }
+
+    private StatusHelper()
+    {
+        // no-op
+    }
+
+    public static String map( final Status status )
+    {
+        return MAPPING.get( status );
+    }
+}

Propchange: incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/status/StatusHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/status/StatusHelper.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/plugin/status/StatusEndpoints.java
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/plugin/status/StatusEndpoints.java?rev=1621005&r1=1621004&r2=1621005&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/plugin/status/StatusEndpoints.java (original)
+++ incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/plugin/status/StatusEndpoints.java Thu Aug 28 00:38:20 2014
@@ -21,7 +21,6 @@ import org.apache.sirona.reporting.web.p
 import org.apache.sirona.repositories.Repository;
 import org.apache.sirona.status.NodeStatus;
 
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.TreeMap;