/*
(non-Javadoc)
@see javax.servlet.sip.Address#getExpires()
328349
public int getExpires() {	
		String expires = this.getParameter(EXPIRES_PARAM_NAME);
		if(expires != null) { // This is how the TCK expects to parse it. See AddressingServlet in TCK spec tests.
			return Integer.parseInt(expires);
		} else { // I think this is not needed.
			return ((SipURI)address.getURI()).getParameter(EXPIRES_PARAM_NAME) == null ? -1 : 
				Integer.parseInt(((SipURI)address.getURI()).getParameter(EXPIRES_PARAM_NAME));
		}
	}
463009
public java.util.List<String> getUnassignedIpv6Addresses() {
        if (unassignedIpv6Addresses == null) {
            unassignedIpv6Addresses = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return unassignedIpv6Addresses;
    }
544590
public Iterator<String> getChallengeRealms() {
		List<String> realms = new ArrayList<String>();
		final Response response = getResponse();
		if(response.getStatusCode() == SipServletResponse.SC_UNAUTHORIZED) {
			WWWAuthenticateHeader authenticateHeader = (WWWAuthenticateHeader) 
				response.getHeader(WWWAuthenticateHeader.NAME);
			realms.add(authenticateHeader.getRealm());
		} else if (response.getStatusCode() == SipServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED) {
			ProxyAuthenticateHeader authenticateHeader = (ProxyAuthenticateHeader) 
				response.getHeader(ProxyAuthenticateHeader.NAME);
			realms.add(authenticateHeader.getRealm());
		}
		return realms.iterator();
	}
968170
@Override
	public Map<String, List<String>> get(URI uri, Map<String, List<String>> requestHeaders) throws IOException {
		clearExpired(new Date());
		ArrayList<String> cookies = new ArrayList<String>();
		for (Cookie cookie : getCookies(uri)) {
			cookies.add(cookie.getName() + "=" + cookie.getValue());
		}
		return singletonMap(SM.COOKIE, singletonList(join(cookies, SEP)));
	}
1196193
@Override
    public Builder expirationTime(long exp) throws InvalidClaimException {

        long currTime = System.currentTimeMillis() / 1000;
        if (exp >= currTime) {
            // if (exp > (new Date()).getTime()) {
            claims.put(Claims.EXPIRATION, Long.valueOf(exp));
        } else {
            // Expiration must be greater than the current time
            String err = Tr.formatMessage(tc, "JWT_INVALID_EXP_CLAIM_ERR", new Object[] { Claims.EXPIRATION, exp, JwtUtils.getDate(exp), JwtUtils.getDate(currTime) });
            throw new InvalidClaimException(err);
        }
        return this;
    }
74913
private synchronized void fetchCredentials() {
        if (!needsToLoadCredentials()) return;

        JsonNode accessKey;
        JsonNode secretKey;
        JsonNode node;
        JsonNode token;
        try {
            lastInstanceProfileCheck = new Date();

            String credentialsResponse = EC2CredentialsUtils.getInstance().readResource(credentailsEndpointProvider.getCredentialsEndpoint(), credentailsEndpointProvider.getRetryPolicy());

            node = Jackson.jsonNodeOf(credentialsResponse);
            accessKey = node.get(ACCESS_KEY_ID);
            secretKey = node.get(SECRET_ACCESS_KEY);
            token = node.get(TOKEN);

            if (null == accessKey || null == secretKey) {
                throw new SdkClientException("Unable to load credentials.");
            }

            if (null != token) {
                credentials = new BasicSessionCredentials(accessKey.asText(),
                        secretKey.asText(), token.asText());
            } else {
                credentials = new BasicAWSCredentials(accessKey.asText(),
                        secretKey.asText());
            }

            JsonNode expirationJsonNode = node.get("Expiration");
            if (null != expirationJsonNode) {
                /*
                 * TODO: The expiration string comes in a different format
                 * than what we deal with in other parts of the SDK, so we
                 * have to convert it to the ISO8601 syntax we expect.
                 */
                String expiration = expirationJsonNode.asText();
                expiration = expiration.replaceAll("\\+0000$", "Z");

                try {
                    credentialsExpiration = DateUtils.parseISO8601Date(expiration);
                } catch(Exception ex) {
                    handleError("Unable to parse credentials expiration date from Amazon EC2 instance", ex);
                }
            }
        } catch (JsonMappingException e) {
            handleError("Unable to parse response returned from service endpoint", e);
        } catch (IOException e) {
            handleError("Unable to load credentials from service endpoint", e);
        } catch (URISyntaxException e) {
            handleError("Unable to load credentials from service endpoint", e);
        }
    }
