eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject incubator-eagle git commit: EAGLE-88 Eagle web-service should have status url
Date Wed, 16 Dec 2015 07:48:13 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master 208086424 -> 0c583e5d9


EAGLE-88 Eagle web-service should have status url

https://issues.apache.org/jira/browse/EAGLE-88

- Clear the dependency to make dev able to start eagle-service with mvn
tomcat7:run
- Add template monitor resource which returns OK for external monitoring

Author: @RalphSu <suliangfei@gmail.com>
Reviewer: @haoch <hao@apache.org>

Closes #32


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/0c583e5d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/0c583e5d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/0c583e5d

Branch: refs/heads/master
Commit: 0c583e5d90f1053599fdf64ab9c8c693c4f5e9be
Parents: 2080864
Author: Hao Chen <hao@apache.org>
Authored: Wed Dec 16 15:43:44 2015 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Wed Dec 16 15:43:44 2015 +0800

----------------------------------------------------------------------
 .../eclipse-java-templates.xml                  |  20 ++++
 .../eclipse-scala-templates.xml                 | 117 +++++++++++++++++++
 eagle-webservice/pom.xml                        |  32 +++++
 .../service/security/auth/MonitorResource.java  |  44 +++++++
 .../src/main/resources/eagleSecurity.xml        |   1 +
 pom.xml                                         |   4 +
 6 files changed, 218 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0c583e5d/eagle-project-preference/eclipse-java-templates.xml
