org.openid4java.association.Association.getHandle()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中org.openid4java.association.Association.getHandle()方法的一些代码示例,展示了Association.getHandle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Association.getHandle()方法的具体详情如下:
包路径:org.openid4java.association.Association
类名称:Association
方法名:getHandle

Association.getHandle介绍

暂无

代码示例

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

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);
}

代码示例来源:origin: org.openid4java/openid4java-nodeps

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);
}

代码示例来源:origin: org.openid4java/openid4java

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);
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provider

@Override
  public void run() {
    if(log.isDebugEnabled()) {
      log.debug("Storing association " + association.getHandle() + " in the database.");
    }
    dao.storeAssociation(association);
  }
};

代码示例来源:origin: com.cloudbees/openid4java-shaded

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);
}

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.openid/org.wso2.carbon.identity.provider

@Override
  public void run() {
    if(log.isDebugEnabled()) {
      log.debug("Storing association " + association.getHandle() + " in the database.");
    }
    dao.storeAssociation(association);
  }
};

代码示例来源:origin: jbufu/openid4java

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);
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provider

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());
      }
    }

  }
}

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.openid/org.wso2.carbon.identity.provider

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());
      }
    }

  }
}

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.openid/org.wso2.carbon.identity.provider

public void addAssociation(Association association) {
  associationMap.put(association.getHandle(),association);
  AssociationClusterMessage associationInfoData = new AssociationClusterMessage(association, false);
  replicateAssociationInfo(associationInfoData);
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provider

public void addAssociation(Association association) {
  associationMap.put(association.getHandle(),association);
  AssociationClusterMessage associationInfoData = new AssociationClusterMessage(association, false);
  replicateAssociationInfo(associationInfoData);
}

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.openid/org.wso2.carbon.identity.provider

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;
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provider

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;
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provider

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());
  }
}

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.openid/org.wso2.carbon.identity.provider

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());
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provider

/**
 * 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());
  }
}

代码示例来源:origin: org.picketlink/picketlink-openid

/**
 * @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;
}

代码示例来源:origin: org.picketlink/picketlink-consolidated-social

/**
 * @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;
}

代码示例来源:origin: picketlink/picketlink

/**
 * @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;
}

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

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);
  }
}

相关文章