congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
KapuaDataMessage.getClientId
Code IndexAdd Tabnine to your IDE (free)

How to use
getClientId
method
in
org.eclipse.kapua.message.device.data.KapuaDataMessage

Best Java code snippets using org.eclipse.kapua.message.device.data.KapuaDataMessage.getClientId (Showing top 7 results out of 315)

origin: eclipse/kapua

private void checkClientInfoAgainstPreparedMessages(ClientInfoListResult cliInfo, List<KapuaDataMessage> msgLst) {
  Set<String> msgClients = new HashSet<>();
  Set<String> infoClients = new HashSet<>();
  assertNotNull("No client info data!", cliInfo);
  assertNotNull("No messages to compare to!", msgLst);
  for (KapuaDataMessage tmpMsg : msgLst) {
    msgClients.add(tmpMsg.getClientId());
  }
  for (ClientInfo tmpClient : cliInfo.getItems()) {
    infoClients.add(tmpClient.getClientId());
  }
  assertEquals("The number of clients does not match!", msgClients.size(), infoClients.size());
  for (String tmpClient : msgClients) {
    assertTrue(String.format("The client id [%s] is not found in the info list!", tmpClient), infoClients.contains(tmpClient));
  }
}
origin: eclipse/kapua

private void checkChannelInfoAgainstPreparedMessages(ChannelInfoListResult chnInfo, List<KapuaDataMessage> msgLst) {
  Set<String> msgTopics = new HashSet<>();
  Set<String> msgClients = new HashSet<>();
  Set<String> infoTopics = new HashSet<>();
  Set<String> infoClients = new HashSet<>();
  assertNotNull("No channel info data!", chnInfo);
  assertNotNull("No messages to compare to!", msgLst);
  for (KapuaDataMessage tmpMsg : msgLst) {
    msgClients.add(tmpMsg.getClientId());
    msgTopics.add(tmpMsg.getChannel().toString());
  }
  for (ChannelInfo tmpInfo : chnInfo.getItems()) {
    infoClients.add(tmpInfo.getClientId());
    infoTopics.add(tmpInfo.getName());
  }
  assertEquals("The number of clients does not match!", msgClients.size(), infoClients.size());
  assertEquals("The number of topics does not match!", msgTopics.size(), infoTopics.size());
  for (String tmpTopic : msgTopics) {
    assertTrue(String.format("The topic [%s] is not found in the info list!", tmpTopic), infoTopics.contains(tmpTopic));
  }
  for (String tmpClient : msgClients) {
    assertTrue(String.format("The client id [%s] is not found in the info list!", tmpClient), infoClients.contains(tmpClient));
  }
}
origin: eclipse/kapua

private void checkMetricInfoAgainstPreparedMessages(MetricInfoListResult metInfo, List<KapuaDataMessage> msgLst) {
  Set<String> msgMetrics = new HashSet<>();
  Set<String> msgClients = new HashSet<>();
  Set<String> infoMetrics = new HashSet<>();
  Set<String> infoClients = new HashSet<>();
  assertNotNull("No channel info data!", metInfo);
  assertNotNull("No messages to compare to!", msgLst);
  for (KapuaDataMessage tmpMsg : msgLst) {
    msgClients.add(tmpMsg.getClientId());
    for (String tmpMet : tmpMsg.getPayload().getMetrics().keySet()) {
      msgMetrics.add(tmpMet);
    }
  }
  for (MetricInfo tmpMet : metInfo.getItems()) {
    infoClients.add(tmpMet.getClientId());
    infoMetrics.add(tmpMet.getName());
  }
  assertEquals("The number of clients does not match!", msgClients.size(), infoClients.size());
  assertEquals("The number of topics does not match!", msgMetrics.size(), infoMetrics.size());
  for (String tmpMetric : msgMetrics) {
    assertTrue(String.format("The topic [%s] is not found in the info list!", tmpMetric), infoMetrics.contains(tmpMetric));
  }
  for (String tmpClient : msgClients) {
    assertTrue(String.format("The client id [%s] is not found in the info list!", tmpClient), infoClients.contains(tmpClient));
  }
}
origin: eclipse/kapua

