Examples of UserResource


Examples of org.apache.airavata.persistance.registry.jpa.resources.UserResource

        }
        GatewayResource gatewayResource = new GatewayResource();
        gatewayResource.setGatewayName((String) properties.get(GATEWAY_ID));
        gatewayResource.setOwner((String) properties.get(GATEWAY_ID));
        gatewayResource.save();
        UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
        userResource.setUserName((String) properties.get(REGISTRY_USER));
        userResource.setPassword((String) properties.get(REGISTRY_PASSWORD));
        userResource.save();
        WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
        workerResource.setUser(userResource.getUserName());
        workerResource.save();
    }
View Full Code Here

Examples of org.apache.airavata.persistance.registry.jpa.resources.UserResource

      return userRegistry.getUsers();
    }
    List<AiravataUser> result=new ArrayList<AiravataUser>();
       List<Resource> users = jpa.getGateway().get(ResourceType.USER);
       for (Resource resource : users) {
        UserResource userRes = (UserResource) resource;
        AiravataUser user = new AiravataUser(userRes.getUserName());
      result.add(user);
    }
       return result;
  }
View Full Code Here

Examples of org.apache.airavata.persistance.registry.jpa.resources.UserResource

            GatewayResource gatewayResource = new GatewayResource();
            gatewayResource.setGatewayName(RegistrySettings.getSetting("default.registry.gateway"));
            gatewayResource.setOwner(RegistrySettings.getSetting("default.registry.gateway"));
            gatewayResource.save();

            UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
            userResource.setUserName(RegistrySettings.getSetting("default.registry.user"));
            userResource.setPassword(RegistrySettings.getSetting("default.registry.password"));
            userResource.save();

            WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
            workerResource.setUser(userResource.getUserName());
            workerResource.save();
        } catch (RegistrySettingsException e) {
            logger.error("Unable to read properties", e);
        }
    }
View Full Code Here

Examples of org.apache.airavata.persistance.registry.jpa.resources.UserResource

                logger.info("Database already created for Registry!");
            }
            try{
                GatewayResource gateway = (GatewayResource)ResourceUtils.createGateway(ServerSettings.getSystemUserGateway());
                gateway.save();
                UserResource user = ResourceUtils.createUser(ServerSettings.getSystemUser(), ServerSettings.getSystemUserPassword());
                user.save();
                WorkerResource workerResource = (WorkerResource)gateway.create(ResourceType.GATEWAY_WORKER);
                workerResource.setUser(user.getUserName());
                workerResource.save();
                ProjectResource projectResource = workerResource.createProject(DEFAULT_PROJECT_NAME);
                projectResource.setName(DEFAULT_PROJECT_NAME);
                projectResource.setGateway(gateway);
                projectResource.save();
View Full Code Here

Examples of org.apache.airavata.persistance.registry.jpa.resources.UserResource

                logger.info("Database already created for Registry!");
            }
            try{
                GatewayResource gateway = (GatewayResource)ResourceUtils.createGateway(ServerSettings.getSystemUserGateway());
                gateway.save();
                UserResource user = ResourceUtils.createUser(ServerSettings.getSystemUser(), ServerSettings.getSystemUserPassword());
                user.save();
                WorkerResource workerResource = (WorkerResource)gateway.create(ResourceType.GATEWAY_WORKER);
                workerResource.setUser(user.getUserName());
                workerResource.save();
                ProjectResource projectResource = workerResource.createProject(DEFAULT_PROJECT_NAME);
                projectResource.setName(DEFAULT_PROJECT_NAME);
                projectResource.setGateway(gateway);
                projectResource.save();
View Full Code Here

Examples of org.apache.airavata.persistance.registry.jpa.resources.UserResource

            GatewayResource gatewayResource = new GatewayResource();
            gatewayResource.setGatewayName(RegistrySettings.getSetting("default.registry.gateway"));
            gatewayResource.setOwner(RegistrySettings.getSetting("default.registry.gateway"));
            gatewayResource.save();
           
            UserResource userResource = new UserResource();
            userResource.setUserName(RegistrySettings.getSetting("default.registry.user"));
            userResource.setPassword(RegistrySettings.getSetting("default.registry.password"));
            userResource.save();

            WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
            workerResource.setUser(userResource.getUserName());
            workerResource.save();
           
            ProjectResource projectResource = (ProjectResource)workerResource.create(ResourceType.PROJECT);
            projectResource.setGateway(gatewayResource);
            projectResource.setId("default");
View Full Code Here

Examples of org.apache.airavata.persistance.registry.jpa.resources.UserResource

        String status = updateStatus();
        if (status == null) {
            try {
//                Properties properties = Utils.loadProperties();
                GatewayResource gatewayResource = (GatewayResource)ResourceUtils.getGateway(getGatewayName());
                UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
                userResource.setUserName(getUsername());
                userResource.setPassword(getPassword());
                userResource.save();
                WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
                workerResource.setUser(userResource.getUserName());
                workerResource.save();
                setUserCreated(true);
//                JCRComponentRegistry registry = new JCRComponentRegistry(getUsername(),getPassword());
            } catch (Exception e) {
                e.printStackTrace();
View Full Code Here

Examples of org.apache.cxf.jaxrs.model.UserResource

   
    @Test
    public void testCreateClientWithUserResource() throws Exception {
        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
        bean.setAddress("http://bar");
        UserResource r = new UserResource();
        r.setName(BookStore.class.getName());
        r.setPath("/");
        UserOperation op = new UserOperation();
        op.setName("getDescription");
        op.setVerb("GET");
        r.setOperations(Collections.singletonList(op));
        bean.setModelBeans(r);
        assertTrue(bean.create() instanceof BookStore);
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.model.UserResource

   
    @Test
    public void testCreateClientWithTwoUserResources() throws Exception {
        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
        bean.setAddress("http://bar");
        UserResource r1 = new UserResource();
        r1.setName(BookStore.class.getName());
        r1.setPath("/store");
        UserOperation op = new UserOperation();
        op.setName("getDescription");
        op.setVerb("GET");
        r1.setOperations(Collections.singletonList(op));
       
        UserResource r2 = new UserResource();
        r2.setName(Book.class.getName());
        r2.setPath("/book");
        UserOperation op2 = new UserOperation();
        op2.setName("getName");
        op2.setVerb("GET");
        r2.setOperations(Collections.singletonList(op2));
       
        bean.setModelBeans(r1, r2);
        bean.setServiceClass(Book.class);
        assertTrue(bean.create() instanceof Book);
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.model.UserResource

        assertEquals(String.class, c.getParameterTypes()[1]);
    }

    @Test
    public void testClassResourceInfoUserResource() throws Exception {
        UserResource ur = new UserResource();
        ur.setName(HashMap.class.getName());
        ur.setPath("/hashmap");
        UserOperation op = new UserOperation();
        op.setPath("/key/{id}");
        op.setName("get");
        op.setVerb("POST");
        op.setParameters(Collections.singletonList(new Parameter(ParameterType.PATH, "id")));
        ur.setOperations(Collections.singletonList(op));
       
        Map<String, UserResource> resources = new HashMap<String, UserResource>();
        resources.put(ur.getName(), ur);
        ClassResourceInfo cri = ResourceUtils.createClassResourceInfo(resources, ur, true, true);
        assertNotNull(cri);
        assertEquals("/hashmap", cri.getURITemplate().getValue());
        Method method =
            HashMap.class.getMethod("get", new Class[]{Object.class});
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.