use of org.eclipse.smarthome.core.persistence.dto.PersistenceServiceDTO in project smarthome by eclipse.
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<PersistenceServiceDTO>();
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