public String getSourceIP() { InetSocketAddress sockAddr = connection.getRemoteSocketAddress(); if (sockAddr == null) { return null; } return sockAddr.getAddress().getHostAddress() + ":" + sockAddr.getPort(); }
public String getSourceIP() { InetSocketAddress sockAddr = connection.getRemoteSocketAddress(); if (sockAddr == null) { return null; } return sockAddr.getAddress().getHostAddress() + ":" + sockAddr.getPort(); }
public ConnectionBean(ServerCnxn connection,ZooKeeperServer zk){ this.connection = connection; this.stats = connection; this.zk = zk; InetSocketAddress sockAddr = connection.getRemoteSocketAddress(); if (sockAddr == null) { remoteIP = "Unknown"; } else { InetAddress addr = sockAddr.getAddress(); if (addr instanceof Inet6Address) { remoteIP = ObjectName.quote(addr.getHostAddress()); } else { remoteIP = addr.getHostAddress(); } } sessionId = connection.getSessionId(); }
public KeeperException.Code handleAuthentication(ServerCnxn cnxn, byte[] authData) { String id = cnxn.getRemoteSocketAddress().getAddress().getHostAddress(); cnxn.addAuthInfo(new Id(getScheme(), id)); return KeeperException.Code.OK; }
public void reopenSession(ServerCnxn cnxn, long sessionId, byte[] passwd, int sessionTimeout) throws IOException { if (checkPasswd(sessionId, passwd)) { revalidateSession(cnxn, sessionId, sessionTimeout); } else { LOG.warn("Incorrect password from " + cnxn.getRemoteSocketAddress() + " for session 0x" + Long.toHexString(sessionId)); finishSessionInit(cnxn, false); } }
public ConnectionBean(ServerCnxn connection,ZooKeeperServer zk){ this.connection = connection; this.stats = connection; this.zk = zk; InetSocketAddress sockAddr = connection.getRemoteSocketAddress(); if (sockAddr == null) { remoteIP = "Unknown"; } else { InetAddress addr = sockAddr.getAddress(); if (addr instanceof Inet6Address) { remoteIP = ObjectName.quote(addr.getHostAddress()); } else { remoteIP = addr.getHostAddress(); } } sessionId = connection.getSessionId(); }
public KeeperException.Code handleAuthentication(ServerCnxn cnxn, byte[] authData) { String id = cnxn.getRemoteSocketAddress().getAddress().getHostAddress(); cnxn.addAuthInfo(new Id(getScheme(), id)); return KeeperException.Code.OK; }
public synchronized Map<String, Object> getConnectionInfo(boolean brief) { Map<String, Object> info = new LinkedHashMap<String, Object>(); info.put("remote_socket_address", getRemoteSocketAddress()); info.put("interest_ops", getInterestOps()); info.put("outstanding_requests", getOutstandingRequests()); info.put("packets_received", getPacketsReceived()); info.put("packets_sent", getPacketsSent()); if (!brief) { info.put("session_id", getSessionId()); info.put("last_operation", getLastOperation()); info.put("established", getEstablished()); info.put("session_timeout", getSessionTimeout()); info.put("last_cxid", getLastCxid()); info.put("last_zxid", getLastZxid()); info.put("last_response_time", getLastResponseTime()); info.put("last_latency", getLastLatency()); info.put("min_latency", getMinLatency()); info.put("avg_latency", getAvgLatency()); info.put("max_latency", getMaxLatency()); } return info; }
dumpConnectionInfo(PrintWriter pwriter, boolean brief) { pwriter.print(" "); pwriter.print(getRemoteSocketAddress()); pwriter.print("["); int interestOps = getInterestOps();
dumpConnectionInfo(PrintWriter pwriter, boolean brief) { pwriter.print(" "); pwriter.print(getRemoteSocketAddress()); pwriter.print("["); int interestOps = getInterestOps();
+ " with negotiated timeout " + cnxn.getSessionTimeout() + " for client " + cnxn.getRemoteSocketAddress()); cnxn.enableRecv(); } else { + Long.toHexString(cnxn.getSessionId()) + " for client " + cnxn.getRemoteSocketAddress() + ", probably expired"); cnxn.sendBuffer(ServerCnxnFactory.closeConn);
+ Long.toHexString(cnxn.getSessionId()) + " for client " + cnxn.getRemoteSocketAddress() + ", probably expired"); cnxn.sendBuffer(ServerCnxnFactory.closeConn); + " with negotiated timeout " + cnxn.getSessionTimeout() + " for client " + cnxn.getRemoteSocketAddress()); cnxn.enableRecv();
if (LOG.isDebugEnabled()) { LOG.debug("Session establishment request from client " + cnxn.getRemoteSocketAddress() + " client's lastZxid is 0x" + Long.toHexString(connReq.getLastZxidSeen())); + cnxn.getRemoteSocketAddress() + "; will be dropped if server is in r-o mode"); + cnxn.getRemoteSocketAddress(); LOG.info(msg); throw new CloseRequestException(msg); + cnxn.getRemoteSocketAddress() + " as it has seen zxid 0x" + Long.toHexString(connReq.getLastZxidSeen()) Long.toHexString(connReq.getLastZxidSeen()), connReq.getTimeOut(), cnxn.getRemoteSocketAddress()); } else { long clientSessionId = connReq.getSessionId(); Long.toHexString(connReq.getLastZxidSeen()), connReq.getTimeOut(), cnxn.getRemoteSocketAddress()); if (serverCnxnFactory != null) { serverCnxnFactory.closeSession(sessionId);
if (LOG.isDebugEnabled()) { LOG.debug("Session establishment request from client " + cnxn.getRemoteSocketAddress() + " client's lastZxid is 0x" + Long.toHexString(connReq.getLastZxidSeen())); + cnxn.getRemoteSocketAddress() + "; will be dropped if server is in r-o mode"); + cnxn.getRemoteSocketAddress(); LOG.info(msg); throw new CloseRequestException(msg); + cnxn.getRemoteSocketAddress() + " as it has seen zxid 0x" + Long.toHexString(connReq.getLastZxidSeen()) LOG.info("Client attempting to renew session 0x" + Long.toHexString(clientSessionId) + " at " + cnxn.getRemoteSocketAddress()); serverCnxnFactory.closeSession(sessionId); cnxn.setSessionId(sessionId); } else { LOG.info("Client attempting to establish new session at " + cnxn.getRemoteSocketAddress()); createSession(cnxn, passwd, sessionTimeout);
LOG.info("got auth packet " + cnxn.getRemoteSocketAddress()); AuthPacket authPacket = new AuthPacket(); ByteBufferInputStream.byteBuffer2Record(incomingBuffer, authPacket); LOG.debug("Authentication succeeded for scheme: " + scheme); LOG.info("auth success " + cnxn.getRemoteSocketAddress()); ReplyHeader rh = new ReplyHeader(h.getXid(), 0, KeeperException.Code.OK.intValue());
LOG.info("got auth packet " + cnxn.getRemoteSocketAddress()); AuthPacket authPacket = new AuthPacket(); ByteBufferInputStream.byteBuffer2Record(incomingBuffer, authPacket); + scheme); LOG.info("auth success " + cnxn.getRemoteSocketAddress()); ReplyHeader rh = new ReplyHeader(h.getXid(), 0, KeeperException.Code.OK.intValue());