2424import com .pubnub .api .endpoints .push .ListPushProvisions ;
2525import com .pubnub .api .managers .BasePathManager ;
2626import com .pubnub .api .managers .PublishSequenceManager ;
27+ import com .pubnub .api .managers .RetrofitManager ;
2728import com .pubnub .api .managers .SubscriptionManager ;
2829import com .pubnub .api .vendor .Crypto ;
2930import lombok .AccessLevel ;
@@ -45,6 +46,8 @@ public class PubNub {
4546 private BasePathManager basePathManager ;
4647 @ Getter (AccessLevel .NONE )
4748 private PublishSequenceManager publishSequenceManager ;
49+ @ Getter (AccessLevel .NONE )
50+ private RetrofitManager retrofitManager ;
4851
4952
5053 private static final int TIMESTAMP_DIVIDER = 1000 ;
@@ -54,8 +57,9 @@ public class PubNub {
5457
5558 public PubNub (final PNConfiguration initialConfig ) {
5659 this .configuration = initialConfig ;
57- this .subscriptionManager = new SubscriptionManager (this );
5860 this .basePathManager = new BasePathManager (initialConfig );
61+ this .retrofitManager = new RetrofitManager (this , basePathManager );
62+ this .subscriptionManager = new SubscriptionManager (this , retrofitManager );
5963 this .publishSequenceManager = new PublishSequenceManager (MAX_SEQUENCE );
6064 }
6165
@@ -84,78 +88,78 @@ public final UnsubscribeBuilder unsubscribe() {
8488 // start push
8589
8690 public final AddChannelsToPush addPushNotificationsOnChannels () {
87- return new AddChannelsToPush (this );
91+ return new AddChannelsToPush (this , this . retrofitManager . getTransactionInstance () );
8892 }
8993
9094 public final RemoveChannelsFromPush removePushNotificationsFromChannels () {
91- return new RemoveChannelsFromPush (this );
95+ return new RemoveChannelsFromPush (this , this . retrofitManager . getTransactionInstance () );
9296 }
9397
9498 public final RemoveAllPushChannelsForDevice removeAllPushNotificationsFromDeviceWithPushToken () {
95- return new RemoveAllPushChannelsForDevice (this );
99+ return new RemoveAllPushChannelsForDevice (this , this . retrofitManager . getTransactionInstance () );
96100 }
97101
98102 public final ListPushProvisions auditPushChannelProvisions () {
99- return new ListPushProvisions (this );
103+ return new ListPushProvisions (this , this . retrofitManager . getTransactionInstance () );
100104 }
101105
102106 // end push
103107
104108 public final WhereNow whereNow () {
105- return new WhereNow (this );
109+ return new WhereNow (this , this . retrofitManager . getTransactionInstance () );
106110 }
107111
108112 public final HereNow hereNow () {
109- return new HereNow (this );
113+ return new HereNow (this , this . retrofitManager . getTransactionInstance () );
110114 }
111115
112116 public final Time time () {
113- return new Time (this );
117+ return new Time (this , this . retrofitManager . getTransactionInstance () );
114118 }
115119
116120 public final History history () {
117- return new History (this );
121+ return new History (this , this . retrofitManager . getTransactionInstance () );
118122 }
119123
120124
121125 public final Audit audit () {
122- return new Audit (this );
126+ return new Audit (this , this . retrofitManager . getTransactionInstance () );
123127 }
124128
125129 public final Grant grant () {
126- return new Grant (this );
130+ return new Grant (this , this . retrofitManager . getTransactionInstance () );
127131 }
128132
129133 public final GetState getPresenceState () {
130- return new GetState (this );
134+ return new GetState (this , this . retrofitManager . getTransactionInstance () );
131135 }
132136
133137 public final SetState setPresenceState () {
134- return new SetState (this , subscriptionManager );
138+ return new SetState (this , subscriptionManager , this . retrofitManager . getTransactionInstance () );
135139 }
136140
137141 public final Publish publish () {
138- return new Publish (this , publishSequenceManager );
142+ return new Publish (this , publishSequenceManager , this . retrofitManager . getTransactionInstance () );
139143 }
140144
141145 public final ListAllChannelGroup listAllChannelGroups () {
142- return new ListAllChannelGroup (this );
146+ return new ListAllChannelGroup (this , this . retrofitManager . getTransactionInstance () );
143147 }
144148
145149 public final AllChannelsChannelGroup listChannelsForChannelGroup () {
146- return new AllChannelsChannelGroup (this );
150+ return new AllChannelsChannelGroup (this , this . retrofitManager . getTransactionInstance () );
147151 }
148152
149153 public final AddChannelChannelGroup addChannelsToChannelGroup () {
150- return new AddChannelChannelGroup (this );
154+ return new AddChannelChannelGroup (this , this . retrofitManager . getTransactionInstance () );
151155 }
152156
153157 public final RemoveChannelChannelGroup removeChannelsFromChannelGroup () {
154- return new RemoveChannelChannelGroup (this );
158+ return new RemoveChannelChannelGroup (this , this . retrofitManager . getTransactionInstance () );
155159 }
156160
157161 public final DeleteChannelGroup deleteChannelGroup () {
158- return new DeleteChannelGroup (this );
162+ return new DeleteChannelGroup (this , this . retrofitManager . getTransactionInstance () );
159163 }
160164
161165 // public methods
0 commit comments