@ReadOperation
    @Operation(summary = "Produce expiration policies given an optional service id",
        parameters = @Parameter(name = "serviceId", required = false, description = "The service id to look up"))
    public Map<String, ?> handle(@Nullable final String serviceId) {
        val model = new HashMap<String, Object>();
        expirationPolicyBuilders.forEach(Unchecked.consumer(builder -> {
            val policy = builder.buildTicketExpirationPolicy();
            model.put(builder.getClass().getSimpleName(), policy);
        }));

        val servicesManager = servicesManagerProvider.getObject();
        val registeredService = StringUtils.isNotBlank(serviceId)
            ? NumberUtils.isCreatable(serviceId)
            ? servicesManager.findServiceBy(Long.parseLong(serviceId))
            : servicesManager.findServiceBy(webApplicationServiceFactory.createService(serviceId))
            : null;

        Optional.ofNullable(registeredService)
            .map(CasModelRegisteredService.class::cast)
            .map(RegisteredService::getTicketGrantingTicketExpirationPolicy)
            .map(RegisteredServiceTicketGrantingTicketExpirationPolicy::toExpirationPolicy)
            .filter(Optional::isPresent)
            .map(Optional::get)
            .ifPresent(Unchecked.consumer(policy -> model.put(TicketGrantingTicket.class.getName().concat(registeredService.getName()), policy)));

        Optional.ofNullable(registeredService)
            .map(CasModelRegisteredService.class::cast)
            .map(CasModelRegisteredService::getServiceTicketExpirationPolicy)
            .ifPresent(Unchecked.consumer(policy -> model.put(ServiceTicket.class.getName().concat(registeredService.getName()), policy)));

        Optional.ofNullable(registeredService)
            .map(CasModelRegisteredService.class::cast)
            .map(CasModelRegisteredService::getProxyGrantingTicketExpirationPolicy)
            .ifPresent(Unchecked.consumer(policy -> model.put(ProxyGrantingTicket.class.getName().concat(registeredService.getName()), policy)));

        Optional.ofNullable(registeredService)
            .map(CasModelRegisteredService.class::cast)
            .map(CasModelRegisteredService::getProxyTicketExpirationPolicy)
            .ifPresent(Unchecked.consumer(policy -> model.put(ProxyTicket.class.getName().concat(registeredService.getName()), policy)));

        return model;
    }
Produce expiration policies.

@param serviceId the service
@return the map
support/cas-server-support-reports-core/src/main/java/org/apereo/cas/web/report/TicketExpirationPoliciesEndpoint.java