Examples of TimeSpan


Examples of TimeTable.spans.TimeSpan

        long endTime = beginTime + 24*3600*1000;
       
        // Y coord
        for (int i = 0; i < spans.size(); i++) {
            TimeSpanInternal s = spans.get(i);
            TimeSpan ts = s.span;
            long spanBegin = ts.getBegin().getTime();
            long spanEnd = spanBegin + ts.getLength()*60*1000;
           
            //pass hidden
            if (spanBegin >= endTime || spanEnd <= beginTime) {
                s.visible = false;
                continue;
View Full Code Here

Examples of ch.njol.skript.util.Timespan

      @Override
      public void run() {
        if (!SkriptConfig.checkForNewVersion.value())
          return;
        check(Bukkit.getConsoleSender(), SkriptConfig.automaticallyDownloadNewVersion.value(), true);
        final Timespan t = SkriptConfig.updateCheckInterval.value();
        if (t.getTicks() != 0)
          setNextExecution(t.getTicks());
      }
    };
  }
View Full Code Here

Examples of cli.System.TimeSpan

        if(obj instanceof Boolean){
            return CIL.box_boolean(((Boolean)obj).booleanValue());
        }
        if(obj instanceof Time){
            Time ts = (Time)obj;
            return new TimeSpan(ts.getHours(), ts.getMinutes(), ts.getSeconds());
        }
        if(obj instanceof java.util.Date){
            long ticks = getNetTicks((java.util.Date)obj);
            return new cli.System.DateTime(ticks);
        }
View Full Code Here

Examples of com.fathomdb.TimeSpan

    if (response instanceof HttpServletResponse) {
      String requestUri = ((HttpServletRequest) request).getRequestURI();

      HttpServletResponse httpServletResponse = (HttpServletResponse) response;

      TimeSpan cacheFor = null;

      if (requestUri.contains(".cache.")) {
        // Cache forever
        cacheFor = TimeSpan.ONE_DAY.multiplyBy(365);
      } else if (requestUri.contains(".nocache.")) {
        // Don't ever cache
        cacheFor = null;
      } else {
        // Micro cache
        cacheFor = TimeSpan.TEN_MINUTES;
      }

      if (cacheFor == null) {
        httpServletResponse.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
        httpServletResponse.setHeader("Expires", "0");
      } else {
        long now = System.currentTimeMillis() / 1000L;
        long timeoutAt = now + cacheFor.getTotalSeconds();

        long deltaSeconds = timeoutAt - now;

        httpServletResponse.setHeader("Cache-Control", "max-age=" + deltaSeconds);
View Full Code Here

Examples of com.fathomdb.TimeSpan

    return runnable;
  }

  private JobScheduleCalculator parseSchedule(JobSchedule schedule, boolean tolerant) {
    TimeSpan interval = null;
    Date base = null;

    if (schedule == null) {
      if (tolerant) {
        log.warn("Expected schedule; was null");
View Full Code Here

Examples of com.fathomdb.TimeSpan

      if (cancelled) {
        log.debug("Task cancelled; won't schedule");
        return;
      }

      TimeSpan delay = TimeSpan.timeUntil(nextExecution);
      delay = TimeSpan.max(delay, MIN_DELAY);

      // We can't reissue tasks, so we have to create a new TimerTask every time
      // (as we want more complicated scheduling)
      TimerTask timerTask = new TimerTask() {
View Full Code Here

Examples of com.fathomdb.TimeSpan

  @Override
  protected ProcessExecution executeCommandUnchecked(Command command) throws ProcessExecutionException {
    try {
      String commandString = command.buildCommandString();
      TimeSpan timeout = command.getTimeout();

      if (command.getKeyPair() != null) {
        SshConnection agentConnection = sshConnection.buildAgentConnection(command.getKeyPair());
        try {
          return agentConnection.sshExecute(commandString, timeout);
View Full Code Here

Examples of com.fathomdb.TimeSpan

          synchronized (random) {
            fraction = random.nextDouble();
          }
        } while (fraction < MIN_RANDOM_FRACTION);

        TimeSpan delay = TimeSpan.fromMilliseconds((long) (fraction * previousInterval.getTotalMilliseconds()));
        return new Date(now + delay.getTotalMilliseconds());
      } else {
        return currentInterval.addTo(previousExecution.getStartTimestamp());
      }
    } else {
      // Based e.g. every morning at 2AM
View Full Code Here

Examples of com.fathomdb.TimeSpan

    String remoteDir = remoteFile.substring(0, lastSlash);
    String filename = remoteFile.substring(lastSlash + 1);

    try {
      TimeSpan timeout = TimeSpan.FIVE_MINUTES;
      scp.put(fileData, dataLength, filename, remoteDir, mode, timeout, sudo);
    } catch (IOException ioException) {
      throw new SshException("Cannot doing scp on file", ioException);
    } catch (RuntimeSshException e) {
      throw new SshException("Error doing scp on file", e);
View Full Code Here

Examples of com.fathomdb.TimeSpan

    MinaSshConnectionWrapper sshConnection = ensureConnected();

    MinaScpClient scp = new MinaScpClient(sshConnection);
    try {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      TimeSpan timeout = TimeSpan.FIVE_MINUTES;
      scp.get(remoteFile, baos, timeout, sudo);
      return baos.toByteArray();
    } catch (IOException ioException) {
      throw new SshException("Cannot read file", ioException);
    } catch (SshException sshException) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.