This method will process the connection information received from our peer.
At the moment this consists of the connection object ID required at the server,
the name of the messaging engine and the ME Uuid.

@param buffer
@param conversation
334067
private void processConnectionInfo(CommsByteBuffer buffer, Conversation conversation)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "processConnectionInfo",
                                           new Object[]{buffer, conversation});

      ClientConversationState convState = (ClientConversationState) conversation.getAttachment();

      short connectionObjectId = buffer.getShort();           // BIT16 ConnectionObjectID
      String meName = buffer.getString();                     // STR   MEName

      // Set the connection object ID in the conversation state
      convState.setConnectionObjectID(connectionObjectId);

      // Create the connection proxy and save it away in the conversation state
      final ConnectionProxy connectionProxy;

      // The type of connection proxy we create is dependent on FAP version.  Fap version 5 supports
      // a connection which MSSIXAResourceProvider.  This is done so that PEV (introduced in line with
      // FAP 5) can perform remote recovery of resources.
      if (conversation.getHandshakeProperties().getFapLevel() >= JFapChannelConstants.FAP_VERSION_5)
      {
         connectionProxy = new MSSIXAResourceProvidingConnectionProxy(conversation);
      }
      else
      {
         connectionProxy = new ConnectionProxy(conversation);
      }

      convState.setSICoreConnection(connectionProxy);

      // Set in the ME name
      connectionProxy.setMeName(meName);

      // Now get the unique Id if there was one, and set it in the connection proxy
      short idLength = buffer.getShort();
      if (idLength != 0)
      {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Got unique id of length:", idLength);

         byte[] uniqueId = buffer.get(idLength);

         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.bytes(tc, uniqueId);

         connectionProxy.setInitialUniqueId(uniqueId);
      }
      else
      {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "No unique Id was returned");
      }

      // Get the ME Uuid
      String meUuid = buffer.getString();
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "ME Uuid: ", meUuid);
      connectionProxy.setMeUuid(meUuid);

      // Get the resolved User Id
      String resolvedUserId = buffer.getString();
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Resolved UserId: ", resolvedUserId);
      connectionProxy.setResolvedUserId(resolvedUserId);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "processConnectionInfo");
   }
650042
public void queueDataReceivedInvocation(Connection connection,
                                              ReceiveListener listener,
                                              WsByteBuffer data,
                                              int segmentType,
                                              int requestNumber,
                                              int priority,
                                              boolean allocatedFromBufferPool,
                                              boolean partOfExchange,
                                              Conversation conversation)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "queueDataReceivedInvocation", new Object[] {connection, listener, data, ""+segmentType, ""+requestNumber, ""+priority, ""+allocatedFromBufferPool, ""+partOfExchange, conversation});

      int dataSize = 0;
      if (dispatcherEnabled)
         dataSize = data.position();                                                                                                      // D240062

      AbstractInvocation invocation =
         allocateDataReceivedInvocation(connection,
                                        listener,
                                        data,
                                        dataSize,
                                        segmentType,
                                        requestNumber,
                                        priority,
                                        allocatedFromBufferPool,
                                        partOfExchange,
                                        conversation);

      queueInvocationCommon(invocation, (ConversationImpl)conversation);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "queueDataReceivedInvocation");
   }
903304
public void queueErrorOccurredInvocation(Connection connection,
                                               ReceiveListener listener,
                                               SIConnectionLostException exception,
                                               int segmentType,
                                               int requestNumber,
                                               int priority,
                                               Conversation conversation)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "queueErrorOccurredInvocation", new Object[] {connection, listener, exception, ""+segmentType, ""+requestNumber, ""+priority, conversation});

      AbstractInvocation invocation =
         allocateErrorOccurredInvocation(connection,
                                         listener,
                                         exception,
                                         segmentType,
                                         requestNumber,
                                         priority,
                                         conversation);
      queueInvocationCommon(invocation, (ConversationImpl)conversation);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "queueErrorOccurredInvocation");
   }