public JsonKapuaDataMessage(KapuaDataMessage kapuaDataMessage) {
  setId(kapuaDataMessage.getId());
  setScopeId(kapuaDataMessage.getScopeId());
  setDeviceId(kapuaDataMessage.getDeviceId());
  setClientId(kapuaDataMessage.getClientId());
  setReceivedOn(kapuaDataMessage.getReceivedOn());
  setSentOn(kapuaDataMessage.getSentOn());
  setCapturedOn(kapuaDataMessage.getCapturedOn());
  setPosition(kapuaDataMessage.getPosition());
  setChannel(kapuaDataMessage.getChannel());
  setPayload(kapuaDataMessage.getPayload());
}
origin: eclipse/kapua

ArgumentValidator.notNull(requestMessage.getClientId(), "clientId");
origin: eclipse/kapua

@Override
public KuraDataMessage translate(KapuaDataMessage kapuaDataMessage)
    throws KapuaException {
  KapuaLocator locator = KapuaLocator.getInstance();
  AccountService accountService = locator.getService(AccountService.class);
  Account account = accountService.find(kapuaDataMessage.getScopeId());
  if (account == null) {
    throw new KapuaEntityNotFoundException(Account.TYPE, kapuaDataMessage.getScopeId());
  }
  //
  // Kapua Channel
  KuraDataChannel kuraDataChannel = translate(kapuaDataMessage.getChannel());
  kuraDataChannel.setClientId(kapuaDataMessage.getClientId());
  kuraDataChannel.setScope(account.getName());
  //
  // Kapua payload
  KuraDataPayload kuraDataPayload = translate(kapuaDataMessage.getPayload());
  kuraDataPayload.setBody(kapuaDataMessage.getPayload().getBody());
  kuraDataPayload.setMetrics(kapuaDataMessage.getPayload().getMetrics());
  kuraDataPayload.setPosition(TranslatorKapuaKuraUtils.translate(kapuaDataMessage.getPosition()));
  kuraDataPayload.setTimestamp(kapuaDataMessage.getSentOn());
  //
  // Kapua message
  KuraDataMessage kuraDataMessage = new KuraDataMessage();
  kuraDataMessage.setChannel(kuraDataChannel);
  kuraDataMessage.setPayload(kuraDataPayload);
  // Return Kapua Message
  return kuraDataMessage;
}
origin: org.eclipse.kapua/kapua-translator-kapua-kura

@Override
public KuraDataMessage translate(KapuaDataMessage kapuaDataMessage)
    throws KapuaException {
  KapuaLocator locator = KapuaLocator.getInstance();
  AccountService accountService = locator.getService(AccountService.class);
  Account account = accountService.find(kapuaDataMessage.getScopeId());
  if (account == null) {
    throw new KapuaEntityNotFoundException(Account.TYPE, kapuaDataMessage.getScopeId());
  }
  //
  // Kapua Channel
  KuraDataChannel kuraDataChannel = translate(kapuaDataMessage.getChannel());
  kuraDataChannel.setClientId(kapuaDataMessage.getClientId());
  kuraDataChannel.setScope(account.getName());
  //
  // Kapua payload
  KuraDataPayload kuraDataPayload = translate(kapuaDataMessage.getPayload());
  kuraDataPayload.setBody(kapuaDataMessage.getPayload().getBody());
  kuraDataPayload.setMetrics(kapuaDataMessage.getPayload().getMetrics());
  kuraDataPayload.setPosition(TranslatorKapuaKuraUtils.translate(kapuaDataMessage.getPosition()));
  kuraDataPayload.setTimestamp(kapuaDataMessage.getSentOn());
  //
  // Kapua message
  KuraDataMessage kuraDataMessage = new KuraDataMessage();
  kuraDataMessage.setChannel(kuraDataChannel);
  kuraDataMessage.setPayload(kuraDataPayload);
  // Return Kapua Message
  return kuraDataMessage;
}
org.eclipse.kapua.message.device.dataKapuaDataMessagegetClientId

Popular methods of KapuaDataMessage

  • getChannel
  • getPayload
  • getPosition
  • getScopeId
  • getSentOn
  • setCapturedOn
  • setPayload
  • setReceivedOn
  • setSentOn
  • getCapturedOn
  • getDeviceId
  • getReceivedOn
  • getDeviceId,
  • getReceivedOn,
  • setChannel,
  • setClientId,
  • setDeviceId,
  • setPosition,
  • setScopeId,
  • getId,
  • setId

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setScale (BigDecimal)
  • putExtra (Intent)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now