|
| 1 | +/* |
| 2 | + * Licensed to Elasticsearch under one or more contributor |
| 3 | + * license agreements. See the NOTICE file distributed with |
| 4 | + * this work for additional information regarding copyright |
| 5 | + * ownership. Elasticsearch licenses this file to you under |
| 6 | + * the Apache License, Version 2.0 (the "License"); you may |
| 7 | + * not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +package org.elasticsearch.client.security; |
| 21 | + |
| 22 | +/** |
| 23 | + * Enumeration of values that control the refresh policy for a request that |
| 24 | + * supports specifying a refresh policy. |
| 25 | + */ |
| 26 | +public enum RefreshPolicy { |
| 27 | + |
| 28 | + /** |
| 29 | + * Don't refresh after this request. The default. |
| 30 | + */ |
| 31 | + NONE("false"), |
| 32 | + /** |
| 33 | + * Force a refresh as part of this request. This refresh policy does not scale for high indexing or search throughput but is useful |
| 34 | + * to present a consistent view to for indices with very low traffic. And it is wonderful for tests! |
| 35 | + */ |
| 36 | + IMMEDIATE("true"), |
| 37 | + /** |
| 38 | + * Leave this request open until a refresh has made the contents of this request visible to search. This refresh policy is |
| 39 | + * compatible with high indexing and search throughput but it causes the request to wait to reply until a refresh occurs. |
| 40 | + */ |
| 41 | + WAIT_UNTIL("wait_for"); |
| 42 | + |
| 43 | + private final String value; |
| 44 | + |
| 45 | + RefreshPolicy(String value) { |
| 46 | + this.value = value; |
| 47 | + } |
| 48 | + |
| 49 | + public String getValue() { |
| 50 | + return value; |
| 51 | + } |
| 52 | + |
| 53 | + /** |
| 54 | + * Get the default refresh policy, which is <code>NONE</code> |
| 55 | + */ |
| 56 | + public static RefreshPolicy getDefault() { |
| 57 | + return RefreshPolicy.NONE; |
| 58 | + } |
| 59 | +} |
0 commit comments