1134007
private void updateMessage(ClientSocket client, DataInputStream buffer, byte messageSystemId, byte from)
            throws IOException
    {
        switch (messageSystemId)
        {
            case NetworkMessageSystemId.CONNECTING:
                receiveConnecting(client, buffer, from, StateConnection.CONNECTING);
                break;
            case NetworkMessageSystemId.CONNECTED:
                receiveConnected(client, from, StateConnection.CONNECTED);
                break;
            case NetworkMessageSystemId.PING:
                client.getOut().writeByte(NetworkMessageSystemId.PING);
                client.getOut().flush();
                bandwidth += 1;
                break;
            case NetworkMessageSystemId.OTHER_CLIENT_DISCONNECTED:
                receiveDisconnected(client, from, StateConnection.CONNECTED);
                break;
            case NetworkMessageSystemId.OTHER_CLIENT_RENAMED:
                receiveRenamed(client, buffer, from, StateConnection.CONNECTED);
                break;
            case NetworkMessageSystemId.USER_MESSAGE:
                receiveMessage(client, buffer, from, StateConnection.CONNECTED);
                break;
            default:
                break;
        }
    }
988646
private void dumpMEtoMEConversations(final IncidentStream is) 
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpMEtoMEConversations", is);
      
      final ServerConnectionManager scm = ServerConnectionManager.getRef();
      final List obc = scm.getActiveOutboundMEtoMEConversations();
      
      is.writeLine("", "");
      is.writeLine("\n------ ME to ME Conversation Dump ------ ", ">");
      
      if (obc != null)
      {
         //Build a map of connection -> conversation so that we can output the
         //connection information once per set of conversations.
         final Map<Object, LinkedList<Conversation>> connectionToConversationMap = convertToMap(is, obc);

         //Go through the map and dump out a connection - followed by its conversations
         for (final Iterator<Entry<Object,LinkedList<Conversation>>>i = connectionToConversationMap.entrySet().iterator(); i.hasNext();)
         {
            final Entry<Object, LinkedList<Conversation>>entry = i.next();
            is.writeLine("\nOutbound connection:", entry.getKey());

            final LinkedList conversationList = entry.getValue();
            while(!conversationList.isEmpty())
            {
               final Conversation c = (Conversation)conversationList.removeFirst();
               is.writeLine("\nOutbound Conversation[" + c.getId() + "]: ", c.getFullSummary());
               
               try
               {
                  dumpMEtoMEConversation(is, c);
               }
               catch(Throwable t)
               {
                  // No FFDC Code Needed
                  is.writeLine("\nUnable to dump conversation", t);
               }        
            }
         }
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpMEtoMEConversations");
   }
870988
static void receiveSchemas(CommsConnection conn, byte[] data) throws JMFException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "receiveSchemas", conn);

    final SchemaSet ids;

    try {
      ids = (SchemaSet)conn.getSchemaSet();
      if (ids == null) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "getSchemaSet() returned null for CommsConnection: " + conn);
        throw new IllegalStateException("CommsConnection returned null SchemaSet");
      }
    } catch (SIConnectionDroppedException e) {
      // No FFDC code needed - this is not an unexpected condition when a connection fails during start of a new conversation on the connection
      throw new IllegalStateException("CommsConnection threw exception", e);
    }

    Coder coder = new Coder(data);
    addSchemaDefinitions(ids, coder);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "receiveSchemas");
  }
