Class JdbcTaskRepository
- java.lang.Object
-
- no.skatteetaten.fastsetting.formueinntekt.felles.task.jdbc.JdbcTaskRepository
-
- All Implemented Interfaces:
TaskRepository<Connection,SQLException>,TaskReviver<Connection,SQLException>,TaskSink<Connection,SQLException>,TaskSource<Connection,SQLException>
- Direct Known Subclasses:
JdbcTaskRepository.WithIntervalMultiplication,OracleTaskRepository
public class JdbcTaskRepository extends Object implements TaskRepository<Connection,SQLException>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classJdbcTaskRepository.WithIntervalMultiplication-
Nested classes/interfaces inherited from interface no.skatteetaten.fastsetting.formueinntekt.felles.task.api.TaskRepository
TaskRepository.Counting, TaskRepository.Direction, TaskRepository.Listing, TaskRepository.Snapshot
-
Nested classes/interfaces inherited from interface no.skatteetaten.fastsetting.formueinntekt.felles.task.api.TaskReviver
TaskReviver.Revived, TaskReviver.Revivification
-
Nested classes/interfaces inherited from interface no.skatteetaten.fastsetting.formueinntekt.felles.task.api.TaskSink
TaskSink.Insertion
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHANGE_LOGprotected booleanconcurrentprotected Stringowner-
Fields inherited from interface no.skatteetaten.fastsetting.formueinntekt.felles.task.api.TaskRepository
INCEPTION
-
-
Constructor Summary
Constructors Constructor Description JdbcTaskRepository(boolean concurrent, String owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete(Connection conn, String topic, Map<Task,TaskDecision> decisions)Map<String,Map<TaskState,Long>>count(Connection conn, TaskRepository.Snapshot snapshot, TaskRepository.Counting counting, long from, long to)(package private) voiddoComplete(Connection conn, String topic, Map<Task,TaskDecision> decisions)(package private) voiddoFilter(Connection conn, String topic, Collection<String> identifiers, long sequence)(package private) Set<Task>doPoll(Connection conn, String topic, TaskState state, long from, long to, int size)(package private) longdoPurge(Connection conn, String topic, long from, long to, TaskState lower, TaskState upper)(package private) <TASK extends Task>
Map<TASK,Task>doRecreate(Connection conn, String topic, TaskSink.Insertion insertion, Collection<TASK> tasks, TaskState lower, TaskState upper)(package private) <TASK extends Task>
Map<TASK,Task>doReset(Connection conn, String topic, Collection<TASK> tasks, TaskState lower, TaskState upper)(package private) voiddoTranscribe(Connection conn, String topic, Collection<? extends Task> tasks, Function<Task,TaskState> resolver, TaskState lower, TaskState upper)voidexpire(Connection conn, long timeout, TimeUnit unit)(package private) StringgetCountingHint(boolean identified)StringgetOwner()voidheartbeat(Connection conn)booleaninitialize(Connection conn, String topic)booleanisConcurrent()List<TaskInfo>page(Connection conn, String topic, long sequence, int size, TaskRepository.Direction direction)List<TaskInfo>page(Connection conn, String topic, TaskRepository.Listing listing, long sequence, int size, TaskRepository.Direction direction)Set<Task>poll(Connection conn, String topic, int size)longpurge(Connection conn, String topic, long from, long to)longpurge(Connection conn, String topic, TaskState state, long from, long to)voidpurgeAll(Connection conn, String topic)List<Task>push(Connection conn, String topic, TaskSink.Insertion insertion, Collection<TaskCreation> creations)voidreassign(Connection conn, String topic, Map<Task,TaskResult> tasks)<TASK extends Task>
Map<TASK,Task>recreate(Connection conn, String topic, TaskReviver.Revivification revivification, Set<TASK> tasks)Map<Task,Task>recreate(Connection conn, String topic, TaskReviver.Revivification revivification, TaskReviver.Revived revived, long from, long to, int size)voidregister(Connection conn)longresolve(Connection conn, LocalDateTime dateTime, boolean preceding)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface no.skatteetaten.fastsetting.formueinntekt.felles.task.api.TaskRepository
count, count, count, page, page, purge, purge, reassign, recreate, refresh, resolve, task
-
Methods inherited from interface no.skatteetaten.fastsetting.formueinntekt.felles.task.api.TaskReviver
recreate, recreate
-
Methods inherited from interface no.skatteetaten.fastsetting.formueinntekt.felles.task.api.TaskSink
push, push, push, push
-
Methods inherited from interface no.skatteetaten.fastsetting.formueinntekt.felles.task.api.TaskSource
complete, poll
-
-
-
-
Field Detail
-
CHANGE_LOG
public static final String CHANGE_LOG
- See Also:
- Constant Field Values
-
concurrent
protected final boolean concurrent
-
owner
protected final String owner
-
-
Constructor Detail
-
JdbcTaskRepository
public JdbcTaskRepository(boolean concurrent, String owner)
-
-
Method Detail
-
isConcurrent
public boolean isConcurrent()
-
getOwner
public String getOwner()
-
register
public void register(Connection conn) throws SQLException
- Specified by:
registerin interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
heartbeat
public void heartbeat(Connection conn) throws SQLException
- Specified by:
heartbeatin interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
expire
public void expire(Connection conn, long timeout, TimeUnit unit) throws SQLException
- Specified by:
expirein interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
initialize
public boolean initialize(Connection conn, String topic) throws SQLException
- Specified by:
initializein interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
push
public List<Task> push(Connection conn, String topic, TaskSink.Insertion insertion, Collection<TaskCreation> creations) throws SQLException
- Specified by:
pushin interfaceTaskSink<Connection,SQLException>- Throws:
SQLException
-
doFilter
void doFilter(Connection conn, String topic, Collection<String> identifiers, long sequence) throws SQLException
- Throws:
SQLException
-
poll
public Set<Task> poll(Connection conn, String topic, int size) throws SQLException
- Specified by:
pollin interfaceTaskSource<Connection,SQLException>- Throws:
SQLException
-
doPoll
Set<Task> doPoll(Connection conn, String topic, TaskState state, long from, long to, int size) throws SQLException
- Throws:
SQLException
-
doTranscribe
void doTranscribe(Connection conn, String topic, Collection<? extends Task> tasks, Function<Task,TaskState> resolver, TaskState lower, TaskState upper) throws SQLException
- Throws:
SQLException
-
doComplete
void doComplete(Connection conn, String topic, Map<Task,TaskDecision> decisions) throws SQLException
- Throws:
SQLException
-
doRecreate
<TASK extends Task> Map<TASK,Task> doRecreate(Connection conn, String topic, TaskSink.Insertion insertion, Collection<TASK> tasks, TaskState lower, TaskState upper) throws SQLException
- Throws:
SQLException
-
doReset
<TASK extends Task> Map<TASK,Task> doReset(Connection conn, String topic, Collection<TASK> tasks, TaskState lower, TaskState upper) throws SQLException
- Throws:
SQLException
-
complete
public void complete(Connection conn, String topic, Map<Task,TaskDecision> decisions) throws SQLException
- Specified by:
completein interfaceTaskSource<Connection,SQLException>- Throws:
SQLException
-
reassign
public void reassign(Connection conn, String topic, Map<Task,TaskResult> tasks) throws SQLException
- Specified by:
reassignin interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
recreate
public Map<Task,Task> recreate(Connection conn, String topic, TaskReviver.Revivification revivification, TaskReviver.Revived revived, long from, long to, int size) throws SQLException
- Specified by:
recreatein interfaceTaskReviver<Connection,SQLException>- Throws:
SQLException
-
recreate
public <TASK extends Task> Map<TASK,Task> recreate(Connection conn, String topic, TaskReviver.Revivification revivification, Set<TASK> tasks) throws SQLException
- Specified by:
recreatein interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
page
public List<TaskInfo> page(Connection conn, String topic, long sequence, int size, TaskRepository.Direction direction) throws SQLException
- Specified by:
pagein interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
page
public List<TaskInfo> page(Connection conn, String topic, TaskRepository.Listing listing, long sequence, int size, TaskRepository.Direction direction) throws SQLException
- Specified by:
pagein interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
count
public Map<String,Map<TaskState,Long>> count(Connection conn, TaskRepository.Snapshot snapshot, TaskRepository.Counting counting, long from, long to) throws SQLException
- Specified by:
countin interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
getCountingHint
String getCountingHint(boolean identified)
-
purgeAll
public void purgeAll(Connection conn, String topic) throws SQLException
- Specified by:
purgeAllin interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
purge
public long purge(Connection conn, String topic, long from, long to) throws SQLException
- Specified by:
purgein interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
purge
public long purge(Connection conn, String topic, TaskState state, long from, long to) throws SQLException
- Specified by:
purgein interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
doPurge
long doPurge(Connection conn, String topic, long from, long to, TaskState lower, TaskState upper) throws SQLException
- Throws:
SQLException
-
resolve
public long resolve(Connection conn, LocalDateTime dateTime, boolean preceding) throws SQLException
- Specified by:
resolvein interfaceTaskRepository<Connection,SQLException>- Throws:
SQLException
-
-