org.apache.tinkerpop.gremlin.driver.RequestOptions Maven / Gradle / Ivy
The newest version!
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.tinkerpop.gremlin.driver;
import org.apache.tinkerpop.gremlin.util.message.RequestMessage;
import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.util.BytecodeHelper;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import static org.apache.tinkerpop.gremlin.util.Tokens.ARGS_BATCH_SIZE;
import static org.apache.tinkerpop.gremlin.util.Tokens.ARGS_EVAL_TIMEOUT;
import static org.apache.tinkerpop.gremlin.util.Tokens.ARGS_MATERIALIZE_PROPERTIES;
import static org.apache.tinkerpop.gremlin.util.Tokens.ARGS_USER_AGENT;
import static org.apache.tinkerpop.gremlin.util.Tokens.REQUEST_ID;
/**
* Options that can be supplied on a per request basis.
*
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public final class RequestOptions {
public static final RequestOptions EMPTY = RequestOptions.build().create();
private final Map aliases;
private final Map parameters;
private final Integer batchSize;
private final Long timeout;
private final UUID overrideRequestId;
private final String userAgent;
private final String language;
private final String materializeProperties;
private RequestOptions(final Builder builder) {
this.aliases = builder.aliases;
this.parameters = builder.parameters;
this.batchSize = builder.batchSize;
this.timeout = builder.timeout;
this.overrideRequestId = builder.overrideRequestId;
this.userAgent = builder.userAgent;
this.language = builder.language;
this.materializeProperties = builder.materializeProperties;
}
public Optional getOverrideRequestId() {
return Optional.ofNullable(overrideRequestId);
}
public Optional
© 2015 - 2025 Weber Informatics LLC | Privacy Policy