----------------------------------------------------------------------
diff --git a/eagle-project-preference/eclipse-java-templates.xml b/eagle-project-preference/eclipse-java-templates.xml
new file mode 100644
index 0000000..8ccc558
--- /dev/null
+++ b/eagle-project-preference/eclipse-java-templates.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template
autoinsert="false" context="newtype_context" deleted="false" description="Newly created files"
enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">/*
+ * 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_declaration}
+
+${typecomment}
+${type_declaration}</template></templates>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0c583e5d/eagle-project-preference/eclipse-scala-templates.xml
----------------------------------------------------------------------
diff --git a/eagle-project-preference/eclipse-scala-templates.xml b/eagle-project-preference/eclipse-scala-templates.xml
new file mode 100644
index 0000000..55ce31a
--- /dev/null
+++ b/eagle-project-preference/eclipse-scala-templates.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template
autoinsert="true" context="org.scala-ide.sdt.core.templates" deleted="false" description="New
App template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.app"
name="wizard_app">/*
+ * 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_name}
+
+object ${type_name} extends App {
+  ${cursor}
+}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates"
deleted="false" description="New class template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.class"
name="wizard_class">/*
+ * 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_name}
+
+class ${type_name} {
+  ${cursor}
+}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates"
deleted="false" description="New empty file template for the new file wizard" enabled="true"
id="org.scalaide.core.templates.wizards.empty" name="wizard_empty">/*
+ * 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.
+ */
+ </template><template autoinsert="true" context="org.scala-ide.sdt.core.templates"
deleted="false" description="New object template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.object"
name="wizard_object">/*
+ * 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_name}
+
+object ${type_name} {
+  ${cursor}
+}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates"
deleted="false" description="New package object template for the new file wizard" enabled="true"
id="org.scalaide.core.templates.wizards.packageObject" name="wizard_package_object">/*
+ * 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_name}
+
+package object ${type_name} {
+  ${cursor}
+}</template><template autoinsert="true" context="org.scala-ide.sdt.core.templates"
deleted="false" description="New trait template for the new file wizard" enabled="true" id="org.scalaide.core.templates.wizards.trait"
name="wizard_trait">/*
+ * 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_name}
+
+trait ${type_name} {
+  ${cursor}
+}</template></templates>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0c583e5d/eagle-webservice/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-webservice/pom.xml b/eagle-webservice/pom.xml
index 9c3a71e..1f65842 100644
--- a/eagle-webservice/pom.xml
+++ b/eagle-webservice/pom.xml
@@ -34,6 +34,14 @@
 					<groupId>org.slf4j</groupId>
 					<artifactId>log4j-over-slf4j</artifactId>
 				</exclusion>
+				<exclusion>
+					<artifactId>servlet-api</artifactId>
+					<groupId>javax.servlet</groupId>
+				</exclusion>
+				<exclusion>
+					<artifactId>servlet-api</artifactId>
+					<groupId>org.mortbay.jetty</groupId>
+				</exclusion>
 			</exclusions>
 		</dependency>
 
@@ -46,6 +54,14 @@
 					<groupId>org.slf4j</groupId>
 					<artifactId>log4j-over-slf4j</artifactId>
 				</exclusion>
+				<exclusion>
+					<artifactId>servlet-api</artifactId>
+					<groupId>javax.servlet</groupId>
+				</exclusion>
+				<exclusion>
+					<artifactId>servlet-api-2.5</artifactId>
+					<groupId>org.mortbay.jetty</groupId>
+				</exclusion>
 			</exclusions>
 		</dependency>
 
@@ -81,6 +97,10 @@
 					<groupId>asm</groupId>
 					<artifactId>asm-tree</artifactId>
 				</exclusion>
+				<exclusion>
+					<artifactId>servlet-api</artifactId>
+					<groupId>javax.servlet</groupId>
+				</exclusion>
 			</exclusions>
 		</dependency>
 		<dependency>
@@ -108,6 +128,10 @@
 					<groupId>asm</groupId>
 					<artifactId>asm-tree</artifactId>
 				</exclusion>
+				<exclusion>
+					<artifactId>servlet-api</artifactId>
+					<groupId>javax.servlet</groupId>
+				</exclusion>
 			</exclusions>
 		</dependency>
 
@@ -236,6 +260,14 @@
 			<artifactId>spring-security-ldap</artifactId>
 			<version>${spring.framework.version}</version>
 		</dependency>
+
+		<dependency>
+		    <groupId>javax.servlet</groupId>
+		    <artifactId>servlet-api</artifactId>
+		    <version>${servlet-api.version}</version>
+		    <scope>provided</scope>
+		</dependency>
+
 	</dependencies>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0c583e5d/eagle-webservice/src/main/java/org/apache/eagle/service/security/auth/MonitorResource.java
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/java/org/apache/eagle/service/security/auth/MonitorResource.java
b/eagle-webservice/src/main/java/org/apache/eagle/service/security/auth/MonitorResource.java
new file mode 100644
index 0000000..5da87ba
--- /dev/null
+++ b/eagle-webservice/src/main/java/org/apache/eagle/service/security/auth/MonitorResource.java
@@ -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.eagle.service.security.auth;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * @since 15/12/15
+ */
+@Path("/status")
+public class MonitorResource {
+	
+	public static class ServerStatus {
+		@JsonProperty
+		public String status = "OK";
+	}
+
+	@GET
+	@Produces({ MediaType.APPLICATION_JSON })
+	public Response get() {
+		// TODO : add server management/throttling reflection here.
+		return Response.ok(new ServerStatus()).build();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0c583e5d/eagle-webservice/src/main/resources/eagleSecurity.xml
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/resources/eagleSecurity.xml b/eagle-webservice/src/main/resources/eagleSecurity.xml
index 8c340ac..2b106b3 100644
--- a/eagle-webservice/src/main/resources/eagleSecurity.xml
+++ b/eagle-webservice/src/main/resources/eagleSecurity.xml
@@ -29,6 +29,7 @@
         <scr:intercept-url pattern="/rest/entities" method="POST" access="hasRole('ROLE_ADMIN')"
/>
         <scr:intercept-url pattern="/rest/entities/delete" method="POST" access="hasRole('ROLE_ADMIN')"
/>
         <scr:intercept-url pattern="/rest/list" method="POST" access="hasRole('ROLE_ADMIN')"
/>
+        <scr:intercept-url pattern="/rest/status" method="GET" access="permitAll" />
         <scr:intercept-url pattern="/rest/*" access="isAuthenticated()" />
         <scr:logout logout-url="/logout" invalidate-session="true" delete-cookies="JSESSIONID"
success-handler-ref="logoutSuccessHandler"/>
         <scr:session-management session-fixation-protection="newSession"/>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/0c583e5d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f9c1007..ca90e41 100755
--- a/pom.xml
+++ b/pom.xml
@@ -224,6 +224,9 @@
         <jaxb-impl.version>2.2.6</jaxb-impl.version>
         <stax-api.version>1.0.1</stax-api.version>
         <org.mortbay.jetty.version>6.1.26</org.mortbay.jetty.version>
+                
+        <!-- servlet  -->
+        <servlet-api.version>2.5</servlet-api.version>
 
         <!-- Alert Framework -->
         <velocity.version>1.7</velocity.version>
@@ -246,6 +249,7 @@
 
         <!-- sprint security -->
         <spring.framework.version>3.1.2.RELEASE</spring.framework.version>
+
     </properties>
 
     <dependencyManagement>


Mime
View raw message