Sets the milliseconds in Unix time at which the subscription will expire or {@code null} for an
infinite TTL.
432046
public StoredChannel setExpiration(Long expiration) {
    lock.lock();
    try {
      this.expiration = expiration;
    } finally {
      lock.unlock();
    }
    return this;
  }
1172363
@Override
    public void setTime(int parameterIndex, Time x) throws SQLException {
        internalStmt.setTime(parameterIndex, x);
    }
362595
private void assignMinimumTTL(List<? extends DnsAnswer> dnsAnswers, LookupResult.Builder builder) {

        if (config.hasOverrideTTL()) {
            builder.cacheTTL(config.getCacheTTLOverrideMillis());
        } else {
            // Deduce minimum TTL on all TXT records. A TTL will always be returned by DNS server.
            builder.cacheTTL(dnsAnswers.stream()
                                       .map(DnsAnswer::dnsTTL)
                                       .min(Comparator.comparing(Long::valueOf)).get() * 1000);
        }
    }
454586
@Override
    public void setTimeLimitDaemon(TimeLimitDaemon timeLimitDaemon) {
        final String methodName = "setTimeLimitDaemon(timeLimitDaemon)";
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, methodName + " cacheName=" + cacheName + " ERROR because it should not be called");
        }
    }
1073932
private void setUpdateTimer(final String subscriptionId, final String serviceContextId, long ms) {
    Date timeToRun = new Date(System.currentTimeMillis() + ms);
    sendUpdatetimer.schedule(new TimerTask() {
      public void run() {
        try {
          updateCharging(subscriptionId, serviceContextId, partialCallDurationCounter);
        }
        catch (Exception e) {
          logger.error("(( $ )) Failure trying to create/send CCR (UPDATE) message. (( $ ))", e);
        }
      }
    }, timeToRun);
  }
187020
@Override
    public void addToTimeLimitDaemon(Object id, long expirationTime, int inactivity) {
        final String methodName = "addToTimeLimitDaemon()";
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, methodName + " cacheName=" + cacheName + " ERROR because it should not be called");
        }
    }
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");
		}
	}
646260
public void setStart(ReadableInstant start) {
        long startMillis = DateTimeUtils.getInstantMillis(start);
        super.setInterval(startMillis, getEndMillis(), getChronology());
    }
150701
protected final void setAccessExpirationTime(Expirable<?> expirable, long currentTimeMS) {
    try {
      Duration duration = expiry.getExpiryForAccess();
      if (duration == null) {
        return;
      } else if (duration.isZero()) {
        expirable.setExpireTimeMS(0L);
      } else if (duration.isEternal()) {
        expirable.setExpireTimeMS(Long.MAX_VALUE);
      } else {
        if (currentTimeMS == 0L) {
          currentTimeMS = currentTimeMillis();
        }
        long expireTimeMS = duration.getAdjustedTime(currentTimeMS);
        expirable.setExpireTimeMS(expireTimeMS);
      }
    } catch (Exception e) {
      logger.log(Level.WARNING, "Failed to set the entry's expiration time", e);
    }
  }
870062
public void setTimeLimit(int timeLimit) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  expirationTimeFlag = SET;
	  this.timeLimit = timeLimit;
	  if (timeLimit > 0) {
         long ttlmsec = ((long)timeLimit) * 1000;  
		 expirationTime = ttlmsec + System.currentTimeMillis();
	  }
   }
864083
public function setInterval(int $seconds, ?int $microseconds = null): void
    {
        if (func_num_args() === 1) {
            $microseconds = $seconds;
            $seconds      = 0;
        }

        Assert::notNull($microseconds, 'Cannot set $microseconds to null. Set to 0 for no microseconds.');
        parent::setInterval($seconds, $microseconds);

        $this->seconds      = $seconds;
        $this->microseconds = $microseconds;
    }
448144
public void setAcquireRetryDelay(long acquireRetryDelay, TimeUnit timeUnit) {
		this.acquireRetryDelayInMs = TimeUnit.MILLISECONDS.convert(acquireRetryDelay, timeUnit);
	}
