mirror of
https://github.com/valitydev/three-ds-server-storage.git
synced 2024-11-06 00:15:16 +00:00
BJ-988: Add ScheduledPreparationFlowService handler and servlet
This commit is contained in:
parent
c3552a4a6c
commit
a2770efca7
@ -0,0 +1,27 @@
|
||||
package com.rbkmoney.threeds.server.storage.handler;
|
||||
|
||||
import com.rbkmoney.damsel.schedule.ContextValidationResponse;
|
||||
import com.rbkmoney.damsel.schedule.ExecuteJobRequest;
|
||||
import com.rbkmoney.damsel.schedule.ScheduledJobExecutorSrv;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.thrift.TException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ScheduledPreparationFlowServiceHandler implements ScheduledJobExecutorSrv.Iface {
|
||||
|
||||
@Override
|
||||
public ContextValidationResponse validateExecutionContext(ByteBuffer byteBuffer) throws TException {
|
||||
return null; // TODO [a.romanov]: impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuffer executeJob(ExecuteJobRequest executeJobRequest) throws TException {
|
||||
return null; // TODO [a.romanov]: impl
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.rbkmoney.threeds.server.storage.servlet;
|
||||
|
||||
import com.rbkmoney.damsel.schedule.ScheduledJobExecutorSrv;
|
||||
import com.rbkmoney.threeds.server.storage.handler.ScheduledPreparationFlowServiceHandler;
|
||||
import com.rbkmoney.woody.thrift.impl.http.THServiceBuilder;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import java.io.IOException;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@WebServlet("/three-ds-server-storage/scheduled-preparation-flow")
|
||||
public class ScheduledPreparationFlowServiceServlet extends GenericServlet {
|
||||
|
||||
private final ScheduledPreparationFlowServiceHandler handler;
|
||||
|
||||
private Servlet servlet;
|
||||
|
||||
@Override
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
super.init(config);
|
||||
servlet = new THServiceBuilder()
|
||||
.build(ScheduledJobExecutorSrv.Iface.class, handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void service(
|
||||
ServletRequest request,
|
||||
ServletResponse response) throws ServletException, IOException {
|
||||
servlet.service(request, response);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user