Package org.apache.lucene.gdata.server

Examples of org.apache.lucene.gdata.server.ServiceFactory


                ServerBaseFeed feed = createFeedFromRequest(request);
                GDataAccount account = createRequestedAccount(request);

                GDataServerRegistry registry = GDataServerRegistry
                        .getRegistry();
                ServiceFactory serviceFactory = registry.lookup(
                        ServiceFactory.class, ComponentType.SERVICEFACTORY);
                if (serviceFactory == null) {
                    setError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                            "required component is not available");
                    throw new FeedHandlerException(
                            "Can't save feed - ServiceFactory is null");
                }
                service = serviceFactory.getAdminService();
                service.createFeed(feed, account);
            } catch (ServiceException e) {
                setError(GDataResponse.SERVER_ERROR,
                        "can not create feed");
                LOG.error("Can not create feed -- " + e.getMessage(), e);
View Full Code Here


    }
   
   
    protected GDataAccount createRequestedAccount(HttpServletRequest request) throws FeedHandlerException{
        GDataServerRegistry registry = GDataServerRegistry.getRegistry();
           ServiceFactory serviceFactory = registry.lookup(ServiceFactory.class,ComponentType.SERVICEFACTORY);
       
        if(serviceFactory == null){
            setError(GDataResponse.SERVER_ERROR, "Required server component not available");
            throw new FeedHandlerException("Required server component not available -- "+ServiceFactory.class.getName());
        }
        AdminService service = serviceFactory.getAdminService();
        String account = request.getParameter(PARAMETER_ACCOUNT);
        try{
        return service.getAccount(account);
        }catch (ServiceException e) {
            if(LOG.isInfoEnabled())
View Full Code Here

                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");
                    throw new FeedHandlerException("Can't save feed - ServiceFactory is null");
                }
                service = serviceFactory.getAdminService();
                service.deleteFeed(feed);
            } catch (FeedHandlerException e) {
                LOG.error("Can not delete feed -- "+e.getMessage(),e);
            }catch (ServiceException e) {
                LOG.error("Can not delete feed -- "+e.getMessage(),e);
View Full Code Here

                            + role + "; ClientIp: " + clientIp);

        AuthenticationController controller = GDataServerRegistry.getRegistry()
                .lookup(AuthenticationController.class,
                        ComponentType.AUTHENTICATIONCONTROLLER);
        ServiceFactory factory = GDataServerRegistry.getRegistry().lookup(
                ServiceFactory.class, ComponentType.SERVICEFACTORY);
        AdminService adminService = factory.getAdminService();
        GDataAccount account;
        try {
            account = adminService.getFeedOwningAccount(request.getFeedId());
            String token = getTokenFromRequest(request.getHttpServletRequest());
            if (LOG.isDebugEnabled())
View Full Code Here

            fail("RegistryException expected");
        } catch (RegistryException e) {
            //
        }
        this.reg.registerComponent(ServiceFactory.class, null);
        ServiceFactory servicefactory = this.reg.lookup(ServiceFactory.class,
                ComponentType.SERVICEFACTORY);
        assertNotNull(servicefactory);
        assertNotNull(factory);
    }
View Full Code Here

    this.feedResponse.setError(error);
  }

    private void getService(GDataRequest request) throws ServletException {
        GDataServerRegistry registry = GDataServerRegistry.getRegistry();
        ServiceFactory serviceFactory = registry.lookup(ServiceFactory.class,ComponentType.SERVICEFACTORY);
        this.service = serviceFactory.getService(request);
        if(this.service == null)
            throw new ServletException("Service not available");
       
    }
View Full Code Here

                ServerBaseFeed feed = createFeedFromRequest(request);
                GDataAccount account = createRequestedAccount(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");
                    throw new FeedHandlerException(
                            "Can't update feed - ServiceFactory is null");
                }
                service = serviceFactory.getAdminService();
                service.updateFeed(feed, account);
            } catch (ServiceException e) {
                setError(e.getErrorCode(),
                        "can not update feed");
                LOG.error("Can not update feed -- " + e.getMessage(), e);
View Full Code Here

            this.authenticated = authenticateAccount(request,
                AccountRole.USERADMINISTRATOR);
       
        if (this.authenticated) {
            GDataServerRegistry registry = GDataServerRegistry.getRegistry();
            ServiceFactory factory = registry.lookup(ServiceFactory.class,
                    ComponentType.SERVICEFACTORY);
            try {

                GDataAccount account = getAccountFromRequest(request);
                if (!account.requiredValuesSet()) {
                    setError(GDataResponse.SERVER_ERROR,
                            "Required server component not available");
                    throw new AccountHandlerException(
                            "Required values are not set -- account can not be saved -- "
                                    + account);
                }
                this.service = factory.getAdminService();
                processServiceAction(account);
            } catch (ServiceException e) {
                LOG.error("Can't process account action -- " + e.getMessage(),
                        e);
                setError(e.getErrorCode(), "");
View Full Code Here

TOP

Related Classes of org.apache.lucene.gdata.server.ServiceFactory

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.