use of com.cloud.host.HostTagVO in project cloudstack by apache.
the class HostTagsDaoImpl method persist.
@Override
public void persist(long hostId, List<String> hostTags) {
TransactionLegacy txn = TransactionLegacy.currentTxn();
txn.start();
SearchCriteria<HostTagVO> sc = HostSearch.create();
sc.setParameters("hostId", hostId);
expunge(sc);
for (String tag : hostTags) {
tag = tag.trim();
if (tag.length() > 0) {
HostTagVO vo = new HostTagVO(hostId, tag);
persist(vo);
}
}
txn.commit();
}
use of com.cloud.host.HostTagVO in project cloudstack by apache.
the class HostTagsDaoImpl method persist.
@Override
public void persist(long hostId, List<String> hostTags) {
TransactionLegacy txn = TransactionLegacy.currentTxn();
txn.start();
SearchCriteria<HostTagVO> sc = HostSearch.create();
sc.setParameters("hostId", hostId);
expunge(sc);
for (String tag : hostTags) {
tag = tag.trim();
if (tag.length() > 0) {
HostTagVO vo = new HostTagVO(hostId, tag);
persist(vo);
}
}
txn.commit();
}
use of com.cloud.host.HostTagVO in project cloudstack by apache.
the class HostTagsDaoImpl method gethostTags.
@Override
public List<String> gethostTags(long hostId) {
SearchCriteria<HostTagVO> sc = HostSearch.create();
sc.setParameters("hostId", hostId);
List<HostTagVO> results = search(sc, null);
List<String> hostTags = new ArrayList<String>(results.size());
for (HostTagVO result : results) {
hostTags.add(result.getTag());
}
return hostTags;
}
Aggregations