Java Second Get getTokenRenewIntervalInSeconds(int tokenValidityInSeconds)

Here you can find the source of getTokenRenewIntervalInSeconds(int tokenValidityInSeconds)

Description

get Token Renew Interval In Seconds

License

Open Source License

Declaration

static int getTokenRenewIntervalInSeconds(int tokenValidityInSeconds) 

Method Source Code

//package com.java2s;
/*/*from w w  w  .  j  a v a2 s . c  o m*/
 * Copyright (c) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */

public class Main {
    static int getTokenRenewIntervalInSeconds(int tokenValidityInSeconds) {
        if (tokenValidityInSeconds >= 300) {
            return tokenValidityInSeconds - 30;
        } else if (tokenValidityInSeconds >= 60) {
            return tokenValidityInSeconds - 10;
        } else {
            return (tokenValidityInSeconds - 1) > 0 ? tokenValidityInSeconds - 1 : 0;
        }
    }
}

Related

  1. GetTimeFromSeconds(double time)
  2. getTimeFromSeconds(int seconds)
  3. getTimeInSecondResolution(long timeMillis)
  4. getTimeSeconds(String time)
  5. getTimeStringFromSeconds(int totalSeconds)
  6. getUnitLengthSeconds(String unit)
  7. getUnixTimeSeconds()
  8. getUSeconds(int time)
  9. getValidCodeSecond()