use of org.openhab.core.persistence.dto.PersistenceServiceDTO in project openhab-core by openhab.
the class PersistenceResource method getPersistenceServiceList.
/**
* Gets a list of persistence services currently configured in the system
*
* @return list of persistence services as {@link ServiceBean}
*/
private List<PersistenceServiceDTO> getPersistenceServiceList(Locale locale) {
List<PersistenceServiceDTO> dtoList = new ArrayList<>();
for (PersistenceService service : persistenceServiceRegistry.getAll()) {
PersistenceServiceDTO serviceDTO = new PersistenceServiceDTO();
serviceDTO.id = service.getId();
serviceDTO.label = service.getLabel(locale);
if (service instanceof ModifiablePersistenceService) {
serviceDTO.type = MODIFYABLE;
} else if (service instanceof QueryablePersistenceService) {
serviceDTO.type = QUERYABLE;
} else {
serviceDTO.type = STANDARD;
}
dtoList.add(serviceDTO);
}
return dtoList;
}
Aggregations