Search in sources :

Example 66 with Tags

use of org.ovirt.engine.core.common.businessentities.Tags in project ovirt-engine by oVirt.

the class TagsDirector method getTagNameAndChildrenNames.

@Override
public String getTagNameAndChildrenNames(Guid tagId) {
    Tags tag = getTagById(tagId);
    StringBuilder sb = tag.getTagNameAndChildrenNames();
    return sb.toString();
}
Also used : Tags(org.ovirt.engine.core.common.businessentities.Tags)

Example 67 with Tags

use of org.ovirt.engine.core.common.businessentities.Tags in project ovirt-engine by oVirt.

the class TagsDirector method getTagIdAndChildrenIdsAsSet.

public HashSet<Guid> getTagIdAndChildrenIdsAsSet(Guid tagId) {
    Tags tag = getTagById(tagId);
    HashSet<Guid> set = new HashSet<>();
    tag.getTagIdAndChildrenIdsAsList(set);
    return set;
}
Also used : Guid(org.ovirt.engine.core.compat.Guid) Tags(org.ovirt.engine.core.common.businessentities.Tags) HashSet(java.util.HashSet)

Example 68 with Tags

use of org.ovirt.engine.core.common.businessentities.Tags in project ovirt-engine by oVirt.

the class TagsDirector method addChildren.

/**
 * Recursive tree initialization call
 */
private void addChildren(Tags tag) {
    log.info("Tag '{}' added to tree", tag.getTagName());
    List<Tags> children = tagDao.getAllForParent(tag.getTagId());
    for (Tags child : children) {
        addChildren(child);
        log.info("Tag '{}' added as child to parent '{}'", child.getTagName(), tag.getTagName());
        tag.getChildren().add(child);
        addTagToHash(tag);
        addTagToHash(child);
    }
}
Also used : Tags(org.ovirt.engine.core.common.businessentities.Tags)

Aggregations

Tags (org.ovirt.engine.core.common.businessentities.Tags)68 Test (org.junit.Test)34 ArrayList (java.util.ArrayList)8 Guid (org.ovirt.engine.core.compat.Guid)5 HashSet (java.util.HashSet)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Before (org.junit.Before)2 TagsTemplateMap (org.ovirt.engine.core.common.businessentities.TagsTemplateMap)2 TagsVdsMap (org.ovirt.engine.core.common.businessentities.TagsVdsMap)2 TagsVmMap (org.ovirt.engine.core.common.businessentities.TagsVmMap)2 MapSqlParameterSource (org.springframework.jdbc.core.namedparam.MapSqlParameterSource)2 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Date (java.util.Date)1 List (java.util.List)1 PostConstruct (javax.annotation.PostConstruct)1 Named (javax.inject.Named)1 Singleton (javax.inject.Singleton)1 Response (javax.ws.rs.core.Response)1 Tag (org.ovirt.engine.api.model.Tag)1