2424import com .pubnub .api .endpoints .push .ListPushProvisions ;
2525import com .pubnub .api .endpoints .push .RemoveAllPushChannelsForDevice ;
2626import com .pubnub .api .endpoints .push .RemoveChannelsFromPush ;
27- import com .pubnub .api .managers .BasePathManager ;
28- import com .pubnub .api .managers .MapperManager ;
29- import com .pubnub .api .managers .PublishSequenceManager ;
30- import com .pubnub .api .managers .RetrofitManager ;
31- import com .pubnub .api .managers .SubscriptionManager ;
27+ import com .pubnub .api .managers .*;
3228import com .pubnub .api .vendor .Crypto ;
29+ import lombok .AccessLevel ;
3330import lombok .Getter ;
3431
3532import java .util .Date ;
@@ -53,6 +50,8 @@ public class PubNub {
5350
5451 private PublishSequenceManager publishSequenceManager ;
5552
53+ private TelemetryManager telemetryManager ;
54+
5655 private RetrofitManager retrofitManager ;
5756
5857 private static final int TIMESTAMP_DIVIDER = 1000 ;
@@ -63,9 +62,10 @@ public class PubNub {
6362 public PubNub (PNConfiguration initialConfig ) {
6463 this .configuration = initialConfig ;
6564 this .mapper = new MapperManager ();
65+ this .telemetryManager = new TelemetryManager ();
6666 this .basePathManager = new BasePathManager (initialConfig );
6767 this .retrofitManager = new RetrofitManager (this );
68- this .subscriptionManager = new SubscriptionManager (this , retrofitManager );
68+ this .subscriptionManager = new SubscriptionManager (this , retrofitManager , this . telemetryManager );
6969 this .publishSequenceManager = new PublishSequenceManager (MAX_SEQUENCE );
7070 instanceId = UUID .randomUUID ().toString ();
7171 }
@@ -95,85 +95,85 @@ public UnsubscribeBuilder unsubscribe() {
9595 // start push
9696
9797 public AddChannelsToPush addPushNotificationsOnChannels () {
98- return new AddChannelsToPush (this , this .retrofitManager .getTransactionInstance ());
98+ return new AddChannelsToPush (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
9999 }
100100
101101 public RemoveChannelsFromPush removePushNotificationsFromChannels () {
102- return new RemoveChannelsFromPush (this , this .retrofitManager .getTransactionInstance ());
102+ return new RemoveChannelsFromPush (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
103103 }
104104
105105 public RemoveAllPushChannelsForDevice removeAllPushNotificationsFromDeviceWithPushToken () {
106- return new RemoveAllPushChannelsForDevice (this , this .retrofitManager .getTransactionInstance ());
106+ return new RemoveAllPushChannelsForDevice (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
107107 }
108108
109109 public ListPushProvisions auditPushChannelProvisions () {
110- return new ListPushProvisions (this , this .retrofitManager .getTransactionInstance ());
110+ return new ListPushProvisions (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
111111 }
112112
113113 // end push
114114
115115 public WhereNow whereNow () {
116- return new WhereNow (this , this .retrofitManager .getTransactionInstance ());
116+ return new WhereNow (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
117117 }
118118
119119 public HereNow hereNow () {
120- return new HereNow (this , this .retrofitManager .getTransactionInstance ());
120+ return new HereNow (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
121121 }
122122
123123 public Time time () {
124- return new Time (this , this .retrofitManager .getTransactionInstance ());
124+ return new Time (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
125125 }
126126
127127 public History history () {
128- return new History (this , this .retrofitManager .getTransactionInstance ());
128+ return new History (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
129129 }
130130
131131 public FetchMessages fetchMessages () {
132- return new FetchMessages (this , this .retrofitManager .getTransactionInstance ());
132+ return new FetchMessages (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
133133 }
134134
135135 public DeleteMessages deleteMessages () {
136- return new DeleteMessages (this , this .retrofitManager .getTransactionInstance ());
136+ return new DeleteMessages (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
137137 }
138138
139139 public Audit audit () {
140- return new Audit (this , this .retrofitManager .getTransactionInstance ());
140+ return new Audit (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
141141 }
142142
143143 public Grant grant () {
144- return new Grant (this , this .retrofitManager .getTransactionInstance ());
144+ return new Grant (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
145145 }
146146
147147 public GetState getPresenceState () {
148- return new GetState (this , this .retrofitManager .getTransactionInstance ());
148+ return new GetState (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
149149 }
150150
151151 public SetState setPresenceState () {
152- return new SetState (this , subscriptionManager , this .retrofitManager .getTransactionInstance ());
152+ return new SetState (this , subscriptionManager , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
153153 }
154154
155155 public Publish publish () {
156- return new Publish (this , publishSequenceManager , this .retrofitManager .getTransactionInstance ());
156+ return new Publish (this , publishSequenceManager , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
157157 }
158158
159159 public ListAllChannelGroup listAllChannelGroups () {
160- return new ListAllChannelGroup (this , this .retrofitManager .getTransactionInstance ());
160+ return new ListAllChannelGroup (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
161161 }
162162
163163 public AllChannelsChannelGroup listChannelsForChannelGroup () {
164- return new AllChannelsChannelGroup (this , this .retrofitManager .getTransactionInstance ());
164+ return new AllChannelsChannelGroup (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
165165 }
166166
167167 public AddChannelChannelGroup addChannelsToChannelGroup () {
168- return new AddChannelChannelGroup (this , this .retrofitManager .getTransactionInstance ());
168+ return new AddChannelChannelGroup (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
169169 }
170170
171171 public RemoveChannelChannelGroup removeChannelsFromChannelGroup () {
172- return new RemoveChannelChannelGroup (this , this .retrofitManager .getTransactionInstance ());
172+ return new RemoveChannelChannelGroup (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
173173 }
174174
175175 public DeleteChannelGroup deleteChannelGroup () {
176- return new DeleteChannelGroup (this , this .retrofitManager .getTransactionInstance ());
176+ return new DeleteChannelGroup (this , this .telemetryManager , this . retrofitManager .getTransactionInstance ());
177177 }
178178
179179 // public methods
0 commit comments