496586
public Iterable<DConnection> queryByExpireTime(java.util.Date expireTime) {
    return queryByField(null, DConnectionMapper.Field.EXPIRETIME.getFieldName(), expireTime);
  }
65905
public java.util.List<String> getDnsIpAddresses() {
        if (dnsIpAddresses == null) {
            dnsIpAddresses = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return dnsIpAddresses;
    }
104693
public void collectUnfreshPeers(int expireTimeoutSec) {
    for (TrackedPeer peer : this.peers.values()) {
      if (!peer.isFresh(expireTimeoutSec)) {
        this.peers.remove(new PeerUID(peer.getAddress(), this.getHexInfoHash()));
      }
    }
  }
549803
public static void setExpiresHours(@NotNull HttpServletResponse response, int hours) {
    Date expiresDate = DateUtils.addHours(new Date(), hours);
    setExpires(response, expiresDate);
  }
1348410
public double expiresIn(AuthRequest req) {
        String val = tokenStore.get(req.asString());
        return val == null ? Double.NEGATIVE_INFINITY :
                Double.valueOf(TokenInfo.fromString(val).getExpires()) - clock.now();
    }
1303282
public void setExpires(int seconds) {
		try {
			ExpiresHeader expiresHeader =
				SipFactoryImpl.headerFactory.createExpiresHeader(seconds);
			expiresHeader.setExpires(seconds);
			this.message.setExpires(expiresHeader);
		} catch (Exception e) {
			throw new IllegalArgumentException("Error setting expiration header!", e);
		}
	}
52381
public Date getExpirationDateFromToken(String token) {
        Date expiration;
        try {
            final Claims claims = getClaimsFromToken(token);
            return claims.getExpiration();
        } catch (Exception e) {
            log.error("get expiration Time from jwt token error : {}", e.getMessage());
            return null;
        }
    }
622239
public java.util.List<String> getIpRanges() {
        if (ipRanges == null) {
            ipRanges = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return ipRanges;
    }
1145593
public void setExpires(int seconds) throws IllegalArgumentException {
		javax.sip.address.URI uri = this.getAddress().getURI();

		if (uri instanceof SipURI) {
			/*
			SipURI sipUri = (SipURI) uri;
			try {
				sipUri.setParameter(EXPIRES_PARAM_NAME, Integer.toString(seconds));
			} catch (ParseException e) {
				throw new IllegalArgumentException("Problem setting parameter",
						e);
			}*/
			if(seconds == -1) {
				this.removeParameter(EXPIRES_PARAM_NAME);
				return;
			}
			this.setParameter(EXPIRES_PARAM_NAME, Integer.toString(seconds));
		} else {
			throw new IllegalArgumentException(
					"Can only set parameter for Sip URI");
		}
	}
797503
public long getDateExpires() {

        int pos = m_flexContextInfoList.size() - 1;
        if (pos < 0) {
            // ensure a valid position is used
            return CmsResource.DATE_EXPIRED_DEFAULT;
        }
        return (m_flexContextInfoList.get(pos)).getDateExpires();
    }
777754
public java.util.List<String> getDnsIpAddrs() {
        if (dnsIpAddrs == null) {
            dnsIpAddrs = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return dnsIpAddrs;
    }