graphql.servlet.GraphQLContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphql-java-servlet Show documentation
Show all versions of graphql-java-servlet Show documentation
relay.js-compatible GraphQL servlet
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