Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.Tool


    /**
     * @return
     */
    public String getToolSummary() {
        Tool st = null;
        if( sd != null )
            st = sd.getTool();
        if( sr != null )
            st = sr.getServiceDescription().getTool();
        if( st == null )
            return null;
        // Return a tool description;
        String desc = "";
        if( st.getName() != null ) {
            desc += st.getName();
            if( st.getVersion() != null ) {
                desc += " "+st.getVersion();
            }
        } else {
            if( st.getIdentifier() != null ) {
                desc += st.getIdentifier().toString();
            }
        }
        return desc;
    }
View Full Code Here


                toolUri = new URI(this.toolIdentifier);
            }
        } catch (URISyntaxException e1) {
            e1.printStackTrace();
        }
        sdb.tool( new Tool(toolUri, this.toolName, this.toolVersion, null, null) );
        return sdb.build();
    }
View Full Code Here

        String title = null, description = null, version = null, creator = null,
                publisher = null, identifier = null,
                instructions = null, furtherinfo = null, logo = null;

        Tool tool = null;

        for (int nodeIndex = 0; nodeIndex < topLevelNodes.getLength(); nodeIndex++) {
            final Node currentNode = topLevelNodes.item(nodeIndex);
            if (currentNode.getNodeType() == Node.ELEMENT_NODE){
                if (currentNode.getNodeName().equals(Constants.TITLE)){
View Full Code Here

            } catch (URISyntaxException e) {
                throw new ConfigurationException("identifier not set to valid value", e);
            }
        }

        Tool t = new Tool(identifierURI, name, version, description, homepageURL);
        return t;
    }
View Full Code Here

            final String serviceVersion = getOptionalElementText(
                    serviceDescriptionNode,
                    ConfigurationFileTagsV1.VERSION_ELEMENT);

            final Tool toolDescription = getToolDescriptionElement(serviceDescriptionNode);

            // Get the migration service identifier or create an identifier if
            // it has not been specified in the configuration document.
            String identifier = getOptionalElementText(serviceDescriptionNode,
                    ConfigurationFileTagsV1.IDENTIFIER_ELEMENT);

            if (identifier == null || "".equals(identifier)) {
               
                // Construct an identifier in the form of a MD5 digest of
                // the tool ID, the canonical class name of the migration
                // service and its version number.
                try {
                    final MessageDigest identDigest = MessageDigest
                            .getInstance("MD5");
                    identDigest.update(this.canonicalServiceName.getBytes());

                    final String versionInfo = (serviceVersion != null) ? serviceVersion
                            : "";
                    identDigest.update(versionInfo.getBytes());

                    final URI toolIDURI = toolDescription.getIdentifier();
                    final String toolIdentifier = toolIDURI == null ? ""
                            : toolIDURI.toString();
                    identDigest.update(toolIdentifier.getBytes());

                    final BigInteger md5hash = new BigInteger(identDigest.digest());
View Full Code Here

                    ConfigurationFileTagsV1.NAME_ELEMENT);

            final URL homePageURL = getOptionalURLElement(toolDescriptionNode,
                    ConfigurationFileTagsV1.HOME_PAGE_ELEMENT);

            final Tool toolDescription = new Tool(identifierURI, name, version,
                    description, homePageURL);

            return toolDescription;
        } catch (XPathExpressionException xPathExpressionException) {
            throw new ConfigurationException(String.format(
View Full Code Here

TOP

Related Classes of eu.planets_project.services.datatypes.Tool

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.