mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 13:33:08 +00:00
Replace new uses of Log4J v1 with v2. Ban v1 artifacts. #3190.
This commit is contained in:
@@ -413,6 +413,12 @@
|
||||
<groupId>org.apache.jena</groupId>
|
||||
<artifactId>apache-jena-libs</artifactId>
|
||||
<type>pom</type>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
@@ -546,6 +552,10 @@
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@@ -14,7 +14,8 @@ import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.scripts.DSpaceRunnable;
|
||||
import org.dspace.scripts.configuration.ScriptConfiguration;
|
||||
import org.dspace.scripts.factory.ScriptServiceFactory;
|
||||
@@ -36,7 +37,7 @@ import org.jdom.input.SAXBuilder;
|
||||
*/
|
||||
public class ScriptLauncher {
|
||||
|
||||
private static final Logger log = Logger.getLogger(ScriptLauncher.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
/**
|
||||
* The service manager kernel
|
||||
|
@@ -13,7 +13,8 @@ import java.io.InputStreamReader;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -26,7 +27,7 @@ import org.json.JSONTokener;
|
||||
* @see SHERPAPublisher
|
||||
*
|
||||
* @author Kim Shepherd
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SHERPAPublisherResponse {
|
||||
// Is this response to be treated as an error?
|
||||
@@ -52,7 +53,7 @@ public class SHERPAPublisherResponse {
|
||||
JSON, XML
|
||||
};
|
||||
|
||||
private static Logger log = Logger.getLogger(SHERPAPublisherResponse.class);
|
||||
private static Logger log = LogManager.getLogger();
|
||||
|
||||
/**
|
||||
* Parse SHERPA v2 API for a given format
|
||||
|
@@ -16,7 +16,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
@@ -29,9 +30,9 @@ import org.json.JSONTokener;
|
||||
* The structure is based on journal data, which in turn contains data about publishers and policies
|
||||
*
|
||||
* @see SHERPAJournal
|
||||
*
|
||||
*
|
||||
* @author Kim Shepherd
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SHERPAResponse {
|
||||
// Is this response to be treated as an error?
|
||||
@@ -57,7 +58,7 @@ public class SHERPAResponse {
|
||||
JSON, XML
|
||||
};
|
||||
|
||||
private static Logger log = Logger.getLogger(SHERPAResponse.class);
|
||||
private static Logger log = LogManager.getLogger();
|
||||
|
||||
/**
|
||||
* Parse SHERPA v2 API for a given format
|
||||
|
@@ -21,7 +21,8 @@ import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.BitstreamService;
|
||||
import org.dspace.core.Constants;
|
||||
@@ -45,7 +46,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(Bitstream.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Column(name = "bitstream_id", insertable = false, updatable = false)
|
||||
private Integer legacyId;
|
||||
|
@@ -27,7 +27,8 @@ import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.comparator.NameAscendingComparator;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
@@ -57,7 +58,7 @@ public class Item extends DSpaceObject implements DSpaceObjectLegacySupport {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(Item.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
/**
|
||||
* Wild card for Dublin Core metadata qualifiers/languages
|
||||
|
@@ -10,7 +10,8 @@ package org.dspace.discovery;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.validator.routines.UrlValidator;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.solr.client.solrj.SolrClient;
|
||||
import org.apache.solr.client.solrj.SolrQuery;
|
||||
import org.apache.solr.client.solrj.SolrRequest;
|
||||
@@ -28,7 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class SolrSearchCore {
|
||||
|
||||
private final Logger log = Logger.getLogger(SolrSearchCore.class);
|
||||
private final Logger log = LogManager.getLogger();
|
||||
@Autowired
|
||||
protected IndexingService indexingService;
|
||||
@Autowired
|
||||
|
@@ -11,7 +11,7 @@ import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.content.Collection;
|
||||
@@ -32,7 +32,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class ExternalDataServiceImpl implements ExternalDataService {
|
||||
|
||||
private static final Logger log = Logger.getLogger(ExternalDataServiceImpl.class);
|
||||
private static final Logger log
|
||||
= org.apache.logging.log4j.LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private List<ExternalDataProvider> externalDataProviders;
|
||||
|
@@ -15,7 +15,7 @@ import static java.util.Calendar.DAY_OF_YEAR;
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.apache.commons.cli.Option.builder;
|
||||
import static org.apache.commons.lang.time.DateFormatUtils.format;
|
||||
import static org.apache.log4j.Logger.getLogger;
|
||||
import static org.apache.logging.log4j.LogManager.getLogger;
|
||||
import static org.dspace.core.LogManager.getHeader;
|
||||
import static org.dspace.statistics.SolrLoggerServiceImpl.DATE_FORMAT_8601;
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.apache.commons.cli.DefaultParser;
|
||||
import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.solr.client.solrj.SolrServerException;
|
||||
import org.apache.solr.client.solrj.response.QueryResponse;
|
||||
import org.apache.solr.common.SolrDocument;
|
||||
@@ -55,9 +55,9 @@ import org.dspace.statistics.service.SolrLoggerService;
|
||||
*/
|
||||
public class AnonymizeStatistics {
|
||||
|
||||
private static Logger log = getLogger(AnonymizeStatistics.class);
|
||||
private static Context context = new Context();
|
||||
private static String action = "anonymize_statistics";
|
||||
private static final Logger log = getLogger();
|
||||
private static final Context context = new Context();
|
||||
private static final String action = "anonymize_statistics";
|
||||
|
||||
private static final String HELP_OPTION = "h";
|
||||
private static final String SLEEP_OPTION = "s";
|
||||
@@ -66,9 +66,9 @@ public class AnonymizeStatistics {
|
||||
|
||||
private static int sleep;
|
||||
|
||||
private static SolrLoggerService solrLoggerService =
|
||||
private static final SolrLoggerService solrLoggerService =
|
||||
StatisticsServiceFactory.getInstance().getSolrLoggerService();
|
||||
private static ConfigurationService configurationService =
|
||||
private static final ConfigurationService configurationService =
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
private static int batchSize = 100;
|
||||
|
@@ -9,7 +9,7 @@ package org.dspace.statistics.export;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.Context;
|
||||
@@ -27,7 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class IrusExportUsageEventListener extends AbstractUsageEventListener {
|
||||
/* Log4j logger*/
|
||||
private static Logger log = Logger.getLogger(IrusExportUsageEventListener.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
ConfigurationService configurationService;
|
||||
@@ -37,6 +37,7 @@ public class IrusExportUsageEventListener extends AbstractUsageEventListener {
|
||||
*
|
||||
* @param event includes all the information related to the event that occurred
|
||||
*/
|
||||
@Override
|
||||
public void receiveEvent(Event event) {
|
||||
if (configurationService.getBooleanProperty("irus.statistics.tracker.enabled", false)) {
|
||||
if (event instanceof UsageEvent) {
|
||||
|
@@ -19,7 +19,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.codec.CharEncoding;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.DCDate;
|
||||
import org.dspace.content.Entity;
|
||||
import org.dspace.content.EntityType;
|
||||
@@ -41,7 +42,7 @@ import org.dspace.statistics.export.service.OpenUrlService;
|
||||
*/
|
||||
public abstract class ExportEventProcessor {
|
||||
|
||||
private static Logger log = Logger.getLogger(ExportEventProcessor.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
protected static final String ENTITY_TYPE_DEFAULT = "Publication";
|
||||
|
||||
@@ -50,14 +51,17 @@ public abstract class ExportEventProcessor {
|
||||
|
||||
protected final static String UTF_8 = CharEncoding.UTF_8;
|
||||
|
||||
private ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
private EntityService entityService = ContentServiceFactory.getInstance().getEntityService();
|
||||
private ItemService itemService = ContentServiceFactory.getInstance().getItemService();
|
||||
private OpenUrlService openUrlService = OpenURLTrackerLoggerServiceFactory.getInstance().getOpenUrlService();
|
||||
private final ConfigurationService configurationService
|
||||
= DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
private final EntityService entityService
|
||||
= ContentServiceFactory.getInstance().getEntityService();
|
||||
private final ItemService itemService
|
||||
= ContentServiceFactory.getInstance().getItemService();
|
||||
private final OpenUrlService openUrlService
|
||||
= OpenURLTrackerLoggerServiceFactory.getInstance().getOpenUrlService();
|
||||
|
||||
|
||||
private Context context;
|
||||
private HttpServletRequest request;
|
||||
private final Context context;
|
||||
private final HttpServletRequest request;
|
||||
|
||||
/**
|
||||
* Creates a new ExportEventProcessor based on the params and initializes the services
|
||||
|
@@ -16,7 +16,8 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.statistics.export.OpenURLTracker;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -26,7 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class OpenUrlServiceImpl implements OpenUrlService {
|
||||
|
||||
private Logger log = Logger.getLogger(OpenUrlService.class);
|
||||
private final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
protected FailedOpenURLTrackerService failedOpenUrlTrackerService;
|
||||
@@ -38,6 +39,7 @@ public class OpenUrlServiceImpl implements OpenUrlService {
|
||||
* @param urlStr - the url to be processed
|
||||
* @throws SQLException
|
||||
*/
|
||||
@Override
|
||||
public void processUrl(Context c, String urlStr) throws SQLException {
|
||||
log.debug("Prepared to send url to tracker URL: " + urlStr);
|
||||
|
||||
@@ -107,6 +109,7 @@ public class OpenUrlServiceImpl implements OpenUrlService {
|
||||
* @param context
|
||||
* @throws SQLException
|
||||
*/
|
||||
@Override
|
||||
public void reprocessFailedQueue(Context context) throws SQLException {
|
||||
if (failedOpenUrlTrackerService == null) {
|
||||
log.error("Error retrieving the \"failedOpenUrlTrackerService\" instance, aborting the processing");
|
||||
@@ -124,6 +127,7 @@ public class OpenUrlServiceImpl implements OpenUrlService {
|
||||
* @param url
|
||||
* @throws SQLException
|
||||
*/
|
||||
@Override
|
||||
public void logfailed(Context context, String url) throws SQLException {
|
||||
Date now = new Date();
|
||||
if (StringUtils.isBlank(url)) {
|
||||
|
@@ -7,7 +7,8 @@
|
||||
*/
|
||||
package org.dspace.submit.step;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* @author Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
|
||||
@@ -16,7 +17,6 @@ public class ExtractionStep extends MetadataStep {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger
|
||||
.getLogger(ExtractionStep.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
}
|
@@ -21,7 +21,8 @@ import gr.ekt.bte.core.Record;
|
||||
import gr.ekt.bte.core.Value;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.InProgressSubmission;
|
||||
import org.dspace.content.Item;
|
||||
@@ -41,14 +42,14 @@ public class MetadataStep extends AbstractProcessingStep {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(MetadataStep.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
protected List<MetadataListener> listeners = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServicesByType(MetadataListener.class);
|
||||
|
||||
protected Map<String, List<MetadataValue>> metadataMap = new HashMap<String, List<MetadataValue>>();
|
||||
private Map<String, Set<String>> results = new HashMap<String, Set<String>>();
|
||||
private Map<String, String> mappingIdentifier = new HashMap<String, String>();
|
||||
protected Map<String, List<MetadataValue>> metadataMap = new HashMap<>();
|
||||
private final Map<String, Set<String>> results = new HashMap<>();
|
||||
private final Map<String, String> mappingIdentifier = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void doPreProcessing(Context context, InProgressSubmission wsi) {
|
||||
@@ -60,7 +61,7 @@ public class MetadataStep extends AbstractProcessingStep {
|
||||
if (mm != null && !mm.isEmpty()) {
|
||||
metadataMap.put(metadata, mm);
|
||||
} else {
|
||||
metadataMap.put(metadata, new ArrayList<MetadataValue>());
|
||||
metadataMap.put(metadata, new ArrayList<>());
|
||||
}
|
||||
mappingIdentifier.put(metadata, listener.getMetadata().get(metadata));
|
||||
}
|
||||
@@ -160,7 +161,7 @@ public class MetadataStep extends AbstractProcessingStep {
|
||||
String key = mappingIdentifier.get(metadata);
|
||||
Set<String> identifiers = null;
|
||||
if (!results.containsKey(key)) {
|
||||
identifiers = new HashSet<String>();
|
||||
identifiers = new HashSet<>();
|
||||
} else {
|
||||
identifiers = results.get(key);
|
||||
}
|
||||
@@ -169,7 +170,7 @@ public class MetadataStep extends AbstractProcessingStep {
|
||||
}
|
||||
|
||||
public List<Record> convertFields(List<Record> recordSet, Map<String, String> fieldMap) {
|
||||
List<Record> result = new ArrayList<Record>();
|
||||
List<Record> result = new ArrayList<>();
|
||||
for (Record publication : recordSet) {
|
||||
for (String fieldName : fieldMap.keySet()) {
|
||||
String md = null;
|
||||
|
@@ -21,7 +21,8 @@ import org.apache.commons.cli.DefaultParser;
|
||||
import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.solr.client.solrj.SolrQuery;
|
||||
import org.apache.solr.client.solrj.SolrServerException;
|
||||
import org.apache.solr.client.solrj.impl.HttpSolrClient;
|
||||
@@ -51,19 +52,19 @@ import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* CLI tool to upgrade legacy id references in SOLR statistics to DSpace 6 UUID's.
|
||||
*
|
||||
*
|
||||
* This command will need to be run iteratively over each statistics shard until all legacy id values have
|
||||
* been replaced.
|
||||
*
|
||||
*
|
||||
* If a legacy id cannot be resolved from the database, the id will remain unchanged.
|
||||
* "field:* AND NOT(field:*-*)" can be used to locate legacy ids
|
||||
*
|
||||
*
|
||||
* See DS-3602 for the origin of this issue. This code is targeted for inclusion in the DSpace 6.1 release.
|
||||
*
|
||||
*
|
||||
* Recommendation: for a large repository, run this command with -Xmx2000m if possible.
|
||||
*
|
||||
*
|
||||
* To process 1,000,000 statistics records, it took 60 min to complete.
|
||||
*
|
||||
*
|
||||
* @author Terry Brady, Georgetown University Library
|
||||
*/
|
||||
|
||||
@@ -109,7 +110,7 @@ public class SolrUpgradePre6xStatistics {
|
||||
}
|
||||
|
||||
//Logger
|
||||
private static final Logger log = Logger.getLogger(SolrUpgradePre6xStatistics.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
//DSpace Servcies
|
||||
private ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
@@ -202,7 +203,7 @@ public class SolrUpgradePre6xStatistics {
|
||||
|
||||
/**
|
||||
* Compute the time since the last batch was processed
|
||||
*
|
||||
*
|
||||
* @param fromStart
|
||||
* if true, report on processing time since the start of the program
|
||||
* @return the time in ms since the start time
|
||||
@@ -223,9 +224,9 @@ public class SolrUpgradePre6xStatistics {
|
||||
|
||||
/*
|
||||
* Format ms count as h:mm:ss
|
||||
*
|
||||
*
|
||||
* @param dur Duration in ms
|
||||
*
|
||||
*
|
||||
* @return duration formatted as h:mm:ss
|
||||
*/
|
||||
private String duration(long dur) {
|
||||
@@ -238,7 +239,7 @@ public class SolrUpgradePre6xStatistics {
|
||||
|
||||
/**
|
||||
* Print a status message appended with the processing time for the operation
|
||||
*
|
||||
*
|
||||
* @param header
|
||||
* Message to display
|
||||
* @param fromStart
|
||||
@@ -313,7 +314,7 @@ public class SolrUpgradePre6xStatistics {
|
||||
|
||||
/**
|
||||
* Entry point for command-line invocation
|
||||
*
|
||||
*
|
||||
* @param args
|
||||
* command-line arguments; see help for description
|
||||
* @throws ParseException
|
||||
@@ -437,7 +438,7 @@ public class SolrUpgradePre6xStatistics {
|
||||
* Process records with a legacy id. From the command line, the user may specify
|
||||
* records of a specific type to update Otherwise, the following sequence will
|
||||
* be applied in order to optimize hibernate caching.
|
||||
*
|
||||
*
|
||||
* Communities and Collections - retain in the cache since each is likely to be
|
||||
* re-used Items - retain in the cache until a new item is processed Bitstreams
|
||||
* - retain in the cache until a new bitstream is processed
|
||||
@@ -462,12 +463,12 @@ public class SolrUpgradePre6xStatistics {
|
||||
|
||||
/*
|
||||
* Update records associated with a particular object id
|
||||
*
|
||||
*
|
||||
* @param query Query to retrieve all of the statistics records associated with
|
||||
* a particular object
|
||||
*
|
||||
*
|
||||
* @param field Field to use for grouping records
|
||||
*
|
||||
*
|
||||
* @return number of items processed. 0 indicates that no more work is available
|
||||
* (or the max processed has been reached).
|
||||
*/
|
||||
@@ -508,14 +509,14 @@ public class SolrUpgradePre6xStatistics {
|
||||
|
||||
/*
|
||||
* Map solr fields from legacy ids to UUIDs.
|
||||
*
|
||||
*
|
||||
* The id field is interpreted by the type field. The scopeId field is
|
||||
* interpreted by scopeType field.
|
||||
*
|
||||
*
|
||||
* Legacy ids will be unchanged if they cannot be mapped
|
||||
*
|
||||
*
|
||||
* @param input The SOLR statistics document to be updated
|
||||
*
|
||||
*
|
||||
* @param col The SOLR field to update (if present)
|
||||
*/
|
||||
private void mapField(SolrInputDocument input, FIELD col) throws SQLException {
|
||||
@@ -581,7 +582,7 @@ public class SolrUpgradePre6xStatistics {
|
||||
/*
|
||||
* Determine if the last processed item should be cleared from the hibernate
|
||||
* cache
|
||||
*
|
||||
*
|
||||
* @param item Current item being processed
|
||||
*/
|
||||
private void checkLastItem(Item item) throws SQLException {
|
||||
@@ -599,7 +600,7 @@ public class SolrUpgradePre6xStatistics {
|
||||
/*
|
||||
* Determine if the last processed bitstream should be cleared from the
|
||||
* hibernate cache
|
||||
*
|
||||
*
|
||||
* @param bitstream Current bitstream being processed
|
||||
*/
|
||||
private void checkLastBitstream(Bitstream bitstream) throws SQLException {
|
||||
@@ -617,9 +618,9 @@ public class SolrUpgradePre6xStatistics {
|
||||
/*
|
||||
* Retrieve the UUID corresponding to a legacy id found in a SOLR statistics
|
||||
* record
|
||||
*
|
||||
*
|
||||
* @param col Solr Statistic Field being processed
|
||||
*
|
||||
*
|
||||
* @param val Value to lookup as a legacy id
|
||||
*/
|
||||
private UUID mapId(FIELD col, int val) throws SQLException {
|
||||
@@ -647,9 +648,9 @@ public class SolrUpgradePre6xStatistics {
|
||||
/*
|
||||
* Retrieve the UUID corresponding to a legacy id found in a SOLR statistics
|
||||
* record
|
||||
*
|
||||
*
|
||||
* @param type Identifying type field for id OR scopeType field for scopeId
|
||||
*
|
||||
*
|
||||
* @param val Value to lookup as a legacy id
|
||||
*/
|
||||
private UUID mapType(int type, int val) throws SQLException {
|
||||
@@ -679,9 +680,9 @@ public class SolrUpgradePre6xStatistics {
|
||||
/*
|
||||
* Retrieve the UUID corresponding to a legacy owner found in a SOLR statistics
|
||||
* record Legacy owner fields are prefixed in solr with "e" or "g"
|
||||
*
|
||||
*
|
||||
* @param owntype Identifying type field (e - eperson, g - group)
|
||||
*
|
||||
*
|
||||
* @param val Value to lookup as a legacy id
|
||||
*/
|
||||
private UUID mapOwner(String owntype, int val) throws SQLException {
|
||||
|
@@ -9,7 +9,8 @@ package org.dspace.builder;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.EntityType;
|
||||
import org.dspace.content.service.EntityTypeService;
|
||||
@@ -19,7 +20,7 @@ import org.dspace.discovery.SearchServiceException;
|
||||
public class EntityTypeBuilder extends AbstractBuilder<EntityType, EntityTypeService> {
|
||||
|
||||
/* Log4j logger*/
|
||||
private static final Logger log = Logger.getLogger(EntityTypeBuilder.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
private EntityType entityType;
|
||||
|
||||
|
@@ -10,7 +10,8 @@ package org.dspace.builder;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.Relationship;
|
||||
@@ -22,7 +23,7 @@ import org.dspace.discovery.SearchServiceException;
|
||||
public class RelationshipBuilder extends AbstractBuilder<Relationship, RelationshipService> {
|
||||
|
||||
/* Log4j logger*/
|
||||
private static final Logger log = Logger.getLogger(RelationshipBuilder.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
private Relationship relationship;
|
||||
|
||||
|
@@ -10,7 +10,8 @@ package org.dspace.builder;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.EntityType;
|
||||
import org.dspace.content.Relationship;
|
||||
@@ -22,7 +23,7 @@ import org.dspace.discovery.SearchServiceException;
|
||||
public class RelationshipTypeBuilder extends AbstractBuilder<RelationshipType, RelationshipTypeService> {
|
||||
|
||||
/* Log4j logger*/
|
||||
private static final Logger log = Logger.getLogger(RelationshipTypeBuilder.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
private RelationshipType relationshipType;
|
||||
|
||||
|
@@ -11,7 +11,8 @@ import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.ResourcePolicy;
|
||||
import org.dspace.authorize.service.ResourcePolicyService;
|
||||
@@ -24,7 +25,7 @@ import org.dspace.eperson.Group;
|
||||
public class ResourcePolicyBuilder extends AbstractBuilder<ResourcePolicy, ResourcePolicyService> {
|
||||
|
||||
/* Log4j logger*/
|
||||
private static final Logger log = Logger.getLogger(ResourcePolicyBuilder.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
private ResourcePolicy resourcePolicy;
|
||||
|
||||
|
@@ -24,7 +24,8 @@ import java.util.regex.Pattern;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.codec.CharEncoding;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.AbstractIntegrationTestWithDatabase;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.builder.BitstreamBuilder;
|
||||
@@ -65,7 +66,7 @@ import org.junit.Test;
|
||||
//@RunWith(MockitoJUnitRunner.class)
|
||||
public class ITIrusExportUsageEventListener extends AbstractIntegrationTestWithDatabase {
|
||||
|
||||
private static Logger log = Logger.getLogger(ITIrusExportUsageEventListener.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
|
||||
protected CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService();
|
||||
|
@@ -13,7 +13,8 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.AbstractIntegrationTest;
|
||||
import org.dspace.app.scripts.handler.impl.TestDSpaceRunnableHandler;
|
||||
import org.dspace.scripts.DSpaceRunnable;
|
||||
@@ -31,7 +32,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class ITRetryFailedOpenUrlTracker extends AbstractIntegrationTest {
|
||||
|
||||
private static Logger log = Logger.getLogger(ITRetryFailedOpenUrlTracker.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
|
||||
protected FailedOpenURLTrackerService failedOpenURLTrackerService =
|
||||
@@ -41,8 +42,8 @@ public class ITRetryFailedOpenUrlTracker extends AbstractIntegrationTest {
|
||||
.getServiceByName("testProcessedUrls",
|
||||
ArrayList.class);
|
||||
|
||||
private ScriptService scriptService = ScriptServiceFactory.getInstance().getScriptService();
|
||||
|
||||
private final ScriptService scriptService
|
||||
= ScriptServiceFactory.getInstance().getScriptService();
|
||||
|
||||
/**
|
||||
* Clean up the logged entries from the db after each test
|
||||
|
@@ -16,7 +16,8 @@ import java.util.Arrays;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.atteo.evo.inflector.English;
|
||||
import org.dspace.app.rest.converter.ConverterService;
|
||||
import org.dspace.app.rest.model.DSpaceObjectRest;
|
||||
@@ -49,8 +50,7 @@ public class IdentifierRestController implements InitializingBean {
|
||||
|
||||
public static final String PARAM = "id";
|
||||
|
||||
private static final Logger log =
|
||||
Logger.getLogger(IdentifierRestController.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private ConverterService converter;
|
||||
|
@@ -17,7 +17,8 @@ import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.exception.MethodNotAllowedException;
|
||||
import org.dspace.app.rest.exception.UnprocessableEntityException;
|
||||
import org.dspace.app.rest.utils.ContextUtil;
|
||||
@@ -45,7 +46,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/api/core/items" + REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID + "/mappedCollections")
|
||||
public class MappedCollectionRestController {
|
||||
|
||||
private static final Logger log = Logger.getLogger(MappedCollectionRestController.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private ItemService itemService;
|
||||
|
@@ -21,9 +21,8 @@ import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.utils.ContextUtil;
|
||||
import org.dspace.app.rest.utils.ScopeResolver;
|
||||
import org.dspace.app.util.SyndicationFeed;
|
||||
import org.dspace.app.util.factory.UtilServiceFactory;
|
||||
import org.dspace.app.util.service.OpenSearchService;
|
||||
@@ -59,7 +58,7 @@ import org.w3c.dom.Document;
|
||||
@RequestMapping("/opensearch")
|
||||
public class OpenSearchController {
|
||||
|
||||
private static final Logger log = Logger.getLogger(ScopeResolver.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger();
|
||||
private static final String errorpath = "/error";
|
||||
private List<String> searchIndices = null;
|
||||
|
||||
|
@@ -17,7 +17,8 @@ import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.converter.ConverterService;
|
||||
import org.dspace.app.rest.model.DSpaceObjectRest;
|
||||
import org.dspace.app.rest.utils.ContextUtil;
|
||||
@@ -59,8 +60,7 @@ public class UUIDLookupRestController implements InitializingBean {
|
||||
@Autowired
|
||||
private Utils utils;
|
||||
|
||||
private static final Logger log =
|
||||
Logger.getLogger(UUIDLookupRestController.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private DiscoverableEndpointsService discoverableEndpointsService;
|
||||
|
@@ -9,7 +9,8 @@ package org.dspace.app.rest.authorization.impl;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.authorization.AuthorizationFeature;
|
||||
import org.dspace.app.rest.authorization.AuthorizationFeatureDocumentation;
|
||||
import org.dspace.app.rest.authorization.AuthorizeServiceRestUtil;
|
||||
@@ -37,7 +38,7 @@ import org.springframework.stereotype.Component;
|
||||
description = "It can be used to verify if bitstreams can be created in a specific bundle")
|
||||
public class CreateBitstreamFeature implements AuthorizationFeature {
|
||||
|
||||
Logger log = Logger.getLogger(CreateBitstreamFeature.class);
|
||||
Logger log = LogManager.getLogger();
|
||||
|
||||
public final static String NAME = "canCreateBitstream";
|
||||
|
||||
|
@@ -9,7 +9,8 @@ package org.dspace.app.rest.authorization.impl;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.authorization.AuthorizationFeature;
|
||||
import org.dspace.app.rest.authorization.AuthorizationFeatureDocumentation;
|
||||
import org.dspace.app.rest.authorization.AuthorizeServiceRestUtil;
|
||||
@@ -38,7 +39,7 @@ import org.springframework.stereotype.Component;
|
||||
description = "It can be used to verify if an item can be moved to a different collection")
|
||||
public class MoveFeature implements AuthorizationFeature {
|
||||
|
||||
Logger log = Logger.getLogger(MoveFeature.class);
|
||||
Logger log = LogManager.getLogger();
|
||||
|
||||
public final static String NAME = "canMove";
|
||||
|
||||
|
@@ -12,7 +12,8 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.authorization.AuthorizationFeature;
|
||||
import org.dspace.app.rest.authorization.AuthorizationFeatureDocumentation;
|
||||
import org.dspace.app.rest.model.BaseObjectRest;
|
||||
@@ -37,7 +38,7 @@ import org.springframework.stereotype.Component;
|
||||
* in an item.
|
||||
*
|
||||
* Authorization is granted for a bitstream if the user has no access to the bitstream
|
||||
* and the bistream is part of an archived item.
|
||||
* and the bitstream is part of an archived item.
|
||||
* Authorization is granted for an item if the user has no access to a bitstream in the item, and the item is archived.
|
||||
*/
|
||||
@Component
|
||||
@@ -45,7 +46,7 @@ import org.springframework.stereotype.Component;
|
||||
description = "It can be used to verify if the user can request a copy of a bitstream")
|
||||
public class RequestCopyFeature implements AuthorizationFeature {
|
||||
|
||||
Logger log = Logger.getLogger(RequestCopyFeature.class);
|
||||
Logger log = LogManager.getLogger();
|
||||
|
||||
public final static String NAME = "canRequestACopy";
|
||||
|
||||
|
@@ -20,7 +20,8 @@ import javax.annotation.Nullable;
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.link.HalLinkFactory;
|
||||
import org.dspace.app.rest.link.HalLinkService;
|
||||
import org.dspace.app.rest.model.BaseObjectRest;
|
||||
@@ -52,13 +53,13 @@ import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* Converts domain objects from the DSpace service layer to rest objects, and from rest objects to resource
|
||||
* objects, applying {@link Projection}s where applicable.
|
||||
*
|
||||
*
|
||||
* @author Luca Giamminonni (luca.giamminonni at 4science dot it)
|
||||
*/
|
||||
@Service
|
||||
public class ConverterService {
|
||||
|
||||
private static final Logger log = Logger.getLogger(ConverterService.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
private final Map<String, Projection> projectionMap = new HashMap<>();
|
||||
|
||||
|
@@ -11,7 +11,8 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.model.SearchFacetEntryRest;
|
||||
import org.dspace.app.rest.model.SearchFacetValueRest;
|
||||
import org.dspace.app.rest.model.SearchResultsRest;
|
||||
@@ -31,9 +32,9 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
public class DiscoverFacetsConverter {
|
||||
|
||||
private static final Logger log = Logger.getLogger(DiscoverFacetsConverter.class);
|
||||
private static final Logger log = LogManager.getLogger(DiscoverFacetsConverter.class);
|
||||
|
||||
private DiscoverFacetValueConverter facetValueConverter = new DiscoverFacetValueConverter();
|
||||
private final DiscoverFacetValueConverter facetValueConverter = new DiscoverFacetValueConverter();
|
||||
|
||||
@Autowired
|
||||
private SearchService searchService;
|
||||
@@ -56,7 +57,7 @@ public class DiscoverFacetsConverter {
|
||||
/**
|
||||
* Fill the facet values information in the SearchResultsRest using the information in the api DiscoverResult object
|
||||
* according to the configuration applied to the discovery query
|
||||
*
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace context
|
||||
* @param searchResult
|
||||
@@ -104,7 +105,7 @@ public class DiscoverFacetsConverter {
|
||||
|
||||
/**
|
||||
* This method will fill the facetEntry with the appropriate min and max values if they're not empty
|
||||
*
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace context
|
||||
* @param field
|
||||
|
@@ -12,7 +12,8 @@ import java.util.Map;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.converter.query.SearchQueryConverter;
|
||||
import org.dspace.app.rest.model.RestAddressableModel;
|
||||
import org.dspace.app.rest.model.SearchResultEntryRest;
|
||||
@@ -34,7 +35,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
public class DiscoverResultConverter {
|
||||
|
||||
private static final Logger log = Logger.getLogger(DiscoverResultConverter.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private List<IndexableObjectConverter> converters;
|
||||
|
@@ -9,7 +9,8 @@ package org.dspace.app.rest.converter;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.model.VersionRest;
|
||||
import org.dspace.app.rest.projection.Projection;
|
||||
import org.dspace.app.rest.utils.ContextUtil;
|
||||
@@ -29,7 +30,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
public class VersionConverter implements DSpaceConverter<Version, VersionRest> {
|
||||
|
||||
private static final Logger log = Logger.getLogger(VersionConverter.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private AuthorizeService authorizeService;
|
||||
|
@@ -16,7 +16,8 @@ import javax.mail.MessagingException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.DiscoverableEndpointsService;
|
||||
import org.dspace.app.rest.Parameter;
|
||||
import org.dspace.app.rest.SearchRestMethod;
|
||||
@@ -67,7 +68,7 @@ import org.springframework.stereotype.Component;
|
||||
public class ClaimedTaskRestRepository extends DSpaceRestRepository<ClaimedTaskRest, Integer>
|
||||
implements InitializingBean {
|
||||
|
||||
private static final Logger log = Logger.getLogger(ClaimedTaskRestRepository.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
ItemService itemService;
|
||||
@@ -231,7 +232,7 @@ public class ClaimedTaskRestRepository extends DSpaceRestRepository<ClaimedTaskR
|
||||
/**
|
||||
* This method delete only the claimed task. The workflow engine will return it to the pool if there are not
|
||||
* enough other claimed tasks for the same workflowitem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@PreAuthorize("hasPermission(#id, 'CLAIMEDTASK', 'DELETE')")
|
||||
protected void delete(Context context, Integer id) {
|
||||
@@ -251,6 +252,7 @@ public class ClaimedTaskRestRepository extends DSpaceRestRepository<ClaimedTaskR
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ClaimedTaskRest> findAll(Context context, Pageable pageable) {
|
||||
throw new RepositoryMethodNotImplementedException(ClaimedTaskRest.NAME, "findAll");
|
||||
}
|
||||
|
@@ -16,7 +16,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.DiscoverableEndpointsService;
|
||||
import org.dspace.app.rest.Parameter;
|
||||
import org.dspace.app.rest.SearchRestMethod;
|
||||
@@ -61,7 +62,7 @@ import org.springframework.stereotype.Component;
|
||||
public class EPersonRestRepository extends DSpaceObjectRestRepository<EPerson, EPersonRest>
|
||||
implements InitializingBean {
|
||||
|
||||
private static final Logger log = Logger.getLogger(EPersonRestRepository.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
AuthorizeService authorizeService;
|
||||
|
@@ -20,7 +20,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.converter.MetadataConverter;
|
||||
import org.dspace.app.rest.exception.DSpaceBadRequestException;
|
||||
import org.dspace.app.rest.exception.RepositoryMethodNotImplementedException;
|
||||
@@ -61,7 +62,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component(ItemRest.CATEGORY + "." + ItemRest.NAME)
|
||||
public class ItemRestRepository extends DSpaceObjectRestRepository<Item, ItemRest> {
|
||||
|
||||
private static final Logger log = Logger.getLogger(ItemRestRepository.class);
|
||||
private static final Logger log = LogManager.getLogger(ItemRestRepository.class);
|
||||
|
||||
public static final String[] COPYVIRTUAL_ALL = {"all"};
|
||||
public static final String[] COPYVIRTUAL_CONFIGURED = {"configured"};
|
||||
|
@@ -13,7 +13,8 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.DiscoverableEndpointsService;
|
||||
import org.dspace.app.rest.Parameter;
|
||||
import org.dspace.app.rest.SearchRestMethod;
|
||||
@@ -51,7 +52,7 @@ import org.springframework.stereotype.Component;
|
||||
public class PoolTaskRestRepository extends DSpaceRestRepository<PoolTaskRest, Integer>
|
||||
implements InitializingBean {
|
||||
|
||||
private static final Logger log = Logger.getLogger(PoolTaskRestRepository.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
ItemService itemService;
|
||||
|
@@ -15,7 +15,8 @@ import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.Parameter;
|
||||
import org.dspace.app.rest.SearchRestMethod;
|
||||
import org.dspace.app.rest.converter.ConverterService;
|
||||
@@ -49,7 +50,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component(ProcessRest.CATEGORY + "." + ProcessRest.NAME)
|
||||
public class ProcessRestRepository extends DSpaceRestRepository<ProcessRest, Integer> {
|
||||
|
||||
private static final Logger log = Logger.getLogger(ProcessRestRepository.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private ProcessService processService;
|
||||
|
@@ -16,7 +16,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.Parameter;
|
||||
import org.dspace.app.rest.SearchRestMethod;
|
||||
import org.dspace.app.rest.exception.RepositoryMethodNotImplementedException;
|
||||
@@ -49,7 +50,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component(RelationshipRest.CATEGORY + "." + RelationshipRest.NAME)
|
||||
public class RelationshipRestRepository extends DSpaceRestRepository<RelationshipRest, Integer> {
|
||||
|
||||
private static final Logger log = Logger.getLogger(RelationshipRestRepository.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
private static final String ALL = "all";
|
||||
private static final String LEFT = "left";
|
||||
|
@@ -16,7 +16,8 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.Parameter;
|
||||
import org.dspace.app.rest.SearchRestMethod;
|
||||
import org.dspace.app.rest.exception.DSpaceBadRequestException;
|
||||
@@ -75,7 +76,7 @@ public class WorkflowItemRestRepository extends DSpaceRestRepository<WorkflowIte
|
||||
|
||||
public static final String OPERATION_PATH_SECTIONS = "sections";
|
||||
|
||||
private static final Logger log = Logger.getLogger(WorkflowItemRestRepository.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
XmlWorkflowItemService wis;
|
||||
@@ -202,7 +203,7 @@ public class WorkflowItemRestRepository extends DSpaceRestRepository<WorkflowIte
|
||||
|
||||
this.checkIfEditMetadataAllowedInCurrentStep(context, source);
|
||||
|
||||
List<ErrorRest> errors = new ArrayList<ErrorRest>();
|
||||
List<ErrorRest> errors = new ArrayList<>();
|
||||
SubmissionConfig submissionConfig =
|
||||
submissionConfigReader.getSubmissionConfigByName(wsi.getSubmissionDefinition().getName());
|
||||
for (int i = 0; i < submissionConfig.getNumberOfSteps(); i++) {
|
||||
|
@@ -15,7 +15,8 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.utils.ContextUtil;
|
||||
import org.dspace.authenticate.service.AuthenticationService;
|
||||
import org.dspace.core.Context;
|
||||
@@ -34,9 +35,9 @@ import org.springframework.security.web.authentication.www.BasicAuthenticationFi
|
||||
*/
|
||||
public class AnonymousAdditionalAuthorizationFilter extends BasicAuthenticationFilter {
|
||||
|
||||
private static final Logger log = Logger.getLogger(AnonymousAdditionalAuthorizationFilter.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
private AuthenticationService authenticationService;
|
||||
private final AuthenticationService authenticationService;
|
||||
|
||||
/**
|
||||
* Constructor for the class
|
||||
|
@@ -10,7 +10,8 @@ package org.dspace.app.rest.submit.step.validation;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.model.ErrorRest;
|
||||
import org.dspace.app.rest.repository.WorkspaceItemRestRepository;
|
||||
import org.dspace.app.rest.submit.SubmissionService;
|
||||
@@ -32,7 +33,7 @@ public class LicenseValidation extends AbstractValidation {
|
||||
|
||||
private static final String ERROR_VALIDATION_LICENSEREQUIRED = "error.validation.license.notgranted";
|
||||
|
||||
private static final Logger log = Logger.getLogger(LicenseValidation.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired
|
||||
private BitstreamService bitstreamService;
|
||||
|
@@ -12,7 +12,8 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.rest.Parameter;
|
||||
import org.dspace.app.rest.SearchRestMethod;
|
||||
import org.dspace.app.rest.exception.MissingParameterException;
|
||||
@@ -49,7 +50,7 @@ public class RestRepositoryUtils {
|
||||
private static final String NAME_NOT_FOUND = "Unable to detect parameter names for query method %s! Use @Param or" +
|
||||
" compile with -parameters on JDK 8.";
|
||||
|
||||
private static final Logger log = Logger.getLogger(RestRepositoryUtils.class);
|
||||
private static final Logger log = LogManager.getLogger();
|
||||
|
||||
@Autowired(required = true)
|
||||
@Qualifier(value = "mvcConversionService")
|
||||
@@ -78,7 +79,7 @@ public class RestRepositoryUtils {
|
||||
* @return the names of the search methods if any. Otherwise an empty list
|
||||
*/
|
||||
public List<String> listSearchMethods(DSpaceRestRepository repository) {
|
||||
List<String> searchMethods = new LinkedList<String>();
|
||||
List<String> searchMethods = new LinkedList<>();
|
||||
for (Method method : repository.getClass().getMethods()) {
|
||||
// We need to use AnnotationUtils because the DSpaceRestRepository is possibly enhanced by a Spring AOP
|
||||
// proxy. The regular "method.getAnnotation()" method would then search the proxy instead of the
|
||||
@@ -136,7 +137,7 @@ public class RestRepositoryUtils {
|
||||
public Object executeQueryMethod(DSpaceRestRepository repository, MultiValueMap<String, Object> parameters,
|
||||
Method method, Pageable pageable, Sort sort, PagedResourcesAssembler assembler) {
|
||||
|
||||
MultiValueMap<String, Object> result = new LinkedMultiValueMap<String, Object>(parameters);
|
||||
MultiValueMap<String, Object> result = new LinkedMultiValueMap<>(parameters);
|
||||
MethodParameters methodParameters = new MethodParameters(method, PARAM_ANNOTATION);
|
||||
|
||||
for (MethodParameter parameter : methodParameters.getParameters()) {
|
||||
|
15
pom.xml
15
pom.xml
@@ -116,6 +116,21 @@
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>ban-dependencies</id>
|
||||
<goals>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<rules>
|
||||
<bannedDependencies>
|
||||
<excludes>
|
||||
<exclude>log4j:log4j</exclude>
|
||||
</excludes>
|
||||
</bannedDependencies>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Used to compile all Java classes -->
|
||||
|
Reference in New Issue
Block a user