corefx updates to account for latest protobuf file
This commit is contained in:
parent
0692ab6f68
commit
c7ce0e47f4
1 changed files with 18 additions and 20 deletions
|
@ -6,7 +6,6 @@ import com.core.client.rest.ServiceFile;
|
||||||
import com.core.client.rest.WlanConfig;
|
import com.core.client.rest.WlanConfig;
|
||||||
import com.core.data.*;
|
import com.core.data.*;
|
||||||
import com.core.ui.dialogs.MobilityPlayerDialog;
|
import com.core.ui.dialogs.MobilityPlayerDialog;
|
||||||
import com.google.protobuf.ByteString;
|
|
||||||
import io.grpc.Context;
|
import io.grpc.Context;
|
||||||
import io.grpc.ManagedChannel;
|
import io.grpc.ManagedChannel;
|
||||||
import io.grpc.ManagedChannelBuilder;
|
import io.grpc.ManagedChannelBuilder;
|
||||||
|
@ -15,7 +14,6 @@ import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -38,8 +36,8 @@ public class CoreGrpcClient implements ICoreClient {
|
||||||
|
|
||||||
private CoreProto.Node nodeToProto(CoreNode node) {
|
private CoreProto.Node nodeToProto(CoreNode node) {
|
||||||
CoreProto.Position position = CoreProto.Position.newBuilder()
|
CoreProto.Position position = CoreProto.Position.newBuilder()
|
||||||
.setX(node.getPosition().getX().floatValue())
|
.setX(node.getPosition().getX().intValue())
|
||||||
.setY(node.getPosition().getY().floatValue())
|
.setY(node.getPosition().getY().intValue())
|
||||||
.build();
|
.build();
|
||||||
CoreProto.Node.Builder builder = CoreProto.Node.newBuilder()
|
CoreProto.Node.Builder builder = CoreProto.Node.newBuilder()
|
||||||
.addAllServices(node.getServices())
|
.addAllServices(node.getServices())
|
||||||
|
@ -90,31 +88,31 @@ public class CoreGrpcClient implements ICoreClient {
|
||||||
unidirectional = true;
|
unidirectional = true;
|
||||||
}
|
}
|
||||||
if (options.getBandwidth() != null) {
|
if (options.getBandwidth() != null) {
|
||||||
builder.setBandwidth(options.getBandwidth().floatValue());
|
builder.setBandwidth(options.getBandwidth().intValue());
|
||||||
}
|
}
|
||||||
if (options.getBurst() != null) {
|
if (options.getBurst() != null) {
|
||||||
builder.setBurst(options.getBurst().floatValue());
|
builder.setBurst(options.getBurst().intValue());
|
||||||
}
|
}
|
||||||
if (options.getDelay() != null) {
|
if (options.getDelay() != null) {
|
||||||
builder.setDelay(options.getDelay().floatValue());
|
builder.setDelay(options.getDelay().intValue());
|
||||||
}
|
}
|
||||||
if (options.getDup() != null) {
|
if (options.getDup() != null) {
|
||||||
builder.setDup(options.getDup().floatValue());
|
builder.setDup(options.getDup().intValue());
|
||||||
}
|
}
|
||||||
if (options.getJitter() != null) {
|
if (options.getJitter() != null) {
|
||||||
builder.setJitter(options.getJitter().floatValue());
|
builder.setJitter(options.getJitter().intValue());
|
||||||
}
|
}
|
||||||
if (options.getMburst() != null) {
|
if (options.getMburst() != null) {
|
||||||
builder.setMburst(options.getMburst().floatValue());
|
builder.setMburst(options.getMburst().intValue());
|
||||||
}
|
}
|
||||||
if (options.getMer() != null) {
|
if (options.getMer() != null) {
|
||||||
builder.setMer(options.getMer().floatValue());
|
builder.setMer(options.getMer().intValue());
|
||||||
}
|
}
|
||||||
if (options.getPer() != null) {
|
if (options.getPer() != null) {
|
||||||
builder.setPer(options.getPer().floatValue());
|
builder.setPer(options.getPer().intValue());
|
||||||
}
|
}
|
||||||
if (options.getKey() != null) {
|
if (options.getKey() != null) {
|
||||||
builder.setKey(options.getKey().toString());
|
builder.setKey(options.getKey());
|
||||||
}
|
}
|
||||||
if (options.getOpaque() != null) {
|
if (options.getOpaque() != null) {
|
||||||
builder.setOpaque(options.getOpaque());
|
builder.setOpaque(options.getOpaque());
|
||||||
|
@ -196,8 +194,8 @@ public class CoreGrpcClient implements ICoreClient {
|
||||||
options.setJitter((double) protoOptions.getJitter());
|
options.setJitter((double) protoOptions.getJitter());
|
||||||
options.setPer((double) protoOptions.getPer());
|
options.setPer((double) protoOptions.getPer());
|
||||||
options.setBurst((double) protoOptions.getBurst());
|
options.setBurst((double) protoOptions.getBurst());
|
||||||
if (!protoOptions.getKey().isEmpty()) {
|
if (protoOptions.hasField(CoreProto.LinkOptions.getDescriptor().findFieldByName("key"))) {
|
||||||
options.setKey(Integer.parseInt(protoOptions.getKey()));
|
options.setKey(protoOptions.getKey());
|
||||||
}
|
}
|
||||||
options.setMburst((double) protoOptions.getMburst());
|
options.setMburst((double) protoOptions.getMburst());
|
||||||
options.setMer((double) protoOptions.getMer());
|
options.setMer((double) protoOptions.getMer());
|
||||||
|
@ -784,8 +782,8 @@ public class CoreGrpcClient implements ICoreClient {
|
||||||
@Override
|
@Override
|
||||||
public boolean editNode(CoreNode node) throws IOException {
|
public boolean editNode(CoreNode node) throws IOException {
|
||||||
CoreProto.Position position = CoreProto.Position.newBuilder()
|
CoreProto.Position position = CoreProto.Position.newBuilder()
|
||||||
.setX(node.getPosition().getX().floatValue())
|
.setX(node.getPosition().getX().intValue())
|
||||||
.setY(node.getPosition().getY().floatValue())
|
.setY(node.getPosition().getY().intValue())
|
||||||
.build();
|
.build();
|
||||||
CoreProto.EditNodeRequest request = CoreProto.EditNodeRequest.newBuilder()
|
CoreProto.EditNodeRequest request = CoreProto.EditNodeRequest.newBuilder()
|
||||||
.setSessionId(sessionId)
|
.setSessionId(sessionId)
|
||||||
|
@ -1104,13 +1102,13 @@ public class CoreGrpcClient implements ICoreClient {
|
||||||
}
|
}
|
||||||
CoreProto.Position.Builder positionBuilder = CoreProto.Position.newBuilder();
|
CoreProto.Position.Builder positionBuilder = CoreProto.Position.newBuilder();
|
||||||
if (config.getPosition().getX() != null) {
|
if (config.getPosition().getX() != null) {
|
||||||
positionBuilder.setX(config.getPosition().getX().floatValue());
|
positionBuilder.setX(config.getPosition().getX().intValue());
|
||||||
}
|
}
|
||||||
if (config.getPosition().getY() != null) {
|
if (config.getPosition().getY() != null) {
|
||||||
positionBuilder.setY(config.getPosition().getY().floatValue());
|
positionBuilder.setY(config.getPosition().getY().intValue());
|
||||||
}
|
}
|
||||||
if (config.getPosition().getZ() != null) {
|
if (config.getPosition().getZ() != null) {
|
||||||
positionBuilder.setZ(config.getPosition().getZ().floatValue());
|
positionBuilder.setZ(config.getPosition().getZ().intValue());
|
||||||
}
|
}
|
||||||
if (config.getLocation().getLongitude() != null) {
|
if (config.getLocation().getLongitude() != null) {
|
||||||
positionBuilder.setLon(config.getLocation().getLongitude().floatValue());
|
positionBuilder.setLon(config.getLocation().getLongitude().floatValue());
|
||||||
|
|
Loading…
Add table
Reference in a new issue