Examples of SaveableData


Examples of net.sourceforge.processdash.data.SaveableData

            double targetVal = 0;
            try {
                targetVal = FormatUtil.parseNumber(target);
            } catch (Exception e) {
                SaveableData val = getDataRepository().getInheritableValue(
                        getPrefix(), target);
                if (val != null) {
                    SimpleData sVal = val.getSimpleValue();
                    if (sVal instanceof NumberData)
                        targetVal = ((NumberData) sVal).getDouble();
                }
            }
            if (targetVal == 0)
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

     *         value that was or was not found
     */
    public static InheritedValue get(DataContext data, String prefix,
            String name) {
        String dataName = prefix + "/" + name;
        SaveableData result = data.getValue(dataName);
        int pos;
        while (result == null && prefix.length() > 0) {
            pos = prefix.lastIndexOf('/');
            if (pos == -1)
                prefix = "";
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

        Object result = get(name);
        if (result instanceof SimpleData) {
            return (SimpleData) result;
       
        } else if (result instanceof SaveableData) {
            SaveableData sd = (SaveableData) result;
            return sd.getSimpleValue();
           
        } else {
            return null;
        }
    }
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

        String [] fixedUpNames = new String[dataNames.length];
        for (int i=dataNames.length;  i>0)
            if (dataNames[--i].charAt(0) == '!')
                fixedUpNames[i] = fixupName(dataNames[i]);
        SaveableData value;

        for (int p=0;  p < prefixes.length;  p++) {
            // get the next prefix
            prefix = prefixes[p];
            // remove the name of the orderBy data element, & the preceeding /
            prefix = prefix.substring(0, prefix.length() - tailLen);
            if (baseLen > prefix.length())
                result.setRowName(p+1, "");
            else
                result.setRowName(p+1, prefix.substring(baseLen));

            // look up the data for this row.
            for (int d=0;  d < dataNames.length;  d++)
                if (dataNames[d].startsWith("![(")) {
                    dataName = DataRepository.anonymousPrefix + "/" +
                        prefix + "/" + fixedUpNames[d];
                    value = data.getSimpleValue(dataName);

                    if (value == null) try {
                        value = ValueFactory.create
                            (dataName, dataNames[d], data, prefix);
                        data.putValue(dataName, value);
                    } catch (MalformedValueException mve) { }
                    result.setData(p+1, d+1,
                                   value==null ?null :value.getSimpleValue());

                } else if (dataNames[d].startsWith("\"")) { try {
                    result.setData(p+1, d+1, new StringData(dataNames[d]));
                } catch (MalformedValueException mve) {
                    result.setData(p+1, d+1, null);
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

     * the default set of historical data.
     */
    public static ProbeData getEffectiveData(DataRepository data, String prefix) {
        String forListDataName = DataRepository.createDataName(prefix,
            PROBE_LIST_NAME);
        SaveableData probeList = data.getValue(forListDataName);
        if (probeList == null)
            return new ProbeData(data, prefix, (String) null);
        else
            return new ProbeData(data, prefix, ListData.asListData(probeList));
    }
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

        return createHandler(extensionPointId, configElement);
    }

    protected String getHandlerId(String targetPath) {
        // look for a data element stating the ID of the extension point to use.
        SaveableData registration = getDataRepository().getInheritableValue(
            targetPath, REGISTRATION_DATA_ELEM);
        if (registration == null)
            throw new WebApiException(UNSUPPORTED_TARGET_PATH, 400,
                    "The path '" + targetPath + "' does not support the "
                            + "storage of size metrics through this API.");
        else
            return registration.getSimpleValue().format();
    }
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

    private void addNotification(SizeMetricApiRequestData request,
            DateData timestamp) {

        // find the root node of the team project, and retrieve the project ID
        StringBuffer projectPrefixBuf = new StringBuffer(request.targetPath);
        SaveableData projID = request.ctx.getData().getInheritableValue(
            projectPrefixBuf, "Project_ID");
        if (projID == null)
            return;
        String projectPrefix = projectPrefixBuf.toString();

        // construct an ID representing this user notification. We construct
        // an ID that will be the same for multiple API invocations against
        // this same team project; this way, the multiple invocations will
        // only spawn a single notification
        String notificationId = McfSizeMetricApiHandler.class.getName() + ":"
                + projID.getSimpleValue().format();

        // retrieve the message that should be displayed to the user
        String message = resources.format("Notification_Message_FMT",
            projectPrefix);
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

        return getData(request, dataElemName) != null;
    }

    private String getStringData(SizeMetricApiRequestData request,
            String dataElemName) {
        SaveableData value = getData(request, dataElemName);

        SimpleData result = null;
        if (value != null)
            result = value.getSimpleValue();

        return (result == null ? null : result.format());
    }
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

        public PathVariable(String name) {
            this(name, name, null, null); }
        public PathVariable(String name, String metaName, String impliedPath,
                            String defaultValue) {
            this.metaName = metaName;
            SaveableData val = null;
            DataRepository data = getDataRepository();

            if (name.startsWith("/")) {
                // The name is absolute - look it up in the data repository.
                val = data.getSimpleValue(dataName = name);

            } else {
                // Look for an inheritable value with this name in the data
                // repository.
                StringBuffer prefix = new StringBuffer(getPrefix());
                val = data.getInheritableValue(prefix, name);
                if (val != null && !(val instanceof SimpleData))
                    val = val.getSimpleValue();
                dataName = DataRepository.createDataName(prefix.toString(), name);
            }

            // Check to see if a value was POSTed to this CGI script for this
            // data element.  If so, it would override any previous value.
View Full Code Here

Examples of net.sourceforge.processdash.data.SaveableData

            String newName = ELEMENTS_TO_RENAME[i][1];
           
            String legacyDataName = DataRepository.createDataName(path, legacyName);
            String newDataName = DataRepository.createDataName(path, newName);
           
            SaveableData value = data.getValue(legacyDataName);
            if (value instanceof DoubleData) {
                data.putValue(newDataName, value);
                data.restoreDefaultValue(legacyDataName);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.