1214080
public void messageReceived(Object message) {
        if (message instanceof Packet) {
            try {
                messageReceived(conn, (Packet) message);
            } catch (Exception e) {
                log.warn("Exception on packet receive", e);
            }
        } else {
            // raw buffer handling
            IoBuffer in = (IoBuffer) message;
            // filter based on current connection state
            RTMP rtmp = conn.getState();
            final byte connectionState = conn.getStateCode();
            log.trace("connectionState: {}", RTMP.states[connectionState]);
            // get the handshake
            OutboundHandshake handshake = (OutboundHandshake) conn.getAttribute(RTMPConnection.RTMP_HANDSHAKE);
            switch (connectionState) {
                case RTMP.STATE_CONNECT:
                    log.debug("Handshake - client phase 1 - size: {}", in.remaining());
                    in.get(); // 0x01
                    byte handshakeType = in.get(); // usually 0x03 (rtmp)
                    log.debug("Handshake - byte type: {}", handshakeType);
                    // copy out 1536 bytes
                    byte[] s1 = new byte[Constants.HANDSHAKE_SIZE];
                    in.get(s1);
                    // decode s1
                    IoBuffer out = handshake.decodeServerResponse1(IoBuffer.wrap(s1));
                    if (out != null) {
                        // set state to indicate we're waiting for S2
                        rtmp.setState(RTMP.STATE_HANDSHAKE);
                        conn.writeRaw(out);
                        // if we got S0S1+S2 continue processing
                        if (in.remaining() >= Constants.HANDSHAKE_SIZE) {
                            log.debug("Handshake - client phase 2 - size: {}", in.remaining());
                            if (handshake.decodeServerResponse2(in)) {
//                                conn.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
//                                conn.setStateCode(RTMP.STATE_CONNECTED);
//                                connectionOpened(conn);
                            } else {
                                log.warn("Handshake failed on S2 processing");
                                //conn.close();
                            }
                            // open regardless of server type
                            conn.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
                            conn.setStateCode(RTMP.STATE_CONNECTED);
                            connectionOpened(conn);
                        }
                    } else {
                        log.warn("Handshake failed on S0S1 processing");
                        conn.close();
                    }
                    break;
                case RTMP.STATE_HANDSHAKE:
                    log.debug("Handshake - client phase 2 - size: {}", in.remaining());
                    if (handshake.decodeServerResponse2(in)) {
//                        conn.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
//                        conn.setStateCode(RTMP.STATE_CONNECTED);
//                        connectionOpened(conn);
                    } else {
                        log.warn("Handshake failed on S2 processing");
                        //conn.close();
                    }
                    // open regardless of server type
                    conn.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
                    conn.setStateCode(RTMP.STATE_CONNECTED);
                    connectionOpened(conn);
                    break;
                default:
                    throw new IllegalStateException("Invalid RTMP state: " + connectionState);
            }
        }
    }
