public synchronized TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
@Override public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) { if (id != null) { SessionId sessionId = id.getParentId(); if (sessionId != null) { ConnectionId connectionId = sessionId.getParentId(); if (connectionId != null) { ConnectionState cs = connectionStates.get(connectionId); if (cs != null) { SessionState ss = cs.getSessionState(sessionId); if (ss != null) { ss.removeConsumer(id); } cs.getRecoveringPullConsumers().remove(id); } } } } return TRACKED_RESPONSE_MARKER; }
@Override public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception { SessionId sessionId = id.getParentId(); ConnectionId connectionId = sessionId.getParentId(); TransportConnectionState cs = lookupConnectionState(connectionId); if (cs == null) { throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: " + connectionId); } SessionState ss = cs.getSessionState(sessionId); if (ss == null) { throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: " + sessionId); } ConsumerState consumerState = ss.removeConsumer(id); if (consumerState == null) { throw new IllegalStateException("Cannot remove a consumer that had not been registered: " + id); } ConsumerInfo info = consumerState.getInfo(); info.setLastDeliveredSequenceId(lastDeliveredSequenceId); broker.removeConsumer(cs.getContext(), consumerState.getInfo()); removeConsumerBrokerExchange(id); return null; }
c.setBroker(context.getBroker()); c.setClientId(key.getClientId()); c.setConnectionId(consumerInfo.getConsumerId().getParentId().getParentId()); sub = (DurableTopicSubscription)createSubscription(c, consumerInfo); sub.setOfflineTimestamp(System.currentTimeMillis());
@Override public Response processAddConsumer(ConsumerInfo info) { if (info != null) { SessionId sessionId = info.getConsumerId().getParentId(); if (sessionId != null) { ConnectionId connectionId = sessionId.getParentId(); if (connectionId != null) { ConnectionState cs = connectionStates.get(connectionId); if (cs != null) { SessionState ss = cs.getSessionState(sessionId); if (ss != null) { ss.addConsumer(info); if (info.isResponseRequired()) { return new Tracked(new ExceptionResponseCheckAction(info)); } } } } } } return TRACKED_RESPONSE_MARKER; }
private ConsumerBrokerExchange addConsumerBrokerExchange(TransportConnectionState connectionState, ConsumerId id) { ConsumerBrokerExchange result = consumerExchanges.get(id); if (result == null) { synchronized (consumerExchanges) { result = new ConsumerBrokerExchange(); context = connectionState.getContext(); result.setConnectionContext(context); SessionState ss = connectionState.getSessionState(id.getParentId()); if (ss != null) { ConsumerState cs = ss.getConsumerState(id); if (cs != null) { ConsumerInfo info = cs.getInfo(); if (info != null) { if (info.getDestination() != null && info.getDestination().isPattern()) { result.setWildcard(true); } } } } consumerExchanges.put(id, result); } } return result; }
@Override public Response processAddConsumer(ConsumerInfo info) throws Exception { SessionId sessionId = info.getConsumerId().getParentId(); ConnectionId connectionId = sessionId.getParentId(); TransportConnectionState cs = lookupConnectionState(connectionId);
public synchronized TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public synchronized TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public synchronized TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public synchronized TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = connectionState; if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public TransportConnectionState lookupConnectionState(ConsumerId id) { TransportConnectionState cs = lookupConnectionState(id.getConnectionId()); if (cs == null) { throw new IllegalStateException( "Cannot lookup a consumer from a connection that had not been registered: " + id.getParentId().getParentId()); } return cs; }
public ConsumerState removeConsumer(ConsumerId consumerId) { if (consumerId != null && consumerId.getConnectionId() != null && consumerId.getParentId() != null) { TransportConnectionState cs = lookupConnectionState(consumerId.getConnectionId()); if (cs != null) { SessionState sessionState = cs.getSessionState(consumerId.getParentId()); if (sessionState != null) { return sessionState.removeConsumer(consumerId); } } } return null; }
public ConsumerState removeConsumer(ConsumerId consumerId) { if (consumerId != null && consumerId.getConnectionId() != null && consumerId.getParentId() != null) { TransportConnectionState cs = lookupConnectionState(consumerId.getConnectionId()); if (cs != null) { SessionState sessionState = cs.getSessionState(consumerId.getParentId()); if (sessionState != null) { return sessionState.removeConsumer(consumerId); } } } return null; }
public void addConsumer(ConsumerInfo info) { if (info != null && info.getConsumerId() != null && info.getConsumerId().getParentId() != null && info.getConsumerId().getConnectionId() != null) { TransportConnectionState cs = lookupConnectionState(info.getConsumerId().getConnectionId()); if (cs != null) { SessionState sessionState = cs.getSessionState(info.getConsumerId().getParentId()); if (sessionState != null) { sessionState.addConsumer(info); } } } }
public void addConsumer(ConsumerInfo info) { if (info != null && info.getConsumerId() != null && info.getConsumerId().getParentId() != null && info.getConsumerId().getConnectionId() != null) { TransportConnectionState cs = lookupConnectionState(info.getConsumerId().getConnectionId()); if (cs != null) { SessionState sessionState = cs.getSessionState(info.getConsumerId().getParentId()); if (sessionState != null) { sessionState.addConsumer(info); } } } }