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

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

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

Association.getExpiry介绍

暂无

代码示例

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

public synchronized Association load(String opUrl) {
  removeExpired();
  Association latest = null;
  if (_opMap.containsKey(opUrl)) {
    Map handleMap = (Map) _opMap.get(opUrl);
    Iterator handles = handleMap.keySet().iterator();
    while (handles.hasNext()) {
      String handle = (String) handles.next();
      Association association = (Association) handleMap.get(handle);
      if (latest == null ||
        latest.getExpiry().before(association.getExpiry())) {
        latest = association;
      }
    }
  }
  return latest;
}

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

public synchronized Association load(String opUrl)
{
  removeExpired();
  Association latest = null;
  if (_opMap.containsKey(opUrl))
  {
    Map handleMap = (Map) _opMap.get(opUrl);
    Iterator handles = handleMap.keySet().iterator();
    while (handles.hasNext())
    {
      String handle = (String) handles.next();
      Association association = (Association) handleMap.get(handle);
      if (latest == null ||
          latest.getExpiry().before(association.getExpiry()))
        latest = association;
    }
  }
  return latest;
}

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

public synchronized Association load(String opUrl)
{
  removeExpired();
  Association latest = null;
  if (_opMap.containsKey(opUrl))
  {
    Map handleMap = (Map) _opMap.get(opUrl);
    Iterator handles = handleMap.keySet().iterator();
    while (handles.hasNext())
    {
      String handle = (String) handles.next();
      Association association = (Association) handleMap.get(handle);
      if (latest == null ||
          latest.getExpiry().before(association.getExpiry()))
        latest = association;
    }
  }
  return latest;
}

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

public synchronized Association load(String opUrl)
{
  removeExpired();
  Association latest = null;
  if (_opMap.containsKey(opUrl))
  {
    Map handleMap = (Map) _opMap.get(opUrl);
    Iterator handles = handleMap.keySet().iterator();
    while (handles.hasNext())
    {
      String handle = (String) handles.next();
      Association association = (Association) handleMap.get(handle);
      if (latest == null ||
          latest.getExpiry().before(association.getExpiry()))
        latest = association;
    }
  }
  return latest;
}

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

public synchronized Association load(String opUrl)
{
  removeExpired();
  Association latest = null;
  if (_opMap.containsKey(opUrl))
  {
    Map handleMap = (Map) _opMap.get(opUrl);
    Iterator handles = handleMap.keySet().iterator();
    while (handles.hasNext())
    {
      String handle = (String) handles.next();
      Association association = (Association) handleMap.get(handle);
      if (latest == null ||
          latest.getExpiry().before(association.getExpiry()))
        latest = association;
    }
  }
  return latest;
}

代码示例来源: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.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);
  }
}

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

prepStmt.setString(1, association.getHandle());
prepStmt.setString(2, association.getType());
prepStmt.setTimestamp(3, new java.sql.Timestamp(association.getExpiry().getTime()));
prepStmt.setString(4, Base64.encode(association.getMacKey().getEncoded()));
prepStmt.setString(5, associationStore);

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

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

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

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

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

prepStmt.setString(1, association.getHandle());
prepStmt.setString(2, association.getType());
prepStmt.setTimestamp(3, new java.sql.Timestamp(association.getExpiry().getTime()));
prepStmt.setString(4, Base64.encode(association.getMacKey().getEncoded()));
prepStmt.setString(5, associationStore);

代码示例来源:origin: 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 ) ;
  }
}

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

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

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

new String(Base64.encodeBase64(
        association.getMacKey().getEncoded())),
    association.getExpiry()
});

代码示例来源: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.wso2.carbon.identity.inbound.auth.openid/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.openid4java/openid4java-nodeps

Long expiryIn = new Long( ( assoc.getExpiry().getTime() -
              System.currentTimeMillis() ) / 1000 );
setExpire(expiryIn);

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

Long expiryIn = new Long( ( assoc.getExpiry().getTime() -
              System.currentTimeMillis() ) / 1000 );
setExpire(expiryIn);

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

Long expiryIn = new Long((assoc.getExpiry().getTime() -
             System.currentTimeMillis()) / 1000);
setExpire(expiryIn);

相关文章