protected void asyncSubscribe(ByteString topic, ByteString subscriberId, CreateOrAttach mode,
Callback<Void> callback, Object context, boolean isHub) {
// Validate that the format of the subscriberId is valid either as a
// local or hub subscriber.
if (!isValidSubscriberId(subscriberId, isHub)) {
callback.operationFailed(context, new ServiceDownException(new InvalidSubscriberIdException(
"SubscriberId passed is not valid: " + subscriberId.toStringUtf8() + ", isHub: " + isHub)));
return;
}
asyncSubUnsub(topic, subscriberId, callback, context, OperationType.SUBSCRIBE, mode);
}