ToC: Connection listeners
@param data The data
@return The events
@exception Exception If an error occurs
11794
public static Map<String, List<TraceEvent>> tocConnectionListeners(List<TraceEvent> data) throws Exception
   {
      Map<String, List<TraceEvent>> result = new TreeMap<String, List<TraceEvent>>();

      for (TraceEvent te : data)
      {
         if (te.getType() == TraceEvent.GET_CONNECTION_LISTENER ||
             te.getType() == TraceEvent.GET_CONNECTION_LISTENER_NEW ||
             te.getType() == TraceEvent.GET_INTERLEAVING_CONNECTION_LISTENER ||
             te.getType() == TraceEvent.GET_INTERLEAVING_CONNECTION_LISTENER_NEW)
         {
            List<TraceEvent> l = result.get(te.getConnectionListener());

            if (l == null)
               l = new ArrayList<TraceEvent>();

            l.add(te);

            result.put(te.getConnectionListener(), l);
         }
      }

      return result;
   }
866449
public void handleData(String data) {
		try {
			sendEvent(new ClickEvent(this.user, getPayload()));
			if (clickHandler != null)
				clickHandler.clicked();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
1130137
public void reconnect() throws SQLException {
    try {
      listener.reconnect();
    } catch (SQLException e) {
      ExceptionMapper.throwException(e, null, null);
    }
  }
1214328
private void add(Iterable<?> data) {

    for (Object el : data) {
      try {
        add(SoyData.createFromExistingData(el));

      } catch (SoyDataException sde) {
        sde.prependIndexToDataPath(list.size());
        throw sde;
      }
    }
  }
972202
public static synchronized XMLEventReader createListReader(final List<XMLEvent> paramEvents)
        throws IOException, XMLStreamException {
        checkNotNull(paramEvents);
        return new ListEventReader(paramEvents);
    }
452460
public static Map<String, List<TraceEvent>> filterLifecycleEvents(List<TraceEvent> data) throws Exception
   {
      Map<String, List<TraceEvent>> result = new TreeMap<String, List<TraceEvent>>();

      for (TraceEvent te : data)
      {
         if (te.getType() == TraceEvent.CREATE_CONNECTION_LISTENER_GET ||
             te.getType() == TraceEvent.CREATE_CONNECTION_LISTENER_PREFILL ||
             te.getType() == TraceEvent.CREATE_CONNECTION_LISTENER_INCREMENTER ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_RETURN ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_IDLE ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_INVALID ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_FLUSH ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_ERROR ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_PREFILL ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_INCREMENTER ||
             te.getType() == TraceEvent.MANAGED_CONNECTION_POOL_CREATE ||
             te.getType() == TraceEvent.MANAGED_CONNECTION_POOL_DESTROY)
         {
            List<TraceEvent> l = result.get(te.getPool());

            if (l == null)
               l = new ArrayList<TraceEvent>();

            l.add(te);

            result.put(te.getPool(), l);
         }
      }

      return result;
   }
1215209
private void processCalendars() throws SQLException
   {
      List<Row> rows = getTable("EXCEPTIONN");
      Map<Integer, DayType> exceptionMap = m_reader.createExceptionTypeMap(rows);

      rows = getTable("WORK_PATTERN");
      Map<Integer, Row> workPatternMap = m_reader.createWorkPatternMap(rows);

      rows = new LinkedList<Row>();// getTable("WORK_PATTERN_ASSIGNMENT"); // Need to generate an example
      Map<Integer, List<Row>> workPatternAssignmentMap = m_reader.createWorkPatternAssignmentMap(rows);

      rows = getTable("EXCEPTION_ASSIGNMENT");
      Map<Integer, List<Row>> exceptionAssignmentMap = m_reader.createExceptionAssignmentMap(rows);

      rows = getTable("TIME_ENTRY");
      Map<Integer, List<Row>> timeEntryMap = m_reader.createTimeEntryMap(rows);

      rows = getTable("CALENDAR");
      Collections.sort(rows, CALENDAR_COMPARATOR);
      for (Row row : rows)
      {
         m_reader.processCalendar(row, workPatternMap, workPatternAssignmentMap, exceptionAssignmentMap, timeEntryMap, exceptionMap);
      }

      //
      // Update unique counters at this point as we will be generating
      // resource calendars, and will need to auto generate IDs
      //
      m_reader.getProject().getProjectConfig().updateUniqueCounters();
   }
341269
public static ServerSentEvent withEventType(ByteBuf eventType, ByteBuf data) {
        return new ServerSentEvent(null, eventType, data);
    }
1213700
private void updateOtherClientConnected() throws IOException
    {
        final byte cid = in.readByte();
        final String cname = readString();
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyClientConnected(Byte.valueOf(cid), cname);
        }
    }
379213
private void processCalendars() throws IOException
   {
      CalendarReader reader = new CalendarReader(m_data.getTableData("Calendars"));
      reader.read();

      for (MapRow row : reader.getRows())
      {
         processCalendar(row);
      }

      m_project.setDefaultCalendar(m_calendarMap.get(reader.getDefaultCalendarUUID()));
   }
1293995
private void dispatchToConversationListenerMethod(WsByteBuffer data, ConversationImpl conversation)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dispatchToConversationListenerMethod", new Object[]{data, conversation});
      boolean bailOut = false;

      if (conversation == null)
      {
         // Must be an attempt to start a new conversation.
         if (onClientSide)
         {
            // This is an error!
            bailOut = true;
         }
         else
         {
            // On the server side we assume any previously unseend
            // conversation id means that the client is stricking up a
            // conversation with us.
            conversation = new ConversationImpl((short)conversationHeaderFields.conversationId, false, connection, null);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "accepting new conversation");

            ConversationReceiveListener rl = null;
            boolean badReceiveListener = false;
            try
            {
               rl = acceptListener.acceptConnection(conversation);
            }
            catch(Throwable t)
            {
               FFDCFilter.processException
                  (t, "com.ibm.ws.sib.jfapchannel.impl.ConnectionReadCompletedCallback", JFapChannelConstants.INBOUNDXMITPARSER_DISPCONVLST_01);
               if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "exception thrown from acceptConnection");
               if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, t.getMessage());

               // Oh dear, user managed to throw an exception in their callback.
               badReceiveListener = true;
               bailOut = true;
            }

            // If the user did not supply us with a receive listener (either through
            // incompetence or throwning an exception) make our own.  We need one before
            // we can finish establishing the conversation and the cleanest way to dump the
            // conversation is to finish establishing it then close it.
            if (rl == null)
            {
               if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "bad receive listener");
               badReceiveListener = true;
               bailOut = true;
               rl = new BadReceiveListener();
            }

            conversation.setDefaultReceiveListener(rl);
            try
            {
               conversation = connection.startNewConversation(conversation);

               if (badReceiveListener)
               {
                  try
                  {
                     conversation.close();
                  }
                  catch (SIResourceException e)
                  {
                     FFDCFilter.processException
                        (e, "com.ibm.ws.sib.jfapchannel.impl.ConnectionReadCompletedCallback", JFapChannelConstants.INBOUNDXMITPARSER_DISPCONVLST_02);
                     if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "exception thrown closing conversation");
                     if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, e);

                     // Hmmn, something went wrong trying to close the logical conversation.
                     // Bring down the whole conneciton.
                     connection.invalidate(false, e, "SIResourceError when closing conversation - "+e.getMessage()); // D224570
                     bailOut = true;
                  }
               }
            }
            catch(SIResourceException e)
            {
               // No FFDC code needed
               // (FFDC taken at source of exception)
               try
               {
                  conversation.close();
               }
               catch(Exception e2)
               {
                  // No FFDC code needed
                  // (already broken)
               }

               connection.invalidate(true, e, "SIResourceError when creating conversation - "+e.getMessage());
            }
         }
      }

      if (!bailOut)
      {

         RequestIdTable reqIdTable = null;
         if (conversation != null)
            reqIdTable = conversation.getRequestIdTable();

         // Is this request something we were expecting a reply for?
         if ((reqIdTable != null) && reqIdTable.containsId(conversationHeaderFields.requestNumber))
         {
            ReceiveListener listener = reqIdTable.getListener(conversationHeaderFields.requestNumber);
            reqIdTable.remove(conversationHeaderFields.requestNumber);

            if (listener != null)
            {
               if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "listener: "+listener+" conversaion: "+conversation);

               ReceiveListenerDispatcher.getInstance(conversation.getConversationType(), conversation.isOnClientSide()).        // D242116
                queueDataReceivedInvocation
                  (connection, listener, data, primaryHeaderFields.segmentType,
                     conversationHeaderFields.requestNumber, primaryHeaderFields.priority, primaryHeaderFields.isPooled,
                     primaryHeaderFields.isExchange, conversation);
            }
            else
            {
               // It should be impossible to get to here and discover that
               // the associated entry in the request table has a null
               // receive listener...
               if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Entry "+conversationHeaderFields.requestNumber+" in request table has null listener");

               // Probably better stop talking to our peer - just to be on the safe side.
               connection.invalidate(true, null, "no receive listener for conversation "+conversationHeaderFields.requestNumber); // F176003, D224570
            }

         }
         else
         {
            // We weren't expecting this reply - notify the 'default' request
            // listener associated with this conversation...
            ConversationReceiveListener listener =                                 // F174776
               conversation.getDefaultReceiveListener();
            //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "invokeCallback", "default receive listener: "+listener);
            if (listener == null)
            {
               // Earlier error checking should prevent us ever getting into
               // this condition.
               //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "No default receive listener");

               // Since we can't really continue, probably best to stop talking
               // to our peer now.
               connection.invalidate(true, null, "no default receive listener");    // F176003, D224570
            }
            else
            {
               ReceiveListenerDispatcher.getInstance(conversation.getConversationType(), conversation.isOnClientSide()).        // D242116
                queueDataReceivedInvocation
                  (connection, listener, data, primaryHeaderFields.segmentType,
                  conversationHeaderFields.requestNumber, primaryHeaderFields.priority, primaryHeaderFields.isPooled,
                  primaryHeaderFields.isExchange, conversation);
            }
         }

      }//if(!bailOut)

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dispatchToConversationListenerMethod");
   }
