当前位置: 首页>>代码示例>>Java>>正文


Java JsonObject.getString方法代码示例

本文整理汇总了Java中io.vertx.core.json.JsonObject.getString方法的典型用法代码示例。如果您正苦于以下问题:Java JsonObject.getString方法的具体用法?Java JsonObject.getString怎么用?Java JsonObject.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vertx.core.json.JsonObject的用法示例。

在下文中一共展示了JsonObject.getString方法的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: create

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
@Override
public Single<JsonObject> create(JsonObject item) {
  if (item == null) {
    return Single.error(new IllegalArgumentException("The item must not be null"));
  }
  if (item.getString("name") == null || item.getString("name").isEmpty()) {
    return Single.error(new IllegalArgumentException("The name must not be null or empty"));
  }
  if (item.getInteger("stock", 0) < 0) {
    return Single.error(new IllegalArgumentException("The stock must greater or equal to 0"));
  }
  if (item.containsKey("id")) {
    return Single.error(new IllegalArgumentException("The created item already contains an 'id'"));
  }

  return db.rxGetConnection()
    .flatMap(conn -> {
      JsonArray params = new JsonArray().add(item.getValue("name")).add(item.getValue("stock", 0));
      return conn
        .rxUpdateWithParams(INSERT, params)
        .map(ur -> item.put("id", ur.getKeys().getLong(0)))
        .doAfterTerminate(conn::close);
    });
}
 
开发者ID:cescoffier,项目名称:various-vertx-demos,代码行数:25,代码来源:JdbcProductStore.java


示例2: AuthMgr

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
public AuthMgr(JsonObject conf,AppContain app){
	
	this.authenticationUrl = conf.getString("authentication");
	this.authorisationUrl = conf.getString("authorisation");
	this.mainpage = conf.getString("mainpage");
	this.successFiled = conf.getString("successfield","userid");
	this.loginpage = conf.getString("loginpage");
	
	String authapp = conf.getString("app");
			
	String sufix = conf.getString("exclude.end");		
	String noauthpath = conf.getString("exclude.start");	
	this.setNotAuthSufix(sufix);
	this.setNoAuthPaths(noauthpath);
	if(S.isNotBlank(this.loginpage))
		this.addNoAuthPath(this.loginpage);
	
	this.authApp = app.getAppInfo(authapp);		
	
	this.authenticationUrl = this.authApp.offsetUrl(this.authenticationUrl);
	this.authorisationUrl = this.authApp.offsetUrl(this.authorisationUrl);

	this.authProvider = new GateAuthProvider(this);
	
	
}
 
开发者ID:troopson,项目名称:etagate,代码行数:27,代码来源:AuthMgr.java


示例3: generate

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
public void generate(Message<JsonObject> message) {
    JsonObject metadata = message.body();
    String build = metadata.getString("build", "maven");
    String language = metadata.getString("language", "java");
    //Act as a activation flags in .gitignore
    metadata.put(build, true);
    metadata.put(language, true);
    String baseDir = metadata.getString("baseDir");
    CompositeFuture.all(
        generateFile(metadata, baseDir, BUILD.get(build)),
        generateFile(metadata, baseDir, LANGUAGES.get(language)),
        generateFile(metadata, baseDir, ".gitignore"),
        generateFile(metadata, baseDir, ".editorconfig")
    ).setHandler(ar -> {
        if (ar.failed()) {
            log.error("Impossible to generate project {} : {}", metadata, ar.cause().getMessage());
            message.fail(500, ar.cause().getMessage());
        } else {
            message.reply(null);
        }
    });
}
 
开发者ID:danielpetisme,项目名称:vertx-forge,代码行数:23,代码来源:ProjectGeneratorService.java


示例4: computeResponse

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
private void computeResponse(RoutingContext rc) {
    JsonObject json = rc.getBodyAsJson();
    String name = json.getString("name");
    Double price = prices.computeIfAbsent(name, k -> (double) random.nextInt(50));
    Integer q = Integer.parseInt(json.getString("quantity", "1"));
    rc.response().end(new JsonObject()
        .put("name", name)
        .put("price", price)
        .put("quantity", json.getString("quantity", "1"))
        .put("total", "" + (price * q))
        .encodePrettily());
}
 
