com.newegg.marketplace.sdk.seller.SellerConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-seller Show documentation
Show all versions of sdk-seller Show documentation
The Seller Management service group contains functions that will allow you to get reference information you may need to use some of the functions in Newegg API.
package com.newegg.marketplace.sdk.seller;
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.logging.log4j.LogManager;
import com.newegg.marketplace.sdk.common.APIConfig;
import feign.Logger;
import feign.Retryer;
/**
Copyright (c) 2000-present, Newegg Inc.
Licensed 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.
*/
/**
* configure of library
* @author QB
*
*/
public class SellerConfig extends APIConfig{
private org.apache.logging.log4j.Logger log = LogManager.getLogger(SellerConfig.class);
public SellerConfig() throws ConfigurationException {
super();
load();
}
private void load() {
log.info("Load Seller Properties");
Configuration config=this.getConfig();
Variables.SimulationEnabled = config.getBoolean("newegg.seller.simulation");
Variables.Retryer = new Retryer.Default(config.getInt("newegg.seller.retry.period"),
config.getInt("newegg.seller.retry.maxperiod"), config.getInt("newegg.seller.retry.maxattempts"));
Variables.LogLevel=Logger.Level.valueOf(config.getString("newegg.seller.loglevel"));
}
}