use of com.cloud.host.DetailVO in project cloudstack by apache.
the class HostDetailsDaoImpl method findDetail.
@Override
public DetailVO findDetail(long hostId, String name) {
SearchCriteria<DetailVO> sc = DetailSearch.create();
sc.setParameters("hostId", hostId);
sc.setParameters("name", name);
DetailVO detail = findOneIncludingRemovedBy(sc);
if ("password".equals(name) && detail != null) {
detail.setValue(DBEncryptionUtil.decrypt(detail.getValue()));
}
return detail;
}
use of com.cloud.host.DetailVO in project cloudstack by apache.
the class HostDetailsDaoImpl method deleteDetails.
@Override
public void deleteDetails(long hostId) {
SearchCriteria sc = HostSearch.create();
sc.setParameters("hostId", hostId);
List<DetailVO> results = search(sc, null);
for (DetailVO result : results) {
remove(result.getId());
}
}
use of com.cloud.host.DetailVO in project cloudstack by apache.
the class HostDetailsDaoImpl method findDetails.
@Override
public Map<String, String> findDetails(long hostId) {
SearchCriteria<DetailVO> sc = HostSearch.create();
sc.setParameters("hostId", hostId);
List<DetailVO> results = search(sc, null);
Map<String, String> details = new HashMap<String, String>(results.size());
for (DetailVO result : results) {
if ("password".equals(result.getName())) {
details.put(result.getName(), DBEncryptionUtil.decrypt(result.getValue()));
} else {
details.put(result.getName(), result.getValue());
}
}
return details;
}
Aggregations