public synchronized void save(String opUrl, Association association) { removeExpired(); Map handleMap = (Map) _opMap.get(opUrl); if (handleMap == null) { handleMap = new HashMap(); _opMap.put(opUrl, handleMap); } String handle = association.getHandle(); if (DEBUG) { _log.debug("Adding association to the in-memory store: " + handle + " with OP: " + opUrl); } handleMap.put(association.getHandle(), association); }
public synchronized void save(String opUrl, Association association) { removeExpired(); Map handleMap = (Map) _opMap.get(opUrl); if (handleMap == null) { handleMap = new HashMap(); _opMap.put(opUrl, handleMap); } String handle = association.getHandle(); if(DEBUG) _log.debug("Adding association to the in-memory store: " + handle + " with OP: " + opUrl); handleMap.put(association.getHandle(), association); }
public synchronized void save(String opUrl, Association association) { removeExpired(); Map handleMap = (Map) _opMap.get(opUrl); if (handleMap == null) { handleMap = new HashMap(); _opMap.put(opUrl, handleMap); } String handle = association.getHandle(); if(DEBUG) _log.debug("Adding association to the in-memory store: " + handle + " with OP: " + opUrl); handleMap.put(association.getHandle(), association); }
@Override public void run() { if(log.isDebugEnabled()) { log.debug("Storing association " + association.getHandle() + " in the database."); } dao.storeAssociation(association); } };
public synchronized void save(String opUrl, Association association) { removeExpired(); Map handleMap = (Map) _opMap.get(opUrl); if (handleMap == null) { handleMap = new HashMap(); _opMap.put(opUrl, handleMap); } String handle = association.getHandle(); if(DEBUG) _log.debug("Adding association to the in-memory store: " + handle + " with OP: " + opUrl); handleMap.put(association.getHandle(), association); }
@Override public void run() { if(log.isDebugEnabled()) { log.debug("Storing association " + association.getHandle() + " in the database."); } dao.storeAssociation(association); } };
public synchronized void save(String opUrl, Association association) { removeExpired(); Map handleMap = (Map) _opMap.get(opUrl); if (handleMap == null) { handleMap = new HashMap(); _opMap.put(opUrl, handleMap); } String handle = association.getHandle(); if(DEBUG) _log.debug("Adding association to the in-memory store: " + handle + " with OP: " + opUrl); handleMap.put(association.getHandle(), association); }
public void removeExpiredAssociations() { Date currentTime = new Date(); for (Map.Entry<String, Association> entry : associationMap.entrySet()) { Association association = entry.getValue(); if(currentTime.after(association.getExpiry())) { if (log.isDebugEnabled()) { log.debug("Current time : " + currentTime.getTime() + ", expiry time : " + association.getExpiry().getTime() + ". Hence removing expired association : " + association.getHandle()); } removeAssociation(association.getHandle()); } } } }
public void removeExpiredAssociations() { Date currentTime = new Date(); for (Map.Entry<String, Association> entry : associationMap.entrySet()) { Association association = entry.getValue(); if(currentTime.after(association.getExpiry())) { if (log.isDebugEnabled()) { log.debug("Current time : " + currentTime.getTime() + ", expiry time : " + association.getExpiry().getTime() + ". Hence removing expired association : " + association.getHandle()); } removeAssociation(association.getHandle()); } } } }
public void addAssociation(Association association) { associationMap.put(association.getHandle(),association); AssociationClusterMessage associationInfoData = new AssociationClusterMessage(association, false); replicateAssociationInfo(associationInfoData); }
public void addAssociation(Association association) { associationMap.put(association.getHandle(),association); AssociationClusterMessage associationInfoData = new AssociationClusterMessage(association, false); replicateAssociationInfo(associationInfoData); }
public Association generate(String type, int expiryIn) throws AssociationException { String handle = storeId + timestamp + "-" + getCounter(); Association association = Association.generate(type, handle, expiryIn); // replicating association using cluster messages if(log.isDebugEnabled()) { log.debug("Storing association " + association.getHandle() + " in the map."); } OpenIDAssociationReplicationManager.getPersistenceManager().addAssociation(association); return association; }
public Association generate(String type, int expiryIn) throws AssociationException { String handle = storeId + timestamp + "-" + getCounter(); Association association = Association.generate(type, handle, expiryIn); // replicating association using cluster messages if(log.isDebugEnabled()) { log.debug("Storing association " + association.getHandle() + " in the map."); } OpenIDAssociationReplicationManager.getPersistenceManager().addAssociation(association); return association; }
private void replicateAssociationInfo(AssociationClusterMessage associationInfoData) { if (log.isDebugEnabled()) { log.debug("Starting to replicate association : " + associationInfoData.getAssociation().getHandle()); } ClusteringAgent agent = IdentityProviderServiceComponent.getConfigContext().getAxisConfiguration().getClusteringAgent(); if (log.isDebugEnabled()) { log.debug("Clustering Agent: " + agent); } if (agent != null) { try { agent.sendMessage(associationInfoData, true); } catch (ClusteringFault e) { log.error("Unable to send cluster message :" + e.getMessage(), e); } } if (log.isDebugEnabled()) { log.debug("Completed replicating association : " + associationInfoData.getAssociation().getHandle()); } }
private void replicateAssociationInfo(AssociationClusterMessage associationInfoData) { if (log.isDebugEnabled()) { log.debug("Starting to replicate association : " + associationInfoData.getAssociation().getHandle()); } ClusteringAgent agent = IdentityProviderServiceComponent.getConfigContext().getAxisConfiguration().getClusteringAgent(); if (log.isDebugEnabled()) { log.debug("Clustering Agent: " + agent); } if (agent != null) { try { agent.sendMessage(associationInfoData, true); } catch (ClusteringFault e) { log.error("Unable to send cluster message :" + e.getMessage(), e); } } if (log.isDebugEnabled()) { log.debug("Completed replicating association : " + associationInfoData.getAssociation().getHandle()); } }
/** * Add the entry to the cache. * * @param association */ public void addToCache(Association association) { if(association == null){ throw new IllegalArgumentException("Association is \'Null\'"); } OpenIDIdentityCacheKey cacheKey = new OpenIDIdentityCacheKey(0, association.getHandle()); OpenIDIdentityCacheEntry cacheEntry = new OpenIDIdentityCacheEntry(association.getType(), association.getMacKey(), association.getExpiry()); associationCache.addToCache(cacheKey, cacheEntry); if (log.isDebugEnabled()) { log.debug("New entry is added to cache for handle : " + association.getHandle()); } }
/** * @see org.openid4java.server.ServerAssociationStore#generate(java.lang.String, int) */ public Association generate(String type, int expiryIn) throws AssociationException { Association association = store.generate(type, expiryIn); try { addToken(association.getHandle(), association); } catch (IOException e) { throw new AssociationException(e); } return association; }
/** * @see org.openid4java.server.ServerAssociationStore#generate(java.lang.String, int) */ public Association generate(String type, int expiryIn) throws AssociationException { Association association = store.generate(type, expiryIn); try { addToken(association.getHandle(), association); } catch (IOException e) { throw new AssociationException(e); } return association; }
/** * @see org.openid4java.server.ServerAssociationStore#generate(java.lang.String, int) */ public Association generate(String type, int expiryIn) throws AssociationException { Association association = store.generate(type, expiryIn); try { addToken(association.getHandle(), association); } catch (IOException e) { throw new AssociationException(e); } return association; }
public void save(String opUrl, Association association) { cleanupExpired(); try { JdbcTemplate jdbcTemplate = getJdbcTemplate(); int cnt = jdbcTemplate.update(_sqlInsert, new Object[] { opUrl, association.getHandle(), association.getType(), association.getMacKey() == null ? null : new String( Base64.encodeBase64(association.getMacKey().getEncoded())), association.getExpiry()}); } catch (Exception e) { _log.error("Error saving association to table: " + _tableName, e); } }