Package eu.planets_project.services.datatypes

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


        return "success";
    }
   
    private void addToServiceRegistry() {
        // Attempt to register:
        ServiceDescription toReg =  new ServiceDescription.Builder( this.getDescription() ).endpoint(
                this.getLocation() ).build();
        Response response = ServiceRegistryBackingBean.registry.register( toReg );
        log.info("Got response success: "+response.success());
        log.info("Got response: "+response.getMessage());
        if( response.success() ) {
View Full Code Here


     *
     */
    public void checkUpToDate() {
        // Check if the current service description is up to date:
        try {
            ServiceDescription csd = getCurrentServiceDescription();
            if( csd != null && this.getDescription().equals( csd ) ) {
                this.setDescriptionStatus(DescriptionStatus.OK);
            } else {
                this.setDescriptionStatus(DescriptionStatus.OUTDATED);
                log.info("Old: " + this.getDescription().toXmlFormatted());
                if (csd != null) {
                    log.info("New: " + csd.toXmlFormatted());
                } else {
                    log.info("No new service description");
                }
            }
        } catch( Exception e ) {
View Full Code Here

      ServiceDescriptionBackingBean descBean = (ServiceDescriptionBackingBean) ServiceRegistryBackingBean.getManagedObject("DescriptionBean");
      // get the selected endpoint
      log.info("Getting Row data");
        _currentEndpoint = (PlanetsServiceEndpoint) this._endpointsDataTable.getRowData();
      ServiceRegistry registry = ServiceRegistryFactory.getServiceRegistry();
      ServiceDescription example = new ServiceDescription.Builder(null, null).endpoint(_currentEndpoint.getLocation()).build();
      List<ServiceDescription> _matches = registry.query(example)
        // If it's registered then get the description from the registry
      if (_matches.size() > 0) {
          descBean.setServiceDescription(_matches.get(0));
        // If it's a new style endpoint then we can get the description and set the bean
        } else if (! _currentEndpoint.isDeprecated()) {
          log.info("");
          // Get the service description and add the endpoint
          ServiceDescription servDev = DiscoveryUtils.getServiceDescription(_currentEndpoint.getLocation());
          servDev = new ServiceDescription.Builder(servDev).endpoint(_currentEndpoint.getLocation()).build();
          descBean.setServiceDescription(servDev);
        // It's an old deprecated interface so we'll cobble together a service description
        // as best we can :)
        // TODO: This is horrible, we can get rid when we de-commission the old interfaces
View Full Code Here

    public static ServiceDescription getServiceDescription( URL wsdlLocation ) {
        try {
          PlanetsServiceExplorer se = new PlanetsServiceExplorer(wsdlLocation);
            PlanetsService s = (PlanetsService) createServiceObject(se.getServiceClass(), wsdlLocation);
            if( s == null ) return null;
            ServiceDescription sd = s.describe();
            return sd;
        } catch( Exception e ) {
            log.severe("Runtime exception while inspecting WSDL: "+wsdlLocation+" : "+e);
            e.printStackTrace();
            return null;
View Full Code Here

    @Test
    public void createServiceFromDescription() throws MalformedURLException {
        ServiceDescription.Builder builder = new ServiceDescription.Builder(NAME, INTERFACE_NAME);
        builder.endpoint(new URL(ENDPOINT));
        ServiceDescription shotgun = builder.build();
        Modify modify = ServiceUtils.createService(shotgun);
        modify.modify(DIGITAL_OBJECT, FORMAT, null);
    }
View Full Code Here

    /**
     * Test method for {@link eu.planets_project.ifr.core.simple.impl.SimpleCompareService#describe()}.
     */
    @Test
    public void testDescribe() {
        ServiceDescription desc = ids.describe();
        assertTrue("The ServiceDescription should not be NULL.", desc != null );
        System.out.println("Recieved service description: " + desc.toXmlFormatted());
    }
View Full Code Here

          compareService, WorkflowContext.Property_ServiceEndpoint,
          java.lang.String.class);
      if (endpoint != null) {
        wfResultItem.setServiceEndpoint(new URL(endpoint));
      }
      ServiceDescription serDescr = compareService.describe();
      wfResultItem.setServiceDescription(serDescr);

      //retrieve the digital objects from their data registry location
      DigitalObject digo1 = this.retrieveDigitalObjectDataRegistryRef(digo1Ref);
      DigitalObject digo2 = this.retrieveDigitalObjectDataRegistryRef(digo2Ref);
View Full Code Here

     * contents is correct.
     */
    @Test
    public void testGetServiceDescription() throws Exception {

  final ServiceDescription serviceDescription = serviceDescriptionFactory
    .getServiceDescription();

  assertNotNull(serviceDescription);

  assertEquals("Un-expected author (creator) information.",
    "\"Easter Bunny <easter.bunny@bunny.net>\"", serviceDescription
      .getAuthor());

  final String expectedDescription = "Example description of a service "
    + "wrapping of a fantastic\n            command line tool for migrating an "
    + "egg to eggnog.";
  assertEquals("Un-expected description.", expectedDescription,
    serviceDescription.getDescription());

  final URI expectedFurtherInfoURI = new URI("http://example.org");
  assertEquals("Un-expected text returned by getFurtherInfo().",
    expectedFurtherInfoURI, serviceDescription.getFurtherInfo());

  assertEquals("Un-expected identifier.", "-3995df4febea7decc4848e2864b7f863",
    serviceDescription.getIdentifier());

  assertEquals("Un-expected input formats.", getExpectedInputFormats(),
    new HashSet<URI>(serviceDescription.getInputFormats()));

  final String expectedInstructions = "Example: Please install the XYZ "
    + "tool on the system to\n            make this service work.";
  assertEquals("Un-expected instructions.", expectedInstructions,
    serviceDescription.getInstructions());

  final String expectedLogoURL = "http://www.planets-project.eu/graphics"
    + "/Planets_Logo.png";
  assertEquals("Un-expected logo URI.", expectedLogoURL,
    serviceDescription.getLogo().toString());

  final String expctedServiceName = "Example: Eggnog migration service.";
  assertEquals("Un-expected service name.", expctedServiceName,
    serviceDescription.getName());

  assertEquals("Un-expected service class name.", this.getClass()
    .getCanonicalName(), serviceDescription.getClassname());

  verifyParameters(serviceDescription.getParameters());

  verifyToolDescription(serviceDescription.getTool());

  assertEquals("Un-expected service version.", "3.141592653589793",
    serviceDescription.getVersion());

  assertEquals("Not testing a service, thus un-expected end-point URL.",
    null, serviceDescription.getEndpoint());

  verifyProperties(serviceDescription.getProperties());

  assertEquals("Un-expected service provider information.",
    SERVICE_PROVIDER, serviceDescription.getServiceProvider());

  assertEquals("Un-expected interface type.",
    "eu.planets_project.services.migrate.Migrate",
    serviceDescription.getType());

  verifyMigrationPaths(serviceDescription.getPaths());
    }
View Full Code Here

    /**
     *
     */
    @Test
    public void testDescribe() {
  ServiceDescription sb = this.genericWrapper.describe();
  assertNotNull(sb);
    }
View Full Code Here

     *
     */
    @Test
    public void testDescribe() {
  // FIXME! Make a meaningful implementation.
  ServiceDescription sb = this.genericWrapper.describe();
  sb.getAuthor(); // Now sb is used :-)
    }
View Full Code Here

TOP

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

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.