Package org.apache.lucene.gdata.data

Examples of org.apache.lucene.gdata.data.ServerBaseFeed


     * @see org.apache.lucene.gdata.storage.Storage#getFeedLastModified(java.lang.String)
     */
    public Long getFeedLastModified(String feedId) throws StorageException {
        if(feedId == null)
            throw new StorageException("can not get last modified -- id is null");
        ServerBaseFeed feed = getServerBaseFeed(feedId);
        return new Long(feed.getUpdated().getValue());
    
    }
View Full Code Here


           throw new ServiceException("Search Failed -- Searcher throws IOException",e,GDataResponse.SERVER_ERROR);
          
        }
        if(LOG.isInfoEnabled())
            LOG.info("Fetching results for user query result size: "+result.size());
        ServerBaseFeed requestFeed = new ServerBaseFeed();
        requestFeed.setServiceConfig(service);
        requestFeed.setStartIndex(0);
        requestFeed.setItemsPerPage(0);
        requestFeed.setId(request.getFeedId());
        BaseFeed feed = null;
        try{
         feed = this.storage.getFeed(requestFeed);
        }catch (StorageException e) {
            throw new ServiceException("Search Failed -- can not get feed, feed not stored ",e,GDataResponse.NOT_FOUND);
View Full Code Here

        this.controller.setPersistFactor(10);
        this.controller.initialize();
        this.configurator = new ProvidedServiceStub();
        this.modifier = this.controller.getStorageModifier();
        this.dir = this.controller.getDirectory();       
        ServerBaseFeed feed = new ServerBaseFeed();
        feed.setId(feedId);
        feed.setServiceType(service);
        feed.setServiceConfig(this.configurator);
       
        StorageFeedWrapper wrapper = new StorageFeedWrapper(feed,accountName);
        this.modifier.createFeed(wrapper);
        insertEntries(this.count);
        this.query = this.controller.getStorageQuery();
View Full Code Here

                .getParameter("service"), this.serviceName);
        this.requestMockControl.expectAndReturn(this.mockRequest.getReader(),this.reader);
        this.requestMockControl.replay();
        AbstractFeedHandler handler = new InsertFeedHandler();
        try{
        ServerBaseFeed feed = handler.createFeedFromRequest(this.mockRequest);
        assertNotNull(feed.getId());
       
        }catch (Exception e) {
            e.printStackTrace();
            fail("unexpected exception -- "+e.getMessage());
           
        }
        this.requestMockControl.verify();
        this.requestMockControl.reset();
        /*
         * Test for not registered service
         */
        this.requestMockControl.expectAndDefaultReturn(this.mockRequest
                .getParameter("service"), "some other service");
        this.requestMockControl.replay();
         handler = new InsertFeedHandler();
        try{
        ServerBaseFeed feed = handler.createFeedFromRequest(this.mockRequest);
       
        fail(" exception expected");
        }catch (FeedHandlerException e) {
            e.printStackTrace();
            assertEquals(HttpServletResponse.SC_NOT_FOUND,handler.getErrorCode());
        }
        this.requestMockControl.verify();
       
        this.requestMockControl.reset();
        /*
         * Test for IOException
         */
        this.requestMockControl.expectAndDefaultReturn(this.mockRequest
                .getParameter("service"), this.serviceName);
        this.reader.close();
        this.requestMockControl.expectAndReturn(this.mockRequest.getReader(),this.reader);
        this.requestMockControl.replay();
         handler = new InsertFeedHandler();
        try{
        ServerBaseFeed feed = handler.createFeedFromRequest(this.mockRequest);
       
        fail(" exception expected");
        }catch (IOException e) {
            e.printStackTrace();
            assertEquals(HttpServletResponse.SC_BAD_REQUEST,handler.getErrorCode());
View Full Code Here

            HttpServletResponse response) throws ServletException, IOException {
        super.processRequest(request, response);
        if (this.authenticated) {
            AdminService service= null;
            try {
                ServerBaseFeed feed = createFeedFromRequest(request);
                GDataAccount account = createRequestedAccount(request);

                GDataServerRegistry registry = GDataServerRegistry
                        .getRegistry();
                ServiceFactory serviceFactory = registry.lookup(
View Full Code Here

                .getParameter("service"), this.serviceName);
        this.requestMockControl.expectAndReturn(this.mockRequest.getReader(),this.reader);
        this.requestMockControl.replay();
        AbstractFeedHandler handler = new InsertFeedHandler();
        try{
        ServerBaseFeed feed = handler.createFeedFromRequest(this.mockRequest);
        assertNotNull(feed.getId());
       
        }catch (Exception e) {
            e.printStackTrace();
            fail("unexpected exception -- "+e.getMessage());
           
        }
        this.requestMockControl.verify();
        this.requestMockControl.reset();
        /*
         * Test for not registered service
         */
        this.requestMockControl.expectAndDefaultReturn(this.mockRequest
                .getParameter("service"), "some other service");
        this.requestMockControl.replay();
         handler = new InsertFeedHandler();
        try{
        ServerBaseFeed feed = handler.createFeedFromRequest(this.mockRequest);
       
        fail(" exception expected");
        }catch (FeedHandlerException e) {
            e.printStackTrace();
            assertEquals(HttpServletResponse.SC_NOT_FOUND,handler.getErrorCode());
        }
        this.requestMockControl.verify();
       
        this.requestMockControl.reset();
        /*
         * Test for IOException
         */
        this.requestMockControl.expectAndDefaultReturn(this.mockRequest
                .getParameter("service"), this.serviceName);
        this.reader.close();
        this.requestMockControl.expectAndReturn(this.mockRequest.getReader(),this.reader);
        this.requestMockControl.replay();
         handler = new InsertFeedHandler();
        try{
        ServerBaseFeed feed = handler.createFeedFromRequest(this.mockRequest);
       
        fail(" exception expected");
        }catch (IOException e) {
            e.printStackTrace();
            assertEquals(HttpServletResponse.SC_BAD_REQUEST,handler.getErrorCode());
View Full Code Here

TOP

Related Classes of org.apache.lucene.gdata.data.ServerBaseFeed

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.