Skip to content

Commit

Permalink
add requestId
Browse files Browse the repository at this point in the history
  • Loading branch information
aaggarwal committed May 18, 2020
1 parent 4deb5b2 commit cb25a30
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.function.Function;

import javax.ws.rs.core.MultivaluedHashMap;
Expand Down Expand Up @@ -66,7 +67,7 @@ public class RequestScope implements com.yahoo.elide.security.RequestScope {

//TODO - this ought to be read only and set in the constructor.
@Getter @Setter private EntityProjection entityProjection;

private final String requestId;
private final Map<String, FilterExpression> expressionsByType;

private PublishSubject<CRUDEvent> lifecycleEvents;
Expand Down Expand Up @@ -118,6 +119,7 @@ public RequestScope(String path,
this.newPersistentResources = new LinkedHashSet<>();
this.dirtyResources = new LinkedHashSet<>();
this.deletedResources = new LinkedHashSet<>();
this.requestId = UUID.randomUUID().toString();

Function<RequestScope, PermissionExecutor> permissionExecutorGenerator = elideSettings.getPermissionExecutor();
this.permissionExecutor = (permissionExecutorGenerator == null)
Expand Down Expand Up @@ -204,6 +206,7 @@ protected RequestScope(String path, String apiVersion,
this.distinctLifecycleEvents = outerRequestScope.distinctLifecycleEvents;
this.updateStatusCode = outerRequestScope.updateStatusCode;
this.queuedLifecycleEvents = outerRequestScope.queuedLifecycleEvents;
this.requestId = outerRequestScope.requestId;
}

public Set<com.yahoo.elide.security.PersistentResource> getNewResources() {
Expand Down

0 comments on commit cb25a30

Please sign in to comment.