Package com.sleepycat.bind.tuple

Examples of com.sleepycat.bind.tuple.TupleBinding.entryToObject()


  TupleBinding tpb = new IndexableDoc().getBdbBinding();
  DatabaseEntry data = new DatabaseEntry();
  if ( dbt.fetch(key, data) )
   {
     //*-- extract the text of the document
     IndexableDoc idoc = (IndexableDoc) tpb.entryToObject(data);
     String docText = idoc.getContents().toString();
   
     //*-- tokenize the text
     analyzer.setExtractEntities(false);
     Token[] tokens = null;
View Full Code Here


            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            TupleBinding binding = _queueTupleBindingFactory.getInstance();
            while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
            {
                QueueRecord queueRecord = (QueueRecord) binding.entryToObject(value);
               
                String queueName = queueRecord.getNameShortString() == null ? null :
                                        queueRecord.getNameShortString().asString();
                String owner = queueRecord.getOwner() == null ? null :
                                        queueRecord.getOwner().asString();
View Full Code Here

            DatabaseEntry value = new DatabaseEntry();
            TupleBinding binding = new ExchangeTB();
           
            while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
            {
                ExchangeRecord exchangeRec = (ExchangeRecord) binding.entryToObject(value);

                String exchangeName = exchangeRec.getNameShortString() == null ? null :
                                      exchangeRec.getNameShortString().asString();
                String type = exchangeRec.getType() == null ? null :
                              exchangeRec.getType().asString();
View Full Code Here

           
            while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
            {
                //yes, this is retrieving all the useful information from the key only.
                //For table compatibility it shall currently be left as is
                BindingKey bindingRecord = (BindingKey) binding.entryToObject(key);
               
                String exchangeName = bindingRecord.getExchangeName() == null ? null :
                                      bindingRecord.getExchangeName().asString();
                String queueName = bindingRecord.getQueueName() == null ? null :
                                   bindingRecord.getQueueName().asString();
View Full Code Here

            OperationStatus status = _queueDb.get(null, key, value, LockMode.DEFAULT);
            if(status == OperationStatus.SUCCESS)
            {
                //read the existing record and apply the new exclusivity setting
                QueueRecord queueRecord = (QueueRecord) queueBinding.entryToObject(value);
                queueRecord.setExclusive(queue.isExclusive());
               
                //write the updated entry to the store
                queueBinding.objectToEntry(queueRecord, newValue);
               
View Full Code Here

            if (status != OperationStatus.SUCCESS)
            {
                throw new AMQStoreException("Metadata not found for message with id " + messageId);
            }

            StorableMessageMetaData mdd = (StorableMessageMetaData) messageBinding.entryToObject(value);

            return mdd;
        }
        catch (DatabaseException e)
        {
View Full Code Here

       
        DatabaseVisitor exchangeListVisitor = new DatabaseVisitor()
        {          
            public void visit(DatabaseEntry key, DatabaseEntry value) throws DatabaseException
            {
                ExchangeRecord exchangeRec = (ExchangeRecord) exchangeTB.entryToObject(value);
                AMQShortString type = exchangeRec.getType();

                if (ExchangeDefaults.TOPIC_EXCHANGE_CLASS.equals(type))
                {
                    topicExchanges.add(exchangeRec.getNameShortString());
View Full Code Here

                {
                    _bytesSeenSoFar = 0;
                }

                //determine the content size
                ByteBuffer content = (ByteBuffer) contentTB.entryToObject(value);
                int contentSize = content.limit();

                //create the new key: id + previously seen data count
                MessageContentKey_5 newKey = new MessageContentKey_5(msgId, _bytesSeenSoFar);
                DatabaseEntry newKeyEntry = new DatabaseEntry();
View Full Code Here

        /* Test standard object binding. */

        binding.objectToEntry(val, buffer);
        assertEquals(byteSize, buffer.getSize());

        Object val2 = binding.entryToObject(buffer);
        assertSame(compareCls, val2.getClass());
        assertEquals(val, val2);

        Object valWithWrongCls = (primitiveCls == String.class)
                      ? ((Object) new Integer(0)) : ((Object) new String(""));
View Full Code Here

        binding.objectToEntry(val, output);
        output.writeString("xyz");

        TupleInput input = new TupleInput(output);
        assertEquals("abc", input.readString());
        Object val3 = binding.entryToObject(input);
        assertEquals("xyz", input.readString());

        assertEquals(0, input.available());
        assertSame(compareCls, val3.getClass());
        assertEquals(val, val3);
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.