1183885
@SuppressWarnings(value="unchecked")
	public int setExpires(int deltaMinutes) {
		if(!isValid()) {
			throw new IllegalStateException("Impossible to change the sip application " +
					"session timeout when it has been invalidated !");
		}
		expired = false;
		if(logger.isDebugEnabled()) {
			logger.debug("Postponing the expiratin of the sip application session "
					+ key +" to expire in " + deltaMinutes + " minutes.");
		}
		if(deltaMinutes <= 0) {
			if(logger.isDebugEnabled()) {
				logger.debug("The sip application session "+ key +" won't expire anymore ");
			}
			// If the session timeout value is 0 or less, then an application session timer
			// never starts for the SipApplicationSession object and the container
			// does not consider the object to ever have expired
//			this.expirationTime = -1;
			if(expirationTimerTask != null) {
				cancelExpirationTimer();
				// Fix for Issue 1678 : SipApplicationSession.setExpires() doesn't work sometimes
				// the global sipApplicationSessionTimeout needs to be reset as well
				sipApplicationSessionTimeout = deltaMinutes;
			}
			return Integer.MAX_VALUE;
		} else {
			long deltaMilliseconds = 0;
//			if(expirationTimerTask != null) {
				//extending the app session life time
//				expirationTime = expirationTimerFuture.getDelay(TimeUnit.MILLISECONDS) + deltaMinutes * 1000 * 60;
				deltaMilliseconds = deltaMinutes * 1000L * 60;
//			} else {
				//the app session was scheduled to never expire and now an expiration time is set
//				deltaMilliseconds = deltaMinutes * 1000L * 60;
//			}
			// Fix for Issue 1678 : SipApplicationSession.setExpires() doesn't work sometimes
			// the global sipApplicationSessionTimeout needs to be reset as well
			sipApplicationSessionTimeout = deltaMilliseconds;
			expirationTime = System.currentTimeMillis() + deltaMilliseconds;
			if(logger.isDebugEnabled()) {
				logger.debug("Setting expirationTime to "+ expirationTime + " on sip application session " + key);
				logger.debug("Re-Scheduling sip application session "+ key +" to expire in " + deltaMinutes + " minutes");
				Calendar calendar = Calendar.getInstance();
				calendar.setTimeInMillis(expirationTime);
				logger.debug("sip application session "+ key +" will expires at " + new SimpleDateFormat().format(calendar.getTime()));
			}


			final long milisecondsToGive = deltaMilliseconds;


			//Run the timer in different transaction
			new Thread(){

				@Override
				public void run() {
					if(expirationTimerTask != null) {
						cancelExpirationTimer();
//						expirationTimerFuture = null;
					}
					expirationTimerTask = sipContext.getSipApplicationSessionTimerService().createSipApplicationSessionTimerTask(SipApplicationSessionImpl.this);
					expirationTimerTask = sipContext.getSipApplicationSessionTimerService().schedule(expirationTimerTask, milisecondsToGive, TimeUnit.MILLISECONDS);
				}

			}.start();


			return deltaMinutes;
		}
	}
366088
public static void setMinTime(int mintime) {
    System.setProperty(MIN_TIME, String.valueOf(mintime));
    TimerTrace.mintime = mintime;
  }
504253
public void setExpirationTime(long expirationTime) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  expirationTimeFlag = SET;
	  this.expirationTime = expirationTime;
	  this.timeLimit = (int) ((expirationTime - System.currentTimeMillis()) / 1000L);
   }
732003
private Period setTimeUnitValue(TimeUnit unit, float value) {
    if (value < 0) {
      throw new IllegalArgumentException("value: " + value);
    }
    return setTimeUnitInternalValue(unit, (int)(value * 1000) + 1);
  }
1127137
@Override
    public boolean setTransactionTimeout(final int _seconds)
    {
        if (JCRStoreResource.LOG.isDebugEnabled()) {
            JCRStoreResource.LOG.debug("setTransactionTimeout (seconds = " + _seconds + ")");
        }
        return true;
    }