// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler/common/FromMemberHandler.java
// public abstract class FromMemberHandler implements NextRTCHandler {
// 
//     @Override
//     public final void handleEvent(NextRTCEvent event) {
//         event.from().ifPresent(from -> handleEvent(from, event));
//     }
// 
//     protected abstract void handleEvent(NextRTCMember from, NextRTCEvent event);
// }
// 
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/service/SessionClosedService.java
// @Service
// @Transactional
// public class SessionClosedService {
// 
//     @Autowired
//     private MemberRepository memberRepository;
// 
//     public void execute(String memberId, Optional<String> reasonOfClose) {
//         memberRepository.getByRtcId(memberId).disconnectWithReason(reasonOfClose);
//     }
// }


import org.apache.log4j.Logger;
import org.nextrtc.examples.videochat_with_rest.domain.handler.common.FromMemberHandler;
import org.nextrtc.examples.videochat_with_rest.service.SessionClosedService;
import org.nextrtc.signalingserver.api.annotation.NextRTCEventListener;
import org.nextrtc.signalingserver.api.dto.NextRTCEvent;
import org.nextrtc.signalingserver.api.dto.NextRTCMember;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static org.nextrtc.signalingserver.api.NextRTCEvents.SESSION_CLOSED;
package org.nextrtc.examples.videochat_with_rest.domain.handler;



@Component
@NextRTCEventListener(SESSION_CLOSED)
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler/common/FromMemberHandler.java
// public abstract class FromMemberHandler implements NextRTCHandler {
// 
//     @Override
//     public final void handleEvent(NextRTCEvent event) {
//         event.from().ifPresent(from -> handleEvent(from, event));
//     }
// 
//     protected abstract void handleEvent(NextRTCMember from, NextRTCEvent event);
// }
// 
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/service/SessionClosedService.java
// @Service
// @Transactional
// public class SessionClosedService {
// 
//     @Autowired
//     private MemberRepository memberRepository;
// 
//     public void execute(String memberId, Optional<String> reasonOfClose) {
//         memberRepository.getByRtcId(memberId).disconnectWithReason(reasonOfClose);
//     }
// }


// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler/SessionClosedHandler.java
import org.apache.log4j.Logger;
import org.nextrtc.examples.videochat_with_rest.domain.handler.common.FromMemberHandler;
import org.nextrtc.examples.videochat_with_rest.service.SessionClosedService;
import org.nextrtc.signalingserver.api.annotation.NextRTCEventListener;
import org.nextrtc.signalingserver.api.dto.NextRTCEvent;
import org.nextrtc.signalingserver.api.dto.NextRTCMember;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static org.nextrtc.signalingserver.api.NextRTCEvents.SESSION_CLOSED;

package org.nextrtc.examples.videochat_with_rest.domain.handler;



@Component
@NextRTCEventListener(SESSION_CLOSED)
public class SessionClosedHandler extends FromMemberHandler {