Commit e413abb7 authored by Roman Soldatow's avatar Roman Soldatow

REST API Plugin update to 1.3.2

* Adding GZIP functionality
parent e5eebf4c
...@@ -44,6 +44,11 @@ ...@@ -44,6 +44,11 @@
REST API Plugin Changelog REST API Plugin Changelog
</h1> </h1>
<p><b>1.3.2</b> -- April 25th, 2018</p>
<ul>
<li>Added: GZIP compression</li>
</ul>
<p><b>1.3.1</b> -- April 20th, 2018</p> <p><b>1.3.1</b> -- April 20th, 2018</p>
<ul> <ul>
<li>Fixed: That created rooms were not propagated to other nodes <a href="https://issues.igniterealtime.org/browse/OF-1535">OF-1535</a></li> <li>Fixed: That created rooms were not propagated to other nodes <a href="https://issues.igniterealtime.org/browse/OF-1535">OF-1535</a></li>
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<name>REST API</name> <name>REST API</name>
<description>Allows administration over a RESTful API.</description> <description>Allows administration over a RESTful API.</description>
<author>Roman Soldatow</author> <author>Roman Soldatow</author>
<version>1.3.1</version> <version>1.3.2</version>
<date>04/20/2018</date> <date>04/25/2018</date>
<minServerVersion>4.1.0</minServerVersion> <minServerVersion>4.1.0</minServerVersion>
<adminconsole> <adminconsole>
<tab id="tab-server"> <tab id="tab-server">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</parent> </parent>
<groupId>org.igniterealtime.openfire.plugins</groupId> <groupId>org.igniterealtime.openfire.plugins</groupId>
<artifactId>restAPI</artifactId> <artifactId>restAPI</artifactId>
<version>1.3.1</version> <version>1.3.2</version>
<name>Rest API Plugin</name> <name>Rest API Plugin</name>
<description>Allows administration over a RESTful API.</description> <description>Allows administration over a RESTful API.</description>
......
...@@ -1998,8 +1998,10 @@ DELETE /chatrooms/{roomName}/{roles}/{name}</p> ...@@ -1998,8 +1998,10 @@ DELETE /chatrooms/{roomName}/{roles}/{name}</p>
</blockquote> </blockquote>
<h1 id="data-format">Data format</h1> <h1 id="data-format">Data format</h1>
<p>Openfire REST API provides XML and JSON as data format. The default data format is XML.<br> <p>Openfire REST API provides XML and JSON as data format. The default data format is XML.<br>
To get a JSON result, please add “<strong>Accept application/json</strong>” to the request header.<br> To get a JSON result, please add “<strong>Accept: application/json</strong>” to the request header.<br>
If you want to create a resource with JSON data format, please add “<strong>Content-Type: application/json</strong>”.</p> If you want to create a resource with JSON data format, please add “<strong>Content-Type: application/json</strong>”.<br>
Since version RESP API 1.3.2 you can also use GZIP to compress the payload of the request or and the response.<br>
<strong>Content-Encoding: gzip</strong>” for the request. “<strong>Accept-Encoding: gzip</strong>” for the response.</p>
<h2 id="data-types">Data types</h2> <h2 id="data-types">Data types</h2>
<h3 id="user">User</h3> <h3 id="user">User</h3>
......
...@@ -37,13 +37,16 @@ public class JerseyWrapper extends ServletContainer { ...@@ -37,13 +37,16 @@ public class JerseyWrapper extends ServletContainer {
/** The Constant CONTAINER_RESPONSE_FILTERS. */ /** The Constant CONTAINER_RESPONSE_FILTERS. */
private static final String CONTAINER_RESPONSE_FILTERS = "com.sun.jersey.spi.container.ContainerResponseFilters"; private static final String CONTAINER_RESPONSE_FILTERS = "com.sun.jersey.spi.container.ContainerResponseFilters";
/** The Constant GZIP_FILTER. */
private static final String GZIP_FILTER = "com.sun.jersey.api.container.filter.GZIPContentEncodingFilter";
/** The Constant RESOURCE_CONFIG_CLASS_KEY. */ /** The Constant RESOURCE_CONFIG_CLASS_KEY. */
private static final String RESOURCE_CONFIG_CLASS_KEY = "com.sun.jersey.config.property.resourceConfigClass"; private static final String RESOURCE_CONFIG_CLASS_KEY = "com.sun.jersey.config.property.resourceConfigClass";
/** The Constant RESOURCE_CONFIG_CLASS. */ /** The Constant RESOURCE_CONFIG_CLASS. */
private static final String RESOURCE_CONFIG_CLASS = "com.sun.jersey.api.core.PackagesResourceConfig"; private static final String RESOURCE_CONFIG_CLASS = "com.sun.jersey.api.core.PackagesResourceConfig";
/** The Constant SCAN_PACKAGE_DEFAULT. */ /** The Constant SCAN_PACKAGE_DEFAULT. */
private static final String SCAN_PACKAGE_DEFAULT = JerseyWrapper.class.getPackage().getName(); private static final String SCAN_PACKAGE_DEFAULT = JerseyWrapper.class.getPackage().getName();
...@@ -73,6 +76,7 @@ public class JerseyWrapper extends ServletContainer { ...@@ -73,6 +76,7 @@ public class JerseyWrapper extends ServletContainer {
prc = new PackagesResourceConfig(SCAN_PACKAGE_DEFAULT); prc = new PackagesResourceConfig(SCAN_PACKAGE_DEFAULT);
prc.setPropertiesAndFeatures(config); prc.setPropertiesAndFeatures(config);
prc.getProperties().put(CONTAINER_RESPONSE_FILTERS, CORSFILTER); prc.getProperties().put(CONTAINER_RESPONSE_FILTERS, CORSFILTER);
prc.getProperties().put(CONTAINER_RESPONSE_FILTERS, GZIP_FILTER);
loadAuthenticationFilter(); loadAuthenticationFilter();
prc.getClasses().add(RestAPIService.class); prc.getClasses().add(RestAPIService.class);
...@@ -132,7 +136,8 @@ public class JerseyWrapper extends ServletContainer { ...@@ -132,7 +136,8 @@ public class JerseyWrapper extends ServletContainer {
loadingStatusMessage = "No custom auth filter found for restAPI plugin! " + customAuthFilterClassName + " " + restAuthType; loadingStatusMessage = "No custom auth filter found for restAPI plugin! " + customAuthFilterClassName + " " + restAuthType;
} }
prc.getProperties().put(CONTAINER_REQUEST_FILTERS, pickedAuthFilter); prc.getProperties().put(CONTAINER_REQUEST_FILTERS, pickedAuthFilter);
prc.getProperties().put(CONTAINER_REQUEST_FILTERS, GZIP_FILTER);
return loadingStatusMessage; return loadingStatusMessage;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment