com.pubnub.internal.endpoints.channel_groups.AddChannelChannelGroupImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-gson-impl Show documentation
Show all versions of pubnub-gson-impl Show documentation
PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second!
package com.pubnub.internal.endpoints.channel_groups;
import com.pubnub.api.PubNubException;
import com.pubnub.api.builder.PubNubErrorBuilder;
import com.pubnub.api.endpoints.channel_groups.AddChannelChannelGroup;
import com.pubnub.api.models.consumer.channel_group.PNChannelGroupsAddChannelResult;
import com.pubnub.internal.EndpointInterface;
import com.pubnub.internal.PubNubCore;
import com.pubnub.internal.endpoints.IdentityMappingEndpoint;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
@Setter
@Accessors(chain = true, fluent = true)
public class AddChannelChannelGroupImpl extends IdentityMappingEndpoint implements AddChannelChannelGroup {
private String channelGroup;
private List channels = new ArrayList<>();
public AddChannelChannelGroupImpl(PubNubCore pubnub) {
super(pubnub);
}
@Override
@NotNull
protected EndpointInterface createAction() {
return pubnub.addChannelsToChannelGroup(channels, channelGroup);
}
@Override
protected void validateParams() throws PubNubException {
if (channelGroup == null) {
throw new PubNubException(PubNubErrorBuilder.PNERROBJ_GROUP_MISSING);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy