public class ReplicationCache extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ReplicationCache.Factory
A factory class for ReplicationCache.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_EXPIRATION_IN_MINUTES
Cache expiration in minutes.
|
Constructor and Description |
---|
ReplicationCache()
Default constructor.
|
ReplicationCache(long expiration,
TimeUnit unit)
Constructor use by default constructor and for unit tests.
|
Modifier and Type | Method and Description |
---|---|
com.sonymobile.tools.gerrit.gerritevents.dto.events.RefReplicated |
getIfPresent(String gerritServer,
String gerritProject,
String ref,
String slaveHost)
Return the cached RefReplicated associated with the specified parameters, if found.
|
boolean |
initialize()
Initialize cache.
|
boolean |
isExpired(long timestamp)
Returns if the specified time stamp is expired.
|
void |
put(com.sonymobile.tools.gerrit.gerritevents.dto.events.RefReplicated refReplicated)
Cache the specified RefReplicated.
|
void |
setCreationTime(long time)
Set creation time for Replication Cache.
|
public static final int DEFAULT_EXPIRATION_IN_MINUTES
public ReplicationCache()
public ReplicationCache(long expiration, TimeUnit unit)
expiration
- Cache expirationunit
- the unit that expiration is expressed inpublic void setCreationTime(long time)
time
- when cache was createdpublic boolean initialize()
public void put(com.sonymobile.tools.gerrit.gerritevents.dto.events.RefReplicated refReplicated)
refReplicated
- the event to cachepublic boolean isExpired(long timestamp)
timestamp
- the time stamp to check.public com.sonymobile.tools.gerrit.gerritevents.dto.events.RefReplicated getIfPresent(String gerritServer, String gerritProject, String ref, String slaveHost)
gerritServer
- The gerritServergerritProject
- The gerritProjectref
- The refslaveHost
- The slaveHostCopyright © 2004-2016. All Rights Reserved.