Examples of openSequence()


Examples of com.sleepycat.je.Database.openSequence()

        SequenceConfig config = new SequenceConfig();
        config.setAllowCreate(true);

        Transaction txn = txnBegin();
        Sequence seq = db.openSequence(txn, key, config);
        txnCommit(txn);

        txn = txnBegin();

        /* Check default values before calling get(). */
 
View Full Code Here

Examples of com.sleepycat.je.Database.openSequence()

        config.setDecrement(true);
        config.setRange(1, 3);
        config.setInitialValue(3);

        Transaction txn = txnBegin();
        Sequence seq = db.openSequence(txn, key, config);
        assertEquals(3, seq.get(txn, 1));
        txnCommit(txn);

        /* Open another handle on the same sequence -- config should match. */

 
View Full Code Here

Examples of com.sleepycat.je.Database.openSequence()

        txnCommit(txn);

        /* Open another handle on the same sequence -- config should match. */

        txn = txnBegin();
        Sequence seq2 = db.openSequence(txn, key, config);
        assertEquals(2, seq2.get(txn, 1));
        txnCommit(txn);

        SequenceStats stats = seq2.getStats(null);
        assertEquals(1, stats.getCurrent());
View Full Code Here

Examples of com.sleepycat.je.Database.openSequence()

        /* Create the sequence oject. */
        SequenceConfig config = new SequenceConfig();
        config.setAllowCreate(true);
        DatabaseEntry key =
            new DatabaseEntry(KEY_NAME.getBytes("UTF-8"));
        Sequence seq = db.openSequence(null, key, config);

        /* Allocate a few sequence numbers. */
        for (int i = 0; i < 10; i++) {
            long seqnum = seq.get(null, 1);
            System.out.println("Got sequence number: " + seqnum);
View Full Code Here

Examples of com.sun.jmx.snmp.BerDecoder.openSequence()

    public void decodeMessage(byte[] inputBytes, int byteCount)
        throws SnmpStatusException {

        try {
            BerDecoder bdec = new BerDecoder(inputBytes);
            bdec.openSequence();
            version = bdec.fetchInteger();
            bdec.openSequence();
            msgId = bdec.fetchInteger();
            msgMaxSize = bdec.fetchInteger();
            msgFlags = bdec.fetchOctetString()[0];
View Full Code Here

Examples of com.sun.jmx.snmp.BerDecoder.openSequence()

        try {
            BerDecoder bdec = new BerDecoder(inputBytes);
            bdec.openSequence();
            version = bdec.fetchInteger();
            bdec.openSequence();
            msgId = bdec.fetchInteger();
            msgMaxSize = bdec.fetchInteger();
            msgFlags = bdec.fetchOctetString()[0];
            msgSecurityModel =bdec.fetchInteger();
            bdec.closeSequence();
View Full Code Here

Examples of com.sun.jmx.snmp.BerDecoder.openSequence()

            msgFlags = bdec.fetchOctetString()[0];
            msgSecurityModel =bdec.fetchInteger();
            bdec.closeSequence();
            msgSecurityParameters = bdec.fetchOctetString();
            if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
                bdec.openSequence();
                contextEngineId = bdec.fetchOctetString();
                contextName = bdec.fetchOctetString();
                data = bdec.fetchAny();
                dataLength = data.length;
                bdec.closeSequence();
View Full Code Here

Examples of com.sun.jmx.snmp.BerDecoder.openSequence()

    public int getRequestId(byte[] data) throws SnmpStatusException {
        BerDecoder bdec = null;
        int msgId = 0;
        try {
            bdec = new BerDecoder(data);
            bdec.openSequence();
            bdec.fetchInteger();
            bdec.openSequence();
            msgId = bdec.fetchInteger();
        }catch(BerException x) {
            throw new SnmpStatusException("Invalid encoding") ;
View Full Code Here

Examples of com.sun.jmx.snmp.BerDecoder.openSequence()

        int msgId = 0;
        try {
            bdec = new BerDecoder(data);
            bdec.openSequence();
            bdec.fetchInteger();
            bdec.openSequence();
            msgId = bdec.fetchInteger();
        }catch(BerException x) {
            throw new SnmpStatusException("Invalid encoding") ;
        }
        try {
View Full Code Here

Examples of com.sun.jmx.snmp.BerDecoder.openSequence()

        SnmpScopedPduPacket pdu = null;

        BerDecoder bdec = new BerDecoder(data) ;
        try {
            int type = bdec.getTag() ;
            bdec.openSequence(type) ;
            switch(type) {

            case pduGetRequestPdu :
            case pduGetNextRequestPdu :
            case pduInformRequestPdu :
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.