开发者ID:cescoffier,项目名称:vertx-chtijug-2017,代码行数:13,代码来源:PricerVerticle.java


示例5: addToList

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
private void addToList(RoutingContext rc) {
    JsonObject json = rc.getBodyAsJson();
    String name = json.getString("name");
    Integer quantity = json
        .getInteger("quantity", 1);

    client.hset(KEY, name, quantity.toString(), x -> {
        getList(rc);
    });
}
 
开发者ID:cescoffier,项目名称:vertx-chtijug-2017,代码行数:11,代码来源:ShoppingBackend.java


示例6: sell

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
@Override
public void sell(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) {
    if (amount <= 0) {
        resultHandler.handle(Future.failedFuture("Cannot sell " + quote.getString("name") + " - the amount must be " +
            "greater than 0"));
        return;
    }

    double price = amount * quote.getDouble("bid");
    String name = quote.getString("name");
    int current = portfolio.getAmount(name);
    // 1) do we have enough stocks
    if (current >= amount) {
        // Yes, sell it
        int newAmount = current - amount;
        if (newAmount == 0) {
            portfolio.getShares().remove(name);
        } else {
            portfolio.getShares().put(name, newAmount);
        }
        portfolio.setCash(portfolio.getCash() + price);
        sendActionOnTheEventBus("SELL", amount, quote, newAmount);
        resultHandler.handle(Future.succeededFuture(portfolio));
    } else {
        resultHandler.handle(Future.failedFuture("Cannot sell " + amount + " of " + name + " - " + "not enough stocks " +
            "in portfolio"));
    }

}
 
开发者ID:cescoffier,项目名称:vertx-kubernetes-workshop,代码行数:30,代码来源:PortfolioServiceImpl.java


示例7: handleMsg

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
@Override
public void handleMsg(Buffer data) {
    JsonObject j = data.toJsonObject();
    String msgType = j.getString(GossipMessageFactory.KEY_MSG_TYPE);
    String _data = j.getString(GossipMessageFactory.KEY_DATA);
    String cluster = j.getString(GossipMessageFactory.KEY_CLUSTER);
    String from = j.getString(GossipMessageFactory.KEY_FROM);
    if (StringUtil.isNullOrEmpty(cluster) || !GossipManager.getInstance().getCluster().equals(cluster)) {
        LOGGER.error("This message shouldn't exist my world!" + data.toString());
        return;
    }
    MessageHandler handler = null;
    MessageType type = MessageType.valueOf(msgType);
    if (type == MessageType.SYNC_MESSAGE) {
        handler = new SyncMessageHandler();
    } else if (type == MessageType.ACK_MESSAGE) {
        handler = new AckMessageHandler();
    } else if (type == MessageType.ACK2_MESSAGE) {
        handler = new Ack2MessageHandler();
    } else if (type == MessageType.SHUTDOWN) {
        handler = new ShutdownMessageHandler();
    } else {
        LOGGER.error("Not supported message type");
    }
    if (handler != null) {
        handler.handle(cluster, _data, from);
    }
}
 
开发者ID:monkeymq,项目名称:jgossip,代码行数:29,代码来源:UDPMsgService.java


示例8: getRecord

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
static Record getRecord(final JsonObject config) {
    /** Config Verify **/
    Fn.flingUp(() -> Fn.shuntZero(() -> Ruler.verify(Key.RULE_KEY, config), config),
            LOGGER);
    // Connect remote etcd to check service
    final ConcurrentMap<String, Record> registryData = ORIGIN.getRegistryData();
    final String name = config.getString(Key.NAME);
    final String address = config.getString(Key.ADDR);
    LOGGER.debug(Info.RPC_SERVICE, name, address);
    // Empty Found
    Fn.flingWeb(registryData.values().isEmpty(), LOGGER,
            _424RpcServiceException.class, RpcHelper.class,
            name, address);

    // Service status checking
    final RxHod container = new RxHod();
    // Lookup Record instance
    Observable.fromIterable(registryData.values())
            .filter(Objects::nonNull)
            .filter(item -> StringUtil.notNil(item.getName()))
            .filter(item -> name.equals(item.getName()) &&
                    address.equals(item.getMetadata().getString(Key.PATH)))
            .subscribe(container::add);
    // Service Not Found
    Fn.flingWeb(!container.successed(), LOGGER,
            _424RpcServiceException.class, RpcHelper.class,
            name, address);
    // Address Not Found
    Fn.flingWeb(!container.successed(), LOGGER,
            _424RpcServiceException.class, RpcHelper.class,
            name, address);
    final Record record = container.get();
    LOGGER.debug(Info.RPC_FOUND, record.toJson());
    return container.get();
}
 
