aboutsummaryrefslogtreecommitdiffstats
path: root/generic-resource-api
AgeCommit message (Expand)AuthorFilesLines
2019-08-09Merge "Test case added for code coverage"Dan Timoney1-0/+28
2019-08-09Merge "Test case added for code coverage"Dan Timoney2-0/+61
2019-08-09Test case added for code coverageprakash.e1-0/+28
2019-08-09Test case added for code coverageprakash.e2-0/+61
2019-08-09Test case addition for SONAR coverageprakash.e9-16/+55
2019-08-07Roll version to recreate artifactsTimoney, Dan (dt5972)8-16/+16
2019-08-05Use release version of parent pomsTimoney, Dan (dt5972)8-8/+8
2019-07-31Network concurrency supportBrandon, Bruce (bb2697)9-21/+32
2019-07-26GR-API Yang change and add async supportBrandon, Bruce (bb2697)3-25/+401
2019-05-17Fixed Blocker BugsVasyl Razinkov1-244/+249
2019-04-30Update master for El Alto versioningTimoney, Dan (dt5972)8-16/+16
2019-04-24<
/*
 * ============LICENSE_START=======================================================
 * PNF-REGISTRATION-HANDLER
 * ================================================================================
 * Copyright (C) 2019 NOKIA 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.dcaegen2.services.prh.tasks;

import com.google.gson.JsonObject;
import io.vavr.collection.HashMap;
import io.vavr.collection.Map;
import org.onap.dcaegen2.services.prh.configuration.Config;
import org.onap.dcaegen2.services.prh.exceptions.AaiFailureException;
import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.model.bbs.ImmutableLogicalLink;
import org.onap.dcaegen2.services.prh.model.bbs.ImmutableRelationship;
import org.onap.dcaegen2.services.prh.model.bbs.ImmutableRelationshipWrapper;
import org.onap.dcaegen2.services.prh.model.bbs.RelationshipWrapper;
import org.onap.dcaegen2.services.prh.model.utils.GsonSerializer;
import org.onap.dcaegen2.services.prh.model.utils.HttpUtils;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.HttpResponse;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.ImmutableHttpRequest;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.RequestBody;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.RxHttpClient;
import org.onap.dcaegen2.services.sdk.rest.services.uri.URI.URIBuilder;
import org.onap.dcaegen2.services.sdk.security.ssl.SslFactory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;



import java.util.Arrays;
import java.util.List;
import java.util.function.Function;

import static org.onap.dcaegen2.services.sdk.rest.services.adapters.http.HttpMethod.PUT;

@Component
public class BbsActionsTaskImpl implements BbsActionsTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(BbsActionsTaskImpl.class);
    private static final String ATTACHMENT_POINT = "attachmentPoint";
    private static final String LOGICAL_LINK_URI = "/network/logical-links/logical-link/";
    private static final String PNF_URI = "/network/pnfs/pnf/";

    private final Config config;
    private final RxHttpClient httpClient;

    @Autowired
    BbsActionsTaskImpl(Config config) {
        this(config, RxHttpClient.create(new SslFactory().createInsecureClientContext()));
    }

    BbsActionsTaskImpl(Config config, RxHttpClient httpClient) {<
2-41971/+102510
2018-08-10Rename vlan-tags in connection-pointBrandon, Bruce (bb2697)1-1/+1
2018-08-09Fixed issues for connectivity attachment providershashikanth.vh1-2/+1
2018-08-03restore sriov-parametersSmokowski, Kevin (ks6305)1-0/+22
2018-08-02Merge "Add the request-action types"Dan Timoney1-0/+32
2018-07-30Add the request-action typesshashikanth.vh1-0/+32
2018-07-30Corrections for northboundgaurav3-2/+6
2018-07-27Merge "Add connection point and related to GR-API"Dan Timoney2-206/+230
2018-07-27Add connection point and related to GR-APIBrandon, Bruce (bb2697)2-206/+230
2018-07-27Add client code to generic-resource-apiTimoney, Dan (dt5972)2-2/+115
2018-07-26Generic resource API catch upBrandon, Bruce (bb2697)9-1121/+3064
2018-07-25Merge "Add the request-action types"Dan Timoney1-0/+24
2018-07-20Add the request-action typesgaurav1-0/+24
2018-07-20Adding testcases for new allotted resourcegaurav3-3/+289
o"><RelationshipWrapper> relationships = buildRelationLink(pnfName); return ImmutableLogicalLink .builder() .linkName(linkName) .linkType(ATTACHMENT_POINT) .relationshipList(relationships) .build(); } private List<RelationshipWrapper> buildRelationLink(String pnfName) { return Arrays.asList(ImmutableRelationshipWrapper .builder() .relationship(ImmutableRelationship .builder() .relatedLink(PNF_URI + pnfName) .build()) .build()); } private String buildLogicalLinkUri(String linkName) { return new URIBuilder() .scheme(config.getAaiClientConfiguration().aaiProtocol()) .host(config.getAaiClientConfiguration().aaiHost()) .port(config.getAaiClientConfiguration().aaiPort()) .path(config.getAaiClientConfiguration().aaiBasePath() + LOGICAL_LINK_URI + linkName) .build() .toString(); } }