org.eclipse.kapua.service.account.Account.getId()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中org.eclipse.kapua.service.account.Account.getId()方法的一些代码示例,展示了Account.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Account.getId()方法的具体详情如下:
包路径:org.eclipse.kapua.service.account.Account
类名称:Account
方法名:getId

Account.getId介绍

暂无

代码示例

代码示例来源:origin: eclipse/kapua

@Override
public Account update(Account account)
    throws KapuaException {
  if (!accounts.containsKey(account.getId())) {
    throw KapuaException.internalError("User not found");
  }
  AccountMock accountMock = accounts.get(account.getId());
  return accountMock;
}

代码示例来源:origin: eclipse/kapua

/**
 * Gets the scoped configuration values from the given {@link Account}.
 * This method defaults to {@link Account#getId()}, but implementations can change it to use other attributes.
 *
 * @param account The account from which get the id.
 * @return The scoped configurations for the given {@link Account}.
 * @throws KapuaException
 * @since 1.0.0
 */
protected Map<String, Object> getConfigValues(Account account) throws KapuaException {
  return getConfigValues(account.getId());
}

代码示例来源:origin: org.eclipse.kapua/kapua-account-internal

@Override
  protected Map<String, Object> getConfigValues(Account entity) throws KapuaException {
    return super.getConfigValues(entity.getId());
  }
}

代码示例来源:origin: eclipse/kapua

@Given("^A full set of device privileges for account \"(.+)\"$")
public void setAccountDevicePrivileges(String name) throws KapuaException {
  KapuaSecurityUtils.doPrivileged(() -> {
    Account account = accountService.findByName(name);
    Map<String, Object> valueMap = new HashMap<>();
    valueMap.put("infiniteChildEntities", true);
    valueMap.put("maxNumberChildEntities", 1000);
    deviceRegistryService.setConfigValues(account.getId(), account.getScopeId(), valueMap);
  });
}

代码示例来源:origin: eclipse/kapua

@Given("^I set the database to device timestamp indexing$")
public void setDatabaseToDeviceTimestampIndexing() throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  updateConfiguration(messageStoreService, account.getId(), account.getScopeId(),
      DataIndexBy.DEVICE_TIMESTAMP, MetricsIndexBy.TIMESTAMP, 30, true);
}

代码示例来源:origin: eclipse/kapua

@Given("^I create metric info query for current account with limit (\\d+)$")
public void createMetricInfoQueryForAccount(int limit) {
  Account account = (Account) stepData.get("LastAccount");
  MetricInfoQuery metricInfoQuery = DatastoreQueryFactory.createBaseMetricInfoQuery(account.getId(), limit);
  stepData.put("metricInfoQuery", metricInfoQuery);
}

代码示例来源:origin: eclipse/kapua

@When("^I delete the the client info data with the ID \"(.+)\" from the current account$")
public void deleteClientInfoWithId(String id) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  clientInfoRegistryServiceProxy.delete(account.getId(), new StorableIdImpl(id));
}

代码示例来源:origin: eclipse/kapua

@Then("^REST response containing Account$")
public void restResponseContainingAccount() throws Exception {
  String restResponse = (String) stepData.get("restResponse");
  Account account = XmlUtil.unmarshalJson(restResponse, Account.class, null);
  KapuaId accId = account.getId();
  System.out.println("Account Id = " + accId);
  stepData.put("lastAccountId", accId.toStringId());
  stepData.put("lastAccountCompactId", accId.toCompactId());
}

代码示例来源:origin: eclipse/kapua

@When("^I count the current account channels and store the count as \"(.*)\"$")
public void countAccountChannels(String countKey) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  ChannelInfoQuery tmpQuery = DatastoreQueryFactory.createBaseChannelInfoQuery(account.getId(), 100);
  long channelCount = channelInfoRegistryService.count(tmpQuery);
  stepData.put(countKey, channelCount);
}

代码示例来源:origin: eclipse/kapua

@Given("^Account$")
public void givenAccount(List<TestAccount> accountList) throws Exception {
  TestAccount testAccount = accountList.get(0);
  // If accountId is not set in account list, use last created Account for scope id
  if (testAccount.getScopeId() == null) {
    testAccount.setScopeId(((Account) stepData.get("LastAccount")).getId().getId());
  }
  stepData.put("LastAccount", createAccount(testAccount));
}

