public interface MetadataStorageActionHandler<EntryType,StatusType,LogType,LockType>
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
addLock(String entryId,
       LockType lock)
Add a lock to the given entry 
 | 
boolean | 
addLog(String entryId,
      LogType log)
Add a log to the entry with the given id. 
 | 
List<Pair<EntryType,StatusType>> | 
getActiveEntriesWithStatus()
Return all active entries with their respective status 
 | 
Pair<org.joda.time.DateTime,String> | 
getCreatedDateAndDataSource(String entryId)
Return createdDate and dataSource for the given id 
 | 
com.google.common.base.Optional<EntryType> | 
getEntry(String entryId)
Retrieves the entry with the given id. 
 | 
default List<StatusType> | 
getInactiveStatusesSince(org.joda.time.DateTime timestamp)  | 
List<StatusType> | 
getInactiveStatusesSince(org.joda.time.DateTime timestamp,
                        Integer maxNumStatuses)
Return up to  
maxNumStatuses statuses for inactive entries created on or later than the given timestamp | 
Long | 
getLockId(String entryId,
         LockType lock)
Returns the lock id for the given entry and the lock. 
 | 
Map<Long,LockType> | 
getLocks(String entryId)
Returns the locks for the given entry 
 | 
List<LogType> | 
getLogs(String entryId)
Returns the logs for the entry with the given id. 
 | 
com.google.common.base.Optional<StatusType> | 
getStatus(String entryId)
Retrieve the status for the entry with the given id. 
 | 
void | 
insert(String id,
      org.joda.time.DateTime timestamp,
      String dataSource,
      EntryType entry,
      boolean active,
      StatusType status)
Creates a new entry. 
 | 
void | 
removeLock(long lockId)
Remove the lock with the given lock id. 
 | 
boolean | 
replaceLock(String entryId,
           long oldLockId,
           LockType newLock)
Replace an existing lock with a new lock. 
 | 
boolean | 
setStatus(String entryId,
         boolean active,
         StatusType status)
Sets or updates the status for any active entry with the given id. 
 | 
void insert(@NotNull
            String id,
            @NotNull
            org.joda.time.DateTime timestamp,
            @NotNull
            String dataSource,
            @NotNull
            EntryType entry,
            boolean active,
            @Nullable
            StatusType status)
     throws EntryExistsException
id - entry idtimestamp - timestamp this entry was createddataSource - datasource associated with this entryentry - object representing this entryactive - active or inactive flagstatus - status object associated wit this object, can be nullEntryExistsExceptionboolean setStatus(String entryId, boolean active, StatusType status)
entryId - entry idactive - activestatus - statuscom.google.common.base.Optional<EntryType> getEntry(String entryId)
entryId - entry idcom.google.common.base.Optional<StatusType> getStatus(String entryId)
entryId - entry idList<Pair<EntryType,StatusType>> getActiveEntriesWithStatus()
default List<StatusType> getInactiveStatusesSince(org.joda.time.DateTime timestamp)
List<StatusType> getInactiveStatusesSince(org.joda.time.DateTime timestamp, @Nullable Integer maxNumStatuses)
maxNumStatuses statuses for inactive entries created on or later than the given timestamptimestamp - timestampmaxNumStatuses - maxNumStatuses@Nullable Pair<org.joda.time.DateTime,String> getCreatedDateAndDataSource(String entryId)
boolean addLock(String entryId, LockType lock)
entryId - entry idlock - lock to addboolean replaceLock(String entryId, long oldLockId, LockType newLock)
entryId - entry idoldLockId - lock to be replacednewLock - lock to be addedvoid removeLock(long lockId)
lockId - lock idboolean addLog(String entryId, LogType log)
entryId - entry idlog - log to addList<LogType> getLogs(String entryId)
entryId - entry idMap<Long,LockType> getLocks(String entryId)
entryId - entry idCopyright © 2011–2018. All rights reserved.