Package net.sourceforge.processdash.net.http

Examples of net.sourceforge.processdash.net.http.TinyCGIException


            return result;

        } catch (Throwable t) {
            t.printStackTrace();
            TinyCGIException e = new TinyCGIException(500, "Internal Error");
            e.initCause(t);
            throw e;
        }
    }
View Full Code Here


    private static final Logger log = Logger
            .getLogger(SizeMetricApiDispatcher.class.getName());

    @Override
    protected void doGet() throws IOException {
        throw new TinyCGIException(405,
                "Request method 'GET' is not supported by this API.");
    }
View Full Code Here

    private void printStoredReport() throws IOException {
        long reportId = Long.parseLong(getParameter("report"));
        File reportFile = STORED_REPORTS.get(reportId);
        if (reportFile == null)
            throw new TinyCGIException(404, "Report Not Found");
        else
            FileUtils.copyFile(reportFile, outStream);
    }
View Full Code Here

        else if (script.contains("getHierarchy"))
            writeHierarchy();
        else if (script.contains("getScripts"))
            writeScripts();
        else
            throw new TinyCGIException(404, "Unrecognized request");
    }
View Full Code Here

    @Override
    protected void doGet() throws IOException {
        int streamID = Integer.parseInt(getParameter("id"));
        InputStream pngData = PngCache.PNG_CACHE.getInputStream(streamID);
        if (pngData == null)
            throw new TinyCGIException(HttpURLConnection.HTTP_NOT_FOUND,
                    "Not Found", "Not Found");

        out.print("Content-type: image/png\r\n\r\n");
        out.flush();
View Full Code Here

    private PageContentTO loadPersistedPageContent(String filename)
            throws IOException {
        // retrieve the contents of the named file from the persistence service
        InputStream content = CmsDefaultConfig.getPersistence().open(filename);
        if (content == null)
            throw new TinyCGIException(404, "Not Found");

        // parse the contents
        PageContentTO page = CmsDefaultConfig.getSerializer().parse(content);
        return page;
    }
View Full Code Here

            else if (VALUE_CHART.equals(tableType))
                writeValueTable();
            else if (COMBINED_CHART.equals(tableType))
                writeCombinedTable();
            else
                throw new TinyCGIException
                    (400, "unrecognized table type parameter");

        } else if (TIME_CHART.equals(chartType))
            writeTimeChart();
        else if (VALUE_CHART.equals(chartType))
            writeValueChart();
        else if (COMBINED_CHART.equals(chartType))
            writeCombinedChart();
        else
            throw new TinyCGIException
                (400, "unrecognized chart type parameter");
    }
View Full Code Here


    private void getEVModel() throws TinyCGIException {
        taskListName = settings.getTaskListName();
        if (taskListName == null)
            throw new TinyCGIException(400, "schedule name missing");
        else if (FAKE_MODEL_NAME.equals(taskListName)) {
            evModel = null;
            return;
        }

        long now = System.currentTimeMillis();

        synchronized (EVReport.class) {
            if (drawingChart &&
                (now - lastRecalcTime < MAX_DELAY) &&
                taskListName.equals(lastTaskListName)) {
                evModel = lastEVModel.get();
                if (evModel != null)
                    return;
            }
        }

        evModel = EVTaskList.openExisting
            (taskListName,
             getDataRepository(),
             getPSPProperties(),
             getObjectCache(),
             false); // change notification not required
        if (evModel == null)
            throw new TinyCGIException(404, "Not Found",
                                       "No such task/schedule");

        EVDependencyCalculator depCalc = new EVDependencyCalculator(
                getDataRepository(), getPSPProperties(), getObjectCache());
        evModel.setDependencyCalculator(depCalc);
View Full Code Here

             getDataRepository(),
             getPSPProperties(),
             getObjectCache(),
             false); // change notification not required
        if (evModel == null)
            throw new TinyCGIException(404, "Not Found",
                                       "No such task/schedule");
       
        EVTaskFilter taskFilter = settings.getEffectiveFilter(evModel);
       
        EVDependencyCalculator depCalc = new EVDependencyCalculator(
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.net.http.TinyCGIException

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.