//Ensure the tag exists in the tag table
Tag existingTag = getTag(tagName, "", hostId);
//validates the tagInode already exists
TagInode existingTagInode = getTagInode(existingTag.getTagId(), inode);
if (existingTagInode.getTagId() == null) {
//the tagInode does not exists, so creates a new TagInode
TagInode tagInode = new TagInode();
tagInode.setTagId(existingTag.getTagId());
/*long i = 0;
try{
i =Long.parseLong(inode);
}catch (Exception e) {
Logger.error(this, "Unable to get Long value from " + inode, e);
}*/
tagInode.setInode(inode);
HibernateUtil.saveOrUpdate(tagInode);
return tagInode;
}
else {