Ignore:
Timestamp:
Feb 28, 2011, 7:40:53 PM (13 years ago)
Author:
mlg
Message:

Modifications to handle proxy error.
Two types of error are handled : proxy address error and proxy authentication error.
Connecting to jiwigo via a proxy seems to work (tried with my own server... gonna have to try with an external server).
version is 0.13.1.1

Location:
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CategoryService.java

    r9392 r9430  
    66import fr.mael.jiwigo.dao.CategoryDao;
    77import fr.mael.jiwigo.om.Category;
     8import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
    89import fr.mael.jiwigo.transverse.session.SessionManager;
    910
     
    7677     * @return the list of categories
    7778     * @throws IOException
     79     * @throws ProxyAuthenticationException
    7880     */
    79     public List<Category> list(boolean recursive) throws IOException {
     81    public List<Category> list(boolean recursive) throws IOException, ProxyAuthenticationException {
    8082        return CategoryDao.getInstance(sessionManager).list(recursive);
    8183    }
     
    8587     * @return list of categories
    8688     * @throws IOException
     89     * @throws ProxyAuthenticationException
    8790     */
    88     public List<Category> makeTree() throws IOException {
     91    public List<Category> makeTree() throws IOException, ProxyAuthenticationException {
    8992        List<Category> list = CategoryDao.getInstance(sessionManager).list(true);
    9093        for (Category category : list) {
     
    109112     * @param parent parent category
    110113     * @return true if successful
     114     * @throws ProxyAuthenticationException
    111115     */
    112     public boolean create(String nom, Integer parent) {
     116    public boolean create(String nom, Integer parent) throws ProxyAuthenticationException {
    113117        Category category = new Category();
    114118        category.setDirectParent(parent);
     
    121125     * @param nom name of the category
    122126     * @return true if successful
     127     * @throws ProxyAuthenticationException
    123128     */
    124     public boolean create(String nom) {
     129    public boolean create(String nom) throws ProxyAuthenticationException {
    125130        Category category = new Category();
    126131        category.setName(nom);
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/CommentService.java

    r9392 r9430  
    66import fr.mael.jiwigo.dao.CommentDao;
    77import fr.mael.jiwigo.om.Comment;
     8import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
    89import fr.mael.jiwigo.transverse.session.SessionManager;
    910
     
    7576     * @return the list of comments
    7677     * @throws IOException
     78     * @throws ProxyAuthenticationException
    7779     */
    78     public List<Comment> list(Integer imageId) throws IOException {
     80    public List<Comment> list(Integer imageId) throws IOException, ProxyAuthenticationException {
    7981        return CommentDao.getInstance(sessionManager).list(imageId);
    8082    }
     
    8789     * @return true if successful
    8890     * @throws IOException
     91     * @throws ProxyAuthenticationException
    8992     */
    90     public boolean create(String content, Integer imageId, String auteur) throws IOException {
     93    public boolean create(String content, Integer imageId, String auteur) throws IOException,
     94            ProxyAuthenticationException {
    9195        Comment comment = new Comment();
    9296        comment.setContent(content);
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java

    r9394 r9430  
    77import fr.mael.jiwigo.dao.ImageDao;
    88import fr.mael.jiwigo.om.Image;
     9import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
    910import fr.mael.jiwigo.transverse.session.SessionManager;
    1011import fr.mael.jiwigo.transverse.util.ImagesUtil;
     
    8081     * @return the list of images
    8182     * @throws IOException
     83     * @throws ProxyAuthenticationException
    8284     */
    83     public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws IOException {
     85    public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws IOException,
     86            ProxyAuthenticationException {
    8487        return ImageDao.getInstance(sessionManager).listByCategory(categoryId, rafraichir);
    8588    }
     
    139142     * @return true if successful
    140143     * @throws IOException
     144     * @throws ProxyAuthenticationException
    141145     */
    142     public boolean addTags(Image image, String tagId) throws IOException {
     146    public boolean addTags(Image image, String tagId) throws IOException, ProxyAuthenticationException {
    143147        return ImageDao.getInstance(sessionManager).addTags(image.getIdentifier(), tagId);
    144148    }
     
    149153     * @return images matching the string
    150154     * @throws IOException
     155     * @throws ProxyAuthenticationException
    151156     */
    152     public List<Image> search(String queryString) throws IOException {
     157    public List<Image> search(String queryString) throws IOException, ProxyAuthenticationException {
    153158        return ImageDao.getInstance(sessionManager).search(queryString);
    154159    }
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/TagService.java

    r9392 r9430  
    77import fr.mael.jiwigo.om.Image;
    88import fr.mael.jiwigo.om.Tag;
     9import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
    910import fr.mael.jiwigo.transverse.session.SessionManager;
    1011
     
    7677     * @return le list of tags
    7778     * @throws IOException
     79     * @throws ProxyAuthenticationException
    7880     */
    79     public List<Tag> list() throws IOException {
     81    public List<Tag> list() throws IOException, ProxyAuthenticationException {
    8082        return TagDao.getInstance(sessionManager).list();
    8183    }
     
    8688     * @return true if the tag is created
    8789     * @throws IOException
     90     * @throws ProxyAuthenticationException
    8891     */
    89     public boolean create(String nom) throws IOException {
     92    public boolean create(String nom) throws IOException, ProxyAuthenticationException {
    9093        Tag tag = new Tag();
    9194        tag.setName(nom);
     
    98101     * @return the list of tags
    99102     * @throws IOException
     103     * @throws ProxyAuthenticationException
    100104     */
    101     public List<Tag> tagsForImage(Image image) throws IOException {
     105    public List<Tag> tagsForImage(Image image) throws IOException, ProxyAuthenticationException {
    102106        return TagDao.getInstance(sessionManager).tagsForImage(image);
    103107    }
Note: See TracChangeset for help on using the changeset viewer.