Codota Logo
SubscriptionInfo.setClientId
Code IndexAdd Codota to your IDE (free)

How to use
setClientId
method
in
org.apache.activemq.command.SubscriptionInfo

Best Java code snippets using org.apache.activemq.command.SubscriptionInfo.setClientId (Showing top 20 results out of 315)

Refine searchRefine arrow

  • SubscriptionInfo.setSelector
  • SubscriptionInfo.setDestination
  • SubscriptionInfo.setSubscribedDestination
  • Common ways to obtain SubscriptionInfo
private void myMethod () {
SubscriptionInfo s =
  • Codota Iconnew SubscriptionInfo()
  • Codota IconTopicMessageStore topicMessageStore;String clientId;String subscriptionName;topicMessageStore.lookupSubscription(clientId, subscriptionName)
  • Smart code suggestions by Codota
}
origin: apache/activemq

@Override
public SubscriptionInfo[] doGetAllSubscriptions(TransactionContext c, ActiveMQDestination destination)
    throws SQLException, IOException {
  PreparedStatement s = null;
  ResultSet rs = null;
  try {
    s = c.getConnection().prepareStatement(this.statements.getFindAllDurableSubsStatement());
    s.setString(1, destination.getQualifiedName());
    rs = s.executeQuery();
    ArrayList<SubscriptionInfo> rc = new ArrayList<SubscriptionInfo>();
    while (rs.next()) {
      SubscriptionInfo subscription = new SubscriptionInfo();
      subscription.setDestination(destination);
      subscription.setSelector(rs.getString(1));
      subscription.setSubscriptionName(rs.getString(2));
      subscription.setClientId(rs.getString(3));
      subscription.setSubscribedDestination(ActiveMQDestination.createDestination(rs.getString(4),
          ActiveMQDestination.QUEUE_TYPE));
      rc.add(subscription);
    }
    return rc.toArray(new SubscriptionInfo[rc.size()]);
  } finally {
    close(rs);
    close(s);
  }
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
  super.tightUnmarshal(wireFormat, o, dataIn, bs);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(tightUnmarshalString(dataIn, bs));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
  info.setSelector(tightUnmarshalString(dataIn, bs));
  info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
}
origin: org.apache.activemq/activemq-all

  protected List<SubscriptionInfo> lookupSubscription(String clientId) throws MQTTProtocolException {
    List<SubscriptionInfo> result = new ArrayList<SubscriptionInfo>();
    RegionBroker regionBroker;

    try {
      regionBroker = (RegionBroker) brokerService.getBroker().getAdaptor(RegionBroker.class);
    } catch (Exception e) {
      throw new MQTTProtocolException("Error recovering durable subscriptions: " + e.getMessage(), false, e);
    }

    final TopicRegion topicRegion = (TopicRegion) regionBroker.getTopicRegion();
    List<DurableTopicSubscription> subscriptions = topicRegion.lookupSubscriptions(clientId);
    if (subscriptions != null) {
      for (DurableTopicSubscription subscription : subscriptions) {
        LOG.debug("Recovered durable sub:{} on connect", subscription);

        SubscriptionInfo info = new SubscriptionInfo();

        info.setDestination(subscription.getActiveMQDestination());
        info.setSubcriptionName(subscription.getSubscriptionKey().getSubscriptionName());
        info.setClientId(clientId);

        result.add(info);
      }
    }

    return result;
  }
}
origin: apache/activemq

@Override
public SubscriptionInfo doGetSubscriberEntry(TransactionContext c, ActiveMQDestination destination,
    String clientId, String subscriptionName) throws SQLException, IOException {
  PreparedStatement s = null;
  ResultSet rs = null;
  try {
    s = c.getConnection().prepareStatement(this.statements.getFindDurableSubStatement());
    s.setString(1, destination.getQualifiedName());
    s.setString(2, clientId);
    s.setString(3, subscriptionName);
    rs = s.executeQuery();
    if (!rs.next()) {
      return null;
    }
    SubscriptionInfo subscription = new SubscriptionInfo();
    subscription.setDestination(destination);
    subscription.setClientId(clientId);
    subscription.setSubscriptionName(subscriptionName);
    subscription.setSelector(rs.getString(1));
    subscription.setSubscribedDestination(ActiveMQDestination.createDestination(rs.getString(2),
        ActiveMQDestination.QUEUE_TYPE));
    return subscription;
  } finally {
    close(rs);
    close(s);
  }
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
  super.tightUnmarshal(wireFormat, o, dataIn, bs);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(tightUnmarshalString(dataIn, bs));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
  info.setSelector(tightUnmarshalString(dataIn, bs));
  info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
}
origin: org.apache.activemq/activemq-mqtt

  protected List<SubscriptionInfo> lookupSubscription(String clientId) throws MQTTProtocolException {
    List<SubscriptionInfo> result = new ArrayList<SubscriptionInfo>();
    RegionBroker regionBroker;

    try {
      regionBroker = (RegionBroker) brokerService.getBroker().getAdaptor(RegionBroker.class);
    } catch (Exception e) {
      throw new MQTTProtocolException("Error recovering durable subscriptions: " + e.getMessage(), false, e);
    }

    final TopicRegion topicRegion = (TopicRegion) regionBroker.getTopicRegion();
    List<DurableTopicSubscription> subscriptions = topicRegion.lookupSubscriptions(clientId);
    if (subscriptions != null) {
      for (DurableTopicSubscription subscription : subscriptions) {
        LOG.debug("Recovered durable sub:{} on connect", subscription);

        SubscriptionInfo info = new SubscriptionInfo();

        info.setDestination(subscription.getActiveMQDestination());
        info.setSubcriptionName(subscription.getSubscriptionKey().getSubscriptionName());
        info.setClientId(clientId);

        result.add(info);
      }
    }

    return result;
  }
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
  super.looseUnmarshal(wireFormat, o, dataIn);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(looseUnmarshalString(dataIn));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
  info.setSelector(looseUnmarshalString(dataIn));
  info.setSubscriptionName(looseUnmarshalString(dataIn));
  info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
  super.looseUnmarshal(wireFormat, o, dataIn);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(looseUnmarshalString(dataIn));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
  info.setSelector(looseUnmarshalString(dataIn));
  info.setSubscriptionName(looseUnmarshalString(dataIn));
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
  super.tightUnmarshal(wireFormat, o, dataIn, bs);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(tightUnmarshalString(dataIn, bs));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
  info.setSelector(tightUnmarshalString(dataIn, bs));
  info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
  info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
  super.looseUnmarshal(wireFormat, o, dataIn);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(looseUnmarshalString(dataIn));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
  info.setSelector(looseUnmarshalString(dataIn));
  info.setSubscriptionName(looseUnmarshalString(dataIn));
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
  super.tightUnmarshal(wireFormat, o, dataIn, bs);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(tightUnmarshalString(dataIn, bs));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
  info.setSelector(tightUnmarshalString(dataIn, bs));
  info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
  info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
}
origin: apache/activemq

