/** a bit aggressive but to force out the little bugs .. */ protected final void assertResponseRead () { if(!didRead) throw new ProviderException ("Response has not been read yet! -- whose bad?"); }
/** * @throws RedisException */ @Version(major=2, minor=0, release=Release.ALPHA) public <K extends Object> JRedis discard () throws RedisException { throw new ProviderException("NOT IMPLEMENTED"); // // works // this.serviceRequest(Command.DISCARD); // return this; } // ------------------------------------------------------------------------
/** * @throws RedisException */ @Version(major=2, minor=0, release=Release.ALPHA) public JRedis discard () throws RedisException { if(true) throw new ProviderException("NOT IMPLEMENTED"); // works this.serviceRequest(Command.DISCARD); return this; } // ------------------------------------------------------------------------
/** * @throws RedisException */ @Version(major=2, minor=0, release=Release.ALPHA) public <K extends Object> JRedis discard () throws RedisException { throw new ProviderException("NOT IMPLEMENTED"); // // works // this.serviceRequest(Command.DISCARD); // return this; } // ------------------------------------------------------------------------
@Override public <K extends Object> void quit() { try { this.serviceRequest(Command.QUIT); } catch (RedisException e) { /* NotConnectedException is OK */ e.printStackTrace(); throw new ProviderException ("Quit raised an unexpected RedisException -- Bug"); } // return true; } // @Override
public void quit() { try { this.serviceRequest(Command.QUIT); } catch (RedisException e) { /* NotConnectedException is OK */ e.printStackTrace(); throw new ProviderException ("Quit raised an unexpected RedisException -- Bug"); } // return true; } //// @Override
@Override public <K extends Object> void quit() { try { this.serviceRequest(Command.QUIT); } catch (RedisException e) { /* NotConnectedException is OK */ e.printStackTrace(); throw new ProviderException ("Quit raised an unexpected RedisException -- Bug"); } // return true; } // @Override
protected List<byte[]> execSortStore(byte[]... fullSortCmd) throws IllegalStateException, RedisException { List<byte[]> multiBulkData= new ArrayList<byte[]>(1); try { ValueResponse valueResp = (ValueResponse) client.serviceRequest(Command.SORT$STORE, fullSortCmd); long resSize = valueResp.getLongValue(); multiBulkData.add(Convert.toBytes(resSize)); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return multiBulkData; }
@Override public <K extends Object> long lastsave() throws RedisException { long value = Long.MIN_VALUE; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.LASTSAVE); value = valResponse.getLongValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return value; }
public long dbsize() throws RedisException { long value = Long.MIN_VALUE; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.DBSIZE); value = valResponse.getLongValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return value; } // @Override
private boolean msetnx(byte[][] mappings) throws RedisException { boolean resvalue = false; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.MSETNX, mappings); resvalue = valResponse.getBooleanValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return resvalue; } public boolean msetnx(Map<String, byte[]> keyValueMap) throws RedisException {
public long lastsave() throws RedisException { long value = Long.MIN_VALUE; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.LASTSAVE); value = valResponse.getLongValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return value; }
@Override public <K extends Object> long lastsave() throws RedisException { long value = Long.MIN_VALUE; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.LASTSAVE); value = valResponse.getLongValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return value; }
protected List<byte[]> execSort(byte[] keyBytes, byte[] sortSpecBytes) throws IllegalStateException, RedisException { List<byte[]> multiBulkData= null; try { MultiBulkResponse multiBulkResponse = (MultiBulkResponse) client.serviceRequest(Command.SORT, keyBytes, sortSpecBytes); multiBulkData = multiBulkResponse.getMultiBulkData(); } catch (ClassCastException e){ throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e); } return multiBulkData; }
private boolean msetnx(byte[][] mappings) throws RedisException { boolean resvalue = false; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.MSETNX, mappings); resvalue = valResponse.getBooleanValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return resvalue; } @Override
@Override public <K extends Object> String bgrewriteaof() throws RedisException { /* boolean ValueRespose */ String value = null; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.BGREWRITEAOF); value = valResponse.getStringValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return value; }
@Override public <K extends Object> long dbsize() throws RedisException { long value = Long.MIN_VALUE; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.DBSIZE); value = valResponse.getLongValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return value; } @Override
@Override protected List<byte[]> execSort(byte[]... fullSortCmd) throws IllegalStateException, RedisException { List<byte[]> multiBulkData= null; try { MultiBulkResponse multiBulkResponse = (MultiBulkResponse) client.serviceRequest(Command.SORT, fullSortCmd); multiBulkData = multiBulkResponse.getMultiBulkData(); } catch (ClassCastException e){ throw new ProviderException("Expecting a MultiBulkResponse here => " + e.getLocalizedMessage(), e); } return multiBulkData; }
private boolean msetnx(byte[][] mappings) throws RedisException { boolean resvalue = false; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.MSETNX, mappings); resvalue = valResponse.getBooleanValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return resvalue; } @Override
public String bgrewriteaof() throws RedisException { /* boolean ValueRespose */ String value = null; try { ValueResponse valResponse = (ValueResponse) this.serviceRequest(Command.BGREWRITEAOF); value = valResponse.getStringValue(); } catch (ClassCastException e){ throw new ProviderException("Expecting a ValueResponse here => " + e.getLocalizedMessage(), e); } return value; }