Changeset 9919 for extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/impl/CommentServiceImpl.java
- Timestamp:
- Mar 29, 2011, 8:21:25 PM (14 years ago)
- Location:
- extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/impl
- Files:
-
- 1 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/impl/CommentServiceImpl.java
r9879 r9919 1 package fr.mael.jiwigo.service ;1 package fr.mael.jiwigo.service.impl; 2 2 3 3 import java.io.IOException; 4 4 import java.util.List; 5 5 6 import org.slf4j.Logger; 7 import org.slf4j.LoggerFactory; 8 6 9 import fr.mael.jiwigo.dao.CommentDao; 7 10 import fr.mael.jiwigo.om.Comment; 11 import fr.mael.jiwigo.service.CommentService; 8 12 import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; 9 import fr.mael.jiwigo.transverse.session.SessionManager;10 13 11 14 /* … … 25 28 * 26 29 */ 27 public class CommentService {30 public class CommentServiceImpl implements CommentService { 28 31 /** 29 32 * Logger 30 33 */ 31 public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory 32 .getLog(CommentService.class); 34 private final Logger LOG = LoggerFactory.getLogger(CommentServiceImpl.class); 33 35 34 /** 35 * singleton 36 */ 37 private static CommentService instance; 38 39 private SessionManager sessionManager; 40 41 /** 42 * @return the singleton 43 */ 44 public static CommentService getInstance(SessionManager sessionManager) { 45 if (instance == null) { 46 instance = new CommentService(sessionManager); 47 } 48 return instance; 49 } 50 51 /** 52 * private constructor, to use a singleton 53 */ 54 private CommentService(SessionManager sessionManager) { 55 this.sessionManager = sessionManager; 56 } 36 private CommentDao dao; 57 37 58 38 /** … … 64 44 */ 65 45 public List<Comment> list(Integer imageId) throws IOException, ProxyAuthenticationException { 66 return CommentDao.getInstance(sessionManager).list(imageId);46 return dao.list(imageId); 67 47 } 68 48 … … 82 62 comment.setImageId(imageId); 83 63 comment.setAuthor(auteur); 84 return CommentDao.getInstance(sessionManager).create(comment); 64 return dao.create(comment); 65 } 66 67 public CommentDao getDao() { 68 return dao; 69 } 70 71 public void setDao(CommentDao dao) { 72 this.dao = dao; 85 73 } 86 74
Note: See TracChangeset
for help on using the changeset viewer.