@Override
    public String trackTicket(final Ticket ownerTicket, final Ticket ticket) {
        val serviceTicket = (ServiceTicket) ticket;
        val ticketGrantingTicket = (TicketGrantingTicket) ownerTicket;
        val trackedEntry = String.format("%s,%s", serviceTicket.getId(), serviceTicket.getService());
        lock.tryLock(__ -> {
            ticketGrantingTicket.update();
            serviceTicket.getService().setPrincipal(ticketGrantingTicket.getRoot().getAuthentication().getPrincipal().getId());
            beforeTrackingServiceTicket(ownerTicket, serviceTicket);
            ticketGrantingTicket.getServices().put(serviceTicket.getId(), serviceTicket.getService());
        });
        return trackedEntry;
    }
This is {@link AllServicesSessionTrackingPolicy}.

@author Misagh Moayyed
@since 6.6.0
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/tracking/AllServicesSessionTrackingPolicy.java