Package org.apache.lucene.gdata.data

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


     */
    @SuppressWarnings("unchecked")
    public BaseFeed getFeed(GDataRequest request, GDataResponse response)
            throws ServiceException {

        ServerBaseFeed feed = new ServerBaseFeed();
        feed.setId(request.getFeedId());
        feed.setStartIndex(request.getStartIndex());
        feed.setItemsPerPage(request.getItemsPerPage());
        feed.setServiceConfig(request.getConfigurator());
        try {
            /*
             * the strategy executes either a search or a direct access.
             */
            BaseFeed retVal = this.storage.getFeed(feed);
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

        if(providedService == null){
            setError(GDataResponse.BAD_REQUEST,"no such service");
            throw new FeedHandlerException("no such service registered -- "+providedService);
        }
        try{
            ServerBaseFeed retVal = new ServerBaseFeed(GDataEntityBuilder.buildFeed(request.getReader(),provServiceInstance));
            retVal.setServiceConfig(provServiceInstance);
        return retVal;
        }catch (IOException e) {
            if(LOG.isInfoEnabled())
                LOG.info("Can not read from input stream - ",e);
            setError(GDataResponse.BAD_REQUEST,"Can not read from input stream");
View Full Code Here

        searcher.close();
    }

    public void testSaveFeed() throws IOException, StorageException {
        String title = "myTitle";
        ServerBaseFeed feed = new ServerBaseFeed();
        feed.setId(feedId);
        feed.setTitle(new PlainTextConstruct(title));
        feed.setServiceType(service);
        feed.setServiceConfig(this.configurator);
        StorageFeedWrapper wrapper = new StorageFeedWrapper(feed,username);
        this.modifier.createFeed(wrapper);
       
        IndexSearcher searcher = new IndexSearcher(this.dir);
        Query q = new TermQuery(new Term(StorageFeedWrapper.FIELD_FEED_ID,
View Full Code Here

     * @throws IOException
     * @throws StorageException
     */
    public void testUpdateFeed() throws IOException, StorageException {
        testSaveFeed();
        ServerBaseFeed feed = new ServerBaseFeed();
        String title = "myTitle";
        String newusername = "doug";
        feed.setTitle(new PlainTextConstruct(title));
        feed.setId(feedId);
        feed.setServiceType(service);
        feed.setServiceConfig(this.configurator);
        StorageFeedWrapper wrapper = new StorageFeedWrapper(feed,newusername);
        this.modifier.updateFeed(wrapper);
        IndexSearcher searcher = new IndexSearcher(this.dir);
        Query q = new TermQuery(new Term(StorageFeedWrapper.FIELD_FEED_ID,
                feedId));
View Full Code Here

    public void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            super.processRequest(request,response);
            if(this.authenticated){
                AdminService service = null;
            try {
                ServerBaseFeed feed = createDeleteFeed(request);
               
                GDataServerRegistry registry = GDataServerRegistry.getRegistry();
                ServiceFactory serviceFactory = registry.lookup(ServiceFactory.class,ComponentType.SERVICEFACTORY);
                if(serviceFactory == null){
                    setError(GDataResponse.SERVER_ERROR,"required component is not available");
View Full Code Here

        String feedId = request.getParameter("feedid");
        if(feedId == null){
            setError(GDataResponse.BAD_REQUEST,"No feed id specified");
            throw new FeedHandlerException("no feed Id specified");
        }
        ServerBaseFeed retVal = new ServerBaseFeed();
        retVal.setId(feedId);
        return retVal;
    }
View Full Code Here

                    "Feed query returned not a unique result");
        if (set.size() == 0)
            throw new StorageException("no feed with feedID: " + feedId
                    + " stored -- query returned no result");

        ServerBaseFeed feed = (ServerBaseFeed) set.next();
        refreshPersistentObject(feed);
        ObjectSet entrySet = getEnriesForFeedID(feed.getId());
        try {
            this.container.delete(feed);
            this.container.delete(feed.getFeed());
            for (Object object : entrySet) {
                refreshPersistentObject(object);
                this.container.delete(object);
            }
           
View Full Code Here

            throw new StorageException("Query for feed id " + feed.getId()
                    + " returns more than one result");
        if (set.size() < 1)
            throw new StorageException("can not find feed for given feed id -- "
                + feed.getId());
        ServerBaseFeed result = set.next();
        refreshPersistentObject(result);
        BaseFeed oldFeed = result.getFeed();
        result.setAccount(account);
        result.setFeed(feed.getFeed());
        try {
            this.container.delete(oldFeed);
            this.container.set(result);
            this.container.commit();
        } catch (Exception e) {
View Full Code Here

                    + " returns more than one result");
        if (feed.size() < 1)
            throw new StorageException("can not find feed for given feed id -- "
                + feedId);
       
        ServerBaseFeed result = feed.next();
        if(LOG.isInfoEnabled())
            LOG.info("Retrieved Service for feed -- serviceType: "+result.getServiceType());
        return result.getServiceType();
    }
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.