1184916
public void processRequest(RequestEvent request) {
    Request req_msg = request.getRequest();
    ToHeader to = (ToHeader) req_msg.getHeader(ToHeader.NAME);
    SipContact my_contact_info = new SipContact();

    synchronized (contactLock) {
      my_contact_info.setContactHeader((ContactHeader) (contactInfo.getContactHeader().clone()));
    }

    // Is it for me? Check: Request-URI = my contact address (I may not be
    // the original 'To' party, also there may be multiple devices for one
    // "me" address of record)
    // If no match, check 'To' = me
    // (so that local messaging without proxy still works) - but ONLY IF
    // setLoopback() has been called

    LOG.trace("request received !");
    LOG.trace("     me ('To' check) = {}", me);
    LOG.trace("     my local contact info ('Request URI' check) = {}", my_contact_info.getURI());
    LOG.trace("     {}" , req_msg.toString());

    if (req_msg.getMethod().equalsIgnoreCase(SipRequest.REGISTER)) {
      if (!isPassThroughRegisterRequests()) {
        if (!isSupportRegisterRequests()) {
          return;
        } else {
          ExpiresHeader expires = req_msg.getExpires();
          if (expires.getExpires() == 0) {
            try {
              Response response = getParent().getMessageFactory().createResponse(Response.OK, request.getRequest());
              sendReply(request, response);
              return;
            } catch (Exception e) {
              LOG.error("Exception while trying to respond to REGISTER with Expires header 0 request");
            }
          }
        }
      }
    } else if (!acceptTrafficOnEphemeralPorts) {
      //Check if destination match
      if (destMatch((SipURI) my_contact_info.getContactHeader().getAddress().getURI(),
              (SipURI) req_msg.getRequestURI()) == false) {
        if (!loopback) {
          LOG.trace("     skipping 'To' check, we're not loopback (see setLoopback())");
          return;
        }

        // check 'To' for a match
        if (to.getAddress().getURI().toString().equals(me) == false) {
          return;
        }
      }
    }

    if (req_msg.getMethod().equalsIgnoreCase(Request.OPTIONS)) {
      int responseCode = Response.OK;
      if (!isAutoResponseOptionsRequests()) {
        if (errorRespondToOptions != -1 ) {
          responseCode = errorRespondToOptions;
        } else {
          return;
        }
      }
      try {
        Response response = getParent().getMessageFactory().createResponse(responseCode, request.getRequest());
        sendReply(request, response);
        lastReceivedOptionsRequest = req_msg;
      } catch (Exception e) {
        LOG.error("Exception while trying to respond to OPTIONS request");
      }
    }

    // check for listener handling
    synchronized (requestListeners) {
      List<RequestListener> listeners = requestListeners.get(req_msg.getMethod());
      if (listeners != null) {
        Iterator<RequestListener> i = listeners.iterator();
        while (i.hasNext()) {
          RequestListener listener = (RequestListener) i.next();
          listener.processEvent(request);
        }
      }
    }

    synchronized (reqBlock) {
      if (rcvRequests == false) {
        LOG.trace("not interested in blocking requests");
        return;
      }

      reqEvents.addLast(request);

      LOG.trace("notifying block object");
      reqBlock.notifyEvent();
    }
  }
505490
@Override
    public void processTextMessage(WebSocketChannel channel, String message) {
        LOG.entering(CLASS_NAME, "send", message);

        WebSocketCompositeChannel parent = (WebSocketCompositeChannel)channel;
        if (parent.readyState != ReadyState.OPEN) {
            LOG.warning("Attempt to post message on unopened or closed web socket");
            throw new IllegalStateException("Attempt to post message on unopened or closed web socket");
        }
        
        WebSocketSelectedChannel selectedChannel = parent.selectedChannel;
        selectedChannel.handler.processTextMessage(selectedChannel, message);
    }
255358
public void processNewConnection(SocketIOChannel socket) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "processNewConnection");
        }

        VirtualConnection vc = vcf.createConnection();
        TCPConnLink bc = (TCPConnLink) tcpChannel.getConnectionLink(vc);
        TCPReadRequestContextImpl bcRead = bc.getTCPReadConnLink();

        bc.setSocketIOChannel(socket);

        ConnectionDescriptor cd = vc.getConnectionDescriptor();
        Socket s = socket.getSocket();
        InetAddress remote = s.getInetAddress();
        InetAddress local = s.getLocalAddress();

        if (cd != null) {
            cd.setAddrs(remote, local);
        } else {
            ConnectionDescriptorImpl cdi = new ConnectionDescriptorImpl(remote, local);

            vc.setConnectionDescriptor(cdi);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Processing Connection: " + vc.getConnectionDescriptor());
        }

        int rc = vc.attemptToSetFileChannelCapable(VirtualConnection.FILE_CHANNEL_CAPABLE_ENABLED);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "FileChannelCapable set in VC to: " + rc);
        }

        bcRead.setJITAllocateSize(bc.getConfig().getNewConnectionBufferSize());
        int timeout = bc.getConfig().getInactivityTimeout();
        if (timeout == ValidateUtils.INACTIVITY_TIMEOUT_NO_TIMEOUT) {
            timeout = TCPRequestContext.NO_TIMEOUT;
        }

        // Set a chain property that is used later by the SSL channel on Z only
        // (CRA)
        // This is needed to support a Z unique client certificate mapping function
        // which may be moved to non Z platforms in the future.
        vc.getStateMap().put("REMOTE_ADDRESS", bc.getRemoteAddress().getHostAddress());

        bcRead.read(1, cc, true, timeout);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "processNewConnection");
        }
    }
