// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler/ConversationCreatedHandler.java
// @Component
// @NextRTCEventListener(CONVERSATION_CREATED)
// public class ConversationCreatedHandler extends ConversationHandler {
// 
//     private static final Logger log = Logger.getLogger(ConversationCreatedHandler.class);
//     @Autowired
//     private ConversationRepository repo;
// 
//     @Override
//     protected void handleEvent(NextRTCConversation rtcConversation, NextRTCEvent event) {
//         Conversation conversation = repo.getByConversationName(rtcConversation.getId());
//         if (conversation == null) {
//             log.info("Created conversation: " + repo.save(new Conversation(rtcConversation.getId())));
//         }
//     }
// }


import org.apache.log4j.Logger;
import org.nextrtc.examples.videochat_with_rest.domain.handler.ConversationCreatedHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.security.authentication.event.InteractiveAuthenticationSuccessEvent;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.Map;
package org.nextrtc.examples.videochat_with_rest.service;



@Service
@Transactional
public class OAuthLoginSuccess implements ApplicationListener<InteractiveAuthenticationSuccessEvent> {
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler/ConversationCreatedHandler.java
// @Component
// @NextRTCEventListener(CONVERSATION_CREATED)
// public class ConversationCreatedHandler extends ConversationHandler {
// 
//     private static final Logger log = Logger.getLogger(ConversationCreatedHandler.class);
//     @Autowired
//     private ConversationRepository repo;
// 
//     @Override
//     protected void handleEvent(NextRTCConversation rtcConversation, NextRTCEvent event) {
//         Conversation conversation = repo.getByConversationName(rtcConversation.getId());
//         if (conversation == null) {
//             log.info("Created conversation: " + repo.save(new Conversation(rtcConversation.getId())));
//         }
//     }
// }


// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/service/OAuthLoginSuccess.java
import org.apache.log4j.Logger;
import org.nextrtc.examples.videochat_with_rest.domain.handler.ConversationCreatedHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.security.authentication.event.InteractiveAuthenticationSuccessEvent;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.Map;

package org.nextrtc.examples.videochat_with_rest.service;



@Service
@Transactional
public class OAuthLoginSuccess implements ApplicationListener<InteractiveAuthenticationSuccessEvent> {
    private static final Logger log = Logger.getLogger(ConversationCreatedHandler.class);