开发者ID:silentbalanceyh,项目名称:vertx-zero,代码行数:36,代码来源:RpcHelper.java


示例9: FakeSourceImpl

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public FakeSourceImpl(JsonObject json) {
  super(Flowable.fromIterable(
    json.getJsonArray("items").getList()).map(Data::new)
  );
  name = json.getString("name");
}
 
开发者ID:cescoffier,项目名称:fluid,代码行数:8,代码来源:FakeSource2Factory.java


示例10: alipayRefund

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
/**
 * 支付宝退款接口;
 *
 * @param bizContent   支付宝退款接口的业务内容请求JSON实例
 * @param acc      企业用户账户对象
 * 异步返回 是否调用成功
 *
 * @author Leibniz
 */
public void alipayRefund(RefundBizContent bizContent, JsonObject acc, String successUrl, Handler<Boolean> callback) {
    String bizContentStr = bizContent.toString(); // 将参数bizContent转成字符串

    // 检查bizContent是否合法
    if (!bizContent.checkParameters()) {
        throw new IllegalArgumentException("错误的支付宝退款接口请求业务JSON:" + bizContentStr); // 抛出异常
    }

    String notifyUrl = zfbPayNotifyUrl; // 服务器后台回调通知的url
    AliAccountInfo aliAccountInfo = new AliAccountInfo(acc.getString(ZFBAPPID), acc.getString(ZFBPRIVKEY), acc.getString(ZFBPUBKEY), successUrl, notifyUrl, null); // 该对象保存了支付宝账号的相关信息,以及请求回调地址
    AlipayClient alipayClient = AliPayCliFactory.getAlipayClient(aliAccountInfo); // 获取支付宝连接
    AlipayTradeRefundRequest request = new AlipayTradeRefundRequest(); // 创建退款请求
    request.setBizContent(bizContentStr); // 设置请求的bizContent
    AlipayTradeRefundResponse response = null;

    try {
        response = alipayClient.execute(request); // 发送退款请求并获得响应
    } catch (AlipayApiException e) { // 捕捉异常
        log.error("调用支付宝退款接口时抛出异常,请求的JSON:" + bizContentStr, e); // 打日志
    }

    // 判断是否有响应
    if (response != null) { // 响应成功
        // 判断退款是否成功
        if (response.isSuccess()) { // 退款成功
            log.info("调用成功"); // 打日志
            callback.handle(true);
            // 退款成功,其他都是错
        } else { // 退款失败
            log.error("调用支付宝退款接口错误,code={},msg={},sub_code={},sub_msg={}", response.getCode(), response.getMsg(), response.getSubCode(), response.getSubMsg()); // 打日志
            callback.handle(false);
        }
    } else { // 响应失败
        log.error("调用支付宝退款接口时发生异常,返回响应对象为null!{}", bizContentStr); // 打日志
        callback.handle(false);
    }
}
 
开发者ID:Leibnizhu,项目名称:AlipayWechatPlatform,代码行数:47,代码来源:AlipayPayService.java


示例11: create

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
@Override
public <T> Single<Source<T>> create(Vertx vertx, JsonObject json) {
    String address = json.getString("address");
    if (address == null) {
        String name = json.getString("name");
        if (name != null) {
            json.put("address", name);
        } else {
            throw new IllegalArgumentException("Either address or name must be set");
        }
    }
    return Single.just(new EventBusSource<>(vertx, json));

}
 
开发者ID:cescoffier,项目名称:fluid,代码行数:15,代码来源:EventBusSourceFactory.java


