Search in sources :

Example 1 with Server

use of com.reprezen.kaizen.oasparser.model3.Server in project cobigen by devonfw.

the class OpenAPIInputReader method extractServers.

/**
 * @param openApi document root
 * @return list of {@link ServerDef}'s
 */
private List<ServerDef> extractServers(OpenApi3 openApi) {
    List<ServerDef> servers = new LinkedList<>();
    ServerDef serv;
    for (Server server : openApi.getServers()) {
        serv = new ServerDef();
        serv.setDescription(server.getDescription());
        serv.setURI(server.getUrl());
        servers.add(serv);
    }
    return servers;
}
Also used : Server(com.reprezen.kaizen.oasparser.model3.Server) LinkedList(java.util.LinkedList) ServerDef(com.devonfw.cobigen.openapiplugin.model.ServerDef)

Example 2 with Server

use of com.reprezen.kaizen.oasparser.model3.Server in project ChatSystem by Dofmor.

the class ServerDriver method main.

public static void main(String[] args) {
    System.out.println("Enter an IP address: ");
    Scanner input = new Scanner(System.in);
    String ip = input.nextLine();
    ip = ip.trim();
    Server server = new Server(7777, "10.0.0.210");
    server.run();
}
Also used : Scanner(java.util.Scanner) Server(Server)

Example 3 with Server

use of com.reprezen.kaizen.oasparser.model3.Server in project ets-ogcapi-features10 by opengeospatial.

the class OpenApiUtils method findBasePath.

private static String findBasePath(OpenApi3 apiModel, URI iut) {
    String basePath = "/";
    List<Server> serverUrls = apiModel.getServers();
    for (Server serverUrl : serverUrls) {
        Matcher matcher = Pattern.compile(serverUrl.getUrl()).matcher(iut.toString());
        if (matcher.find()) {
            String path = iut.toString().substring(matcher.end(), iut.toString().length());
            if (!path.isEmpty()) {
                basePath = path;
            }
        }
    }
    return basePath;
}
Also used : Server(com.reprezen.kaizen.oasparser.model3.Server) Matcher(java.util.regex.Matcher)

Example 4 with Server

use of com.reprezen.kaizen.oasparser.model3.Server in project grpc-java by grpc.

the class ChannelzProtoUtil method toServer.

static Server toServer(InternalInstrumented<ServerStats> obj) {
    ServerStats stats = getFuture(obj.getStats());
    Server.Builder builder = Server.newBuilder().setRef(toServerRef(obj)).setData(toServerData(stats));
    for (InternalInstrumented<SocketStats> listenSocket : stats.listenSockets) {
        builder.addListenSocket(toSocketRef(listenSocket));
    }
    return builder.build();
}
Also used : Server(io.grpc.channelz.v1.Server) ServerStats(io.grpc.InternalChannelz.ServerStats) SocketStats(io.grpc.InternalChannelz.SocketStats)

Example 5 with Server

use of com.reprezen.kaizen.oasparser.model3.Server in project lighty-netconf-simulator by PANTHEONtech.

the class ResetActionProcessor method execute.

@SuppressWarnings({ "rawtypes", "unchecked", "checkstyle:IllegalCatch" })
@Override
protected CompletableFuture<Response> execute(final Element requestXmlElement, final ActionDefinition paramActionDefinition) {
    this.actionDefinition = paramActionDefinition;
    final XmlNodeConverter xmlNodeConverter = getNetconfDeviceServices().getXmlNodeConverter();
    try {
        final XmlElement xmlElement = XmlElement.fromDomElement(requestXmlElement);
        final Element actionElement = findInputElement(xmlElement, this.actionDefinition.getQName());
        final Reader readerFromElement = RPCUtil.createReaderFromElement(actionElement);
        final ContainerNode deserializedNode = (ContainerNode) xmlNodeConverter.deserialize(this.actionDefinition.getInput(), readerFromElement);
        final Input input = this.adapterSerializer.fromNormalizedNodeActionInput(Reset.class, deserializedNode);
        final String key = findNameElement(xmlElement);
        Preconditions.checkNotNull(key);
        final Class listItem = Server.class;
        final Identifier listKey = new ServerKey(key);
        final KeyedInstanceIdentifier<Server, ServerKey> keydIID = (KeyedInstanceIdentifier<Server, ServerKey>) InstanceIdentifier.create(Collections.singletonList(IdentifiableItem.of(listItem, listKey)));
        final ListenableFuture<RpcResult<Output>> outputFuture = this.resetAction.invoke(keydIID, input);
        final CompletableFuture<Response> completableFuture = new CompletableFuture<>();
        Futures.addCallback(outputFuture, new FutureCallback<RpcResult<Output>>() {

            @Override
            public void onSuccess(final RpcResult<Output> result) {
                final NormalizedNode domOutput = ResetActionProcessor.this.adapterSerializer.toNormalizedNodeActionOutput(Reset.class, result.getResult());
                final List<NormalizedNode> list = new ArrayList<>();
                list.add(domOutput);
                completableFuture.complete(new ResponseData(list));
            }

            @Override
            public void onFailure(final Throwable throwable) {
            }
        }, Executors.newSingleThreadExecutor());
        return completableFuture;
    } catch (final TransformerException | DocumentedException | DeserializationException e) {
        throw new RuntimeException(e);
    }
}
Also used : Server(org.opendaylight.yang.gen.v1.urn.example.data.center.rev180807.Server) XmlElement(org.opendaylight.netconf.api.xml.XmlElement) Element(org.w3c.dom.Element) Reader(java.io.Reader) DeserializationException(io.lighty.codecs.util.exception.DeserializationException) ServerKey(org.opendaylight.yang.gen.v1.urn.example.data.center.rev180807.ServerKey) Input(org.opendaylight.yang.gen.v1.urn.example.data.center.rev180807.server.reset.Input) CompletableFuture(java.util.concurrent.CompletableFuture) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) KeyedInstanceIdentifier(org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier) Identifier(org.opendaylight.yangtools.yang.binding.Identifier) DocumentedException(org.opendaylight.netconf.api.DocumentedException) Output(org.opendaylight.yang.gen.v1.urn.example.data.center.rev180807.server.reset.Output) ContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) List(java.util.List) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) Reset(org.opendaylight.yang.gen.v1.urn.example.data.center.rev180807.server.Reset) TransformerException(javax.xml.transform.TransformerException) ResponseData(io.lighty.netconf.device.response.ResponseData) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) Response(io.lighty.netconf.device.response.Response) XmlElement(org.opendaylight.netconf.api.xml.XmlElement) XmlNodeConverter(io.lighty.codecs.util.XmlNodeConverter) KeyedInstanceIdentifier(org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier)

Aggregations

Server (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Server)15 ServerInstance (org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)10 Context (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context)9 Factory (org.eclipse.jst.server.tomcat.core.internal.xml.Factory)8 IPath (org.eclipse.core.runtime.IPath)6 Host (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Host)6 FileInputStream (java.io.FileInputStream)5 IStatus (org.eclipse.core.runtime.IStatus)5 MultiStatus (org.eclipse.core.runtime.MultiStatus)5 Status (org.eclipse.core.runtime.Status)5 ArrayList (java.util.ArrayList)4 Connector (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Connector)4 Engine (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Engine)4 Listener (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Listener)4 Service (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Service)4 File (java.io.File)3 FileNotFoundException (java.io.FileNotFoundException)3 IOException (java.io.IOException)3 SAXException (org.xml.sax.SAXException)3 Operation (com.reprezen.kaizen.oasparser.model3.Operation)2