Package at.tuwien.minimee.model

Examples of at.tuwien.minimee.model.ToolConfig


       
        MigrationResult result = new MigrationResult();
        String key = "minimee/";
        String toolIdentifier = toolID.substring(toolID.indexOf(key)
                + key.length());
        ToolConfig config = ToolRegistry.getInstance().getToolConfig(toolIdentifier);
        migrate(data, config, params, result);
       
        normaliseMeasurements(result, toolIdentifier);
        result.getMeasurements().put("input:filesize",new Measurement("input:filesize",data.length));
        return result;
View Full Code Here


     * @param toolID
     * @param params
     * @return
     */
    public MigrationResult migrate(byte[] data, String toolID, String params) {
        ToolConfig config = getToolConfig(toolID);
        ToolRegistry reg = ToolRegistry.getInstance();

        IMigrationEngine engine = reg.getAllEngines().get(config.getEngine());
        MigrationResult r= engine.migrate(data, toolID, params);

        /* evaluate result */
        evaluate(config, data, r);
       
View Full Code Here

     * This URL points to a GRATE session that contains the object readily waiting
     * to be rendered, already injected into the appropriate environment.
     * @throws PlatoServiceException if the connection to the GRATE server failed
     */
    public String startSession (String samplename, byte[] data, String toolID) throws PlatoServiceException{
        ToolConfig config = getToolConfig(toolID);
       
        String response;
        try {
            HttpClient client = new HttpClient();
            MultipartPostMethod mPost = new MultipartPostMethod(config.getTool().getExecutablePath());
            client.setConnectionTimeout(8000);


            // MultipartPostMethod needs a file instance
            File sample = File.createTempFile(samplename+System.nanoTime(), "tmp");
            OutputStream out = new BufferedOutputStream(new FileOutputStream(sample));
            out.write(data);
            out.close();
           
            mPost.addParameter("datei", samplename, sample);
           
            int statusCode = client.executeMethod(mPost);
           
            response = mPost.getResponseBodyAsString();
           
            return response+ config.getParams();

        } catch (HttpException e) {
            throw new PlatoServiceException("Could not connect to GRATE.", e);
        } catch (FileNotFoundException e) {
            throw new PlatoServiceException("Could not create temp file.", e);
View Full Code Here

   
   public String getToolIdentifier(String url) {
       
        ToolRegistry toolRegistry = ToolRegistry.getInstance();
       
        ToolConfig toolConfig = toolRegistry.getToolConfig(ToolRegistry.getToolKey(url));
       
        if (toolConfig == null) {
            return "";
        }
       
        return toolConfig.getTool().getIdentifier();
    }
View Full Code Here

   
    public String getToolParameters(String url) {
       
        ToolRegistry toolRegistry = ToolRegistry.getInstance();
       
        ToolConfig toolConfig = toolRegistry.getToolConfig(ToolRegistry.getToolKey(url));
       
        return toolConfig.getParams();
    }
View Full Code Here

     * @param toolID
     * @param params
     * @return
     */
    public MigrationResult migrate(byte[] data, String toolID, String params) {
        ToolConfig config = getToolConfig(toolID);
        ToolRegistry reg = ToolRegistry.getInstance();

        IMigrationEngine engine = reg.getAllEngines().get(config.getEngine());
        MigrationResult r= engine.migrate(data, toolID, params);

        /* evaluate result */
        evaluate(config, data, r);
       
View Full Code Here

     * This URL points to a GRATE session that contains the object readily waiting
     * to be rendered, already injected into the appropriate environment.
     * @throws MiniMeeException if the connection to the GRATE server failed
     */
    public String startSession (String samplename, byte[] data, String toolID) {
        ToolConfig config = getToolConfig(toolID);
        //throws MiniMeeException
       
//        String response;
//        try {
//            HttpClient client = new HttpClient();
View Full Code Here

       
        MigrationResult result = new MigrationResult();
        String key = "minimee/";
        String toolIdentifier = toolID.substring(toolID.indexOf(key)
                + key.length());
        ToolConfig config = ToolRegistry.getInstance().getToolConfig(toolIdentifier);
        migrate(data, config, params, result);
       
        normaliseMeasurements(result, toolIdentifier);
        result.getMeasurements().put("input:filesize",new Measurement("input:filesize",data.length));
        return result;
View Full Code Here

    public String getToolIdentifier(String url) {

        ToolRegistry toolRegistry = ToolRegistry.getInstance();

        ToolConfig toolConfig = toolRegistry.getToolConfig(ToolRegistry.getToolKey(url));

        if (toolConfig == null) {
            return "";
        }

        return toolConfig.getTool().getIdentifier();
    }
View Full Code Here

    public String getToolParameters(String url) {

        ToolRegistry toolRegistry = ToolRegistry.getInstance();

        ToolConfig toolConfig = toolRegistry.getToolConfig(ToolRegistry.getToolKey(url));

        return toolConfig.getParams();
    }
View Full Code Here

TOP

Related Classes of at.tuwien.minimee.model.ToolConfig

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.