/** * Create read record header database operation. */ public static Operation getHeader() { return new Operation(Type.READ_HEADER); }
/** * Create string append database operation. */ public static Operation append(Bin bin) { return new Operation(Type.APPEND, bin.name, bin.value); }
/** * Create read record header database operation. */ public static Operation getHeader() { return new Operation(Type.READ_HEADER); }
/** * Create read all record bins database operation. */ public static Operation get() { return new Operation(Type.READ); }
/** * Create integer add database operation. */ public static Operation add(Bin bin) { return new Operation(Type.ADD, bin.name, bin.value); }
/** * Create read bin database operation. */ public static Operation get(String binName) { return new Operation(Type.READ, binName); }
/** * Create set database operation. */ public static Operation put(Bin bin) { return new Operation(Type.WRITE, bin.name, bin.value); }
/** * Create touch database operation. */ public static Operation touch() { return new Operation(Type.TOUCH); }
/** * Create string prepend database operation. */ public static Operation prepend(Bin bin) { return new Operation(Type.PREPEND, bin.name, bin.value); }
protected static Operation createOperation(int command, Operation.Type type, String binName) { Packer packer = new Packer(); packer.packRawShort(command); return new Operation(type, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(1); packer.packInt(v1); return new Operation(type, binName, Value.get(packer.toByteArray())); }
/** * Create default list append items operation. * Server appends each input list item to end of list bin. * Server returns list size. */ public static Operation appendItems(String binName, List<Value> list) { Packer packer = new Packer(); packer.packRawShort(APPEND_ITEMS); packer.packArrayBegin(1); packer.packValueList(list); return new Operation(Operation.Type.CDT_MODIFY, binName, Value.get(packer.toByteArray())); }
/** * Create default list append items operation. * Server appends each input list item to end of list bin. * Server returns list size. */ public static Operation appendItems(String binName, List<Value> list) { Packer packer = new Packer(); packer.packRawShort(APPEND_ITEMS); packer.packArrayBegin(1); packer.packValueList(list); return new Operation(Operation.Type.CDT_MODIFY, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, int v2) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(2); packer.packInt(v1); packer.packInt(v2); return new Operation(type, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, Value v2) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(2); packer.packInt(v1); v2.pack(packer); return new Operation(type, binName, Value.get(packer.toByteArray())); }
/** * Create default list insert items operation. * Server inserts each input list item starting at specified index of list bin. * Server returns list size. */ public static Operation insertItems(String binName, int index, List<Value> list) { Packer packer = new Packer(); packer.packRawShort(INSERT_ITEMS); packer.packArrayBegin(2); packer.packInt(index); packer.packValueList(list); return new Operation(Operation.Type.CDT_MODIFY, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, int v2, int v3) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(3); packer.packInt(v1); packer.packInt(v2); packer.packInt(v3); return new Operation(type, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, int v2, int v3) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(3); packer.packInt(v1); packer.packInt(v2); packer.packInt(v3); return new Operation(type, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, Value v2, int v3) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(3); packer.packInt(v1); v2.pack(packer); packer.packInt(v3); return new Operation(type, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, Value v2, int v3, int v4) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(4); packer.packInt(v1); v2.pack(packer); packer.packInt(v3); packer.packInt(v4); return new Operation(type, binName, Value.get(packer.toByteArray())); }