Package org.openhab.core.persistence

Examples of org.openhab.core.persistence.PersistenceService.store()


          PersistenceModel persistModel = (PersistenceModel) model;
          for(PersistenceConfiguration config : persistModel.getConfigs()) {
            if(hasStrategy(persistModel, config, strategyName)) {
              for(Item item : persistenceManager.getAllItems(config)) {
                long startTime = System.currentTimeMillis();
                persistenceService.store(item, config.getAlias());
                logger.trace("Storing item '{}' with persistence service '{}' took {}ms",
                    new Object[] { item.getName(), modelName, System.currentTimeMillis() - startTime});
              }
            }
          }
View Full Code Here


   * @param serviceName the name of the {@link PersistenceService} to use
   */
  static public void persist(Item item, String serviceName) {
    PersistenceService service = services.get(serviceName);
    if (service != null) {
      service.store(item);
    } else {
      logger.warn("There is no persistence service registered with the name '{}'", serviceName);
    }
  }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.