Codota Logo
DeviceManagementOperationRegistryService.update
Code IndexAdd Codota to your IDE (free)

How to use
update
method
in
org.eclipse.kapua.service.device.management.registry.operation.DeviceManagementOperationRegistryService

Best Java code snippets using org.eclipse.kapua.service.device.management.registry.operation.DeviceManagementOperationRegistryService.update (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: eclipse/kapua

default void closeDeviceManagementOperation(KapuaId scopeId, KapuaId operationId, Date updateOn, OperationStatus finalStatus) throws KapuaException {
  DeviceManagementOperation deviceManagementOperation = null;
  short attempts = 0;
  short limit = 3;
  boolean failed = false;
  do {
    try {
      deviceManagementOperation = getDeviceManagementOperation(scopeId, operationId);
      deviceManagementOperation.setEndedOn(updateOn);
      deviceManagementOperation.setStatus(finalStatus);
      DEVICE_MANAGEMENT_OPERATION_REGISTRY_SERVICE.update(deviceManagementOperation);
      LOG.info("Update DeviceManagementOperation {} with status {}...  SUCCEEDED!", operationId, finalStatus);
      break;
    } catch (Exception e) {
      failed = true;
      attempts++;
      if (attempts >= limit) {
        throw e;
      } else {
        LOG.warn("Update DeviceManagementOperation {} with status {}...  FAILED! Retrying...", operationId, finalStatus);
      }
    }
  } while (failed);
  ManagementOperationNotificationQuery query = MANAGEMENT_OPERATION_NOTIFICATION_FACTORY.newQuery(scopeId);
  query.setPredicate(new AttributePredicateImpl<>(ManagementOperationNotificationAttributes.OPERATION_ID, deviceManagementOperation.getId()));
  ManagementOperationNotificationListResult notifications = MANAGEMENT_OPERATION_NOTIFICATION_REGISTRY_SERVICE.query(query);
  for (ManagementOperationNotification mon : notifications.getItems()) {
    MANAGEMENT_OPERATION_NOTIFICATION_REGISTRY_SERVICE.delete(mon.getScopeId(), mon.getId());
  }
}
origin: eclipse/kapua

protected void closeManagementOperation(KapuaId scopeId, KapuaId deviceId, KapuaId operationId, KapuaResponseMessage<?, ?> responseMessageMessage) throws KapuaException {
  DeviceManagementOperationQuery query = DEVICE_MANAGEMENT_OPERATION_FACTORY.newQuery(scopeId);
  query.setPredicate(
      new AndPredicateImpl(
          new AttributePredicateImpl<>(DeviceManagementOperationAttributes.DEVICE_ID, deviceId),
          new AttributePredicateImpl<>(DeviceManagementOperationAttributes.OPERATION_ID, operationId)
      )
  );
  DeviceManagementOperation deviceManagementOperation = DEVICE_MANAGEMENT_OPERATION_REGISTRY_SERVICE.query(query).getFirstItem();
  if (deviceManagementOperation == null) {
    throw new KapuaEntityNotFoundException(DeviceManagementOperation.TYPE, operationId);
  }
  deviceManagementOperation.setStatus(responseMessageMessage.getResponseCode().isAccepted() ? OperationStatus.COMPLETED : OperationStatus.FAILED);
  deviceManagementOperation.setEndedOn(responseMessageMessage.getReceivedOn());
  KapuaSecurityUtils.doPrivileged(() -> DEVICE_MANAGEMENT_OPERATION_REGISTRY_SERVICE.update(deviceManagementOperation));
}
org.eclipse.kapua.service.device.management.registry.operationDeviceManagementOperationRegistryServiceupdate

Popular methods of DeviceManagementOperationRegistryService

  • query
  • create
  • count
  • delete
  • find

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now