Examples of toRepresentation()


Examples of org.apache.ace.log.LogEvent.toRepresentation()

                    while ((current.getID() > lowest)
                            && rangeIterator.hasNext()) {
                        lowest = rangeIterator.next();
                    }
                    if (current.getID() == lowest) {
                        writer.write(current.toRepresentation() + "\n");
                    }
                }
            }
        }
        writer.flush();
View Full Code Here

Examples of org.apache.ace.log.LogEvent.toRepresentation()

            @SuppressWarnings("unchecked")
            public LogEvent put(int type, Dictionary props) throws IOException { return null; }
        });
        MockConnection connection = new MockConnection(new URL("http://mock"));
        m_task.synchronizeLog(1, input, connection);
        String expectedString = event.toRepresentation() + "\n";
        String actualString = connection.getString();

        assert actualString.equals(expectedString) : "We expected " + expectedString + " but received " + actualString;
    }
View Full Code Here

Examples of org.apache.ace.log.LogEvent.toRepresentation()

        m_logServlet.handleSend(input);

        String actual = "";
        for (Iterator<LogEvent> i = m_mockStore.m_events.iterator(); i.hasNext();) {
            LogEvent event = i.next();
            actual = actual + event.toRepresentation() + "\n";
        }
        assert expected.equals(actual);
    }

    private class MockLogStore implements LogStore {
View Full Code Here

Examples of org.apache.ace.log.LogEvent.toRepresentation()

            throws IOException {
        try {
            LogEvent result = new LogEvent(m_identification.getID(),
                    m_store.getId(), getNextID(), System.currentTimeMillis(),
                    type, props);
            m_store.append(result.getID(), result.toRepresentation().getBytes());
            return result;
        }
        catch (IOException ex) {
            handleException(m_store, ex);
        }
View Full Code Here

Examples of org.apache.ace.range.Range.toRepresentation()

                targetIDToFilename(targetID)), String.valueOf(logID))
                .getAbsolutePath());
        if (high != null) {
            Range r = new Range(1, high);
            return new LogDescriptor(targetID, logID, new SortedRangeSet(
                    r.toRepresentation()));
        }
        List<LogEvent> events = get(new LogDescriptor(targetID, logID,
                SortedRangeSet.FULL_SET));

        long[] idsArray = new long[events.size()];
View Full Code Here

Examples of org.apache.ace.range.Range.toRepresentation()

        assert r1.getLow() == 5 : "Lowest value should be 5";
        assert r1.getHigh() == 5 : "Highest value should be 5";
        assert r1.contains(5) : "Range should contain 5";
        assert !r1.contains(4) : "Range should not contain 4";
        assert !r1.contains(6) : "Range should not contain 6";
        assert "5".equals(r1.toRepresentation()) : "Representation should be 5";
        Range r2 = new Range("2-6");
        assert r2.getLow() == 2 : "Lowest value should be 2";
        assert r2.getHigh() == 6 : "Highest value should be 6";
        assert r2.contains(6) : "Range should contain 6";
        assert !r2.contains(7) : "Range should not contain 7";
View Full Code Here

Examples of org.apache.ace.range.Range.toRepresentation()

        assert r2.getLow() == 2 : "Lowest value should be 2";
        assert r2.getHigh() == 6 : "Highest value should be 6";
        assert r2.contains(6) : "Range should contain 6";
        assert !r2.contains(7) : "Range should not contain 7";
        assert !r2.contains(0) : "Range should not contain 0";
        assert "2-6".equals(r2.toRepresentation()) : "Representation should be 2-6";
        Range r3 = new Range(5);
        assert r3.getLow() == 5 : "Lowest value should be 5";
        assert r3.getHigh() == 5 : "Highest value should be 5";
        Range r4 = new Range(6,8);
        assert r4.getLow() == 6 : "Lowest value should be 6";
View Full Code Here

Examples of org.apache.ace.range.Range.toRepresentation()

    public Descriptor getDescriptor(String targetID, long logID) throws IOException {
        Long high = m_fileToID.get(new File(new File(m_dir, targetIDToFilename(targetID)), String.valueOf(logID)).getAbsolutePath());
        if (high != null) {
            Range r = new Range(1, high);
            return new Descriptor(targetID, logID, new SortedRangeSet(r.toRepresentation()));
        }
        List<Event> events = get(new Descriptor(targetID, logID, SortedRangeSet.FULL_SET));

        long[] idsArray = new long[events.size()];
        int i = 0;
View Full Code Here

Examples of org.apache.ace.range.Range.toRepresentation()

                gatewayIDToFilename(gatewayID)), String.valueOf(logID))
                .getAbsolutePath());
        if (high != null) {
            Range r = new Range(1, high);
            return new LogDescriptor(gatewayID, logID, new SortedRangeSet(
                    r.toRepresentation()));
        }
        List<LogEvent> events = get(new LogDescriptor(gatewayID, logID,
                SortedRangeSet.FULL_SET));

        long[] idsArray = new long[events.size()];
View Full Code Here

Examples of org.geoserver.rest.format.DataFormat.toRepresentation()

        // get the appropriate format
        DataFormat format = getFormatGet();

        // transform the string "Hello World" to the appropriate response
        getResponse().setEntity(format.toRepresentation(ReloadedMsg));
    }

}
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.