diff --git a/.gitignore b/.gitignore
index 54b685e..fb4f905 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,7 @@ target/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
+
+/.classpath
+/.project
+/.settings/
diff --git a/pom.xml b/pom.xml
index 098b2a7..59c9eb2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,9 +5,9 @@
4.0.0
- io.activestack
+ org.activestack
syncengine
- 1.1.16-SNAPSHOT
+ 1.1.17-updatetable-SNAPSHOT
3.2.4.RELEASE
@@ -15,6 +15,7 @@
1.6.1
1.19.0
1.19.0
+ 1.9.5
@@ -34,6 +35,12 @@
4.8.2
test
+
+ org.mockito
+ mockito-core
+ ${mockito-core.version}
+ test
+
org.codehaus.jackson
@@ -244,7 +251,10 @@
com.google.apis
google-api-services-oauth2
- v2-rev78-1.19.0
+
+ v2-rev78-1.19.0
com.google.http-client
@@ -293,6 +303,20 @@
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.7
+ 1.7
+
+
+
+
+
com.springsource.repository.bundles.release
@@ -315,4 +339,6 @@
http://maven.springframework.org/release
+
+
\ No newline at end of file
diff --git a/src/main/java/com/convergys/pulse/service/PulseHttpAuthProvider.java b/src/main/java/com/convergys/pulse/service/PulseHttpAuthProvider.java
deleted file mode 100644
index a61e0a1..0000000
--- a/src/main/java/com/convergys/pulse/service/PulseHttpAuthProvider.java
+++ /dev/null
@@ -1,167 +0,0 @@
-package com.convergys.pulse.service;
-
-import com.percero.agents.auth.services.IAuthProvider;
-import com.percero.agents.auth.vo.BasicAuthCredential;
-import com.percero.agents.auth.vo.ServiceIdentifier;
-import com.percero.agents.auth.vo.ServiceUser;
-import com.percero.serial.map.SafeObjectMapper;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.conn.ClientConnectionManager;
-import org.apache.http.conn.scheme.Scheme;
-import org.apache.http.conn.scheme.SchemeRegistry;
-import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.impl.conn.SingleClientConnManager;
-import org.apache.log4j.Logger;
-import org.codehaus.jackson.map.ObjectMapper;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-import java.io.IOException;
-import java.security.SecureRandom;
-import java.security.cert.X509Certificate;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * AuthProvider implementation for Pulse to their http rest endpoint
- * Created by Jonathan Samples on 8/27/15.
- */
-public class PulseHttpAuthProvider implements IAuthProvider {
-
- private static Logger logger = Logger.getLogger(PulseHttpAuthProvider.class);
- private static final String ID = "pulse_http";
-
- public String getID() {
- return ID;
- }
-
- /**
- * @param credential - String in : format
- * @return
- */
- public ServiceUser authenticate(String credential) {
- ServiceUser result = null;
- BasicAuthCredential cred = BasicAuthCredential.fromString(credential);
-
- String endpoint = hostPortAndContext +"/Authenticate";
- Map params = new HashMap();
- params.put("userDomainAndLogin", cred.getUsername());
- params.put("userPassword", cred.getPassword());
-
- String body = makeRequest(endpoint, params);
-
- /**
- * Result will be something like
- * true
- */
- if(body.contains("true")){
- result = new ServiceUser();
- result.getIdentifiers().add(new ServiceIdentifier("email", cred.getUsername()));
- }
-
- return result;
- }
-
- /**
- * @param url
- * @param params
- * @return
- */
- private String makeRequest(String url, Map params){
- String body = "";
- try {
- HttpClient client = getHttpClient();
- String query = "?";
- for(String key : params.keySet()){
- query += key+"="+params.get(key)+"&";
- }
- url += query;
-
- HttpGet request = new HttpGet(url);
- HttpResponse response = client.execute(request);
- logger.debug("Got response from auth hostPortAndContext: (" + response.getStatusLine().getStatusCode() + ")" + response.getStatusLine().getReasonPhrase());
- body = IOUtils.toString(response.getEntity().getContent(), "UTF8");
- } catch(ClientProtocolException e){
- logger.warn(e.getMessage(), e);
- } catch(IOException ioe){
- logger.warn(ioe.getMessage(), ioe);
- }
-
- return body;
- }
-
- private HttpClient getHttpClient(){
- HttpClient httpClient = null;
- if(trustAllCerts) {
- try {
- SSLContext sslContext = SSLContext.getInstance("SSL");
-
- // set up a TrustManager that trusts everything
- sslContext.init(null, new TrustManager[]{new X509TrustManager() {
- public X509Certificate[] getAcceptedIssuers() {
- return null;
- }
-
- public void checkClientTrusted(X509Certificate[] certs,
- String authType) {
- }
-
- public void checkServerTrusted(X509Certificate[] certs,
- String authType) {
- }
- }}, new SecureRandom());
-
- SSLSocketFactory sf = new SSLSocketFactory(sslContext);
- Scheme httpsScheme = new Scheme("https", sf, 443);
- SchemeRegistry schemeRegistry = new SchemeRegistry();
- schemeRegistry.register(httpsScheme);
-
- ClientConnectionManager cm = new SingleClientConnManager(null, schemeRegistry);
- httpClient = new DefaultHttpClient(cm, null);
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- // If don't trustAllCerts or an exception thrown then use the default one.
- if(httpClient == null){
- httpClient = new DefaultHttpClient();
- }
-
- return httpClient;
- }
-
- private String hostPortAndContext;
- private ObjectMapper objectMapper;
-
- /**
- * Only make this true for development when dealing with a self-signed certificate
- */
- private boolean trustAllCerts = false;
-
- /**
- * @param hostPortAndContext - e.g. https://some_host:5400/auth
- * @param objectMapper
- */
- public PulseHttpAuthProvider(String hostPortAndContext, ObjectMapper objectMapper, boolean trustAllCerts){
- this.hostPortAndContext = hostPortAndContext;
- this.objectMapper = objectMapper;
- this.trustAllCerts = trustAllCerts;
- }
-
- /**
- * For Testing
- * @param args
- */
- public static void main(String[] args){
- PulseHttpAuthProvider provider = new PulseHttpAuthProvider("https://localhost:8900/auth", new SafeObjectMapper(), true);
- ServiceUser su = provider.authenticate("hoo:ha");
- System.out.println(su.toString());
- }
-}
diff --git a/src/main/java/com/convergys/pulse/service/PulseHttpAuthProviderFactory.java b/src/main/java/com/convergys/pulse/service/PulseHttpAuthProviderFactory.java
deleted file mode 100644
index fbbffcc..0000000
--- a/src/main/java/com/convergys/pulse/service/PulseHttpAuthProviderFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.convergys.pulse.service;
-
-import com.percero.agents.auth.services.AuthProviderRegistry;
-import org.apache.log4j.Logger;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-
-/**
- * Created by jonnysamps on 8/27/15.
- */
-@Component
-public class PulseHttpAuthProviderFactory {
-
- private static Logger logger = Logger.getLogger(PulseHttpAuthProviderFactory.class);
-
- @Autowired @Value("$pf{pulseHttpAuth.hostPortAndContext}")
- String hostPortAndContext = null;
-
- @Autowired @Value("$pf{pulseHttpAuth.trustAllCerts:false}")
- Boolean trustAllCerts = false;
-
- @Autowired
- AuthProviderRegistry authProviderRegistry;
-
- @Autowired
- ObjectMapper objectMapper;
-
- @PostConstruct
- public void init(){
- if(hostPortAndContext != null){
- logger.info("Using PulseHttpAuthProvider with endpoint: "+hostPortAndContext);
- PulseHttpAuthProvider provider = new PulseHttpAuthProvider(hostPortAndContext, objectMapper, trustAllCerts);
- authProviderRegistry.addProvider(provider);
- }
- }
-}
diff --git a/src/main/java/com/convergys/pulse/vo/PulseUserInfo.java b/src/main/java/com/convergys/pulse/vo/PulseUserInfo.java
deleted file mode 100644
index 13e6629..0000000
--- a/src/main/java/com/convergys/pulse/vo/PulseUserInfo.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.convergys.pulse.vo;
-
-/**
- * Class to represent the response from the Pulse /retrieve_user endpoint
- * Created by Jonathan Samples on 8/27/15.
- */
-public class PulseUserInfo {
- private String userLogin;
- private String employeeId;
-
- public String getEmployeeId() {
- return employeeId;
- }
-
- public void setEmployeeId(String employeeId) {
- this.employeeId = employeeId;
- }
-
- public String getUserLogin() {
- return userLogin;
- }
-
- public void setUserLogin(String userLogin) {
- this.userLogin = userLogin;
- }
-}
diff --git a/src/main/java/com/percero/agents/auth/services/AuthProviderRegistry.java b/src/main/java/com/percero/agents/auth/services/AuthProviderRegistry.java
index b2e43a1..baaecb0 100644
--- a/src/main/java/com/percero/agents/auth/services/AuthProviderRegistry.java
+++ b/src/main/java/com/percero/agents/auth/services/AuthProviderRegistry.java
@@ -35,7 +35,7 @@ public void addProvider(IAuthProvider provider){
if(providerMap.containsKey(provider.getID()))
logger.warn("Non-unique auth provider ID: "+provider.getID());
- providerMap.put(provider.getID(), provider);
+ providerMap.put(provider.getID().toLowerCase(), provider);
}
/**
@@ -44,7 +44,7 @@ public void addProvider(IAuthProvider provider){
* @return
*/
public IAuthProvider getProvider(String ID){
- return providerMap.get(ID);
+ return providerMap.get(ID.toLowerCase());
}
/**
@@ -53,6 +53,6 @@ public IAuthProvider getProvider(String ID){
* @return
*/
public boolean hasProvider(String ID){
- return providerMap.containsKey(ID);
+ return providerMap.containsKey(ID.toLowerCase());
}
}
diff --git a/src/main/java/com/percero/agents/sync/access/AccessManager.java b/src/main/java/com/percero/agents/sync/access/AccessManager.java
index 33b1fae..b1dc5a4 100644
--- a/src/main/java/com/percero/agents/sync/access/AccessManager.java
+++ b/src/main/java/com/percero/agents/sync/access/AccessManager.java
@@ -870,6 +870,16 @@ public List getObjectAccessJournals(String className, String classId) th
return result;
}
+ @Override
+ public Set getClassAccessJournalIDs(String className) {
+ return null;
+ }
+
+ @Override
+ public long getNumClientsInterestedInWholeClass(String className) {
+ return 0;
+ }
+
@SuppressWarnings("unchecked")
public Map> getClientAccessess(Collection classIdPairs) throws Exception {
Map> result = new HashMap>();
@@ -938,7 +948,7 @@ public List checkUserListAccessRights(List userIdList, String cl
boolean hasAccess = true;
// If the Read Query/Filter uses the ID, then we need to check against each ID here.
if (isValidReadQuery) {
- mappedClass.getReadQuery().setQueryParameters(query, classId, nextUserId);
+ mappedClass.getReadQuery().setQueryParameters(query.getQueryString(), classId, nextUserId);
Number readFilterResult = (Number) query.uniqueResult();
if (readFilterResult == null || readFilterResult.intValue() <= 0)
hasAccess = false;
@@ -1257,6 +1267,34 @@ public String validateAndRetrieveCurrentClientId(String clientId,
return null;
}
+ @Override
+ public void updateWatcherFields(String category, String subCategory,
+ String fieldName, Collection fieldsToWatch, String[] params) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void addWatcherField(String category, String subCategory,
+ String fieldName, Collection collection, String[] params) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void addWatcherField(String category, String subCategory,
+ String fieldName, Collection collection) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void updateWatcherFields(String category, String subCategory,
+ String fieldName, Collection fieldsToWatch) {
+ // TODO Auto-generated method stub
+
+ }
+
/* (non-Javadoc)
* @see com.com.percero.agents.sync.services.IAccessManager#removeDeleteJournals(java.util.List)
*
diff --git a/src/main/java/com/percero/agents/sync/access/IAccessManager.java b/src/main/java/com/percero/agents/sync/access/IAccessManager.java
index 7875993..0d3dc27 100644
--- a/src/main/java/com/percero/agents/sync/access/IAccessManager.java
+++ b/src/main/java/com/percero/agents/sync/access/IAccessManager.java
@@ -153,6 +153,8 @@ public Set findClientByUserIdDeviceId(String deviceId, String userId)
* @throws Exception
*/
public List getObjectAccessJournals(String className, String classId) throws Exception;
+ Set getClassAccessJournalIDs(String className);
+ long getNumClientsInterestedInWholeClass(String className);
public void removeAccessJournalsByObject(ClassIDPair classIdPair);
@@ -196,10 +198,14 @@ public Set findClientByUserIdDeviceId(String deviceId, String userId)
////////////////////////////////////////////////////////
public void addWatcherField(ClassIDPair classIdPair, String fieldName, Collection collection);
public void addWatcherField(ClassIDPair classIdPair, String fieldName, Collection collection, String[] params);
+ public void addWatcherField(String category, String subCategory, String fieldName, Collection collection);
+ public void addWatcherField(String category, String subCategory, String fieldName, Collection collection, String[] params);
public void addWatcherClient(ClassIDPair classIdPair, String fieldName, String clientId);
public void addWatcherClient(ClassIDPair classIdPair, String fieldName, String clientId, String[] params);
public void updateWatcherFields(ClassIDPair classIdPair, String fieldName, Collection fieldsToWatch);
public void updateWatcherFields(ClassIDPair classIdPair, String fieldName, Collection fieldsToWatch, String[] params);
+ public void updateWatcherFields(String category, String subCategory, String fieldName, Collection fieldsToWatch);
+ public void updateWatcherFields(String category, String subCategory, String fieldName, Collection fieldsToWatch, String[] params);
public void saveChangeWatcherResult(ClassIDPair classIdPair, String fieldName, Object result);
public void saveChangeWatcherResult(ClassIDPair classIdPair, String fieldName, Object result, String[] params);
public Boolean getChangeWatcherResultExists(ClassIDPair classIdPair, String fieldName);
diff --git a/src/main/java/com/percero/agents/sync/access/RedisAccessManager.java b/src/main/java/com/percero/agents/sync/access/RedisAccessManager.java
index cdcc43b..c392dec 100644
--- a/src/main/java/com/percero/agents/sync/access/RedisAccessManager.java
+++ b/src/main/java/com/percero/agents/sync/access/RedisAccessManager.java
@@ -26,7 +26,7 @@
import com.percero.agents.sync.cw.ChangeWatcherReporting;
import com.percero.agents.sync.cw.IChangeWatcherHelper;
import com.percero.agents.sync.cw.IChangeWatcherHelperFactory;
-import com.percero.agents.sync.datastore.RedisDataStore;
+import com.percero.agents.sync.datastore.ICacheDataStore;
import com.percero.agents.sync.exceptions.ClientException;
import com.percero.agents.sync.helpers.RedisPostClientHelper;
import com.percero.agents.sync.services.IPushSyncHelper;
@@ -75,9 +75,9 @@ public void setPostClientHelper(RedisPostClientHelper value) {
//MongoOperations mongoOperations;
@Autowired
- RedisDataStore redisDataStore;
- public void setRedisDataStore(RedisDataStore redisDataStore) {
- this.redisDataStore = redisDataStore;
+ ICacheDataStore cacheDataStore;
+ public void setCacheDataStore(ICacheDataStore cacheDataStore) {
+ this.cacheDataStore = cacheDataStore;
}
@Autowired
@@ -105,48 +105,48 @@ public void setPushSyncHelper(IPushSyncHelper pushSyncHelper) {
public void createClient(String clientId, String userId, String deviceType, String deviceId) throws Exception {
String clientUserKey = RedisKeyUtils.clientUser(userId);
- redisDataStore.addSetValue(clientUserKey, clientId);
+ cacheDataStore.addSetValue(clientUserKey, clientId);
if (StringUtils.hasText(deviceId)) {
String userDeviceKey = RedisKeyUtils.userDeviceHash(userId);
- redisDataStore.setHashValue(userDeviceKey, deviceId, clientId);
+ cacheDataStore.setHashValue(userDeviceKey, deviceId, clientId);
String deviceKey = RedisKeyUtils.deviceHash(deviceId);
- redisDataStore.addSetValue(deviceKey, clientId);
+ cacheDataStore.addSetValue(deviceKey, clientId);
}
// Set the client's userId.
- redisDataStore.setValue(RedisKeyUtils.client(clientId), userId);
+ cacheDataStore.setValue(RedisKeyUtils.client(clientId), userId);
// Add to ClientUser list
- redisDataStore.addSetValue(clientUserKey, clientId);
+ cacheDataStore.addSetValue(clientUserKey, clientId);
if (Client.PERSISTENT_TYPE.equalsIgnoreCase(deviceType)) {
- redisDataStore.addSetValue(RedisKeyUtils.clientsPersistent(), clientId);
+ cacheDataStore.addSetValue(RedisKeyUtils.clientsPersistent(), clientId);
}
else {
- redisDataStore.addSetValue(RedisKeyUtils.clientsNonPersistent(), clientId);
+ cacheDataStore.addSetValue(RedisKeyUtils.clientsNonPersistent(), clientId);
}
}
public Boolean isNonPersistentClient(String clientId) {
- return redisDataStore.getSetIsMember(RedisKeyUtils.clientsNonPersistent(), clientId);
+ return cacheDataStore.getSetIsMember(RedisKeyUtils.clientsNonPersistent(), clientId);
}
public String getClientUserId(String clientId) {
- return (String) redisDataStore.getValue(RedisKeyUtils.client(clientId));
+ return (String) cacheDataStore.getValue(RedisKeyUtils.client(clientId));
}
public Boolean findClientByClientIdUserId(String clientId, String userId) throws Exception {
- return redisDataStore.getSetIsMember(RedisKeyUtils.clientUser(userId), clientId);
+ return cacheDataStore.getSetIsMember(RedisKeyUtils.clientUser(userId), clientId);
}
@SuppressWarnings("unchecked")
public Set findClientByUserIdDeviceId(String userId, String deviceId) throws Exception {
- Set deviceClientIds = (Set) redisDataStore.getSetValue(RedisKeyUtils.deviceHash(deviceId));
+ Set deviceClientIds = (Set) cacheDataStore.getSetValue(RedisKeyUtils.deviceHash(deviceId));
if (deviceClientIds == null) {
deviceClientIds = new HashSet(1);
}
- String result = (String) redisDataStore.getHashValue(RedisKeyUtils.userDeviceHash(userId), deviceId);
+ String result = (String) cacheDataStore.getHashValue(RedisKeyUtils.userDeviceHash(userId), deviceId);
if (!StringUtils.hasText(result)) {
deviceClientIds.add(result);
}
@@ -155,9 +155,9 @@ public Set findClientByUserIdDeviceId(String userId, String deviceId) th
}
public Boolean findClientByClientId(String clientId) {
- if (redisDataStore.getSetIsMember(RedisKeyUtils.clientsPersistent(), clientId))
+ if (cacheDataStore.getSetIsMember(RedisKeyUtils.clientsPersistent(), clientId))
return true;
- else if (redisDataStore.getSetIsMember(RedisKeyUtils.clientsNonPersistent(), clientId))
+ else if (cacheDataStore.getSetIsMember(RedisKeyUtils.clientsNonPersistent(), clientId))
return true;
else
return false;
@@ -186,13 +186,13 @@ public Boolean validateClientByClientId(String clientId, Boolean setClientTimeou
@SuppressWarnings("unchecked")
public Set validateClients(Collection clientIds) throws Exception {
- Set validClients = (Set) redisDataStore.getSetsContainsMembers(CLIENT_KEYS_SEY, clientIds.toArray());
+ Set validClients = (Set) cacheDataStore.getSetsContainsMembers(CLIENT_KEYS_SEY, clientIds.toArray());
return validClients;
}
@SuppressWarnings("unchecked")
public Set validateClientsIncludeFromDeviceHistory(Map clientDevices) throws Exception {
- Set validClients = (Set) redisDataStore.getSetsContainsMembers(CLIENT_KEYS_SEY, clientDevices.keySet().toArray());
+ Set validClients = (Set) cacheDataStore.getSetsContainsMembers(CLIENT_KEYS_SEY, clientDevices.keySet().toArray());
// Now check each device to see if it has a corresponding clientId.
Iterator> itrClientDevices = clientDevices.entrySet().iterator();
@@ -201,7 +201,7 @@ public Set validateClientsIncludeFromDeviceHistory(Map c
String nextClient = nextClientDevice.getKey();
String nextDevice = nextClientDevice.getValue();
- if (redisDataStore.getSetIsMember(RedisKeyUtils.deviceHash(nextDevice), nextClient)) {
+ if (cacheDataStore.getSetIsMember(RedisKeyUtils.deviceHash(nextDevice), nextClient)) {
validClients.add(nextClient);
}
}
@@ -217,9 +217,9 @@ public String validateAndRetrieveCurrentClientId(String clientId, String deviceI
}
else {
// Client is NOT current, but could still be valid.
- if (redisDataStore.getSetIsMember(RedisKeyUtils.deviceHash(deviceId), clientId)) {
+ if (cacheDataStore.getSetIsMember(RedisKeyUtils.deviceHash(deviceId), clientId)) {
// Client IS valid, now get current Client.
- Set validDeviceClientIds = (Set) redisDataStore.getSetValue(RedisKeyUtils.deviceHash(deviceId));
+ Set validDeviceClientIds = (Set) cacheDataStore.getSetValue(RedisKeyUtils.deviceHash(deviceId));
Iterator itrValidDeviceClientIds = validDeviceClientIds.iterator();
while (itrValidDeviceClientIds.hasNext()) {
String nextClientId = itrValidDeviceClientIds.next();
@@ -250,8 +250,8 @@ public void registerClient(String clientId, String userId, String deviceId, Stri
if (!isValidClient)
createClient(clientId, userId, deviceType, deviceId);
- redisDataStore.addSetValue(RedisKeyUtils.clientsLoggedIn(), clientId);
- redisDataStore.deleteHashKey(RedisKeyUtils.clientsHibernated(), clientId);
+ cacheDataStore.addSetValue(RedisKeyUtils.clientsLoggedIn(), clientId);
+ cacheDataStore.deleteHashKey(RedisKeyUtils.clientsHibernated(), clientId);
postClient(clientId);
}
@@ -263,8 +263,8 @@ public Boolean hibernateClient(String clientId, String userId) throws Exception
// Make sure this client/user combo is a valid one.
if (findClientByClientIdUserId(clientId, userId)) {
// Remove the client from the LoggedIn list and add it to the Hibernated list.
- redisDataStore.setHashValue(RedisKeyUtils.clientsHibernated(), clientId, System.currentTimeMillis());
- redisDataStore.removeSetValue(RedisKeyUtils.clientsLoggedIn(), clientId);
+ cacheDataStore.setHashValue(RedisKeyUtils.clientsHibernated(), clientId, System.currentTimeMillis());
+ cacheDataStore.removeSetValue(RedisKeyUtils.clientsLoggedIn(), clientId);
// NOTE: The client is still in either the "client persistent" or "client non-persistent" list and
// is therefore still considered a valid client.
@@ -294,16 +294,16 @@ public Boolean upgradeClient(String clientId, String deviceId, String deviceType
try {
// Remove from NonPersistent list.
- redisDataStore.removeSetValue(RedisKeyUtils.clientsNonPersistent(), clientId);
+ cacheDataStore.removeSetValue(RedisKeyUtils.clientsNonPersistent(), clientId);
// Add to Persistent List.
- redisDataStore.addSetValue(RedisKeyUtils.clientsPersistent(), clientId);
+ cacheDataStore.addSetValue(RedisKeyUtils.clientsPersistent(), clientId);
// Add to LoggedIn list
- redisDataStore.addSetValue(RedisKeyUtils.clientsLoggedIn(), clientId);
+ cacheDataStore.addSetValue(RedisKeyUtils.clientsLoggedIn(), clientId);
// Remove from Hibernated list
- redisDataStore.deleteHashKey(RedisKeyUtils.clientsHibernated(), clientId);
+ cacheDataStore.deleteHashKey(RedisKeyUtils.clientsHibernated(), clientId);
if (previousClientIds != null && !previousClientIds.isEmpty()) {
Iterator itrPreviousClientIds = previousClientIds.iterator();
@@ -311,7 +311,7 @@ public Boolean upgradeClient(String clientId, String deviceId, String deviceType
String nextPreviousClient = itrPreviousClientIds.next();
if (StringUtils.hasText(nextPreviousClient) && nextPreviousClient.equals(clientId)) {
// Remove from NonPersistent list.
- redisDataStore.removeSetValue(RedisKeyUtils.clientsNonPersistent(), nextPreviousClient);
+ cacheDataStore.removeSetValue(RedisKeyUtils.clientsNonPersistent(), nextPreviousClient);
renameClient(nextPreviousClient, clientId);
}
@@ -319,7 +319,7 @@ public Boolean upgradeClient(String clientId, String deviceId, String deviceType
}
else {
// Add to ClientUser list
- redisDataStore.addSetValue(RedisKeyUtils.clientUser(userId), clientId);
+ cacheDataStore.addSetValue(RedisKeyUtils.clientUser(userId), clientId);
}
result = true;
@@ -344,94 +344,94 @@ else if (thePreviousClient.equals(clientId)) {
}
// Get the existing UserId.
- String userId = (String) redisDataStore.getValue(RedisKeyUtils.client(thePreviousClient));
+ String userId = (String) cacheDataStore.getValue(RedisKeyUtils.client(thePreviousClient));
log.debug("Renaming client " + thePreviousClient + " to " + clientId);
if (StringUtils.hasText(userId)) {
log.debug("Renaming user " + userId + " from client " + thePreviousClient + " to " + clientId);
// Remove Previous Client from ClientUser list
- redisDataStore.removeSetValue(RedisKeyUtils.clientUser(userId), thePreviousClient);
+ cacheDataStore.removeSetValue(RedisKeyUtils.clientUser(userId), thePreviousClient);
// Add to ClientUser list
- redisDataStore.addSetValue(RedisKeyUtils.clientUser(userId), clientId);
+ cacheDataStore.addSetValue(RedisKeyUtils.clientUser(userId), clientId);
// Update the UserDevice ClientID.
String userDeviceHashKey = RedisKeyUtils.userDeviceHash(userId);
- Collection