@Override public String getRemoteAddress() { return connection.getRemoteAddress(); }
} else { throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from " + oldContext.getConnection().getRemoteAddress());
@Override public String getRemoteAddress() { return connection.getRemoteAddress(); }
@Override public String getRemoteAddress() { return connection.getRemoteAddress(); }
@Override public String getRemoteAddress() { return connection.getRemoteAddress(); }
public String getRemoteAddress() { return connection.getRemoteAddress(); }
protected boolean isSystemConnection(ConnectionReference conn) { String remoteAddress = conn.getConnectionContext().getConnection().getRemoteAddress(); return remoteAddress.startsWith("vm:"); }
private void authenticateBasedOnRemoteAddress(ConnectionContext context, ConnectionInfo info) { boolean grant = false; final String connectionString = context.getConnection().getRemoteAddress(); if (connectionString.startsWith("vm://")) {
@Override public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); if (clientId == null) { throw new InvalidClientIDException("No clientID specified for connection request"); } synchronized (clientIdSet) { ConnectionContext oldContext = clientIdSet.get(clientId); if (oldContext != null) { if (context.isFaultTolerant() || context.isNetworkConnection()){ //remove the old connection try{ removeConnection(oldContext, info, new Exception("remove stale client")); }catch(Exception e){ LOG.warn("Failed to remove stale connection ",e); } }else{ throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from " + oldContext.getConnection().getRemoteAddress()); } } else { clientIdSet.put(clientId, context); } } connections.add(context.getConnection()); }
} else { throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from " + oldContext.getConnection().getRemoteAddress());
} else { throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from " + oldContext.getConnection().getRemoteAddress());
} else { throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from " + oldContext.getConnection().getRemoteAddress());