/*-
* ============LICENSE_START=======================================================
* ONAP : CCSDK
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
* 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.
* ============LICENSE_END=========================================================
*/
package org.onap.ccsdk.sli.core.slipluginutils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A SvcLogicJavaPlugin that generates DME2 proxy urls (for calling the DME2 ingress proxy) using
* parameters from context memory.
*/
public class DME2 implements SvcLogicJavaPlugin {
private static final Logger LOG = LoggerFactory.getLogger(DME2.class);
// the key for proxyUrl, which represents a CSV list of urls
static final String PROXY_URL_KEY = "proxyUrl";
static final String PROXY_URLS_VALUE_SEPARATOR = ",";
static final String AAF_USERNAME_KEY = "aafUserName";
static final String AAF_PASSWORD_KEY = "aafPassword";
static final String ENV_CONTEXT_KEY = "envContext";
static final String ROUTE_OFFER_KEY = "routeOffer";
static final String COMMON_SERVICE_VERSION_KEY = "commonServiceVersion";
static final String PARTNER_KEY = "partner";
static final String VERSION_KEY = "version";
static final String SERVICE_KEY = "service";
static final String SUBCONTEXT_KEY = "subContext";
static final String ENDPOINT_READ_TIMEOUT_KEY = "endpointReadTimeout";
static final String OUTPUT_PATH_KEY = "outputPath";
final String aafUserName;
final String aafPassword;
final String envContext;
final String routeOffer;
final String[] proxyUrls;
final String commonServiceVersion;
final String partner;
final String endpointReadTimeout;
Integer index;
public DME2(Properties properties) {
Iterator> it = properties.entrySet().iterator();
while (it.hasNext()) {
Entry