代码示例来源:origin: eclipse/kapua

@When("^I search for the last inserted message and save it as \"(.*)\"$")
public void findLastInsertedMessage(String keyName) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  StorableId msgId = (StorableId) stepData.get("LastStoredMessageId");
  DatastoreMessage tmpMsg = messageStoreService.find(account.getId(), msgId, StorableFetchStyle.SOURCE_FULL);
  stepData.put(keyName, tmpMsg);
}

代码示例来源:origin: eclipse/kapua

@When("^I perform a default query for the account messages and store the results as \"(.+)\"$")
public void performADefaultMessageQuery(String lstKey) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  MessageQuery query = DatastoreQueryFactory.createBaseMessageQuery(account.getId(), 100);
  MessageListResult msgList = messageStoreService.query(query);
  stepData.put(lstKey, msgList);
}

代码示例来源:origin: eclipse/kapua

@When("^I count the current account clients and store the count as \"(.*)\"$")
public void countAccountClients(String countKey) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  ClientInfoQuery tmpQuery = DatastoreQueryFactory.createBaseClientInfoQuery(account.getId(), 100);
  long clientCount = clientInfoRegistryService.count(tmpQuery);
  stepData.put(countKey, clientCount);
}

代码示例来源:origin: eclipse/kapua

@When("^I search for data message with id \"(.*)\"")
public void messageStoreFind(String storeId) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  DatastoreMessage tmpMsg = messageStoreService.find(account.getId(), new StorableIdImpl(storeId), StorableFetchStyle.SOURCE_FULL);
  stepData.put("message", tmpMsg);
}

代码示例来源:origin: eclipse/kapua

@When("^I search for metric info with id \"(.*)\"")
public void metricInfoFind(String storableId) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  MetricInfo tmpInfo = metricInfoRegistryService.find(account.getId(), new StorableIdImpl(storableId));
  stepData.put("metricInfo", tmpInfo);
}

代码示例来源:origin: eclipse/kapua

@When("^I search for client info with id \"(.*)\"")
public void clientInfoFind(String storableId) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  ClientInfo tmpInfo = clientInfoRegistryService.find(account.getId(), new StorableIdImpl(storableId));
  stepData.put("clientInfo", tmpInfo);
}

代码示例来源:origin: eclipse/kapua

@When("^I delete all metrics from the list \"(.*)\"$")
public void deleteAllMetricsFromList(String lstKey) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  MetricInfoListResult tmpList = (MetricInfoListResult) stepData.get(lstKey);
  for (MetricInfo tmpItem : tmpList.getItems()) {
    metricInfoRegistryServiceProxy.delete(account.getId(), tmpItem.getId());
  }
}

代码示例来源:origin: eclipse/kapua

@When("^I delete all channels from the list \"(.*)\"$")
public void deleteAllChannelsFromList(String lstKey) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  ChannelInfoListResult tmpList = (ChannelInfoListResult) stepData.get(lstKey);
  for (ChannelInfo tmpItem : tmpList.getItems()) {
    channelInfoRegistryServiceProxy.delete(account.getId(), tmpItem.getId());
  }
}

代码示例来源:origin: eclipse/kapua

@When("^I set the user change flag for the connection from device \"(.+)\" in account \"(.+)\" to \"(.+)\"$")
public void modifyDeviceConnectionUserChangeFlag(String device, String account, String flag) throws KapuaException {
  KapuaSecurityUtils.doPrivileged(() -> {
    Account tmpAcc = accountService.findByName(account);
    DeviceConnection tmpConn = deviceConnectionService.findByClientId(tmpAcc.getId(), device);
    Assert.assertNotNull(tmpConn);
    tmpConn.setAllowUserChange(parseBooleanFromString(flag));
    deviceConnectionService.update(tmpConn);
  });
}

代码示例来源:origin: eclipse/kapua

@When("^I perform an ordered query for metrics and store the results as \"(.*)\"$")
public void performAnOrderedMetricQuery(String lstKey) throws KapuaException {
  Account account = (Account) stepData.get("LastAccount");
  MetricInfoQuery query = getBaseMetricQuery(account.getId(), 100, getNamedMetricOrdering());
  query.addFetchAttributes(MetricInfoField.TIMESTAMP_FULL.field());
  MetricInfoListResult metList = metricInfoRegistryService.query(query);
  stepData.put(lstKey, metList);
}

相关文章