/* * Copyright (c) 2023 PANTHEON.tech s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.restconf.server.mdsal; import java.util.Optional; import javax.inject.Inject; import javax.inject.Singleton; import org.opendaylight.netconf.yanglib.writer.YangLibrarySchemaSourceUrlProvider; import org.opendaylight.restconf.nb.jaxrs.JaxRsRestconf; import org.opendaylight.restconf.nb.rfc8040.URLConstants; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri; import org.opendaylight.yangtools.yang.common.Revision; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; /** * Component composing schema source URL value on per YANG resource basis. * *
The URL is expected to be requested by {@link org.opendaylight.netconf.yanglib.writer.YangLibraryWriter
* YangLibraryWriter} when yang-library data is being constructed, only default module-set name ("ODL_modules")
* is supported. The composed URL for resource download expected to be served by
* {@link JaxRsRestconf#modulesYangGET(String, String, javax.ws.rs.container.AsyncResponse)} et al.
*/
@Singleton
@Component
public final class RestconfSchemaSourceUrlProvider implements YangLibrarySchemaSourceUrlProvider {
@Inject
@Activate
public RestconfSchemaSourceUrlProvider() {
// Visible for injection
}
@Override
public Optional