Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.ServiceDescription$Resolver


            throws PlatoServiceException {
       
        FormatRegistry fr = FormatRegistryFactory.getFormatRegistry();
       
        // we only want migration services
        ServiceDescription sdQuery = new ServiceDescription.Builder(null, Migrate.class.getCanonicalName()).build();
       
        ServiceDescription sdQueryViewer = new ServiceDescription.Builder(null, CreateView.class.getCanonicalName()).build();
       
        // query all migration services
        List<ServiceDescription> list = registry.query(sdQuery);
       
        List<ServiceDescription> listViewers = registry.query(sdQueryViewer);
View Full Code Here


    /**
     * @param type
     * @return
     */
    protected List<ServiceDescription> lookupServicesByType( String type ) {
        ServiceDescription sdQuery = new ServiceDescription.Builder(null, type ).build();
        return registry.query(sdQuery);
    }
View Full Code Here

    /**
     * Test the describe() method.
     */
    @Test
    public void testServiceDescription() {
        ServiceDescription description = new JhoveIdentification().describe();
        Assert.assertTrue("We have no supported pronom IDs", description
                .getInputFormats().size() > 0);
        System.out.println(description.toXmlFormatted());
    }
View Full Code Here

        registry
                .register(/* new SanselanMigrate().describe() */new ServiceDescription.Builder(
                        "Sanselan", Migrate.class.getName())
                        .endpoint(endpoint2).paths(path).build());
        /* And can then query by example, e.g. for migration services supporting the path: */
        ServiceDescription example = new ServiceDescription.Builder(null, Migrate.class
                .getName()).paths(path).build();
        List<ServiceDescription> migrationServices = registry.query(example);
        /* Which we expect to return only the compatible migration service: */
        Assert.assertEquals(1, migrationServices.size());
        Assert.assertEquals("Sanselan", migrationServices.get(0).getName());
View Full Code Here

     */
    @Test
    public void syncInMemoryAndDisk() throws MalformedURLException {
        init();
        /* We want the other instance to be up to date as well: */
        ServiceDescription example = ServiceDescription.copy(description)
                .author("Me")
                /*
                 * We need to be really careful when using the copy method, if
                 * we don't null the endpoint here, the new instance will have
                 * the old endpoint, resulting in wrong comparison, unsuccessful
View Full Code Here

    /**
     * @param updated The retrieved descriptions to check
     */
    private void check(List<ServiceDescription> updated) {
        Assert.assertEquals(1, updated.size());
        ServiceDescription retrievedUpdated = updated.get(0);
        Assert.assertEquals("Me", retrievedUpdated.getAuthor());
    }
View Full Code Here

        Assert.assertEquals(true, register.success());
        /* Some client instantiates a registry backed by the same directory: */
        newRegistry = createRegistry();
        checkIfPresent(description, newRegistry);
        /* Now, we change something in the original registry: */
        ServiceDescription newDescription = ServiceDescription
                .copy(description).author("Me").endpoint(
                        new URL("http://some.place")).build();
        registry.register(newDescription);
        checkIfPresent(newDescription, registry);
    }
View Full Code Here

    private void checkIfPresent(ServiceDescription description,
            ServiceRegistry registry) {
        List<ServiceDescription> list = registry.query(description);
        Assert.assertEquals(1, list.size());
        ServiceDescription retrieved = list.get(0);
        Assert.assertEquals(description, retrieved);
    }
View Full Code Here

      log.info("Updating description");
      descBean.updateDescription();
    }
   
    log.info("getting the description to be registered");
      ServiceDescription desc = descBean.getServiceDescription();
    log.info("description->"+desc.toString());
    log.info("endpoint->"+desc.getEndpoint());

      // Register the service
    log.info("registering description");
   
    registry.register(desc);
View Full Code Here

    /**
     * @return "success", if successful
     */
    public String updateDescription() {
        log.info("update: "+this.getLocation());
        ServiceDescription csd = getCurrentServiceDescription();
        if( csd != null ) {
            if( this.getDescription().equals( csd )) {
                this.setDescriptionStatus( DescriptionStatus.OK );
            } else {
                // First, de-register.
View Full Code Here

TOP

Related Classes of eu.planets_project.services.datatypes.ServiceDescription$Resolver

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.