Ejemplo n.º 1
0
 /**
  * Send a subscription represented by the String subStr to the broker with URI brokerURI.
  *
  * @param subStr Subscription in String format. Check the PADRES message format for the syntax.
  * @param brokerURI The URI of the broker to which the subscription is to be sent.
  * @return The SubscriptionMessage sent to the broker containing the given subscription.
  * @throws ClientException If there is a synatx error in the given subscription string or an
  *     thrown by the {@link #subscribe(Subscription, String)} method called by this method.
  * @throws ParseException
  */
 public SubscriptionMessage subscribe(String subStr, String brokerURI)
     throws ClientException, ParseException {
   Subscription newSub = MessageFactory.createSubscriptionFromString(subStr);
   if (newSub.getClassVal() == null) {
     throw new ClientException("Subscription syntax error");
   }
   return subscribe(newSub, brokerURI);
 }