Skip to content

Commit b219c6d

Browse files
committed
Rename Action adaptor
1 parent 1cc08fe commit b219c6d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/main/java/io/tinyauth/elasticsearch/actions/ActionIndexesAdaptor.java renamed to src/main/java/io/tinyauth/elasticsearch/ActionIndicesAdaptor.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/*
22
* Copyright 2017 tinyauth.io
3-
*
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
15+
*
1616
*/
1717

18-
package io.tinyauth.elasticsearch.actions;
18+
package io.tinyauth.elasticsearch;
1919

2020
import java.util.Arrays;
2121
import java.util.List;
@@ -47,11 +47,11 @@
4747
import org.elasticsearch.common.logging.Loggers;
4848

4949

50-
public class ActionIndexesAdaptor {
51-
private static final Logger logger = Loggers.getLogger(ActionIndexesAdaptor.class);
50+
public class ActionIndicesAdaptor {
51+
private static final Logger logger = Loggers.getLogger(ActionIndicesAdaptor.class);
5252
private ArrayList<Method> methods;
5353

54-
public ActionIndexesAdaptor() {
54+
public ActionIndicesAdaptor() {
5555
methods = new ArrayList<Method>();
5656

5757
for (Method m: this.getClass().getMethods()) {
@@ -70,15 +70,15 @@ public ActionIndexesAdaptor() {
7070
public Set<String> extractIndices(SearchRequest req) {
7171
logger.error("SearchRequest");
7272
Set<String> idxs = new HashSet<String>();
73-
Collections.addAll(idxs, req.indices());
73+
Collections.addAll(idxs, req.indices());
7474
return idxs;
7575
}
7676

7777
public Set<String> extractIndices(ActionRequest req) {
7878
logger.error("ActionRequest");
7979
return new HashSet<String>();
8080
}
81-
81+
8282
public Set<String> getIndices(ActionRequest req) {
8383
for (Method m: methods) {
8484
Class<?>[] c = m.getParameterTypes();
@@ -102,7 +102,7 @@ public Set<String> getIndices(ActionRequest req) {
102102
}
103103
}
104104
}
105-
105+
106106
logger.error("Unable to find adaptor for request");
107107
return new HashSet<String>();
108108
}

src/main/java/io/tinyauth/elasticsearch/Origin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
public class Origin {
2121
public static final String REST = "rest";
22-
public static final String INTERNAL_REST = "rest";
22+
public static final String INTERNAL_REST = "internal_rest";
2323
public static final String LOCAL = "local";
2424
}

src/main/java/io/tinyauth/elasticsearch/TinyauthActionFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
import io.tinyauth.elasticsearch.exceptions.ConnectionError;
8282
import io.tinyauth.elasticsearch.Constants;
8383
import io.tinyauth.elasticsearch.Origin;
84-
import io.tinyauth.elasticsearch.actions.*;
84+
import io.tinyauth.elasticsearch.ActionIndicesAdaptor;
8585

8686
import static org.elasticsearch.common.xcontent.XContentFactory.*;
8787

@@ -90,7 +90,7 @@
9090
public class TinyauthActionFilter extends AbstractComponent implements ActionFilter {
9191

9292
private static final Logger logger = Loggers.getLogger(TinyauthActionFilter.class);
93-
private static final ActionIndexesAdaptor indexExtractor = new ActionIndexesAdaptor();
93+
private static final ActionIndicesAdaptor indexExtractor = new ActionIndicesAdaptor();
9494

9595
private final ThreadPool threadPool;
9696

0 commit comments

Comments
 (0)