157740
public void queueErrorOccurredInvocation(Connection connection,
                                               ConversationReceiveListener listener,
                                               SIConnectionLostException exception,
                                               int segmentType,
                                               int requestNumber,
                                               int priority,
                                               Conversation conversation)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "queueErrorOccurredInvocation", new Object[] {connection, listener, exception, ""+segmentType, ""+requestNumber, ""+priority, conversation});

      AbstractInvocation invocation =
         allocateErrorOccurredInvocation(connection,
                                         listener,
                                         exception,
                                         segmentType,
                                         requestNumber,
                                         priority,
                                         conversation);

      // Start F201521
      // We don't always want to queue this as it could end up on some random thread.
      // As such, ask the conversation how many things it has left to process - if that
      // is 0, then queue it - otherwise, save it in the Conversation so that the last
      // thread working on that Conversatioon will invoke it.
      ConversationImpl convImpl = (ConversationImpl) conversation;

      int conversationRequestCount = 0;
      // Start D262285
      boolean queueIt = true;
      synchronized (convImpl.getTotalOutstandingRequestCountLock())
      {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Queueing a errorOccurred invocation for ", conversation);
         conversationRequestCount = convImpl.getTotalOutstandingRequestCount();
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Request count is: " + conversationRequestCount);

         if (conversationRequestCount != 0)
         {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Count != 0, saving");
            convImpl.setErrorOccurredInvocation(invocation);
            queueIt = false;
         }
      }

      if (queueIt)
      {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Count = 0, queueing");
         queueInvocationCommon(invocation, convImpl);
      }
      // End D262285
      // End F201521

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "queueErrorOccurredInvocation");
   }
347411
@Override
    public void messageSent(final NextFilter nextFilter,
            final IoSession session, final WriteRequest writeRequest)
            throws Exception {
        if (writeRequest.getMessage() != null
                && writeRequest.getMessage() instanceof ProxyHandshakeIoBuffer) {
            // Ignore buffers used in handshaking
            return;
        }

        nextFilter.messageSent(session, writeRequest);
    }
64288
public void onConnect(RespokeSignalingChannel sender, String endpointID, String connectionID) {
        connectionInProgress = false;
        reconnectCount = 0;
        localEndpointID = endpointID;
        localConnectionID = connectionID;

        Respoke.sharedInstance().clientConnected(this);

        // Try to set the presence to the initial or last set state
        setPresence(presence, new Respoke.TaskCompletionListener() {
            @Override
            public void onSuccess() {
                // do nothing
            }

            @Override
            public void onError(String errorMessage) {
                // do nothing
            }
        });

        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                Listener listener = listenerReference.get();
                if (null != listener) {
                    listener.onConnect(RespokeClient.this);
                }
            }
        });
    }
450923
@Override
    public void meTerminated(SICoreConnection conn) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "meTerminated");

        //Remember the fact that the ME has terminated so we don't issue spurious FFDCs
        final Conversation conversation = conversationTable.get(conn);

        //If conversation is null we do nothing.
        if (conversation != null) {
            final ConversationState convState = (ConversationState) conversation.getAttachment();
            convState.setMETerminated();
        }

        // Right, so the ME that the core connection is connected to
        // is dead. First of all get the ME Uuid that the connection
        // refers to
        String meUuid = conn.getMeUuid();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.debug(tc, "ME Uuid: ", meUuid);

        // Have we already sent a notification about this ME terminating
        // to the client?
        if (termNotif.get(meUuid) == null) {
            // No we have not. So, get the Conversation and send the client
            // the message about this ME. It will be up to the client to fan
            // out this message to other clients connected to this ME.
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "We have not sent a notification about this ME");

            try {
                sendMeNotificationEvent(CommsConstants.EVENTID_ME_TERMINATED, conn, null, null);

                // and save that we have sent a response concerning this ME
                // Note, just using a Hashtable for fast searching.
                termNotif.put(meUuid, new Object());
            } catch (SIException e) {
                FFDCFilter.processException(e,
                                            CLASS_NAME + ".meTerminated",
                                            CommsConstants.SERVERSICORECONNECTIONLISTENER_MET_01,
                                            this);

                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(tc, e.getMessage(), e);

                SibTr.error(tc, "COMMUNICATION_ERROR_SICO2018", e);
            }
        } else {
            // Yes we have - so do not do anything more
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "Already sent notification about this ME");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "meTerminated");
    }
