Examples of GDataServerRegistry


Examples of org.apache.lucene.gdata.server.registry.GDataServerRegistry

    File indexLocation;

    protected void setUp() throws Exception {
        this.controller = new IndexController();
        GDataServerRegistry reg = GDataServerRegistry.getRegistry();

        this.indexLocation = new File(System.getProperty("java.io.tmpdir"));
       
       
        ProvidedServiceStub stub = new ProvidedServiceStub();
        this.schema = new IndexSchema();
        // must be set
        this.schema.setDefaultSearchField("content");
        this.schema.setName(ProvidedServiceStub.SERVICE_NAME);
        this.schema.setIndexLocation(this.indexLocation.getAbsolutePath());
        IndexSchemaField field = new IndexSchemaField();
        field.setName("content");
        field.setPath("/somePath");
        field.setContentType(ContentType.TEXT);
        this.schema.addSchemaField(field);
        stub.setIndexSchema(this.schema);

        reg.registerService(stub);
    }
View Full Code Here

Examples of org.apache.lucene.gdata.server.registry.GDataServerRegistry

            AdminService service = null;
            try {
                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(
View Full Code Here

Examples of org.apache.lucene.gdata.server.registry.GDataServerRegistry

                setError(GDataResponse.UNAUTHORIZED,"Authorization failed");
       
    }
   
    protected ServerBaseFeed createFeedFromRequest(HttpServletRequest request) throws ParseException, IOException, FeedHandlerException{
        GDataServerRegistry registry = GDataServerRegistry.getRegistry();
        String providedService = request.getParameter(PARAMETER_SERVICE);
        if(!registry.isServiceRegistered(providedService)){
            setError(GDataResponse.NOT_FOUND,"no such service");
            throw new FeedHandlerException("ProvicdedService is not registered -- Name: "+providedService);
         }
        ProvidedService provServiceInstance = registry.getProvidedService(providedService)
        if(providedService == null){
            setError(GDataResponse.BAD_REQUEST,"no such service");
            throw new FeedHandlerException("no such service registered -- "+providedService);
        }
        try{
View Full Code Here

Examples of org.apache.lucene.gdata.server.registry.GDataServerRegistry

       
    }
   
   
    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());
        }
View Full Code Here

Examples of org.apache.lucene.gdata.server.registry.GDataServerRegistry

            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");
                    throw new FeedHandlerException("Can't save feed - ServiceFactory is null");
                }
                service = serviceFactory.getAdminService();
View Full Code Here

Examples of org.apache.lucene.gdata.server.registry.GDataServerRegistry

  protected void setError(int error) {
    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

Examples of org.apache.lucene.gdata.server.registry.GDataServerRegistry

            AdminService service= null;
            try {
                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(
View Full Code Here

Examples of org.apache.lucene.gdata.server.registry.GDataServerRegistry

      try
            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()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.