Package com.pubnub.api.endpoints.pubsub
Class Subscribe
- java.lang.Object
- 
- com.pubnub.api.endpoints.Endpoint<SubscribeEnvelope,SubscribeEnvelope>
- 
- com.pubnub.api.endpoints.pubsub.Subscribe
 
 
- 
- All Implemented Interfaces:
- RemoteAction<SubscribeEnvelope>
 
 public class Subscribe extends Endpoint<SubscribeEnvelope,SubscribeEnvelope> Supports calling of the subscribe endpoints and deconstructs the response to POJO's.
- 
- 
Constructor SummaryConstructors Constructor Description Subscribe(PubNub pubnub, RetrofitManager retrofit, TokenManager tokenManager)Create a new Subscribe instance endpoint.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidasync(@NotNull PNCallback<SubscribeEnvelope> callback)SubscribechannelGroups(java.util.List<java.lang.String> channelGroups)List of channel groups that will be called with subscribe.Subscribechannels(java.util.List<java.lang.String> channels)List of channels that will be called to subscribe.protected SubscribeEnvelopecreateResponse(retrofit2.Response<SubscribeEnvelope> input)protected retrofit2.Call<SubscribeEnvelope>doWork(java.util.Map<java.lang.String,java.lang.String> params)SubscribefilterExpression(java.lang.String filterExpression)filterExpression used as part of PubSub V2 specification to filter on message.protected java.util.List<java.lang.String>getAffectedChannelGroups()protected java.util.List<java.lang.String>getAffectedChannels()protected PNOperationTypegetOperationType()protected booleanisAuthRequired()Subscriberegion(java.lang.String region)region is used as part of PubSub V2 to help the server route traffic to best data center.Subscribestate(java.lang.Object state)Subscribetimetoken(java.lang.Long timetoken)timetoken to subscribe with 0 for initial subscribe.protected voidvalidateParams()- 
Methods inherited from class com.pubnub.api.endpoints.EndpointcreateBaseParams, encodeParams, getPubnub, getRetrofit, isError, queryParam, retry, silentCancel, sync
 
- 
 
- 
- 
- 
Constructor Detail- 
Subscribepublic Subscribe(PubNub pubnub, RetrofitManager retrofit, TokenManager tokenManager) Create a new Subscribe instance endpoint.- Parameters:
- pubnub- supplied pubnub instance.
 
 
- 
 - 
Method Detail- 
getAffectedChannelsprotected java.util.List<java.lang.String> getAffectedChannels() - Specified by:
- getAffectedChannelsin class- Endpoint<SubscribeEnvelope,SubscribeEnvelope>
 
 - 
getAffectedChannelGroupsprotected java.util.List<java.lang.String> getAffectedChannelGroups() - Specified by:
- getAffectedChannelGroupsin class- Endpoint<SubscribeEnvelope,SubscribeEnvelope>
 
 - 
validateParamsprotected void validateParams() throws PubNubException- Specified by:
- validateParamsin class- Endpoint<SubscribeEnvelope,SubscribeEnvelope>
- Throws:
- PubNubException
 
 - 
asyncpublic void async(@NotNull @NotNull PNCallback<SubscribeEnvelope> callback)- Specified by:
- asyncin interface- RemoteAction<SubscribeEnvelope>
- Overrides:
- asyncin class- Endpoint<SubscribeEnvelope,SubscribeEnvelope>
 
 - 
doWorkprotected retrofit2.Call<SubscribeEnvelope> doWork(java.util.Map<java.lang.String,java.lang.String> params) throws PubNubException - Specified by:
- doWorkin class- Endpoint<SubscribeEnvelope,SubscribeEnvelope>
- Throws:
- PubNubException
 
 - 
createResponseprotected SubscribeEnvelope createResponse(retrofit2.Response<SubscribeEnvelope> input) throws PubNubException - Specified by:
- createResponsein class- Endpoint<SubscribeEnvelope,SubscribeEnvelope>
- Throws:
- PubNubException
 
 - 
getOperationTypeprotected PNOperationType getOperationType() - Specified by:
- getOperationTypein class- Endpoint<SubscribeEnvelope,SubscribeEnvelope>
 
 - 
isAuthRequiredprotected boolean isAuthRequired() - Specified by:
- isAuthRequiredin class- Endpoint<SubscribeEnvelope,SubscribeEnvelope>
 
 - 
channelspublic Subscribe channels(java.util.List<java.lang.String> channels) List of channels that will be called to subscribe.- Returns:
- this.
 
 - 
channelGroupspublic Subscribe channelGroups(java.util.List<java.lang.String> channelGroups) List of channel groups that will be called with subscribe.- Returns:
- this.
 
 - 
timetokenpublic Subscribe timetoken(java.lang.Long timetoken) timetoken to subscribe with 0 for initial subscribe.- Returns:
- this.
 
 - 
filterExpressionpublic Subscribe filterExpression(java.lang.String filterExpression) filterExpression used as part of PubSub V2 specification to filter on message.- Returns:
- this.
 
 - 
regionpublic Subscribe region(java.lang.String region) region is used as part of PubSub V2 to help the server route traffic to best data center.- Returns:
- this.
 
 - 
statepublic Subscribe state(java.lang.Object state) - Returns:
- this.
 
 
- 
 
-