All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.servlet.GraphQLContext Maven / Gradle / Ivy

There is a newer version: 6.1.3
Show newest version
package graphql.servlet;

import javax.security.auth.Subject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Part;
import javax.websocket.server.HandshakeRequest;
import java.util.List;
import java.util.Map;
import java.util.Optional;

public class GraphQLContext {
    private HttpServletRequest httpServletRequest;
    private HandshakeRequest handshakeRequest;

    private Subject subject;
    private Map> files;

    public GraphQLContext(HttpServletRequest httpServletRequest, HandshakeRequest handshakeRequest, Subject subject) {
        this.httpServletRequest = httpServletRequest;
        this.handshakeRequest = handshakeRequest;
        this.subject = subject;
    }

    public GraphQLContext(HttpServletRequest httpServletRequest) {
        this(httpServletRequest, null, null);
    }

    public GraphQLContext(HandshakeRequest handshakeRequest) {
        this(null, handshakeRequest, null);
    }

    public GraphQLContext() {
        this(null, null, null);
    }

    public Optional getHttpServletRequest() {
        return Optional.ofNullable(httpServletRequest);
    }

    public Optional getSubject() {
        return Optional.ofNullable(subject);
    }

    public Optional getHandshakeRequest() {
        return Optional.ofNullable(handshakeRequest);
    }

    public Optional>> getFiles() {
        return Optional.ofNullable(files);
    }

    public void setFiles(Map> files) {
        this.files = files;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy