@Override public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { SubscriptionKey key = new SubscriptionKey(info.getClientId(), info.getSubscriptionName()); DurableTopicSubscription sub = durableSubscriptions.get(key); if (sub == null) { throw new InvalidDestinationException("No durable subscription exists for clientID: " + info.getClientId() + " and subscriptionName: " + info.getSubscriptionName());
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalString(info.getSubscriptionName(), dataOut); looseMarshalString(info.getClientId(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); rc += tightMarshalString1(info.getSubscriptionName(), bs); rc += tightMarshalString1(info.getClientId(), bs); return rc + 0; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalString(info.getSubscriptionName(), dataOut); looseMarshalString(info.getClientId(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalString(info.getSubscriptionName(), dataOut); looseMarshalString(info.getClientId(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); rc += tightMarshalString1(info.getSubscriptionName(), bs); rc += tightMarshalString1(info.getClientId(), bs); return rc + 0; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalString(info.getSubscriptionName(), dataOut); looseMarshalString(info.getClientId(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); rc += tightMarshalString1(info.getSubscriptionName(), bs); rc += tightMarshalString1(info.getClientId(), bs); return rc + 0; }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalString(info.getSubscriptionName(), dataOut); looseMarshalString(info.getClientId(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); rc += tightMarshalString1(info.getSubscriptionName(), bs); rc += tightMarshalString1(info.getClientId(), bs); return rc + 0; }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); rc += tightMarshalString1(info.getSubscriptionName(), bs); rc += tightMarshalString1(info.getClientId(), bs); return rc + 0; }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); tightMarshalString2(info.getSubscriptionName(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs); }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); tightMarshalString2(info.getSubscriptionName(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs); }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); tightMarshalString2(info.getSubscriptionName(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs); }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); tightMarshalString2(info.getSubscriptionName(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs); }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); tightMarshalString2(info.getSubscriptionName(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs); }
@Override public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { SubscriptionKey key = new SubscriptionKey(context.getClientId(), info.getSubscriptionName()); RegionBroker regionBroker = null; if (next instanceof RegionBroker) { regionBroker = (RegionBroker) next; } else { BrokerService service = next.getBrokerService(); regionBroker = (RegionBroker) service.getRegionBroker(); } if (regionBroker == null) { LOG.warn("Cannot locate a RegionBroker instance to pass along the removeSubscription call"); throw new IllegalStateException("No RegionBroker found."); } DurableTopicSubscription sub = ((TopicRegion) regionBroker.getTopicRegion()).getDurableSubscription(key); super.removeSubscription(context, info); if (sub == null) { LOG.warn("We cannot send an advisory message for a durable sub removal when we don't know about the durable sub"); return; } ActiveMQDestination dest = sub.getConsumerInfo().getDestination(); // Don't advise advisory topics. if (!AdvisorySupport.isAdvisoryTopic(dest)) { ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(dest); fireConsumerAdvisory(context, dest, topic, info); } }
final SubscriptionInfo subscriptionInfo = new SubscriptionInfo(info.getClientId(), info.getSubscriptionName()); final boolean proxyBridgeSub = isProxyBridgeSubscription(subscriptionInfo.getClientId(), subscriptionInfo.getSubscriptionName());
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); looseMarshalString(info.getSubscriptionName(), dataOut); looseMarshalString(info.getClientId(), dataOut); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); rc += tightMarshalString1(info.getSubscriptionName(), bs); rc += tightMarshalString1(info.getClientId(), bs); return rc + 0; }