protected void unregisterSubscription(ObjectName key, boolean addToInactive) throws Exception {
  queueSubscribers.remove(key);
  topicSubscribers.remove(key);
  temporaryQueueSubscribers.remove(key);
  temporaryTopicSubscribers.remove(key);
  if (registeredMBeans.remove(key)) {
    try {
      managementContext.unregisterMBean(key);
    } catch (Throwable e) {
      LOG.warn("Failed to unregister MBean {}", key);
      LOG.debug("Failure reason: ", e);
    }
  }
  DurableSubscriptionView view = (DurableSubscriptionView)durableTopicSubscribers.remove(key);
  if (view != null) {
    // need to put this back in the inactive list
    SubscriptionKey subscriptionKey = new SubscriptionKey(view.getClientId(), view.getSubscriptionName());
    if (addToInactive) {
      SubscriptionInfo info = new SubscriptionInfo();
      info.setClientId(subscriptionKey.getClientId());
      info.setSubscriptionName(subscriptionKey.getSubscriptionName());
      info.setDestination(new ActiveMQTopic(view.getDestinationName()));
      info.setSelector(view.getSelector());
      addInactiveSubscription(subscriptionKey, info, (brokerService.isKeepDurableSubsActive() ? view.subscription : null));
    }
  }
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
  super.looseUnmarshal(wireFormat, o, dataIn);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(looseUnmarshalString(dataIn));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
  info.setSelector(looseUnmarshalString(dataIn));
  info.setSubscriptionName(looseUnmarshalString(dataIn));
  info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
}
origin: apache/activemq

  info.setClientId(context.getClientId());
  info.setSubscriptionName(sub.getConsumerInfo().getSubscriptionName());
  info.setDestination(sub.getConsumerInfo().getDestination());
  info.setSelector(sub.getSelector());
  addInactiveSubscription(key, info, sub);
} else {
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
  super.looseUnmarshal(wireFormat, o, dataIn);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(looseUnmarshalString(dataIn));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
  info.setSelector(looseUnmarshalString(dataIn));
  info.setSubcriptionName(looseUnmarshalString(dataIn));
  info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
  info.setNoLocal(dataIn.readBoolean());
}
origin: org.apache.activemq/activemq-client

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
  super.tightUnmarshal(wireFormat, o, dataIn, bs);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(tightUnmarshalString(dataIn, bs));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
  info.setSelector(tightUnmarshalString(dataIn, bs));
  info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
  super.looseUnmarshal(wireFormat, o, dataIn);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(looseUnmarshalString(dataIn));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
  info.setSelector(looseUnmarshalString(dataIn));
  info.setSubscriptionName(looseUnmarshalString(dataIn));
  info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
}
origin: org.apache.activemq/activemq-all

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
  super.tightUnmarshal(wireFormat, o, dataIn, bs);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(tightUnmarshalString(dataIn, bs));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
  info.setSelector(tightUnmarshalString(dataIn, bs));
  info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
}
origin: apache/activemq

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
  super.looseUnmarshal(wireFormat, o, dataIn);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(looseUnmarshalString(dataIn));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
  info.setSelector(looseUnmarshalString(dataIn));
  info.setSubcriptionName(looseUnmarshalString(dataIn));
  info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
}
origin: org.apache.activemq/activemq-client

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
  super.looseUnmarshal(wireFormat, o, dataIn);
  SubscriptionInfo info = (SubscriptionInfo)o;
  info.setClientId(looseUnmarshalString(dataIn));
  info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
  info.setSelector(looseUnmarshalString(dataIn));
  info.setSubscriptionName(looseUnmarshalString(dataIn));
}
org.apache.activemq.commandSubscriptionInfosetClientId

Popular methods of SubscriptionInfo

  • getClientId
  • getSubscriptionName
  • <init>
  • getSelector
  • setDestination
  • getDestination
    This is the a resolved destination that the subscription is receiving messages from. This will never
  • getSubscribedDestination
    The destination the client originally subscribed to.. This may not match the getDestination method i
  • setSelector
  • setSubscribedDestination
  • setSubscriptionName
  • getSubcriptionName
  • setSubcriptionName
  • getSubcriptionName,
  • setSubcriptionName,
  • isNoLocal,
  • setNoLocal

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • String (java.lang)
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • JOptionPane (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now