333483
protected String getBulkData(List<SimpleDataEvent> events) {
    StringBuilder builder = new StringBuilder();
    for (SimpleDataEvent event : events) {
      builder.append(JSONUtils.getElasticSearchBulkHeader(event, this.indexName, this.typeName));
      builder.append("\n");
      builder.append(JSONUtils.getElasticSearchAddDocument(event.pairs()));
      builder.append("\n");
    }
    return builder.toString();
  }
289287
@Override
    protected void onPersist(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders)
    {
        Connection conn = getConnection();
        try
        {
            // if entity is embeddable...call cql translator to get cql string!
            // use thrift client to execute cql query.

            if (isCql3Enabled(entityMetadata))
            {
                cqlClient.persist(entityMetadata, entity, conn.getClient(), rlHolders,
                        getTtlValues().get(entityMetadata.getTableName()));
            }
            else
            {
                Map<ByteBuffer, Map<String, List<Mutation>>> mutationMap = new HashMap<ByteBuffer, Map<String, List<Mutation>>>();
                prepareMutation(entityMetadata, entity, id, rlHolders, mutationMap);
                // Write Mutation map to database
                conn.getClient().batch_mutate(mutationMap, getConsistencyLevel());

                mutationMap.clear();
                mutationMap = null;
            }

        }
        catch (InvalidRequestException e)
        {
            log.error("Error while persisting record, Caused by: .", e);
            throw new KunderaException(e);
        }
        catch (TException e)
        {
            log.error("Error while persisting record, Caused by: .", e);
            throw new KunderaException(e);
        }
        catch (UnsupportedEncodingException e)
        {
            log.error("Error while persisting record, Caused by: .", e);
            throw new KunderaException(e);
        }
        finally
        {
            releaseConnection(conn);

            if (isTtlPerRequest())
            {
                getTtlValues().clear();
            }
        }
    }
243920
private static void onDataRead(ChannelHandlerContext ctx, Http2DataFrame data) throws Exception {
        if (data.isEndStream()) {
            sendResponse(ctx, data.content());
        } else {
            // We do not send back the response to the remote-peer, so we need to release it.
            data.release();
        }
    }
672615
void fireOnConnecting(ConnectionEvent e) {
        List<EventListener> listeners = changes.getListenerList(AMQP);
        for (EventListener listener : listeners) {
            ConnectionListener amqpListener = (ConnectionListener)listener;
            amqpListener.onConnecting(e);
        }
    }
1073581
public Connection<A> createConnection(ConnectionData data) {
		return new OAuth1Connection<A>(data, getOAuth1ServiceProvider(), getApiAdapter());
	}
1103663
def connection_event(event, *args)
    return unless @connection_event_handlers.keys.include?(event)
    @connection_event_handlers[event].each { |h| h.call(self, *args) }
  end