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;
}
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();
}
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;
}
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();
}
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);
}
}
Aggregations