public Detach(Detach other) { this._handle = other._handle; this._closed = other._closed; if (other._error != null) { this._error = new ErrorCondition(); this._error.copyFrom(other._error); } }
public Close(Close other) { if (other._error != null) { this._error = new ErrorCondition(); this._error.copyFrom(other._error); } }
@Override public void setCondition(ErrorCondition condition) { if(condition != null) { _localError.copyFrom(condition); } else { _localError.clear(); } }
public End(End other) { if (other._error != null) { this._error = new ErrorCondition(); this._error.copyFrom(other._error); } }
@Override public void setCondition(ErrorCondition condition) { if(condition != null) { _localError.copyFrom(condition); } else { _localError.clear(); } }
@Override public void setCondition(ErrorCondition condition) { if(condition != null) { _localError.copyFrom(condition); } else { _localError.clear(); } }
@Override public void handleEnd(End end, Binary payload, Integer channel) { TransportSession transportSession = _remoteSessions.get(channel); if(transportSession == null) { // TODO - fail due to attach on non-begun session } else { _remoteSessions.remove(channel); transportSession.receivedEnd(); transportSession.unsetRemoteChannel(); SessionImpl session = transportSession.getSession(); session.setRemoteState(EndpointState.CLOSED); ErrorCondition errorCondition = end.getError(); if(errorCondition != null) { session.getRemoteCondition().copyFrom(errorCondition); } _connectionEndpoint.put(Event.Type.SESSION_REMOTE_CLOSE, session); } }
@Override public void handleClose(Close close, Binary payload, Integer channel) { _closeReceived = true; setRemoteState(EndpointState.CLOSED); if(_connectionEndpoint != null) { _connectionEndpoint.setRemoteState(EndpointState.CLOSED); if(close.getError() != null) { _connectionEndpoint.getRemoteCondition().copyFrom(close.getError()); } } }
@Override public void handleEnd(End end, Binary payload, Integer channel) { TransportSession transportSession = _remoteSessions.get(channel); if(transportSession == null) { // TODO - fail due to attach on non-begun session } else { _remoteSessions.remove(channel); transportSession.receivedEnd(); transportSession.unsetRemoteChannel(); SessionImpl session = transportSession.getSession(); session.setRemoteState(EndpointState.CLOSED); ErrorCondition errorCondition = end.getError(); if(errorCondition != null) { session.getRemoteCondition().copyFrom(errorCondition); } _connectionEndpoint.put(Event.Type.SESSION_REMOTE_CLOSE, session); } }
@Override public void handleEnd(End end, Binary payload, Integer channel) { TransportSession transportSession = _remoteSessions[channel]; if(transportSession == null) { // TODO - fail due to attach on non-begun session } else { _remoteSessions[channel] = null; transportSession.receivedEnd(); SessionImpl session = transportSession.getSession(); session.setRemoteState(EndpointState.CLOSED); ErrorCondition errorCondition = end.getError(); if(errorCondition != null) { session.getRemoteCondition().copyFrom(errorCondition); } } }
@Override public void handleClose(Close close, Binary payload, Integer channel) { _closeReceived = true; _remoteIdleTimeout = 0; setRemoteState(EndpointState.CLOSED); if(_connectionEndpoint != null) { _connectionEndpoint.setRemoteState(EndpointState.CLOSED); if(close.getError() != null) { _connectionEndpoint.getRemoteCondition().copyFrom(close.getError()); } _connectionEndpoint.put(Event.Type.CONNECTION_REMOTE_CLOSE, _connectionEndpoint); } }
@Override public void handleClose(Close close, Binary payload, Integer channel) { _closeReceived = true; _remoteIdleTimeout = 0; setRemoteState(EndpointState.CLOSED); if(_connectionEndpoint != null) { _connectionEndpoint.setRemoteState(EndpointState.CLOSED); if(close.getError() != null) { _connectionEndpoint.getRemoteCondition().copyFrom(close.getError()); } _connectionEndpoint.put(Event.Type.CONNECTION_REMOTE_CLOSE, _connectionEndpoint); } }
@Override public void handleDetach(Detach detach, Binary payload, Integer channel) { TransportSession transportSession = _remoteSessions[channel]; if(transportSession == null) { // TODO - fail due to attach on non-begun session } else { TransportLink<?> transportLink = transportSession.getLinkFromRemoteHandle(detach.getHandle()); if(transportLink != null) { LinkImpl link = transportLink.getLink(); transportLink.receivedDetach(); transportSession.freeRemoteHandle(transportLink.getRemoteHandle()); link.setRemoteState(EndpointState.CLOSED); if(detach.getError() != null) { link.getRemoteCondition().copyFrom(detach.getError()); } } else { // TODO - fail - attempt attach on a handle which is in use } } }
if(detach.getError() != null) link.getRemoteCondition().copyFrom(detach.getError());
if(detach.getError() != null) link.getRemoteCondition().copyFrom(detach.getError());