示例12: CamelSink

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
public CamelSink(JsonObject config) {
    endpoint = config.getString("endpoint");
    camelContext = new DefaultCamelContext();
    try {
        camelContext.start();
        producerTemplate = camelContext.createProducerTemplate();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:cescoffier,项目名称:fluid,代码行数:11,代码来源:CamelSink.java


示例13: parseSubMenus

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
protected void parseSubMenus (Menu menu, JsonArray jsonArray) {
    for (int i = 0; i < jsonArray.size(); i++) {
        //get json object
        JsonObject entry = jsonArray.getJsonObject(i);

        //get event and title
        String event = entry.getString("event");
        String title = entry.getString("title");

        //create new menu item
        MenuItem menuItem = new MenuItem(title);

        //add click handler
        menuItem.setOnAction(event1 -> {
            System.out.println("open activitiy: " + event);

            EventBus.getInstance().raiseEvent("open_activity", event);
        });

        menuItem.setAccelerator(new KeyCodeCombination(KeyCode.C, KeyCombination.CONTROL_DOWN));

        //check for shortcut
        if (entry.containsKey("shortcut") && !entry.getString("shortcut").isEmpty()) {
            String keys[] = entry.getString("shortcut").split("\\+");

            if (keys.length > 1) {
                KeyCombination.Modifier modifier = null;

                if (keys[1].equals("SHIFT_DOWN")) {
                    modifier = KeyCombination.SHIFT_DOWN;
                } else {
                    throw new UnsupportedOperationException("Unsupported key code: " + keys[1]);
                }

                //KeyCombination combination = KeyCombination.keyCombination(keys[1]);

                menuItem.setAccelerator(new KeyCodeCombination(KeyCode.getKeyCode(keys[0]), modifier));
            } else if (keys.length == 1) {
                menuItem.setAccelerator(new KeyCodeCombination(KeyCode.getKeyCode(keys[0])));
            } else {
                //no shortcut is set
            }
        }

        //add menu item to menu
        menu.getItems().add(menuItem);
    }
}
 
开发者ID:open-erp-systems,项目名称:erp-frontend,代码行数:49,代码来源:DefaultMenuManager.java


示例14: getAuthenticationData

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
public static String getAuthenticationData(JsonObject user) {
    return "username=" + user.getString("username") +
            "&password=" + user.getString("password") +
            "&client_name=FormClient";
}
 
开发者ID:kristenkotkas,项目名称:moviediary,代码行数:6,代码来源:Utils.java


示例15: getID

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
private String getID(final Record record) {
    final JsonObject metadata = record.getMetadata();
    return metadata.getString(Origin.ID);
}
 
开发者ID:silentbalanceyh,项目名称:vertx-zero,代码行数:5,代码来源:ZeroApiWorker.java


示例16: uploadMedia

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
/**
 * 上传多媒体文件
 * 返回media_id
 */
public static String uploadMedia(String accessToken, String mediaType, String mediaUri) {
    String uploadMediaUrl = String.format(UPLOAD_MEDIA, accessToken, mediaType);
    String boundary = "----------" + System.currentTimeMillis();// 设置边界
    try {
        URL uploadUrl = new URL(uploadMediaUrl);
        HttpURLConnection uploadConn = (HttpURLConnection) uploadUrl.openConnection();
        uploadConn.setDoOutput(true);
        uploadConn.setDoInput(true);
        uploadConn.setRequestMethod("POST");
        // 设置请求头Content-Type
        uploadConn.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary);
        // 获取媒体文件上传的输出流(往微信服务器写数据)
        OutputStream outputStream = uploadConn.getOutputStream();

        URL mediaUrl = new URL(mediaUri);
        HttpURLConnection meidaConn = (HttpURLConnection) mediaUrl.openConnection();
        meidaConn.setDoOutput(true);
        meidaConn.setRequestMethod("GET");

        // 从请求头中获取内容类型
        String contentType = meidaConn.getHeaderField("Content-Type");
        // 根据内容类型判断文件扩展名
        String fileExt = ".jpg";
        // 请求体开始
        outputStream.write(("--" + boundary + "\r\n").getBytes());
        outputStream.write(String.format("Content-Disposition: form-data; name=\"media\"; filename=\"file1%s\"\r\n", fileExt).getBytes());
        outputStream.write(String.format("Content-Type: %s\r\n\r\n", contentType).getBytes());

        // 获取媒体文件的输入流(读取文件)
        BufferedInputStream bis = new BufferedInputStream(meidaConn.getInputStream());
        byte[] buf = new byte[8096];
        int size = 0;
        while ((size = bis.read(buf)) != -1) {
            outputStream.write(buf, 0, size);
        }
        // 请求体结束
        outputStream.write(("\r\n--" + boundary + "--\r\n").getBytes());
        outputStream.close();
        bis.close();
        meidaConn.disconnect();

        // 获取媒体文件上传的输入流(从微信服务器读数据)
        InputStream inputStream = uploadConn.getInputStream();
        InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        StringBuffer buffer = new StringBuffer();
        String str = null;
        while ((str = bufferedReader.readLine()) != null) {
            buffer.append(str);
        }
        bufferedReader.close();
        inputStreamReader.close();
        // 释放资源
        inputStream.close();
        inputStream = null;
        uploadConn.disconnect();
        // 使用JSON-lib解析返回结果
        JsonObject jsonObject = new JsonObject(buffer.toString());
        if (jsonObject.containsKey("media_id"))
            return jsonObject.getString("media_id");
        return null;
    } catch (Exception e) {
        String error = String.format("上传媒体文件失败:%s", e);
        System.out.println(error);
    }
    return null;
}
 
开发者ID:Leibnizhu,项目名称:AlipayWechatPlatform,代码行数:72,代码来源:WxApi.java


示例17: EtcdData

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
private EtcdData(final Class<?> clazz) {
    this.clazz = clazz;
    this.logger = Annal.get(clazz);
    // Read configuration
    final JsonObject config = NODE.read();
    if (config.containsKey(KEY)) {
        final JsonObject root = config.getJsonObject(KEY);
        // Verify the data
        Fn.flingUp(() -> Fn.shuntZero(() -> Ruler.verify(KEY, root), root),
                LOGGER);
        if (root.containsKey(TIMEOUT)) {
            this.timeout = root.getLong(TIMEOUT);
        }
        if (root.containsKey(MICRO)) {
            this.application = root.getString(MICRO);
        }
        // Nodes
        if (root.containsKey(NODES)) {
            this.config.addAll(root.getJsonArray(NODES));
        }
        LOGGER.info(Info.ETCD_TIMEOUT,
                this.application, this.timeout, this.config.size());
    }
    Fn.flingUp(this.config.isEmpty(), this.logger,
            EtcdConfigEmptyException.class, this.clazz);

    final Set<URI> uris = new HashSet<>();
    final ConcurrentMap<Integer, String> networks
            = new ConcurrentHashMap<>();
    Observable.fromIterable(this.config)
            .filter(Objects::nonNull)
            .map(item -> (JsonObject) item)
            .filter(item -> item.containsKey(PORT) && item.containsKey(HOST))
            .map(item -> {
                final Integer port = item.getInteger(PORT);
                final String host = item.getString(HOST);
                networks.put(port, host);
                return "http://" + host + ":" + port;
            })
            .map(URI::create)
            .subscribe(uris::add);
    // Network checking
    networks.forEach((port, host) ->
            Fn.flingUp(!Net.isReach(host, port), LOGGER,
                    EtcdNetworkException.class, getClass(), host, port));
    LOGGER.info(Info.ETCD_NETWORK);
    this.client = new EtcdClient(uris.toArray(new URI[]{}));
}
 
开发者ID:silentbalanceyh,项目名称:vertx-zero,代码行数:49,代码来源:EtcdData.java


示例18: canCreateALoanWithoutAnId

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
@Test
public void canCreateALoanWithoutAnId()
  throws MalformedURLException,
  InterruptedException,
  ExecutionException,
  TimeoutException {

  UUID itemId = UUID.randomUUID();
  UUID userId = UUID.randomUUID();
  UUID proxyUserId = UUID.randomUUID();

  JsonObject loanRequest = new LoanRequestBuilder()
    .withNoId()
    .withItemId(itemId)
    .withUserId(userId)
    .withProxyUserId(proxyUserId)
    .withLoanDate(new DateTime(2017, 3, 20, 7, 21, 45, DateTimeZone.UTC))
    .withStatus("Open")
    .withAction("checkedout")
    .withItemStatus("Checked out")
    .withdueDate(new DateTime(2017, 4, 20, 7, 21, 45, DateTimeZone.UTC))
    .create();

  CompletableFuture<JsonResponse> createCompleted = new CompletableFuture();

  client.post(loanStorageUrl(), loanRequest, StorageTestSuite.TENANT_ID,
    ResponseHandler.json(createCompleted));

  JsonResponse response = createCompleted.get(5, TimeUnit.SECONDS);

  assertThat(String.format("Failed to create loan: %s", response.getBody()),
    response.getStatusCode(), is(HttpURLConnection.HTTP_CREATED));

  JsonObject loan = response.getJson();

  String newId = loan.getString("id");

  Assert.assertThat(newId, is(notNullValue()));

  assertThat("user id does not match",
    loan.getString("userId"), is(userId.toString()));

  assertThat("proxy user id does not match",
    loan.getString("proxyUserId"), is(proxyUserId.toString()));

  assertThat("item id does not match",
    loan.getString("itemId"), is(itemId.toString()));

  assertThat("loan date does not match",
    loan.getString("loanDate"), is("2017-03-20T07:21:45.000Z"));

  assertThat("status is not open",
    loan.getJsonObject("status").getString("name"), is("Open"));

  assertThat("action is not checked out",
    loan.getString("action"), is("checkedout"));

  assertThat("item status is not checked out",
    loan.getString("itemStatus"), is("Checked out"));

  //The RAML-Module-Builder converts all date-time formatted strings to UTC
  //and presents the offset as +0000 (which is ISO8601 compatible, but not RFC3339)
  assertThat("due date does not match",
    loan.getString("dueDate"), is("2017-04-20T07:21:45.000+0000"));
}
 
开发者ID:folio-org,项目名称:mod-circulation-storage,代码行数:66,代码来源:LoansApiTest.java


示例19: start

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
public void start() throws Exception {

		JsonObject conf = vertx.getOrCreateContext().config();
		
		HttpServerOptions options = this.configSSL(conf);	
		options.setAcceptBacklog(S.getInt(conf, "server.backlogsize", 128));
		options.setIdleTimeout(60);
		HttpServer server = vertx.createHttpServer(options);
		
		String host = conf.getString("host","0.0.0.0");
		int port = S.getInt(conf,"port", 80);
		
		
		
		// ============初始化======================

		this.webroot = conf.getString("static.file.dir");
		this.upload_dir = conf.getString("upload.dir");

		this.createWebClient(conf);

		this.appContain = gsetting.getAppContain(vertx,this.webclient);
		
		
		if(gsetting.hasAuth() && !this.appContain.isEmpty())
			authMgr = new AuthMgr(gsetting.getAuthSetting(),appContain);

		String index_page = conf.getString("index.page");
		router = Router.router(this.vertx);		
		this.initRoutes(conf,server,appContain,index_page);

		server.listen(port,host, ar -> {
			if (ar.succeeded()) {
				log.info("OutServer listen on " + port);
			} else {
				log.error("OutServer Failed to start!", ar.cause());
			}
		});		

	}
 
开发者ID:troopson,项目名称:etagate,代码行数:41,代码来源:OutServerVerticle.java


示例20: fromJson

import io.vertx.core.json.JsonObject; //导入方法依赖的package包/类
/**
 * Return a DeviceTemperature instance from a JSON object
 *
 * @param json  JSON object
 * @return  instance of DeviceTemperature
 */
public static DeviceTemperature fromJson(JsonObject json) {
    return new DeviceTemperature(json.getString(JSON_DEVICEID),
            json.getInteger(JSON_TEMPERATURE));
}
 
开发者ID:EnMasseProject,项目名称:enmasse-workshop,代码行数:11,代码来源:DeviceTemperature.java



注:本文中的io.vertx.core.json.JsonObject.getString方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。