/*- * ============LICENSE_START======================================================= * ONAP - CCSDK * ================================================================================ * Copyright (C) 2018 Huawei Technologies Co., Ltd. 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.plugins.restconfdiscovery; import java.util.Map; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; /** * Abstraction of a plugin to enable discovery from DG. */ public interface SvcLogicDiscoveryPlugin extends SvcLogicJavaPlugin { /** * Allows directed graphs to establish a discovery subscription for a given subscriber. * @param paramMap HashMap of parameters passed by the DG to this function * * * * * * * * * * * * * * * * * * * * *
parameterMandatory/Optionaldescriptionexample values
templateDirNameOptionalfull path to YANG directory that can be used to build a request/sdncopt/bvc/resconfapi/test
establishSubscriptionURLMandatoryurl to establish connection with serverhttps://127.0.0.1:8181/restconf/operations/ietf-subscribed-notifications:establish-subscription
sseConnectURLMandatoryurl to setup SSE connection with serverhttps://127.0.0.1:8181/restconf/streams/yang-push-json
callbackDGMandatorycallback DG to process the received notificationResource-Discovery:handleSOTNTopology
filterURLOptionalurl which needs to be subscribed, if null subscribe to allhttp://example.com/sample-data/1.0
subscriptionTypeOptionaltype of subscription, periodic or onDataChangeonDataChange
updateFrequencyOptionalupdate frequency in milli seconds when subscription type is periodic1000
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
responsePrefixOptionallocation the notification response will be written to in context memorytmp.restconfdiscovery.result
skipSendingOptionaltrue or false
convertResponse Optionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
* @param ctx Reference to context memory * @throws SvcLogicException * @since 11.0.2 * @see String#split(String, int) */ void establishSubscription(Map paramMap, SvcLogicContext ctx) throws SvcLogicException; /** * Allows directed graphs to modify a discovery subscription for a given subscriber. * @param paramMap HashMap of parameters passed by the DG to this function * * * * * * * * * * * * * * * * * * * * * *
parameterMandatory/Optionaldescriptionexample values
subscriberIdMandatorysubscription subscriber's identifiertopologyId/1111
templateDirNameOptionalfull path to YANG directory that can be used to build a request/sdncopt/bvc/resconfapi/test
establishSubscriptionURLMandatoryurl to establish connection with serverhttps://127.0.0.1:8181/restconf/operations/ietf-subscribed-notifications:establish-subscription
sseConnectURLMandatoryurl to setup SSE connection with serverhttps://127.0.0.1:8181/restconf/streams/yang-push-json
callbackDGMandatorycallback DG to process the received notificationResource-Discovery:handleSOTNTopology
filterURLOptionalurl filter list which needs to be subscribed, if null subscribe to allhttp://example.com/sample-data/1.0
subscriptionTypeOptionaltype of subscription, periodic or onDataChangeonDataChange
updateFrequencyOptionalupdate frequency in milli seconds when subscription type is periodic1000
restapiUserOptionaluser name to use for http basic authenticationsdnc_ws
restapiPasswordOptionalunencrypted password to use for http basic authenticationplain_password
contentTypeOptionalhttp content type to set in the http headerusually application/json or application/xml
formatOptionalshould match request body formatjson or xml
responsePrefixOptionallocation the notification response will be written to in context memorytmp.restconfdiscovery.result
skipSendingOptionaltrue or false
convertResponse Optionalwhether the response should be convertedtrue or false
customHttpHeadersOptionala list additional http headers to be passed in, follow the format in the exampleX-CSI-MessageId=messageId,headerFieldName=headerFieldValue
dumpHeadersOptionalwhen true writes http header content to context memorytrue or false
* @param ctx Reference to context memory * @throws SvcLogicException * @since 11.0.2 * @see String#split(String, int) */ void modifySubscription(Map paramMap, SvcLogicContext ctx); /** * Allows directed graphs to delete the discovery subscription for a given subscriber. * @param paramMap HashMap of parameters passed by the DG to this function * * * * * *
parameterMandatory/Optionaldescriptionexample values
subscriberIdMandatorysubscription subscriber's identifiertopologyId/1111
* @param ctx Reference to context memory * @throws SvcLogicException */ void deleteSubscription(Map paramMap, SvcLogicContext ctx); }