org.elasticsearch.common.inject.Inject类的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.elasticsearch.common.inject.Inject类的一些代码示例,展示了Inject类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Inject类的具体详情如下:
包路径:org.elasticsearch.common.inject.Inject
类名称:Inject

Inject介绍

暂无

代码示例

代码示例来源:origin: richardwilly98/elasticsearch-river-mongodb

@Inject
public RestMongoDBRiverAction(Settings settings, Client esClient, RestController controller, @RiverIndexName String riverIndexName) {
  super(settings, controller, esClient);
  this.riverIndexName = riverIndexName;
  String baseUrl = "/" + riverIndexName + "/" + MongoDBRiver.TYPE;
  logger.trace("RestMongoDBRiverAction - baseUrl: {}", baseUrl);
  controller.registerHandler(RestRequest.Method.GET, baseUrl + "/{action}", this);
  controller.registerHandler(RestRequest.Method.POST, baseUrl + "/{river}/{action}", this);
}

代码示例来源:origin: medcl/elasticsearch-analysis-ik

@Inject
public Configuration(Environment env,Settings settings) {
  this.environment = env;
  this.settings=settings;
  this.useSmart = settings.get("use_smart", "false").equals("true");
  this.enableLowercase = settings.get("enable_lowercase", "true").equals("true");
  this.enableRemoteDict = settings.get("enable_remote_dict", "true").equals("true");
  Dictionary.initial(this);
}

代码示例来源:origin: floragunncom/search-guard

