本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}
}
}
}
示例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());
}
}
}
}
示例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);
}
}
}
}
示例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;
}