Class HttpResourceStorage
- java.lang.Object
-
- org.swisspush.gateleen.core.storage.HttpResourceStorage
-
- All Implemented Interfaces:
ResourceStorage
public class HttpResourceStorage extends Object implements ResourceStorage
Gives programmatic access to the resource storage.- Author:
- https://github.com/lbovet [Laurent Bovet]
-
-
Constructor Summary
Constructors Constructor Description HttpResourceStorage(io.vertx.core.Vertx vertx)HttpResourceStorage(io.vertx.core.Vertx vertx, GateleenExceptionFactory exceptionFactory, String host, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String uri, io.vertx.core.Handler<Integer> doneHandler)voidget(String path, io.vertx.core.Handler<io.vertx.core.buffer.Buffer> bodyHandler)StringgetHost()intgetPort()voidput(String uri, io.vertx.core.buffer.Buffer buffer, io.vertx.core.Handler<Integer> doneHandler)voidput(String uri, io.vertx.core.MultiMap headers, io.vertx.core.buffer.Buffer buffer, io.vertx.core.Handler<Integer> doneHandler)Under normal operation 'doneHandler' is called with the result.
-
-
-
Constructor Detail
-
HttpResourceStorage
public HttpResourceStorage(io.vertx.core.Vertx vertx)
-
HttpResourceStorage
public HttpResourceStorage(io.vertx.core.Vertx vertx, GateleenExceptionFactory exceptionFactory, String host, int port)
-
-
Method Detail
-
get
public void get(String path, io.vertx.core.Handler<io.vertx.core.buffer.Buffer> bodyHandler)
- Specified by:
getin interfaceResourceStorage
-
getHost
public String getHost()
-
getPort
public int getPort()
-
put
public void put(String uri, io.vertx.core.MultiMap headers, io.vertx.core.buffer.Buffer buffer, io.vertx.core.Handler<Integer> doneHandler)
Description copied from interface:ResourceStorageUnder normal operation 'doneHandler' is called with the result. BUT: There are some impl which sometimes call it with 'null' as its value. It looks like this indicates that there was some kind of error. Most of the time impl knows exactly what the error was. But there is no way that it would report it to the caller (because this API does not provide a way to do so).
There is yet another special case: Some impls in some cases do NOT call 'doneHandler' at all. So there is no way to know what happened behind the scene.
- Specified by:
putin interfaceResourceStorage
-
put
public void put(String uri, io.vertx.core.buffer.Buffer buffer, io.vertx.core.Handler<Integer> doneHandler)
- Specified by:
putin interfaceResourceStorage
-
delete
public void delete(String uri, io.vertx.core.Handler<Integer> doneHandler)
- Specified by:
deletein interfaceResourceStorage
-
-