795674
static void rcvUnlockAll(CommsByteBuffer request, Conversation conversation, int requestNumber,
                             boolean allocatedFromBufferPool, boolean partOfExchange)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "rcvUnlockAll",
                        new Object[]
                        {
                         request,
                         conversation,
                         "" + requestNumber,
                         "" + allocatedFromBufferPool
                        });

        short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
        short consumerObjectId = request.getShort(); // BIT16 ConsumerSessionId

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        {
            SibTr.debug(tc, "connectionObjectId", connectionObjectId);
            SibTr.debug(tc, "consumerObjectId", consumerObjectId);
        }

        CATMainConsumer mainConsumer =
                        (CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectId);

        mainConsumer.unlockAll(requestNumber);

        request.release(allocatedFromBufferPool);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "rcvUnlockAll");
    }
1192153
protected synchronized void reset(Connection connection,
                        ConversationReceiveListener listener,
                        SIConnectionLostException exception,
                        int segmentType,
                        int requestNumber,
                        int priority,
                        Conversation conversation)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "reset",
                                           new Object[]
                                           {
                                              connection,
                                              listener,
                                              exception,
                                              ""+segmentType,
                                              ""+requestNumber,
                                              ""+priority,
                                              conversation
                                           });

      this.connection = connection;
      this.listener = listener;
      this.exception = exception;
      this.segmentType = segmentType;
      this.requestNumber = requestNumber;
      this.priority = priority;
      this.conversation = conversation;
      setDispatchable(null);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "reset");
   }
790532
protected void processReceivedMessage (ChatMessage msg, String localtype)
    {
        String autoResponse = null;
        Name speaker = null;
        Name speakerDisplay = null;
        byte mode = (byte)-1;

        // figure out if the message was triggered by another user
        if (msg instanceof UserMessage) {
            UserMessage umsg = (UserMessage)msg;
            speaker = umsg.speaker;
            speakerDisplay = umsg.getSpeakerDisplayName();
            mode = umsg.mode;

        } else if (msg instanceof UserSystemMessage) {
            speaker = ((UserSystemMessage)msg).speaker;
            speakerDisplay = speaker;
        }

        // Translate and timestamp the message. This would happen during dispatch but we
        // need to do it ahead of filtering.
        setClientInfo(msg, localtype);

        // if there was an originating speaker, see if we want to hear it
        if (speaker != null) {
            if (shouldFilter(msg) && (msg.message = filter(msg.message, speaker, false)) == null) {
                return;
            }

            if (USER_CHAT_TYPE.equals(localtype) &&
                mode == ChatCodes.DEFAULT_MODE) {
                // if it was a tell, add the speaker as a chatter
                addChatter(speaker);

                // note whether or not we have an auto-response
                BodyObject self = (BodyObject)_ctx.getClient().getClientObject();
                if (!StringUtil.isBlank(self.awayMessage)) {
                    autoResponse = self.awayMessage;
                }
            }
        }

        // and send it off!
        dispatchMessage(msg, localtype);

        // if we auto-responded, report as much
        if (autoResponse != null) {
            String amsg = MessageBundle.tcompose(
                "m.auto_responded", speakerDisplay, autoResponse);
            displayFeedback(_bundle, amsg);
        }
    }