use of com.github.jh3nd3rs0n.jargyle.transport.socks5.Reply in project jargyle by jh3nd3rs0n.
the class Socks5Client method receiveSocks5Reply.
protected Socks5Reply receiveSocks5Reply(final Socket connectedInternalSocket) throws IOException {
Socks5Reply socks5Rep = null;
try {
InputStream inputStream = connectedInternalSocket.getInputStream();
socks5Rep = Socks5Reply.newInstanceFrom(inputStream);
} catch (IOException e) {
SocksClientExceptionThrowingHelper.throwAsSocksClientException(e, this);
}
Reply reply = socks5Rep.getReply();
if (!reply.equals(Reply.SUCCEEDED)) {
throw new FailureSocks5ReplyException(this, socks5Rep);
}
return socks5Rep;
}
use of com.github.jh3nd3rs0n.jargyle.transport.socks5.Reply in project 91Pop by DanteAndroid.
the class AppApiHelper method action.
private Observable<BaseResult<List<MeiZiTu>>> action(Observable<String> stringObservable, String tag, final int page, final boolean pullToRefresh) {
DynamicKeyGroup dynamicKeyGroup = new DynamicKeyGroup(tag, page);
EvictDynamicKeyGroup evictDynamicKeyGroup = new EvictDynamicKeyGroup(pullToRefresh);
return cacheProviders.meiZiTu(stringObservable, dynamicKeyGroup, evictDynamicKeyGroup).map(new Function<Reply<String>, String>() {
@Override
public String apply(Reply<String> stringReply) throws Exception {
return stringReply.getData();
}
}).map(new Function<String, BaseResult<List<MeiZiTu>>>() {
@Override
public BaseResult<List<MeiZiTu>> apply(String s) throws Exception {
return ParseMeiZiTu.parseMzPosts(s, page);
}
});
}
use of com.github.jh3nd3rs0n.jargyle.transport.socks5.Reply in project 91Pop by DanteAndroid.
the class AppApiHelper method list99Mm.
@Override
public Observable<BaseResult<List<Mm99>>> list99Mm(String category, final int page, boolean cleanCache) {
String url = buildUrl(category, page);
DynamicKeyGroup dynamicKeyGroup = new DynamicKeyGroup(category, page);
EvictDynamicKeyGroup evictDynamicKeyGroup = new EvictDynamicKeyGroup(cleanCache);
return cacheProviders.cacheWithLimitTime(mm99ServiceApi.imageList(url), dynamicKeyGroup, evictDynamicKeyGroup).map(new Function<Reply<String>, String>() {
@Override
public String apply(Reply<String> stringReply) {
return stringReply.getData();
}
}).map(new Function<String, BaseResult<List<Mm99>>>() {
@Override
public BaseResult<List<Mm99>> apply(String s) {
return Parse99Mm.parse99MmList(s, page);
}
});
}
use of com.github.jh3nd3rs0n.jargyle.transport.socks5.Reply in project 91Pop by DanteAndroid.
the class AppApiHelper method loadPorn91MyFavoriteVideos.
@Override
public Observable<BaseResult<List<UnLimit91PornItem>>> loadPorn91MyFavoriteVideos(String userName, int page, boolean cleanCache) {
Observable<String> favoriteObservable = noLimit91PornServiceApi.myFavoriteVideo(page, HeaderUtils.getIndexHeader(addressHelper));
DynamicKeyGroup dynamicKeyGroup = new DynamicKeyGroup(userName, page);
EvictDynamicKey evictDynamicKey = new EvictDynamicKey(cleanCache);
return cacheProviders.getFavorite(favoriteObservable, dynamicKeyGroup, evictDynamicKey).map(new Function<Reply<String>, String>() {
@Override
public String apply(Reply<String> responseBody) throws Exception {
return responseBody.getData();
}
}).map(new Function<String, BaseResult<List<UnLimit91PornItem>>>() {
@Override
public BaseResult<List<UnLimit91PornItem>> apply(String s) throws Exception {
return Parse91PronVideo.parseMyFavorite(s);
}
});
}
use of com.github.jh3nd3rs0n.jargyle.transport.socks5.Reply in project RxCache by VictorAlbertos.
the class ProcessorProvidersTest method When_Evict_Cache_Then_Source_Retrieved_Is_Cloud.
@Test
public void When_Evict_Cache_Then_Source_Retrieved_Is_Cloud() {
TestObserver observerMock = getSubscriberCompleted(true, true, true, Loader.VALID, false);
Reply<Mock> reply = (Reply) observerMock.values().get(0);
assertThat(reply.getSource(), is(Source.CLOUD));
assertNotNull(reply.getData());
}
Aggregations