Ignore:
Timestamp:
12/19/13 14:36:04 (10 years ago)
Author:
olhsha
Message:

adding trasnactional, refactoring and fixing bugs in updated annotations, removing try-catch from resource methods (The Greek's advice)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java

    r3949 r4207  
    3737import javax.ws.rs.core.UriInfo;
    3838import javax.xml.bind.JAXBElement;
     39import javax.xml.parsers.ParserConfigurationException;
    3940import org.springframework.beans.factory.annotation.Autowired;
    4041import org.springframework.security.access.annotation.Secured;
    4142import org.springframework.stereotype.Component;
     43import org.springframework.transaction.annotation.Transactional;
    4244
    4345/**
     
    4749@Component
    4850@Path("/cached")
     51@Transactional(rollbackFor={Exception.class, SQLException.class, IOException.class, ParserConfigurationException.class})
    4952public class CachedRepresentationResource {
    5053
     
    6568    @Produces(MediaType.TEXT_XML)
    6669    @Path("{cachedid: " + BackendConstants.regExpIdentifier + "}/metadata")
    67     @Secured("ROLE_USER")
     70    @Secured("ROLE_USER")   
     71    @Transactional(readOnly=true)
    6872    public JAXBElement<CachedRepresentationInfo> getCachedRepresentationInfo(@PathParam("cachedid") String externalId) throws SQLException {
    6973        dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
     
    7680    @Produces({"image/jpeg", "image/png"})
    7781    @Path("{cachedid: " + BackendConstants.regExpIdentifier + "}/content")
    78     @Secured("ROLE_USER")
     82    @Secured("ROLE_USER")   
     83    @Transactional(readOnly=true)
    7984    public BufferedImage getCachedRepresentationContent(@PathParam("cachedid") String externalId) throws SQLException, IOException {
    8085        dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
Note: See TracChangeset for help on using the changeset viewer.