@Inject
public TransportWhoAmIAction(final Settings settings,
    final ThreadPool threadPool, final ClusterService clusterService, final TransportService transportService,
    final AdminDNs adminDNs, final ActionFilters actionFilters, final IndexNameExpressionResolver indexNameExpressionResolver) {
  super(settings, WhoAmIAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, WhoAmIRequest::new);
  this.adminDNs = adminDNs;
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument-plugin

@Inject
public VertexiumQueryStringQueryParser(Settings settings) {
  this.defaultAnalyzeWildcard = settings.getAsBoolean("indices.query.query_string.analyze_wildcard", QueryParserSettings.DEFAULT_ANALYZE_WILDCARD);
  this.defaultAllowLeadingWildcard = settings.getAsBoolean("indices.query.query_string.allowLeadingWildcard", QueryParserSettings.DEFAULT_ALLOW_LEADING_WILDCARD);
  try {
    abstractFieldMapperContentTypeMethod = AbstractFieldMapper.class.getDeclaredMethod("contentType");
    abstractFieldMapperContentTypeMethod.setAccessible(true);
  } catch (NoSuchMethodException ex) {
    throw new RuntimeException("Could not find method 'contentType' on class " + AbstractFieldMapper.class.getName(), ex);
  }
}

代码示例来源:origin: sirensolutions/siren-join

@Inject
public RestCoordinateMultiSearchAction(final Settings settings, final RestController controller, final Client client) {
 super(settings, controller, client);
 controller.registerHandler(GET, "/_coordinate_msearch", this);
 controller.registerHandler(POST, "/_coordinate_msearch", this);
 controller.registerHandler(GET, "/{index}/_coordinate_msearch", this);
 controller.registerHandler(POST, "/{index}/_coordinate_msearch", this);
 controller.registerHandler(GET, "/{index}/{type}/_coordinate_msearch", this);
 controller.registerHandler(POST, "/{index}/{type}/_coordinate_msearch", this);
 this.allowExplicitIndex = settings.getAsBoolean("rest.action.multi.allow_explicit_index", true);
}

代码示例来源:origin: io.fabric8.insight/insight-elasticsearch-auth-plugin

@Inject
public HttpBasicServer(Settings settings, Environment environment, HttpServerTransport transport,
    RestController restController,
    NodeService nodeService) {
  super(settings, environment, transport, restController, nodeService);
  this.realm = settings.get("http.basic.realm", "karaf");
  this.roles = settings.getAsArray("http.basic.roles", new String[]{"admin", "manager", "viewer", "Monitor", "Operator", "Maintainer", "Deployer", "Auditor", "Administrator", "SuperUser"});
  this.log = settings.getAsBoolean("http.basic.log", false);
  Loggers.getLogger(getClass()).info("using realm: [{}] and authorized roles: [{}]",
      realm, roles);
}

代码示例来源:origin: salyh/elasticsearch-security-plugin

@Inject
public SecurityService(final Settings settings, final Client client,
    final RestController restController) {
  super(settings);
  this.settings = settings;
  this.restController = restController;
  this.client = client;
  securityConfigurationIndex = settings.get(
      "security.configuration.index", DEFAULT_SECURITY_CONFIG_INDEX);
  strictModeEnabled = settings.getAsBoolean(
      "security.strict", false);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Inject
public GatewayService(Settings settings, AllocationService allocationService, ClusterService clusterService,
           ThreadPool threadPool, GatewayMetaState metaState,
  } else {
    recoverAfterMasterNodes = settings.getAsInt("discovery.zen.minimum_master_nodes", -1);

代码示例来源:origin: spinscale/elasticsearch-suggest-plugin

@Inject public SuggestService(Settings settings, TransportSuggestRefreshAction suggestRefreshAction,
    ClusterService clusterService, IndicesService indicesService) {
  super(settings);
  this.suggestRefreshAction = suggestRefreshAction;
  this.clusterService = clusterService;
  this.indicesService = indicesService;
  suggestRefreshDisabled = settings.getAsBoolean("suggest.refresh_disabled", false);
  suggestRefreshInterval = settings.getAsTime("suggest.refresh_interval", TimeValue.timeValueMinutes(10));
}

代码示例来源:origin: elasticfence/elasticsearch-http-user-auth

@Inject
public AuthRestHandler(Settings settings, RestController restController, Client client) {
  super(settings);
  restController.registerHandler(GET, "/_httpuserauth", this);
  RestFilter filter = new AuthRestFilter(client, settings);
  restController.registerFilter(filter);
}

代码示例来源:origin: NLPchina/elasticsearch-analysis-ansj

@Inject
public AnsjAnalyzerProvider(IndexSettings indexSettings, @Assisted String name, @Assisted Settings settings) {
  super(indexSettings, name, settings);
  Settings settings2 = indexSettings.getSettings().getAsSettings("index.analysis.tokenizer." + name());
  Map<String, String> args = settings2.keySet().stream().collect(Collectors.toMap(k -> k, settings2::get));
  if (args.isEmpty()) {
    args.putAll(AnsjElasticConfigurator.getDefaults());
    args.put("type", name());
  }
  LOG.debug("instance analyzer settings : {}", args);
  analyzer = new AnsjAnalyzer(args);
}

代码示例来源:origin: org.elasticsearch/elasticsearch-lang-groovy

@Inject
public GroovyScriptEngineService(Settings settings) {
  super(settings);
  this.loader = new GroovyClassLoader(settings.getClassLoader());
}

代码示例来源:origin: org.elasticsearch/elasticsearch

InjectionPoint(TypeLiteral<?> type, Method method) {
  this.member = method;
  Inject inject = method.getAnnotation(Inject.class);
  this.optional = inject.optional();
  this.dependencies = forMember(method, type, method.getParameterAnnotations());
}

代码示例来源:origin: com.floragunn/search-guard

@Inject
public SearchGuardConfigService(final Settings settings, final Client client, final IndicesService indicesService) {
  super(settings);
  this.client = client;
  this.settings = settings;
  this.indicesService = indicesService;
  securityConfigurationIndex = settings.get(ConfigConstants.SEARCHGUARD_CONFIG_INDEX_NAME,
      ConfigConstants.DEFAULT_SECURITY_CONFIG_INDEX);
}

代码示例来源:origin: floragunncom/search-guard

@Inject
public TransportConfigUpdateAction(final Settings settings,
    final ThreadPool threadPool, final ClusterService clusterService, final TransportService transportService,
    final IndexBaseConfigurationRepository configurationRepository, final ActionFilters actionFilters, final IndexNameExpressionResolver indexNameExpressionResolver,
    Provider<BackendRegistry> backendRegistry) {
  
  super(settings, ConfigUpdateAction.NAME, threadPool, clusterService, transportService, actionFilters,
      indexNameExpressionResolver, ConfigUpdateRequest::new, TransportConfigUpdateAction.NodeConfigUpdateRequest::new,
      ThreadPool.Names.MANAGEMENT, ConfigUpdateNodeResponse.class);
  this.configurationRepository = configurationRepository;
  this.backendRegistry = backendRegistry;
}

代码示例来源:origin: com.floragunn/search-guard

@Inject
public WaffleAuthenticationBackend(final Settings settings, final IWindowsAuthProvider authProvider) {
  this.settings = settings;
  this.authProvider = authProvider;
  stripDomain = settings.getAsBoolean(ConfigConstants.SEARCHGUARD_AUTHENTICATION_WAFFLE_STRIP_DOMAIN, true);
  if (!OsUtils.WINDOWS) {
    throw new ElasticsearchException("Waffle works only on Windows operating system, not on " + System.getProperty("os.name"));
  }
}

代码示例来源:origin: harbby/presto-connectors

@Inject
public RestMultiPercolateAction(Settings settings, RestController controller, Client client) {
  super(settings, controller, client);
  controller.registerHandler(POST, "/_mpercolate", this);
  controller.registerHandler(POST, "/{index}/_mpercolate", this);
  controller.registerHandler(POST, "/{index}/{type}/_mpercolate", this);
  controller.registerHandler(GET, "/_mpercolate", this);
  controller.registerHandler(GET, "/{index}/_mpercolate", this);
  controller.registerHandler(GET, "/{index}/{type}/_mpercolate", this);
  this.allowExplicitIndex = settings.getAsBoolean("rest.action.multi.allow_explicit_index", true);
}

代码示例来源:origin: com.floragunn/search-guard

@Inject
public HTTPSpnegoAuthenticator(final Settings settings) {
  this.settings = settings;
  System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
  SecurityUtil.setSystemPropertyToAbsoluteFile("java.security.auth.login.config",
      settings.get(ConfigConstants.SEARCHGUARD_AUTHENTICATION_SPNEGO_LOGIN_CONFIG_FILEPATH));
  SecurityUtil.setSystemPropertyToAbsoluteFile("java.security.krb5.conf",
      settings.get(ConfigConstants.SEARCHGUARD_AUTHENTICATION_SPNEGO_KRB5_CONFIG_FILEPATH));
  this.loginContextName = settings.get(ConfigConstants.SEARCHGUARD_AUTHENTICATION_SPNEGO_LOGIN_CONFIG_NAME,
      "com.sun.security.jgss.krb5.accept");
  this.strip = settings.getAsBoolean(ConfigConstants.SEARCHGUARD_AUTHENTICATION_SPNEGO_STRIP_REALM, true);
}

代码示例来源:origin: graphaware/graph-aided-search

@Inject
public GraphAidedSearchFilter(final Settings settings) {
  super(settings);
  logger = Loggers.getLogger(GraphAidedSearchFilter.class.getName(), settings);
  order = settings.getAsInt(FILTER_ORDER_KEY_NAME, DEFAULT_FILTER_ORDER);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

InjectionPoint(TypeLiteral<?> type, Field field) {
  this.member = field;
  Inject inject = field.getAnnotation(Inject.class);
  this.optional = inject.optional();
  Annotation[] annotations = field.getAnnotations();
  Errors errors = new Errors(field);
  Key<?> key = null;
  try {
    key = Annotations.getKey(type.getFieldType(field), field, annotations, errors);
  } catch (ErrorsException e) {
    errors.merge(e.getErrors());
  }
  errors.throwConfigurationExceptionIfErrorsExist();
  this.dependencies = Collections.<Dependency<?>>singletonList(
    newDependency(key, Nullability.allowsNull(annotations), -1));
}

相关文章