This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 8753f2b JUNEAU-140 Provide initial contents of PetStore modules.
8753f2b is described below
commit 8753f2b72603a55bd4e60e0fd4af352c8e6cd56c
Author: JamesBognar <[email protected]>
AuthorDate: Sun Sep 8 11:29:09 2019 -0400
JUNEAU-140 Provide initial contents of PetStore modules.
---
.../juneau-examples-petstore-server/pom.xml | 22 ++
.../apache/juneau/petstore/AppConfiguration.java | 29 +-
.../juneau/petstore/rest/PetStoreResource.java | 6 +-
...oadPhotoMenuItem.java => PetStoreResource.json} | 108 ++++---
.../juneau/petstore/rest/PhotosResource.java | 327 ---------------------
.../juneau/petstore/rest/SqlQueryResource.java | 248 ----------------
.../src/main/resources/META-INF/persistence.xml | 34 +++
.../application.properties} | 52 +---
.../src/main/resources/htdocs/background.jpg | Bin 0 -> 105889 bytes
.../src/main/resources/htdocs/ok.png | Bin 0 -> 455 bytes
.../src/main/resources/htdocs/severe.png | Bin 0 -> 335 bytes
.../src/main/resources/htdocs/warning.png | Bin 0 -> 444 bytes
.../src/main/resources/juneau.cfg | 70 +++++
.../src/main/resources/log4j.xml | 31 ++
.../src/test/resources/xdocs/test.txt | 13 +
.../src/test/resources/xdocs/xsubdocs/test.txt | 13 +
.../juneau-rest-server-utest/xdocs/test2.txt | 13 +
.../xdocs/xsubdocs/test2.txt | 13 +
18 files changed, 298 insertions(+), 681 deletions(-)
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/pom.xml
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/pom.xml
index 504140d..262cabe 100644
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/pom.xml
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/pom.xml
@@ -74,6 +74,28 @@
<version>${javax.inject.version}</version>
</dependency>
+ <!-- Needed for JPA persistence of PetStore beans -->
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>${hibernate.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>${hibernate.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>${xml.apis.version}</version>
+ </dependency>
+
</dependencies>
<build>
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/AppConfiguration.java
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/AppConfiguration.java
index 462b274..b648b06 100644
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/AppConfiguration.java
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/AppConfiguration.java
@@ -13,18 +13,17 @@
package org.apache.juneau.petstore;
import org.apache.juneau.petstore.rest.*;
+import org.apache.juneau.petstore.service.*;
import org.apache.juneau.rest.springboot.annotation.JuneauRestRoot;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.web.servlet.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.*;
+import org.springframework.web.filter.*;
@Configuration
public class AppConfiguration {
- public static String DEFAULT_JDBC_URL =
"jdbc:h2:mem:testdb;MODE=PostgreSQL";
- public static String DEFAULT_JDBC_USERNAME = "sa";
- public static String DEFAULT_JDBC_PASSWORD = "";
-
@Autowired
private static volatile ApplicationContext appContext;
@@ -40,11 +39,17 @@ public class AppConfiguration {
// Services
//-----------------------------------------------------------------------------------------------------------------
+ @Bean
+ public PetStoreService petStoreService() {
+ return new PetStoreService();
+ }
+
//-----------------------------------------------------------------------------------------------------------------
// REST
//-----------------------------------------------------------------------------------------------------------------
- @Bean @JuneauRestRoot
+ @Bean
+ @JuneauRestRoot
public RootResources rootResources() {
return new RootResources();
}
@@ -53,4 +58,18 @@ public class AppConfiguration {
public PetStoreResource petStoreResource() {
return new PetStoreResource();
}
+
+ /**
+ * We want to be able to consume url-encoded-form-post bodies, but
HiddenHttpMethodFilter triggers the HTTP
+ * body to be consumed. So disable it.
+ *
+ * @param filter The filter.
+ * @return Filter registration bean.
+ */
+ @Bean
+ public FilterRegistrationBean<HiddenHttpMethodFilter>
registration(HiddenHttpMethodFilter filter) {
+ FilterRegistrationBean<HiddenHttpMethodFilter> registration = new
FilterRegistrationBean<>(filter);
+ registration.setEnabled(false);
+ return registration;
+ }
}
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java
index fe2e616..d84d480 100644
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java
@@ -98,11 +98,7 @@ import org.apache.juneau.rest.converters.*;
)
}
),
- staticFiles={"htdocs:htdocs"}, // Expose static files in htdocs
subpackage.
- children={
- SqlQueryResource.class,
- PhotosResource.class
- }
+ staticFiles={"htdocs:/htdocs"} // Expose static files in htdocs
subpackage.
)
@HtmlDocConfig(
widgets={
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/UploadPhotoMenuItem.java
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.json
similarity index 53%
copy from
juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/UploadPhotoMenuItem.java
copy to
juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.json
index 3847890..780c654 100644
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/UploadPhotoMenuItem.java
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.json
@@ -10,52 +10,66 @@
// * "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.juneau.petstore.rest;
-import static org.apache.juneau.dto.html5.HtmlBuilder.*;
-import static org.apache.juneau.http.HttpMethodName.*;
-
-import org.apache.juneau.rest.*;
-import org.apache.juneau.rest.widget.*;
-
-/**
- * Menu item for uploading a Photo.
- *
- * <ul class='seealso'>
- * <li class='extlink'>{@source}
- * </ul>
- */
-public class UploadPhotoMenuItem extends MenuItemWidget {
-
- @Override /* MenuItemWidget */
- public String getLabel(RestRequest req, RestResponse res) throws
Exception {
- return "upload";
- }
-
- @Override /* Widget */
- public Object getContent(RestRequest req, RestResponse res) throws
Exception {
- return div(
-
form().id("form").action("servlet:/upload").method(POST).enctype("multipart/form-data").children(
- table(
- tr(
- th("ID:"),
-
td(input().name("id").type("text")),
- td(new Tooltip("❓", "The
unique identifier of the photo.", br(), "e.g. 'Fluffy'"))
- ),
- tr(
- th("File:"),
-
td(input().name("file").type("file").accept("image/*")),
- td(new Tooltip("❓", "The
image file."))
- ),
- tr(
-
td().colspan(2).style("text-align:right").children(
- button("reset",
"Reset"),
-
button("button","Cancel").onclick("window.location.href='/'"),
- button("submit",
"Submit")
- )
- )
- ).style("white-space:nowrap")
- )
- );
+{
+ "swagger": "2.0",
+ "info": {
+ "version": "1.0.0",
+ "title": "Swagger Petstore",
+ "termsOfService": "You are on your own.",
+ "contact": {
+ "name": "Juneau Development Team",
+ "email": "[email protected]",
+ "url": "http://juneau.apache.org"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "externalDocs": {
+ "description": "Find out more about Juneau",
+ "url": "http://juneau.apache.org"
+ },
+ "tags": [
+ {
+ "name": "pet",
+ "description": "Everything about your Pets",
+ "externalDocs": {
+ "description": "Find out more",
+ "url": "http://juneau.apache.org"
+ }
+ },
+ {
+ "name": "store",
+ "description": "Access to Petstore orders"
+ },
+ {
+ "name": "user",
+ "description": "Operations about user",
+ "externalDocs": {
+ "description": "Find out more about our store",
+ "url": "http://juneau.apache.org"
+ }
+ }
+ ],
+ "schemes": [
+ "http"
+ ],
+ "securityDefinitions": {
+ "petstore_auth": {
+ "type": "oauth2",
+ "authorizationUrl":
"http://petstore.swagger.io/oauth/dialog",
+ "flow": "implicit",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ },
+ "api_key": {
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+ }
}
-}
+}
\ No newline at end of file
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PhotosResource.java
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PhotosResource.java
deleted file mode 100644
index 11ea0d8..0000000
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PhotosResource.java
+++ /dev/null
@@ -1,327 +0,0 @@
-//
***************************************************************************************************************************
-// * 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.juneau.petstore.rest;
-
-import static org.apache.juneau.http.HttpMethodName.*;
-import static org.apache.juneau.rest.annotation.HookEvent.*;
-
-import org.apache.juneau.jsonschema.annotation.ExternalDocs;
-import org.apache.juneau.jsonschema.annotation.Schema;
-import java.awt.image.*;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.Map;
-
-import javax.imageio.*;
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-import org.apache.juneau.*;
-import org.apache.juneau.html.annotation.*;
-import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.http.annotation.Body;
-import org.apache.juneau.http.annotation.Path;
-import org.apache.juneau.http.annotation.Response;
-import org.apache.juneau.internal.*;
-import org.apache.juneau.parser.*;
-import org.apache.juneau.rest.*;
-import org.apache.juneau.rest.annotation.*;
-import org.apache.juneau.http.exception.*;
-import org.apache.juneau.rest.helper.*;
-import org.apache.juneau.rest.matchers.*;
-import org.apache.juneau.serializer.*;
-
-/**
- * Sample resource that allows images to be uploaded and retrieved.
- *
- * <ul class='seealso'>
- * <li class='extlink'>{@source}
- * </ul>
- */
-@RestResource(
- path="/photos",
- messages="nls/PhotosResource",
- title="Photo REST service",
- description="Sample resource that allows images to be uploaded and
retrieved.",
- swagger=@ResourceSwagger(
- contact=@Contact(name="Juneau
Developer",email="[email protected]"),
- license=@License(name="Apache
2.0",url="http://www.apache.org/licenses/LICENSE-2.0.html"),
- version="2.0",
- termsOfService="You are on your own.",
- externalDocs=@ExternalDocs(description="Apache
Juneau",url="http://juneau.apache.org")
- )
-)
-@HtmlDocConfig(
- navlinks={
- "up: request:/..",
- "options: servlet:/?method=OPTIONS",
- "$W{UploadPhotoMenuItem}",
- "source:
$C{Source/gitHub}/org/apache/juneau/examples/rest/$R{servletClassSimple}.java"
- },
- aside={
- "<div style='max-width:400px;min-width:200px' class='text'>",
- " <p>Shows an example of using custom serializers and
parsers to create REST interfaces over binary resources.</p>",
- " <p>In this case, our resources are marshalled jpeg and
png binary streams and are stored in an in-memory 'database' (also known as a
<c>TreeMap</c>).</p>",
- "</div>"
- },
- widgets={
- UploadPhotoMenuItem.class
- },
- stylesheet="servlet:/htdocs/themes/dark.css"
-)
-@HtmlConfig(
- // Make the anchor text on URLs be just the path relative to the
servlet.
- uriAnchorText="SERVLET_RELATIVE"
-)
-public class PhotosResource extends BasicRest {
-
- // Our cache of photos
- private Map<String,Photo> photos = new TreeMap<>();
-
- @RestHook(INIT)
- public void init() {
- try (InputStream is =
getClass().getResourceAsStream("photos/cat.jpg")) {
- BufferedImage image = ImageIO.read(is);
- Photo photo = new Photo("cat", image);
- photos.put(photo.id, photo);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- /** Our bean class for storing photos */
- public static class Photo {
- String id;
- BufferedImage image;
-
- Photo(String id, BufferedImage image) {
- this.id = id;
- this.image = image;
- }
-
- /**
- * @return The URI of this photo.
- * @throws URISyntaxException ID could not be converted to a
URI.
- */
- public URI getURI() throws URISyntaxException {
- return new URI("servlet:/" + id);
- }
- }
-
-
//-----------------------------------------------------------------------------------------------------------------
- // REST methods
-
//-----------------------------------------------------------------------------------------------------------------
-
- /**
- * Show the list of all currently loaded photos
- *
- * @return The list of all currently loaded photos.
- * @throws Exception Error occurred.
- */
- @RestMethod(
- name=GET,
- path="/",
- summary="Show the list of all currently loaded photos"
- )
- public Collection<Photo> getAllPhotos() throws Exception {
- return photos.values();
- }
-
- /**
- * Shows how to use a custom serializer to serialize a BufferedImage
object to a stream.
- *
- * @param id The photo ID.
- * @return The image.
- * @throws NotFound Image was not found.
- */
- @RestMethod(
- name=GET,
- path="/{id}",
- serializers=ImageSerializer.class,
- summary="Get a photo by ID",
- description="Shows how to use a custom serializer to serialize
a BufferedImage object to a stream."
- )
- @Response(
- schema=@Schema(type="file")
- )
- public BufferedImage getPhoto(@Path("id") String id) throws NotFound {
- Photo p = photos.get(id);
- if (p == null)
- throw new NotFound("Photo not found");
- return p.image;
- }
-
- /**
- * Shows how to use a custom parser to parse a stream into a
BufferedImage object.
- *
- * @param id The photo ID.
- * @param image Binary contents of image.
- * @return <js>"OK"</jk> if successful.
- * @throws Exception Error occurred.
- */
- @RestMethod(
- name=PUT,
- path="/{id}",
- parsers=ImageParser.class,
- summary="Add or overwrite a photo",
- description="Shows how to use a custom parser to parse a stream
into a BufferedImage object."
- )
- public String addPhoto(
- @Path("id") String id,
- @Body(
- description="Binary contents of image.",
- schema=@Schema(type="file")
- )
- BufferedImage image
- ) throws Exception {
- photos.put(id, new Photo(id, image));
- return "OK";
- }
-
- /**
- * Shows how to use a custom parser to parse a stream into a
BufferedImage object.
- *
- * @param image Binary contents of image.
- * @return The Photo bean.
- * @throws Exception Error occurred.
- */
- @RestMethod(
- name=POST,
- path="/",
- parsers=ImageParser.class,
- summary="Add a photo",
- description="Shows how to use a custom parser to parse a stream
into a BufferedImage object."
- )
- public Photo setPhoto(
- @Body(
- description="Binary contents of image.",
- schema=@Schema(type="file")
- )
- BufferedImage image
- ) throws Exception {
- Photo p = new Photo(UUID.randomUUID().toString(), image);
- photos.put(p.id, p);
- return p;
- }
-
- /**
- * Upload a photo from a multipart form post.
- *
- * @param req HTTP request.
- * @return Redirect to servlet root.
- * @throws Exception Error occurred.
- */
- @RestMethod(
- name=POST,
- path="/upload",
- matchers=MultipartFormDataMatcher.class,
- summary="Upload a photo from a multipart form post",
- description="Shows how to parse a multipart form post
containing a binary field.",
- swagger=@MethodSwagger(
- parameters={
- "{in:'formData', name:'id', description:'Unique
identifier to assign to image.', type:'string', required:false},",
- "{in:'formData', name:'file', description:'The
binary contents of the image file.', type:'file', required:true}"
- }
- )
- )
- public SeeOtherRoot uploadFile(RestRequest req) throws Exception {
- MultipartConfigElement multipartConfigElement = new
MultipartConfigElement((String)null);
- req.setAttribute("org.eclipse.jetty.multipartConfig",
multipartConfigElement);
- String id = UUID.randomUUID().toString();
- BufferedImage img = null;
- for (Part part : req.getParts()) {
- switch (part.getName()) {
- case "id":
- id = IOUtils.read(part.getInputStream());
- break;
- case "file":
- img = ImageIO.read(part.getInputStream());
- }
- }
- addPhoto(id, img);
- return new SeeOtherRoot(); // Redirect to the servlet root.
- }
-
- /**
- * Removes a photo from the database.
- *
- * @param id ID of photo to remove.
- * @return <js>"OK"</jk> if successful.
- * @throws NotFound Photo was not found.
- */
- @RestMethod(
- name=DELETE,
- path="/{id}",
- summary="Delete a photo by ID"
- )
- public String deletePhoto(@Path("id") String id) throws NotFound {
- Photo p = photos.remove(id);
- if (p == null)
- throw new NotFound("Photo not found");
- return "OK";
- }
-
-
//-----------------------------------------------------------------------------------------------------------------
- // Custom serializers and parsers.
-
//-----------------------------------------------------------------------------------------------------------------
-
- /** Serializer for converting images to byte streams */
- public static class ImageSerializer extends OutputStreamSerializer {
-
- /**
- * Constructor.
- * @param ps The property store containing all the settings for
this object.
- */
- public ImageSerializer(PropertyStore ps) {
- super(ps, null, "image/png,image/jpeg");
- }
-
- @Override /* Serializer */
- public OutputStreamSerializerSession
createSession(SerializerSessionArgs args) {
- return new OutputStreamSerializerSession(args) {
-
- @Override /* SerializerSession */
- protected void doSerialize(SerializerPipe out,
Object o) throws IOException, SerializeException {
- RenderedImage image = (RenderedImage)o;
- String mediaType =
getProperty("mediaType", String.class, (String)null);
- ImageIO.write(image,
mediaType.substring(mediaType.indexOf('/')+1), out.getOutputStream());
- }
- };
- }
- }
-
- /** Parser for converting byte streams to images */
- public static class ImageParser extends InputStreamParser {
-
- /**
- * Constructor.
- * @param ps The property store containing all the settings for
this object.
- */
- public ImageParser(PropertyStore ps) {
- super(ps, "image/png", "image/jpeg");
- }
-
- @Override /* Parser */
- public InputStreamParserSession createSession(final
ParserSessionArgs args) {
- return new InputStreamParserSession(args) {
-
- @Override /* ParserSession */
- @SuppressWarnings("unchecked")
- protected <T> T doParse(ParserPipe pipe,
ClassMeta<T> type) throws IOException, ParseException, ExecutableException {
- return
(T)ImageIO.read(pipe.getInputStream());
- }
- };
- }
- }
-}
\ No newline at end of file
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/SqlQueryResource.java
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/SqlQueryResource.java
deleted file mode 100644
index 40962a7..0000000
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/SqlQueryResource.java
+++ /dev/null
@@ -1,248 +0,0 @@
-//
***************************************************************************************************************************
-// * 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.juneau.petstore.rest;
-
-import static org.apache.juneau.dto.html5.HtmlBuilder.*;
-import static org.apache.juneau.http.HttpMethodName.*;
-import static org.apache.juneau.internal.StringUtils.*;
-import static org.apache.juneau.rest.annotation.HookEvent.*;
-
-import java.sql.*;
-import java.util.*;
-
-import org.apache.juneau.jsonschema.annotation.ExternalDocs;
-import org.apache.juneau.config.*;
-import org.apache.juneau.dto.*;
-import org.apache.juneau.dto.html5.*;
-import org.apache.juneau.html.annotation.*;
-import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.http.annotation.Body;
-import org.apache.juneau.http.annotation.Query;
-import org.apache.juneau.http.annotation.Response;
-import org.apache.juneau.rest.*;
-import org.apache.juneau.rest.annotation.*;
-import org.apache.juneau.http.exception.*;
-import org.apache.juneau.rest.widget.*;
-
-/**
- * Sample resource that shows how Juneau can serialize ResultSets.
- *
- * <ul class='seealso'>
- * <li class='extlink'>{@source}
- * </ul>
- */
-@RestResource(
- path="/sql",
- title="SQL query service",
- description="Executes queries against the local derby
'$C{SqlQueryResource/connectionUrl}' database",
- swagger=@ResourceSwagger(
- contact=@Contact(name="Juneau
Developer",email="[email protected]"),
- license=@License(name="Apache
2.0",url="http://www.apache.org/licenses/LICENSE-2.0.html"),
- version="2.0",
- termsOfService="You are on your own.",
- externalDocs=@ExternalDocs(description="Apache
Juneau",url="http://juneau.apache.org")
- )
-)
-@HtmlDocConfig(
- widgets={
- ThemeMenuItem.class
- },
- navlinks={
- "up: request:/..",
- "options: servlet:/?method=OPTIONS",
- "$W{ThemeMenuItem}",
- "source:
$C{Source/gitHub}/org/apache/juneau/examples/rest/$R{servletClassSimple}.java"
- },
- aside={
- "<div style='min-width:200px' class='text'>",
- " <p>An example of a REST interface over a relational
database that serializes ResultSet objects.</p>",
- " <p>Specify one or more queries delimited by
semicolons.</p>",
- " <h5>Examples:</h5>",
- " <ul>",
- " <li><a class='link'
href='?sql=select+*+from+sys.systables'>Tables</a>",
- " <li><a class='link'
href='?sql=select+*+from+PetstorePet'>Pets</a>",
- " <li><a class='link'
href='?sql=select+*+from+PetstoreOrder'>Orders</a>",
- " <li><a class='link'
href='?sql=select+*+from+PetstoreUser'>Users</a>",
- " </ul>",
- "</div>"
- },
- stylesheet="servlet:/htdocs/themes/dark.css"
-)
-public class SqlQueryResource extends BasicRest {
-
- private String driver, connectionUrl;
- private boolean allowUpdates, allowTempUpdates, includeRowNums;
-
- /**
- * Initializes the registry URL and rest client.
- *
- * @param builder The resource config.
- */
- @RestHook(INIT)
- public void initConnection(RestContextBuilder builder) {
- Config cf = builder.getConfig();
-
- driver = cf.getString("SqlQueryResource/driver");
- connectionUrl = cf.getString("SqlQueryResource/connectionUrl");
- allowUpdates = cf.getBoolean("SqlQueryResource/allowUpdates",
false);
- allowTempUpdates =
cf.getBoolean("SqlQueryResource/allowTempUpdates", false);
- includeRowNums =
cf.getBoolean("SqlQueryResource/includeRowNums", false);
-
- try {
- Class.forName(driver).newInstance();
- } catch (Exception e) {
- e.printStackTrace(System.err);
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Displays the query entry page.
- *
- * @param sql Text to prepopulate the SQL query field with.
- * @return The HTML div tag to serialize.
- */
- @RestMethod(
- summary="Display the query entry page"
- )
- public Div get(
- @Query(
- name="sql",
- description="Text to prepopulate the SQL query
field with.",
- example="select * from sys.systables"
- )
- String sql
- ) {
-
- return div(
- script("text/javascript",
- "// Quick and dirty function to allow tabs in
textarea.",
- "function checkTab(e) {",
- " if (e.keyCode == 9) {",
- " var t = e.target;",
- " var ss = t.selectionStart, se =
t.selectionEnd;",
- " t.value =
t.value.slice(0,ss).concat('\\t').concat(t.value.slice(ss,t.value.length));",
- " e.preventDefault();",
- " }",
- "}",
- "// Load results from IFrame into this
document.",
- "function loadResults(b) {",
- " var doc = b.contentDocument ||
b.contentWindow.document;",
- " var data = doc.getElementById('data')
|| doc.getElementsByTagName('body')[0];",
- "
document.getElementById('results').innerHTML = data.innerHTML;",
- "}"
- ),
- form("servlet:/").method(POST).target("buf").children(
- table(
- tr(
- th("Position
(1-10000):").style("white-space:nowrap"),
-
td(input().name("pos").type("number").value(1)),
- th("Limit
(1-10000):").style("white-space:nowrap"),
-
td(input().name("limit").type("number").value(100)),
- td(button("submit", "Submit"),
button("reset", "Reset"))
- ),
- tr(
- td().colspan(5).children(
-
textarea().name("sql").text(sql == null ? " " :
sql).style("width:100%;height:200px;font-family:Courier;font-size:9pt;").onkeydown("checkTab(event)")
- )
- )
- )
- ),
- br(),
- div().id("results"),
-
iframe().name("buf").style("display:none").onload("parent.loadResults(this)")
- );
- }
-
- /**
- * Execute one or more queries.
- *
- * @param in
- * Query input
- * @return
- * Query results.
- * <br>Each entry in the array is a result of one query.
- * <b>Each result can be a result set (for queries) or update
count (for updates).
- * @throws BadRequest Invalid SQL detected.
- */
- @RestMethod(
- summary="Execute one or more queries"
- )
- @Response(
- description="Query results.\nEach entry in the array is a
result of one query.\nEach result can be a result set (for queries) or update
count (for updates)."
- )
- public List<Object> post(
- @Body(
- description="Query input",
- example="{sql:'select * from
sys.systables',pos:1,limit:100}"
- )
- PostInput in
- ) throws BadRequest {
-
- List<Object> results = new LinkedList<>();
-
- // Don't try to submit empty input.
- if (isEmpty(in.sql))
- return results;
-
- if (in.pos < 1 || in.pos > 10000)
- throw new BadRequest("Invalid value for position. Must
be between 1-10000");
- if (in.limit < 1 || in.limit > 10000)
- throw new BadRequest("Invalid value for limit. Must be
between 1-10000");
-
- String sql = null;
-
- // Create a connection and statement.
- // If these fais, let the exception filter up as a 500 error.
- try (Connection c = DriverManager.getConnection(connectionUrl))
{
- c.setAutoCommit(false);
- try (Statement st = c.createStatement()) {
- for (String s : in.sql.split(";")) {
- sql = s.trim();
- if (! sql.isEmpty()) {
- Object o = null;
- if (allowUpdates ||
(allowTempUpdates && ! sql.matches("(?:i)commit.*"))) {
- if (st.execute(sql)) {
- try (ResultSet
rs = st.getResultSet()) {
- o = new
ResultSetList(rs, in.pos, in.limit, includeRowNums);
- }
- } else {
- o =
st.getUpdateCount();
- }
- } else {
- try (ResultSet rs =
st.executeQuery(sql)) {
- o = new
ResultSetList(rs, in.pos, in.limit, includeRowNums);
- }
- }
- results.add(o);
- }
- }
- }
- if (allowUpdates)
- c.commit();
- else if (allowTempUpdates)
- c.rollback();
- } catch (SQLException e) {
- throw new BadRequest(e, "Invalid query: {0}", sql);
- }
-
- return results;
- }
-
- /** The parsed form post */
- @SuppressWarnings("javadoc")
- public static class PostInput {
- public String sql = "";
- public int pos = 1, limit = 100;
- }
-}
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/META-INF/persistence.xml
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..7c0bc2c
--- /dev/null
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,34 @@
+<!--
+
***************************************************************************************************************************
+ * 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.
*
+
***************************************************************************************************************************
+-->
+<persistence
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
+ <persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
+ <class>org.apache.juneau.examples.petstore.dto.Pet</class>
+ <class>org.apache.juneau.examples.petstore.dto.Order</class>
+ <class>org.apache.juneau.examples.petstore.dto.User</class>
+ <properties>
+ <property name="javax.persistence.jdbc.driver"
value="org.apache.derby.jdbc.EmbeddedDriver" />
+ <property name="javax.persistence.jdbc.url"
value="jdbc:derby:target/derby/testDB;create=true" />
+ <property name="javax.persistence.jdbc.user" value="" />
+ <property name="javax.persistence.jdbc.password"
value="" />
+ <property name="hibernate.dialect"
value="org.hibernate.dialect.DerbyDialect" />
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop" />
+ <property name="show_sql" value="true" />
+ <property
name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/UploadPhotoMenuItem.java
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/application.properties
similarity index 50%
rename from
juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/UploadPhotoMenuItem.java
rename to
juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/application.properties
index 3847890..768c87b 100644
---
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/java/org/apache/juneau/petstore/rest/UploadPhotoMenuItem.java
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/application.properties
@@ -9,53 +9,7 @@
// * 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.juneau.petstore.rest;
-
-import static org.apache.juneau.dto.html5.HtmlBuilder.*;
-import static org.apache.juneau.http.HttpMethodName.*;
-
-import org.apache.juneau.rest.*;
-import org.apache.juneau.rest.widget.*;
-
-/**
- * Menu item for uploading a Photo.
- *
- * <ul class='seealso'>
- * <li class='extlink'>{@source}
- * </ul>
- */
-public class UploadPhotoMenuItem extends MenuItemWidget {
-
- @Override /* MenuItemWidget */
- public String getLabel(RestRequest req, RestResponse res) throws
Exception {
- return "upload";
- }
+//
****************************************************************************************************************************
- @Override /* Widget */
- public Object getContent(RestRequest req, RestResponse res) throws
Exception {
- return div(
-
form().id("form").action("servlet:/upload").method(POST).enctype("multipart/form-data").children(
- table(
- tr(
- th("ID:"),
-
td(input().name("id").type("text")),
- td(new Tooltip("❓", "The
unique identifier of the photo.", br(), "e.g. 'Fluffy'"))
- ),
- tr(
- th("File:"),
-
td(input().name("file").type("file").accept("image/*")),
- td(new Tooltip("❓", "The
image file."))
- ),
- tr(
-
td().colspan(2).style("text-align:right").children(
- button("reset",
"Reset"),
-
button("button","Cancel").onclick("window.location.href='/'"),
- button("submit",
"Submit")
- )
- )
- ).style("white-space:nowrap")
- )
- );
- }
-}
+logging.level.org.springframework=INFO
+server.port=5000
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/background.jpg
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/background.jpg
new file mode 100644
index 0000000..d75bcf1
Binary files /dev/null and
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/background.jpg
differ
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/ok.png
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/ok.png
new file mode 100644
index 0000000..31d84f7
Binary files /dev/null and
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/ok.png
differ
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/severe.png
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/severe.png
new file mode 100644
index 0000000..7b71e14
Binary files /dev/null and
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/severe.png
differ
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/warning.png
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/warning.png
new file mode 100644
index 0000000..7a8ab49
Binary files /dev/null and
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/htdocs/warning.png
differ
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/juneau.cfg
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/juneau.cfg
new file mode 100755
index 0000000..98e4574
--- /dev/null
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/juneau.cfg
@@ -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.
*
+#
***************************************************************************************************************************
+
+#=======================================================================================================================
+# REST settings
+#=======================================================================================================================
+[REST]
+
+# Comma-delimited list of key-value pairs that represent locations of static
files that can be served up by your @RestResource-annotated
+# classes. These are static files that are served up by the servlet under the
specified sub-paths.
+# For example, given the following setting...
+# staticFiles = htdocs:my-docs,styles/my-styles
+# ...the URI "/servletPath/htdocs/javadoc.css" resolves to the path
"/my-docs/javadoc.css".
+# This path can be relative to the working directory, classpath root, or
package of your resource class.
+# Used by the BasicRestConfig interface that defines the following value:
+# staticFiles="$C{REST/staticFiles}"
+staticFiles = htdocs:htdocs
+
+# Stylesheet to use for HTML views.
+# Used by the BasicRestConfig interface that defines the following value:
+# stylesheet="$C{REST/theme,servlet:/htdocs/themes/devops.css}"
+theme = servlet:/htdocs/themes/devops.css
+
+# Various look-and-feel settings used in the BasicRestConfig interface.
+headerIcon = servlet:/htdocs/images/juneau.png
+headerLink = http://juneau.apache.org
+footerIcon = servlet:/htdocs/images/asf.png
+footerLink = http://www.apache.org
+favicon = $C{REST/headerIcon}
+head = <link rel='icon' href='$U{$C{REST/favicon}}'/>
+header =
+ <a href='$U{$C{REST/headerLink}}'>
+ <img src='$U{$C{REST/headerIcon}}'
style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/>
+ </a>
+footer =
+ <a href='$U{$C{REST/footerLink}}'>
+ <img style='float:right;padding-right:20px;height:32px'
src='$U{$C{REST/footerIcon}}'>
+ </a>
+
+#=======================================================================================================================
+# SqlQueryResource properties
+#=======================================================================================================================
+[SqlQueryResource]
+driver = org.apache.derby.jdbc.EmbeddedDriver
+directory = target/derby/testDB
+connectionUrl = jdbc:derby:$C{SqlQueryResource/directory};create=true
+allowTempUpdates = true
+includeRowNums = false
+
+#=======================================================================================================================
+# Source code location
+#=======================================================================================================================
+[Source]
+gitHub =
https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java
+
+#=======================================================================================================================
+# PetStoreResource properties
+#=======================================================================================================================
+[PetStore]
+headerImage = <a href='http://swagger.io'><img
src='$U{servlet:/htdocs/cat.png}'
style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/></a>
diff --git
a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/log4j.xml
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/log4j.xml
new file mode 100644
index 0000000..18b0d7c
--- /dev/null
+++
b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/main/resources/log4j.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
***************************************************************************************************************************
+ * 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.
*
+
***************************************************************************************************************************
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss}
%-5p %c{1}:%L - %m%n"/>
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="INFO"/>
+ <appender-ref ref="console"/>
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/resources/xdocs/test.txt
b/juneau-rest/juneau-rest-server-utest/src/test/resources/xdocs/test.txt
new file mode 100644
index 0000000..b734fee
--- /dev/null
+++ b/juneau-rest/juneau-rest-server-utest/src/test/resources/xdocs/test.txt
@@ -0,0 +1,13 @@
+
***************************************************************************************************************************
+ * 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.
*
+
***************************************************************************************************************************
+ OK-3
\ No newline at end of file
diff --git
a/juneau-rest/juneau-rest-server-utest/src/test/resources/xdocs/xsubdocs/test.txt
b/juneau-rest/juneau-rest-server-utest/src/test/resources/xdocs/xsubdocs/test.txt
new file mode 100644
index 0000000..7376634
--- /dev/null
+++
b/juneau-rest/juneau-rest-server-utest/src/test/resources/xdocs/xsubdocs/test.txt
@@ -0,0 +1,13 @@
+
***************************************************************************************************************************
+ * 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.
*
+
***************************************************************************************************************************
+ OK-4
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/xdocs/test2.txt
b/juneau-rest/juneau-rest-server-utest/xdocs/test2.txt
new file mode 100644
index 0000000..6c94803
--- /dev/null
+++ b/juneau-rest/juneau-rest-server-utest/xdocs/test2.txt
@@ -0,0 +1,13 @@
+
***************************************************************************************************************************
+ * 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.
*
+
***************************************************************************************************************************
+ OK-5
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server-utest/xdocs/xsubdocs/test2.txt
b/juneau-rest/juneau-rest-server-utest/xdocs/xsubdocs/test2.txt
new file mode 100644
index 0000000..7bcf3d3
--- /dev/null
+++ b/juneau-rest/juneau-rest-server-utest/xdocs/xsubdocs/test2.txt
@@ -0,0 +1,13 @@
+
***************************************************************************************************************************
+ * 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.
*
+
***************************************************************************************************************************
+ OK-6
\ No newline at end of file