org.telscenter.sail.webapp.service.tag.impl
Class TagServiceImpl

java.lang.Object
  extended by org.telscenter.sail.webapp.service.tag.impl.TagServiceImpl
All Implemented Interfaces:
TagService

public class TagServiceImpl
extends Object
implements TagService

Version:
$Id:$
Author:
patrick lawler

Constructor Summary
TagServiceImpl()
           
 
Method Summary
 Tag createOrGetTag(String name)
          Given a String name, returns the Tag tag with the given name if it exists, creates and returns one if not.
 Tag getTagById(Long id)
          Given a Long tag id, returns the tag associated with that id, returns null if it does not exist.
 boolean isFromDatabase(Tag tag)
          Returns boolean true iff the given Tag tag is a tag that was retrieved from the database, returns false otherwise.
 void removeIfOrphaned(Long tagId)
          Given a Long tag id of a tag that has just been removed from a project, checks to see if this now makes this tag an orphan and removes it from the database if it is.
 void setTagDao(TagDao<Tag> tagDao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagServiceImpl

public TagServiceImpl()
Method Detail

getTagById

@Transactional(readOnly=true)
public Tag getTagById(Long id)
Description copied from interface: TagService
Given a Long tag id, returns the tag associated with that id, returns null if it does not exist.

Specified by:
getTagById in interface TagService
Returns:
Tag - tag
See Also:
TagService.getTagById(java.lang.Long)

createOrGetTag

@Transactional
public Tag createOrGetTag(String name)
Description copied from interface: TagService
Given a String name, returns the Tag tag with the given name if it exists, creates and returns one if not.

Specified by:
createOrGetTag in interface TagService
Returns:
Tag - tag
See Also:
TagService.createOrGetTag(java.lang.String)

isFromDatabase

public boolean isFromDatabase(Tag tag)
Description copied from interface: TagService
Returns boolean true iff the given Tag tag is a tag that was retrieved from the database, returns false otherwise.

Specified by:
isFromDatabase in interface TagService
Returns:
boolean
See Also:
TagService.isFromDatabase(org.telscenter.sail.webapp.domain.project.Tag)

removeIfOrphaned

@Transactional
public void removeIfOrphaned(Long tagId)
Description copied from interface: TagService
Given a Long tag id of a tag that has just been removed from a project, checks to see if this now makes this tag an orphan and removes it from the database if it is.

Specified by:
removeIfOrphaned in interface TagService
See Also:
TagService.removeIfOrphaned(java.lang.Long)

setTagDao

public void setTagDao(TagDao<Tag> tagDao)
Parameters:
tagDao - the tagDao to set


Copyright © 2012. All Rights Reserved.