Java Code Examples for com.sleepycat.bind.tuple.TupleOutput#writeString()

The following examples show how to use com.sleepycat.bind.tuple.TupleOutput#writeString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UpgradeFrom5To6.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
private void writeRecords(OldRecordImpl[] records, TupleOutput output)
{
    if (records == null)
    {
        output.writeInt(0);
    }
    else
    {
        output.writeInt(records.length);
        for (OldRecordImpl record : records)
        {
            output.writeString(record.getQueueName());
            output.writeLong(record.getMessageNumber());
        }
    }
}
 
Example 2
Source File: ConfiguredObjectBinding.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
@Override
public void objectToEntry(ConfiguredObjectRecord object, TupleOutput tupleOutput)
{
    try
    {
        StringWriter writer = new StringWriter();
        final ObjectMapper objectMapper = ConfiguredObjectJacksonModule.newObjectMapper(true);
        objectMapper.writeValue(writer, object.getAttributes());
        tupleOutput.writeString(object.getType());
        tupleOutput.writeString(writer.toString());
    }
    catch (IOException e)
    {
        throw new StoreException(e);
    }
}
 
Example 3
Source File: LinkKeyEntryBinding.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public void objectToEntry(final LinkKey linkKey, final TupleOutput output)
{
    output.writeString(linkKey.getRemoteContainerId());
    output.writeString(linkKey.getLinkName());
    output.writeBoolean(linkKey.getRole().getValue());
}
 
Example 4
Source File: UpgradeFrom7To8.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
void storeVirtualHostHierarchyRecord(Database hierarchyDb, Transaction txn, UUID id, UUID virtualHostId)
{
    DatabaseEntry key = new DatabaseEntry();
    DatabaseEntry value = new DatabaseEntry();
    UUIDTupleBinding.getInstance().objectToEntry(virtualHostId, value);
    TupleOutput tupleOutput = new TupleOutput();
    tupleOutput.writeLong(id.getMostSignificantBits());
    tupleOutput.writeLong(id.getLeastSignificantBits());
    tupleOutput.writeString("VirtualHost");
    TupleBinding.outputToEntry(tupleOutput, key);
    hierarchyDb.put(txn, key, value);
}
 
Example 5
Source File: HierarchyKeyBinding.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public void objectToEntry(HierarchyKey hk, TupleOutput tupleOutput)
{
    UUID uuid = hk.getChildId();
    tupleOutput.writeLong(uuid.getMostSignificantBits());
    tupleOutput.writeLong(uuid.getLeastSignificantBits());
    tupleOutput.writeString(hk.getParentType());
}
 
Example 6
Source File: StringMapBinding.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public void objectToEntry(final Map<String, String> stringStringMap, final TupleOutput tupleOutput)
{
    tupleOutput.writeInt(stringStringMap.size());
    for(Map.Entry<String,String> entry : stringStringMap.entrySet())
    {
        tupleOutput.writeString(entry.getKey());
        tupleOutput.writeString(entry.getValue());
    }
}
 
Example 7
Source File: MapBinding.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public void objectToEntry(final Map<String, Object> map, final TupleOutput output)
{
    try
    {
        StringWriter writer = new StringWriter();
        final ObjectMapper objectMapper = ConfiguredObjectJacksonModule.newObjectMapper(true);
        objectMapper.writeValue(writer, map);
        output.writeString(writer.toString());
    }
    catch (IOException e)
    {
        throw new StoreException(e);
    }
}
 
Example 8
Source File: UpgradeFrom5To6.java    From qpid-broker-j with Apache License 2.0 4 votes vote down vote up
@Override
public void objectToEntry(UpgradeConfiguredObjectRecord object, TupleOutput tupleOutput)
{
    tupleOutput.writeString(object.getType());
    tupleOutput.writeString(object.getAttributes());
}