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


Java TicketGrantingTicket.getServices方法代码示例

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


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

示例1: performLogout

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
/**
 * Perform a back channel logout for a given ticket granting ticket and returns all the logout requests.
 *
 * @param ticket a given ticket granting ticket.
 * @return all logout requests.
 */
@Override
public List<LogoutRequest> performLogout(final TicketGrantingTicket ticket) {
    final Map<String, Service> services = ticket.getServices();
    final List<LogoutRequest> logoutRequests = new ArrayList<>();
    // if SLO is not disabled
    if (!this.singleLogoutCallbacksDisabled) {
        // through all services
        for (final Map.Entry<String, Service> entry : services.entrySet()) {
            // it's a SingleLogoutService, else ignore
            final Service service = entry.getValue();
            if (service instanceof SingleLogoutService) {
                final LogoutRequest logoutRequest = handleLogoutForSloService((SingleLogoutService) service, entry.getKey());
                if (logoutRequest != null) {
                    LOGGER.debug("Captured logout request [{}]", logoutRequest);
                    logoutRequests.add(logoutRequest);
                }
            }
        }
    }

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

示例2: deleteChildren

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
/**
 * Delete TGT's service tickets.
 *
 * @param ticket the ticket
 * @return the count of tickets that were removed including child tickets and zero if the ticket was not deleted
 */
public int deleteChildren(final TicketGrantingTicket ticket) {
    int count = 0;

    // delete service tickets
    final Map<String, Service> services = ticket.getServices();
    if (services != null && !services.isEmpty()) {
        final Iterator<String> it = services.keySet().iterator();

        while (it.hasNext()) {
            final String ticketId = it.next();
            if (deleteSingleTicket(ticketId)) {
                logger.debug("Removed ticket [{}]", ticketId);
                count++;
            } else {
                logger.debug("Unable to remove ticket [{}]", ticketId);
            }
        }
    }

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

示例3: performLogout

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
/**
 * Perform a back channel logout for a given ticket granting ticket and returns all the logout requests.
 *
 * @param ticket a given ticket granting ticket.
 * @return all logout requests.
 */
@Override
public List<LogoutRequest> performLogout(final TicketGrantingTicket ticket) {
    final Map<String, Service> services;
    // synchronize the retrieval of the services and their cleaning for the TGT
    // to avoid concurrent logout mess ups
    synchronized (ticket) {
        services = ticket.getServices();
        ticket.removeAllServices();
    }
    ticket.markTicketExpired();

    final List<LogoutRequest> logoutRequests = new ArrayList<>();
    // if SLO is not disabled
    if (!this.singleLogoutCallbacksDisabled) {
        // through all services
        for (final Map.Entry<String, Service> entry : services.entrySet()) {
            // it's a SingleLogoutService, else ignore
            final Service service = entry.getValue();
            if (service instanceof SingleLogoutService) {
                final LogoutRequest logoutRequest = handleLogoutForSloService((SingleLogoutService) service, entry.getKey());
                if (logoutRequest != null) {
                    LOGGER.debug("Captured logout request [{}]", logoutRequest);
                    logoutRequests.add(logoutRequest);
                }
            }
        }
    }

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

示例4: deleteTicketAndChildren

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
/**
 * Delete the TGT and all of its service tickets.
 *
 * @param ticket the ticket
 * @return boolean indicating whether ticket was deleted or not
 */
private boolean deleteTicketAndChildren(final TicketGrantingTicket ticket) {
    final Map<String, Service> services = ticket.getServices();
    if (services != null && !services.isEmpty()) {
        this.serviceTicketsCache.removeAll(services.keySet());
    }

    return this.ticketGrantingTicketsCache.remove(ticket.getId());
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:15,代码来源:EhCacheTicketRegistry.java

示例5: deleteChildren

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
/**
 * Delete TGT's service tickets.
 *
 * @param ticket the ticket
 */
private void deleteChildren(final TicketGrantingTicket ticket) {
    // delete service tickets
    final Map<String, Service> services = ticket.getServices();
    if (services != null && !services.isEmpty()) {
        for (final Map.Entry<String, Service> entry : services.entrySet()) {
            if (this.cache.remove(entry.getKey()) != null) {
                logger.trace("Removed service ticket [{}]", entry.getKey());
            } else {
                logger.trace("Unable to remove service ticket [{}]", entry.getKey());
            }
        }
    }
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:19,代码来源:DefaultTicketRegistry.java

示例6: deleteChildren

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
/**
 * Delete TGT's service tickets.
 *
 * @param ticket the ticket
 */
private void deleteChildren(final TicketGrantingTicket ticket) {
    // delete service tickets
    final Map<String, Service> services = ticket.getServices();
    if (services != null && !services.isEmpty()) {
        for (final Map.Entry<String, Service> entry : services.entrySet()) {
            if (this.registry.remove(entry.getKey()) != null) {
                logger.trace("Removed service ticket [{}]", entry.getKey());
            } else {
                logger.trace("Ticket not found or is already removed. Unable to remove service ticket [{}]", entry.getKey());
            }
        }
    }
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:19,代码来源:HazelcastTicketRegistry.java

示例7: deleteChildren

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
/**
 * Delete the TGT service tickets.
 *
 * @param ticket the ticket
 */
private void deleteChildren(final TicketGrantingTicket ticket) {
    // delete service tickets
    final Map<String, Service> services = ticket.getServices();
    if (services != null && !services.isEmpty()) {
        for (final Map.Entry<String, Service> entry : services.entrySet()) {
            try {
                this.client.delete(entry.getKey());
                logger.trace("Scheduled deletion of service ticket [{}]", entry.getKey());
            } catch (final Exception e) {
                logger.error("Failed deleting {}", entry.getKey(), e);
            }
        }
    }
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:20,代码来源:MemCacheTicketRegistry.java

示例8: performLogout

import org.jasig.cas.ticket.TicketGrantingTicket; //导入方法依赖的package包/类
/**
 * Perform a back channel logout for a given ticket granting ticket and returns all the logout requests.
 *
 * @param ticket a given ticket granting ticket.
 * @return all logout requests.
 */
@Override
public List<LogoutRequest> performLogout(final TicketGrantingTicket ticket) {
    final Map<String, Service> services;
    // synchronize the retrieval of the services and their cleaning for the TGT
    // to avoid concurrent logout mess ups
    synchronized (ticket) {
        services = ticket.getServices();
        ticket.removeAllServices();
    }
    ticket.markTicketExpired();

    final List<LogoutRequest> logoutRequests = new ArrayList<LogoutRequest>();
    // if SLO is not disabled
    if (!disableSingleSignOut) {
        // through all services
        for (final String ticketId : services.keySet()) {
            final Service service = services.get(ticketId);
            // it's a SingleLogoutService, else ignore
            if (service instanceof SingleLogoutService) {
                final SingleLogoutService singleLogoutService = (SingleLogoutService) service;
                // the logout has not performed already
                if (!singleLogoutService.isLoggedOutAlready()) {
                    final LogoutRequest logoutRequest = new LogoutRequest(ticketId, singleLogoutService);
                    // always add the logout request
                    logoutRequests.add(logoutRequest);
                    final RegisteredService registeredService = servicesManager.findServiceBy(service);
                    // the service is no more defined, or the logout type is not defined or is back channel
                    if (registeredService == null || registeredService.getLogoutType() == null
                            || registeredService.getLogoutType() == LogoutType.BACK_CHANNEL) {
                        // perform back channel logout
                        if (performBackChannelLogout(logoutRequest)) {
                            logoutRequest.setStatus(LogoutRequestStatus.SUCCESS);
                        } else {
                            logoutRequest.setStatus(LogoutRequestStatus.FAILURE);
                            LOGGER.warn("Logout message not sent to [{}]; Continuing processing...",
                                    singleLogoutService.getId());
                        }
                    }
                }
            }
        }
    }

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


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