Class CopyResourceHandler
- java.lang.Object
-
- org.swisspush.gateleen.core.resource.CopyResourceHandler
-
public class CopyResourceHandler extends Object
Allows to copy one single resource to another destination.- Author:
- https://github.com/ljucam [Mario Ljuca]
-
-
Constructor Summary
Constructors Constructor Description CopyResourceHandler(io.vertx.core.http.HttpClient selfClient, GateleenExceptionFactory exceptionFactory, String copyPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhandle(io.vertx.core.http.HttpServerRequest request)Handles the copy task.protected voidperformGETRequest(io.vertx.core.http.HttpServerRequest request, CopyTask task)Performs the initial GET request to the source.protected voidperformPUTRequest(io.vertx.core.http.HttpServerRequest request, io.vertx.core.http.HttpClientResponse getResponse, CopyTask task)Performs the PUT request to the target.protected booleanvalidTask(io.vertx.core.http.HttpServerRequest request, CopyTask task)Checks if the copy task is valid (simple resource, not a collection).
-
-
-
Constructor Detail
-
CopyResourceHandler
public CopyResourceHandler(io.vertx.core.http.HttpClient selfClient, GateleenExceptionFactory exceptionFactory, String copyPath)
-
-
Method Detail
-
handle
public boolean handle(io.vertx.core.http.HttpServerRequest request)
Handles the copy task.- Parameters:
request- - the request- Returns:
- true if the request was handled, false otherwise
-
validTask
protected boolean validTask(io.vertx.core.http.HttpServerRequest request, CopyTask task)Checks if the copy task is valid (simple resource, not a collection).- Parameters:
request- - the original requesttask- - the copy task- Returns:
- true if the task is valid otherwise false
-
performGETRequest
protected void performGETRequest(io.vertx.core.http.HttpServerRequest request, CopyTask task)Performs the initial GET request to the source.- Parameters:
request- - the original requesttask- - the task which has to be performed
-
performPUTRequest
protected void performPUTRequest(io.vertx.core.http.HttpServerRequest request, io.vertx.core.http.HttpClientResponse getResponse, CopyTask task)Performs the PUT request to the target.- Parameters:
request- - the original requestgetResponse- - the GET responsetask- - the task
-
-