- Timestamp:
- Mar 29, 2011, 8:21:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/TagService.java
r9879 r9919 4 4 import java.util.List; 5 5 6 import fr.mael.jiwigo.dao.TagDao;7 6 import fr.mael.jiwigo.om.Image; 8 7 import fr.mael.jiwigo.om.Tag; 9 8 import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; 10 import fr.mael.jiwigo.transverse.session.SessionManager;11 9 12 /* 13 * jiwigo-ws-api Piwigo webservice access Api 14 * Copyright (c) 2010-2011 Mael mael@le-guevel.com 15 * All Rights Reserved 16 * 17 * This library is free software. It comes without any warranty, to 18 * the extent permitted by applicable law. You can redistribute it 19 * and/or modify it under the terms of the Do What The Fuck You Want 20 * To Public License, Version 2, as published by Sam Hocevar. See 21 * http://sam.zoy.org/wtfpl/COPYING for more details. 22 */ 23 /** 24 * 25 26 * @author mael 27 * 28 */ 29 public class TagService { 30 /** 31 * Logger 32 */ 33 public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory 34 .getLog(TagService.class); 35 36 /** 37 * The instance, to use a singleton 38 */ 39 private static TagService instance; 40 41 private SessionManager sessionManager; 42 43 /** 44 * @return the singleton 45 */ 46 public static TagService getInstance(SessionManager sessionManager) { 47 if (instance == null) { 48 instance = new TagService(sessionManager); 49 } 50 return instance; 51 } 52 53 /** 54 * private constructor 55 */ 56 private TagService(SessionManager sessionManager) { 57 this.sessionManager = sessionManager; 58 } 10 public interface TagService { 59 11 60 12 /** … … 64 16 * @throws ProxyAuthenticationException 65 17 */ 66 public List<Tag> list() throws IOException, ProxyAuthenticationException { 67 return TagDao.getInstance(sessionManager).list(); 68 } 18 public List<Tag> list() throws IOException, ProxyAuthenticationException; 69 19 70 20 /** … … 75 25 * @throws ProxyAuthenticationException 76 26 */ 77 public boolean create(String nom) throws IOException, ProxyAuthenticationException { 78 Tag tag = new Tag(); 79 tag.setName(nom); 80 return TagDao.getInstance(sessionManager).create(tag); 81 } 27 public boolean create(String nom) throws IOException, ProxyAuthenticationException; 82 28 83 29 /** … … 88 34 * @throws ProxyAuthenticationException 89 35 */ 90 public List<Tag> tagsForImage(Image image) throws IOException, ProxyAuthenticationException { 91 return TagDao.getInstance(sessionManager).tagsForImage(image); 92 } 93 36 public List<Tag> tagsForImage(Image image) throws IOException, ProxyAuthenticationException; 94 37 }
Note: See TracChangeset
for help on using the changeset viewer.