Skip to content

Commit

Permalink
moved classes to jersey packages
Browse files Browse the repository at this point in the history
  • Loading branch information
stillalex committed Jul 26, 2023
1 parent b2f72df commit 4017b23
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 21 deletions.
18 changes: 2 additions & 16 deletions solr/core/src/java/org/apache/solr/core/PluginBag.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
import org.apache.solr.common.SolrException;
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.handler.RequestHandlerBase;
import org.apache.solr.handler.admin.api.APIConfigProvider;
import org.apache.solr.handler.api.V2ApiUtils;
import org.apache.solr.handler.component.SearchComponent;
import org.apache.solr.jersey.APIConfigProvider;
import org.apache.solr.jersey.APIConfigProviderBinder;
import org.apache.solr.jersey.JerseyApplications;
import org.apache.solr.pkg.PackagePluginHolder;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.util.plugin.NamedListInitializedPlugin;
import org.apache.solr.util.plugin.PluginInfoInitialized;
import org.apache.solr.util.plugin.SolrCoreAware;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -294,20 +294,6 @@ public PluginHolder<T> put(String name, PluginHolder<T> plugin) {
return old;
}

static final class APIConfigProviderBinder extends AbstractBinder {

private final APIConfigProvider<?> cfgProvider;

public APIConfigProviderBinder(APIConfigProvider<?> cfgProvider) {
this.cfgProvider = cfgProvider;
}

@Override
protected void configure() {
bindFactory(cfgProvider).to(cfgProvider.getConfigClass());
}
}

void setDefault(String def) {
if (!registry.containsKey(def)) return;
if (this.def != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.handler.admin.api;
package org.apache.solr.jersey;

import org.apache.solr.handler.admin.api.APIConfigProvider.APIConfig;
import org.apache.solr.jersey.APIConfigProvider.APIConfig;
import org.glassfish.hk2.api.Factory;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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.solr.jersey;

import org.glassfish.hk2.utilities.binding.AbstractBinder;

/**
* Jersey binder for APIConfigProvider
*/
public class APIConfigProviderBinder extends AbstractBinder {

private final APIConfigProvider<?> cfgProvider;

public APIConfigProviderBinder(APIConfigProvider<?> cfgProvider) {
this.cfgProvider = cfgProvider;
}

@Override
protected void configure() {
bindFactory(cfgProvider).to(cfgProvider.getConfigClass());
}
}
7 changes: 4 additions & 3 deletions solr/core/src/test/org/apache/solr/core/PluginBagTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@

import java.util.Collection;
import java.util.List;

import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.api.ApiSupport;
import org.apache.solr.api.JerseyResource;
import org.apache.solr.core.PluginBag.APIConfigProviderBinder;
import org.apache.solr.handler.RequestHandlerBase;
import org.apache.solr.handler.admin.ConfigSetsHandler;
import org.apache.solr.handler.admin.api.APIConfigProvider;
import org.apache.solr.handler.admin.api.APIConfigProvider.APIConfig;
import org.apache.solr.handler.admin.api.CollectionPropertyAPI;
import org.apache.solr.handler.component.SearchComponent;
import org.apache.solr.handler.configsets.ListConfigSetsAPI;
import org.apache.solr.jersey.APIConfigProvider;
import org.apache.solr.jersey.APIConfigProvider.APIConfig;
import org.apache.solr.jersey.APIConfigProviderBinder;
import org.apache.solr.jersey.JerseyApplications;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestHandler;
Expand Down

0 comments on commit 4017b23

Please sign in to comment.