All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vmware.transport.bridge.spring.handlers.TransportConnectedHandler Maven / Gradle / Ivy

Go to download

Transport is a full stack, simple, fast, expandable application event bus for your applications. It provides a standardized and simple API, implemented in multiple languages, to allow any individual component inside your applications to talk to one another. This is the Java implementation of the Transport library.

The newest version!
/*
 * Copyright 2017-2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 *
 */
package com.vmware.transport.bridge.spring.handlers;

import com.vmware.transport.bridge.spring.services.TransportSubscriptionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
import org.springframework.stereotype.Controller;
import org.springframework.web.socket.messaging.SessionConnectedEvent;

@Controller
public class TransportConnectedHandler implements ApplicationListener {

    @Autowired
    private TransportSubscriptionService subService;

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    public void onApplicationEvent(SessionConnectedEvent event) {
        StompHeaderAccessor sha = StompHeaderAccessor.wrap(event.getMessage());
        logger.info("[@] Transport Bridge: connected with sessionId:" + sha.getSessionId());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy