Jobs3Resource.java

/*
 * Copyright © 2024-2026 The CTAN Team and individual authors
 *
 * This file is distributed under the 3-clause BSD license.
 * See file LICENSE for details.
 */
package org.ctan.site.resources.admin;

import java.util.List;

import org.ctan.site.services.jobs.CtanJobManager;

import jakarta.annotation.security.RolesAllowed;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

/**
 * The class <code>Ticket3Resource</code> contains the CRUD controller for the
 * tickets list resource.
 *
 * @author <a href="mailto:gene@ctan.org">Gerd Neugebauer</a>
 */
@Path("/3.0/admin")
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("ADMIN")
public class Jobs3Resource {

    /**
     * The field <code>manager</code> contains the underlying service.
     */
    private CtanJobManager manager = new CtanJobManager();

    /**
     * The method <code>list</code> provides means to retrieve a page of jobs.
     *
     * @return the page for the jobs or {@code null}
     */
    @GET
    @Path("/jobs")
    public List<?> list() {

        return manager.getJobs();
    }

}