@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); } }
@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); } }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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()); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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()); }
/** * 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)); }
/** * 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)); info.setNoLocal(bs.readBoolean()); }
/** * 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)); info.setNoLocal(bs.readBoolean()); }
info.setClientId(clientId); info.setSelector(subscription.getConsumerInfo().getSelector()); info.setSubscriptionName(subscriptionName); info.setDestination(getActiveMQDestination()); info.setNoLocal(subscription.getConsumerInfo().isNoLocal()); info.setSubscribedDestination(subscription.getConsumerInfo().getDestination());
@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); } }
@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); } }
public SubscriptionInfo[] doGetAllSubscriptions(TransactionContext c, ActiveMQDestination destination) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; cleanupExclusiveLock.readLock().lock(); 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 { cleanupExclusiveLock.readLock().unlock(); close(rs); close(s); } }