当前位置: 首页>>代码示例>>Java>>正文


Java TicketState.getLastTimeUsed方法代码示例

本文整理汇总了Java中org.jasig.cas.ticket.TicketState.getLastTimeUsed方法的典型用法代码示例。如果您正苦于以下问题:Java TicketState.getLastTimeUsed方法的具体用法?Java TicketState.getLastTimeUsed怎么用?Java TicketState.getLastTimeUsed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jasig.cas.ticket.TicketState的用法示例。


在下文中一共展示了TicketState.getLastTimeUsed方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
@Override
public boolean isExpired(final TicketState ticketState) {
    final long currentSystemTimeInMillis = System.currentTimeMillis();

    // Ticket has been used, check maxTimeToLive (hard window)
    if (currentSystemTimeInMillis - ticketState.getCreationTime() >= maxTimeToLiveInMilliSeconds) {
        LOGGER.debug("Ticket is expired because the time since creation is greater than maxTimeToLiveInMilliSeconds");
        return true;
    }

    // Ticket is within hard window, check timeToKill (sliding window)
    if (currentSystemTimeInMillis - ticketState.getLastTimeUsed() >= timeToKillInMilliSeconds) {
        LOGGER.debug("Ticket is expired because the time since last use is greater than timeToKillInMilliseconds");
        return true;
    }

    return false;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:TicketGrantingTicketExpirationPolicy.java

示例2: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
@Override
public boolean isExpired(final TicketState ticketState) {
    final long currentTimeInMillis = System.currentTimeMillis();
    final long lastTimeTicketWasUsed = ticketState.getLastTimeUsed();

    if (ticketState.getCountOfUses() == 0
        && (currentTimeInMillis - lastTimeTicketWasUsed < this.timeToKillInMilliSeconds)) {
        LOGGER.debug("Ticket is not expired due to a count of zero and the time being less "
                + "than the timeToKillInMilliseconds");
        return false;
    }

    if ((currentTimeInMillis - lastTimeTicketWasUsed >= this.timeToKillInMilliSeconds)) {
        LOGGER.debug("Ticket is expired due to the time being greater than the timeToKillInMilliseconds");
        return true;
    }

    if ((currentTimeInMillis - lastTimeTicketWasUsed <= this.timeInBetweenUsesInMilliSeconds)) {
        LOGGER.warn("Ticket is expired due to the time being less than the waiting period.");
        return true;
    }

    return false;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:25,代码来源:ThrottledUseAndTimeoutExpirationPolicy.java

示例3: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
@Override
public boolean isExpired(final TicketState ticketState) {
    if (ticketState == null) {
        LOGGER.debug("Ticket state is null for {}", this.getClass().getSimpleName());
        return true;
    }
    final long countUses = ticketState.getCountOfUses();
    if (countUses >= this.numberOfUses) {
        LOGGER.debug("Ticket usage count {} is greater than or equal to {}", countUses, this.numberOfUses);
        return true;
    }

    final long systemTime = System.currentTimeMillis();
    final long lastTimeUsed = ticketState.getLastTimeUsed();
    final long difference = systemTime - lastTimeUsed;

    if (difference >= this.timeToKillInMilliSeconds) {
        LOGGER.debug("Ticket has expired because the difference between current time [{}] "
            + "and ticket time [{}] is greater than or equal to [{}]", systemTime, lastTimeUsed,
            this.timeToKillInMilliSeconds);
        return true;
    }
    return false;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:25,代码来源:MultiTimeUseOrTimeoutExpirationPolicy.java

示例4: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
@Override
public boolean isExpired(final TicketState ticketState) {
    final long currentSystemTimeInMillis = System.currentTimeMillis();

    // Ticket has been used, check maxTimeToLive (hard window)
    if ((currentSystemTimeInMillis - ticketState.getCreationTime() >= maxTimeToLiveInMilliSeconds)) {
        logger.debug("Ticket is expired because the time since creation is greater than maxTimeToLiveInMilliSeconds");
        return true;
    }

    // Ticket is within hard window, check timeToKill (sliding window)
    if ((currentSystemTimeInMillis - ticketState.getLastTimeUsed() >= timeToKillInMilliSeconds)) {
        logger.debug("Ticket is expired because the time since last use is greater than timeToKillInMilliseconds");
        return true;
    }

    return false;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:TicketGrantingTicketExpirationPolicy.java

示例5: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
@Override
public boolean isExpired(final TicketState ticketState) {
    final long currentTimeInMillis = System.currentTimeMillis();
    final long lastTimeTicketWasUsed = ticketState.getLastTimeUsed();

    if (ticketState.getCountOfUses() == 0
        && (currentTimeInMillis - lastTimeTicketWasUsed < this.timeToKillInMilliSeconds)) {
        logger.debug("Ticket is not expired due to a count of zero and the time being less "
                + "than the timeToKillInMilliseconds");
        return false;
    }

    if ((currentTimeInMillis - lastTimeTicketWasUsed >= this.timeToKillInMilliSeconds)) {
        logger.debug("Ticket is expired due to the time being greater than the timeToKillInMilliseconds");
        return true;
    }

    if ((currentTimeInMillis - lastTimeTicketWasUsed <= this.timeInBetweenUsesInMilliSeconds)) {
        logger.warn("Ticket is expired due to the time being less than the waiting period.");
        return true;
    }

    return false;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:25,代码来源:ThrottledUseAndTimeoutExpirationPolicy.java

示例6: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
public boolean isExpired(final TicketState ticketState) {
    if (ticketState.getCountOfUses() == 0
        && (System.currentTimeMillis() - ticketState.getLastTimeUsed() < this.timeToKillInMilliSeconds)) {
        LOGGER.debug("Ticket is not expired due to a count of zero and the time being less "
                + "than the timeToKillInMilliseconds");
        return false;
    }

    if ((System.currentTimeMillis() - ticketState.getLastTimeUsed() >= this.timeToKillInMilliSeconds)) {
        LOGGER.debug("Ticket is expired due to the time being greater than the timeToKillInMilliseconds");
        return true;
    }

    if ((System.currentTimeMillis() - ticketState.getLastTimeUsed() <= this.timeInBetweenUsesInMilliSeconds)) {
        LOGGER.warn("Ticket is expired due to the time being less than the waiting period.");
        return true;
    }

    return false;
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:21,代码来源:ThrottledUseAndTimeoutExpirationPolicy.java

示例7: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
@Override
public boolean isExpired(final TicketState ticketState) {
    final long currentSystemTimeInMillis = System.currentTimeMillis();

    // Ticket has been used, check maxTimeToLive (hard window)
    if ((currentSystemTimeInMillis - ticketState.getCreationTime() >= maxTimeToLiveInMilliSeconds)) {
        LOGGER.debug("Ticket is expired because the time since creation is greater than maxTimeToLiveInMilliSeconds");
        return true;
    }

    // Ticket is within hard window, check timeToKill (sliding window)
    if ((currentSystemTimeInMillis - ticketState.getLastTimeUsed() >= timeToKillInMilliSeconds)) {
        LOGGER.debug("Ticket is expired because the time since last use is greater than timeToKillInMilliseconds");
        return true;
    }

    return false;
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:19,代码来源:TicketGrantingTicketExpirationPolicy.java

示例8: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
public boolean isExpired(final TicketState ticketState) {
    // Ticket has been used, check maxTimeToLive (hard window)
    if ((System.currentTimeMillis() - ticketState.getCreationTime() >= maxTimeToLiveInMilliSeconds)) {
        LOGGER.debug("Ticket is expired because the time since creation is greater than maxTimeToLiveInMilliSeconds");
        return true;
    }

    // Ticket is within hard window, check timeToKill (sliding window)
    if ((System.currentTimeMillis() - ticketState.getLastTimeUsed() >= timeToKillInMilliSeconds)) {
        LOGGER.debug("Ticket is expired because the time since last use is greater than timeToKillInMilliseconds");
        return true;
    }

    return false;
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:16,代码来源:TicketGrantingTicketExpirationPolicy.java

示例9: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
@Override
public boolean isExpired(final TicketState ticketState) {
    return (ticketState == null)
        || (System.currentTimeMillis() - ticketState.getLastTimeUsed() >= this.timeToKillInMilliSeconds);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:6,代码来源:TimeoutExpirationPolicy.java

示例10: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
@Override
public boolean isExpired(final TicketState ticketState) {
    return (ticketState == null)
        || (ticketState.getCountOfUses() >= this.numberOfUses)
        || (System.currentTimeMillis() - ticketState.getLastTimeUsed() >= this.timeToKillInMilliSeconds);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:7,代码来源:MultiTimeUseOrTimeoutExpirationPolicy.java

示例11: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
public boolean isExpired(final TicketState ticketState) {
    return (ticketState == null)
        || (System.currentTimeMillis() - ticketState.getLastTimeUsed() >= this.timeToKillInMilliSeconds);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:5,代码来源:TimeoutExpirationPolicy.java

示例12: isExpired

import org.jasig.cas.ticket.TicketState; //导入方法依赖的package包/类
public boolean isExpired(final TicketState ticketState) {
    return (ticketState == null)
        || (ticketState.getCountOfUses() >= this.numberOfUses)
        || (System.currentTimeMillis() - ticketState.getLastTimeUsed() >= this.timeToKillInMilliSeconds);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:6,代码来源:MultiTimeUseOrTimeoutExpirationPolicy.java


注:本文中的org.jasig.cas.ticket.TicketState.getLastTimeUsed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。