Skip to content

Commit

Permalink
XWIKI-22807: Livedata REST result have inconsistent results when call…
Browse files Browse the repository at this point in the history
…ed concurrently (#3825) (#3832)

(cherry picked from commit 187e545)

Co-authored-by: Manuel Leduc <[email protected]>
  • Loading branch information
github-actions[bot] and manuelleduc authored Jan 23, 2025
1 parent 6722854 commit 66ff70c
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.xwiki.annotation.rest.internal;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.Encoded;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
Expand All @@ -41,7 +40,6 @@
@Component
@Named("org.xwiki.annotation.rest.internal.AnnotationsRESTResource")
@Path("/wikis/{wikiName}/spaces/{spaceName: .+}/pages/{pageName}/annotations")
@Singleton
public class AnnotationsRESTResource extends AbstractAnnotationsRESTResource
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Locale;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.Encoded;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
Expand All @@ -45,7 +44,6 @@
@Component
@Named("org.xwiki.annotation.rest.internal.AnnotationsTranslationRESTResource")
@Path("/wikis/{wikiName}/spaces/{spaceName: .+}/pages/{pageName}/translations/{language}/annotations")
@Singleton
public class AnnotationsTranslationRESTResource extends AbstractAnnotationsRESTResource
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Map;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.DELETE;
import javax.ws.rs.Encoded;
import javax.ws.rs.PUT;
Expand Down Expand Up @@ -54,7 +53,6 @@
@Component
@Named("org.xwiki.annotation.rest.internal.SingleAnnotationRESTResource")
@Path("/wikis/{wikiName}/spaces/{spaceName: .+}/pages/{pageName}/annotation/{id}")
@Singleton
public class SingleAnnotationRESTResource extends AbstractAnnotationRESTResource
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

Expand All @@ -55,13 +54,12 @@

/**
* Default implementation of {@link LiveDataEntriesResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataEntriesResource")
@Singleton
public class DefaultLiveDataEntriesResource extends AbstractLiveDataResource implements LiveDataEntriesResource
{
private static final String FILTERS_PREFIX = "filters.";
Expand Down Expand Up @@ -181,7 +179,7 @@ private Entries createEntries(LiveData liveData, String idProperty, LiveDataQuer
private LiveDataConfiguration initConfig(String sourceId, List<String> properties, List<String> matchAll,
List<String> sort, List<Boolean> descending, long offset, int limit) throws LiveDataException
{
// Workaround for https://github.com/restlet/restlet-framework-java/issues/922 (JaxRs multivalue
// Workaround for https://github.com/restlet/restlet-framework-java/issues/922 (JaxRs multivalue
// query-params gives list with null element).
List<String> actualProperties = properties.stream().filter(Objects::nonNull).collect(Collectors.toList());
List<String> actualMatchAll = matchAll.stream().filter(Objects::nonNull).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Optional;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
Expand All @@ -36,13 +35,12 @@

/**
* Default implementation of {@link LiveDataEntryPropertyResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataEntryPropertyResource")
@Singleton
public class DefaultLiveDataEntryPropertyResource extends AbstractLiveDataResource
implements LiveDataEntryPropertyResource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Optional;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
Expand All @@ -38,13 +37,12 @@

/**
* Default implementation of {@link LiveDataEntryResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataEntryResource")
@Singleton
public class DefaultLiveDataEntryResource extends AbstractLiveDataResource implements LiveDataEntryResource
{
@Override
Expand Down Expand Up @@ -78,7 +76,7 @@ public Response updateEntry(String sourceId, String namespace, String entryId, E
try {
values = entryStore.get(updatedEntryId.get());
} catch (UnsupportedOperationException e) {
// Returns a success response without an entity when the entry store does not implement the get
// Returns a success response without an entity when the entry store does not implement the get
// operation (for instance the liveTable source).
return Response.status(Status.ACCEPTED).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.stream.Collectors;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

Expand All @@ -45,13 +44,12 @@

/**
* Default implementation of {@link LiveDataPropertiesResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataPropertiesResource")
@Singleton
public class DefaultLiveDataPropertiesResource extends AbstractLiveDataResource implements LiveDataPropertiesResource
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Optional;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
Expand All @@ -36,13 +35,12 @@

/**
* Default implementation of {@link LiveDataPropertyResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataPropertyResource")
@Singleton
public class DefaultLiveDataPropertyResource extends AbstractLiveDataResource implements LiveDataPropertyResource
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Optional;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

Expand All @@ -36,13 +35,12 @@

/**
* Default implementation of {@link LiveDataPropertyTypeResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataPropertyTypeResource")
@Singleton
public class DefaultLiveDataPropertyTypeResource extends AbstractLiveDataResource
implements LiveDataPropertyTypeResource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.stream.Collectors;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

Expand All @@ -43,13 +42,12 @@

/**
* Default implementation of {@link LiveDataPropertyTypesResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataPropertyTypesResource")
@Singleton
public class DefaultLiveDataPropertyTypesResource extends AbstractLiveDataResource
implements LiveDataPropertyTypesResource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Optional;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

Expand All @@ -34,13 +33,12 @@

/**
* Default implementation of {@link LiveDataSourceResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataSourceResource")
@Singleton
public class DefaultLiveDataSourceResource extends AbstractLiveDataResource implements LiveDataSourceResource
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.stream.Collectors;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

Expand All @@ -38,13 +37,12 @@

/**
* Default implementation of {@link LiveDataSourcesResource}.
*
*
* @version $Id$
* @since 12.10
*/
@Component
@Named("org.xwiki.livedata.internal.rest.DefaultLiveDataSourcesResource")
@Singleton
public class DefaultLiveDataSourcesResource extends AbstractLiveDataResource implements LiveDataSourcesResource
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response.Status;

Expand All @@ -47,13 +46,12 @@

/**
* Default implementation of {@link PageChannelsResource}.
*
*
* @version $Id$
* @since 13.9RC1
*/
@Component
@Named("org.xwiki.netflux.internal.rest.DefaultPageChannelsResource")
@Singleton
public class DefaultPageChannelsResource extends XWikiResource implements PageChannelsResource
{
private static final String PATH_SEPARATOR = "/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package org.xwiki.repository.internal.resources;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
Expand All @@ -41,7 +40,6 @@
@Component
@Named("org.xwiki.repository.internal.resources.ExtensionRESTResource")
@Path(Resources.EXTENSION)
@Singleton
public class ExtensionRESTResource extends AbstractExtensionRESTResource
{
@GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
Expand Down Expand Up @@ -77,7 +76,6 @@
@Component
@Named("org.xwiki.repository.internal.resources.ExtensionVersionFileRESTResource")
@Path(Resources.EXTENSION_VERSION_FILE)
@Singleton
public class ExtensionVersionFileRESTResource extends AbstractExtensionRESTResource
{
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package org.xwiki.repository.internal.resources;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
Expand All @@ -41,7 +40,6 @@
@Component
@Named("org.xwiki.repository.internal.resources.ExtensionVersionRESTResource")
@Path(Resources.EXTENSION_VERSION)
@Singleton
public class ExtensionVersionRESTResource extends AbstractExtensionRESTResource
{
@GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.Map;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
Expand All @@ -55,7 +54,6 @@
@Component
@Named("org.xwiki.repository.internal.resources.ExtensionVersionsRESTResource")
@Path(Resources.EXTENSION_VERSIONS)
@Singleton
public class ExtensionVersionsRESTResource extends AbstractExtensionRESTResource
{
@GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package org.xwiki.repository.internal.resources;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
Expand All @@ -40,7 +39,6 @@
@Component
@Named("org.xwiki.repository.internal.resources.ExtensionsRESTResource")
@Path(Resources.EXTENSIONS)
@Singleton
public class ExtensionsRESTResource extends AbstractExtensionRESTResource
{
@GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package org.xwiki.repository.internal.resources;

import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

Expand All @@ -36,7 +35,6 @@
@Component
@Named("org.xwiki.repository.internal.resources.RepositoryRESTResource")
@Path(Resources.ENTRYPOINT)
@Singleton
public class RepositoryRESTResource extends AbstractExtensionRESTResource
{
/**
Expand Down
Loading

0 comments on commit 66ff70c

Please sign in to comment.