LugsImportTask.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.tasks;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
import org.ctan.site.services.lugs.LugsImportService;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.dropwizard.servlets.tasks.Task;
import lombok.NonNull;
/**
* The class <code>CatalogueUpdateTask</code> contains the task to start the
* update action for the catalogue XML files.
*
* @author <a href="mailto:gene@ctan.org">Gerd Neugebauer</a>
*/
public class LugsImportTask extends Task {
/**
* The field <code>service</code> contains the underlying service.
*/
private LugsImportService service;
/**
* This is the constructor for <code>CatalogueUpdateTask</code>.
*
* @param service the underlying service
*/
@SuppressFBWarnings(value = "CT_CONSTRUCTOR_THROW")
public LugsImportTask(@NonNull LugsImportService service) {
super("lugs-update");
this.service = service;
}
/**
* {@inheritDoc}
*
* @see io.dropwizard.servlets.tasks.Task#execute(java.util.Map,
* java.io.PrintWriter)
*/
@Override
public void execute(Map<String, List<String>> parameters,
PrintWriter output)
throws Exception {
output.print("### LUGs Update Task ####\n");
service.update();
output.print("### LUGs Update Completed ####\n");
}
}