public class TelegramApi extends Object
| Constructor and Description |
|---|
TelegramApi(AbsApiState state,
AppInfo _appInfo,
ApiCallback _apiCallback)
Instantiates a new Telegram api.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close void.
|
TLFile |
doGetFile(int dcId,
TLAbsInputFileLocation _location,
int _offset,
int _limit)
Do get file.
|
<T extends TLObject> |
doRpcCall(TLMethod<T> method)
Do rpc call.
|
<T extends TLObject> |
doRpcCall(TLMethod<T> method,
int timeout)
Do rpc call.
|
<T extends TLObject> |
doRpcCall(TLMethod<T> method,
int timeout,
RpcCallback<T> callback)
Do rpc call.
|
<T extends TLObject> |
doRpcCall(TLMethod<T> method,
RpcCallback<T> callback)
Do rpc call.
|
<T extends TLObject> |
doRpcCallGzip(TLMethod<T> method,
int timeout)
Do rpc call gzip.
|
<T extends TLObject> |
doRpcCallNonAuth(TLMethod<T> method)
Do rpc call non auth.
|
<T extends TLObject> |
doRpcCallNonAuth(TLMethod<T> method,
int dcId)
Do rpc call non auth.
|
<T extends TLObject> |
doRpcCallNonAuth(TLMethod<T> method,
int timeout,
int dcId)
Do rpc call non auth.
|
<T extends TLObject> |
doRpcCallNonAuth(TLMethod<T> method,
int timeout,
RpcCallback<T> callback)
Do rpc call non auth.
|
<T extends TLObject> |
doRpcCallSide(TLMethod<T> method)
Do rpc call side.
|
<T extends TLObject> |
doRpcCallSide(TLMethod<T> method,
int timeout)
Do rpc call side.
|
<T extends TLObject> |
doRpcCallSideGzip(TLMethod<T> method,
int timeout)
Do rpc call side gzip.
|
<T extends TLObject> |
doRpcCallWeak(TLMethod<T> method)
Do rpc call weak.
|
<T extends TLObject> |
doRpcCallWeak(TLMethod<T> method,
int timeout)
Do rpc call weak.
|
boolean |
doSaveBigFilePart(long _fileId,
int _filePart,
int _totalParts,
byte[] _bytes)
Do save big file part.
|
boolean |
doSaveFilePart(long _fileId,
int _filePart,
byte[] _bytes)
Do save file part.
|
TLApiContext |
getApiContext()
Gets api context.
|
Downloader |
getDownloader()
Gets downloader.
|
AbsApiState |
getState()
Gets state.
|
Uploader |
getUploader()
Gets uploader.
|
boolean |
isClosed()
Is closed.
|
void |
notifyCallbacks() |
protected void |
onMessageArrived(TLObject object)
On message arrived.
|
void |
resetConnectionInfo()
Reset connection info.
|
void |
resetNetworkBackoff()
Reset network backoff.
|
void |
switchToDc(int dcId)
Switch to dc.
|
String |
toString() |
public TelegramApi(AbsApiState state, AppInfo _appInfo, ApiCallback _apiCallback)
state - the state_appInfo - the _ app info_apiCallback - the _ api callbackpublic Downloader getDownloader()
public Uploader getUploader()
public void switchToDc(int dcId)
dcId - the dc idpublic AbsApiState getState()
public TLApiContext getApiContext()
protected void onMessageArrived(TLObject object)
object - the objectpublic boolean isClosed()
public void close()
public void resetNetworkBackoff()
public void resetConnectionInfo()
public <T extends TLObject> void doRpcCallWeak(TLMethod<T> method)
T - the type parametermethod - the methodpublic <T extends TLObject> void doRpcCallWeak(TLMethod<T> method, int timeout)
T - the type parametermethod - the methodtimeout - the timeoutpublic <T extends TLObject> void doRpcCall(TLMethod<T> method, RpcCallback<T> callback)
T - the type parametermethod - the methodcallback - the callbackpublic <T extends TLObject> void doRpcCall(TLMethod<T> method, int timeout, RpcCallback<T> callback)
T - the type parametermethod - the methodtimeout - the timeoutcallback - the callbackpublic <T extends TLObject> T doRpcCall(TLMethod<T> method) throws IOException, TimeoutException
T - the type parametermethod - the methodIOException - the iO exceptionTimeoutExceptionpublic <T extends TLObject> T doRpcCall(TLMethod<T> method, int timeout) throws IOException, TimeoutException
T - the type parametermethod - the methodtimeout - the timeoutIOException - the iO exceptionTimeoutExceptionpublic <T extends TLObject> T doRpcCallSide(TLMethod<T> method) throws IOException, TimeoutException
T - the type parametermethod - the methodIOException - the iO exceptionTimeoutExceptionpublic <T extends TLObject> T doRpcCallSide(TLMethod<T> method, int timeout) throws IOException, TimeoutException
T - the type parametermethod - the methodtimeout - the timeoutIOException - the iO exceptionTimeoutExceptionpublic <T extends TLObject> T doRpcCallSideGzip(TLMethod<T> method, int timeout) throws IOException, TimeoutException
T - the type parametermethod - the methodtimeout - the timeoutIOException - the iO exceptionTimeoutExceptionpublic <T extends TLObject> T doRpcCallGzip(TLMethod<T> method, int timeout) throws IOException, TimeoutException
T - the type parametermethod - the methodtimeout - the timeoutIOException - the iO exceptionTimeoutExceptionpublic <T extends TLObject> T doRpcCallNonAuth(TLMethod<T> method) throws RpcException, TimeoutException
T - the type parametermethod - the methodIOException - the iO exceptionRpcExceptionTimeoutExceptionpublic <T extends TLObject> T doRpcCallNonAuth(TLMethod<T> method, int dcId) throws IOException, TimeoutException
T - the type parametermethod - the methoddcId - the dc idIOException - the iO exceptionTimeoutExceptionpublic <T extends TLObject> T doRpcCallNonAuth(TLMethod<T> method, int timeout, int dcId) throws RpcException, TimeoutException
T - the type parametermethod - the methodtimeout - the timeoutdcId - the dc idIOException - the iO exceptionRpcExceptionTimeoutExceptionpublic <T extends TLObject> void doRpcCallNonAuth(TLMethod<T> method, int timeout, RpcCallback<T> callback)
T - the type parametermethod - the methodtimeout - the timeoutcallback - the callbackpublic boolean doSaveFilePart(long _fileId,
int _filePart,
byte[] _bytes)
throws IOException,
TimeoutException
_fileId - the _ file id_filePart - the _ file part_bytes - the _ bytesIOException - the iO exceptionTimeoutExceptionpublic boolean doSaveBigFilePart(long _fileId,
int _filePart,
int _totalParts,
byte[] _bytes)
throws IOException,
TimeoutException
_fileId - the _ file id_filePart - the _ file part_totalParts - the _ total parts_bytes - the _ bytesIOException - the iO exceptionTimeoutExceptionpublic TLFile doGetFile(int dcId, TLAbsInputFileLocation _location, int _offset, int _limit) throws IOException, TimeoutException
dcId - the dc id_location - the _ location_offset - the _ offset_limit - the _ limitIOException - the iO exceptionTimeoutExceptionpublic void notifyCallbacks()
Copyright © 2016. All rights reserved.