// Path: src/main/java/org/nextrtc/signalingserver/api/dto/NextRTCConversation.java
// public interface NextRTCConversation extends Closeable {
//     String getId();
// 
//     NextRTCMember getCreator();
// 
//     Set<NextRTCMember> getMembers();
// }
// 
// Path: src/main/java/org/nextrtc/signalingserver/cases/LeftConversation.java
// @Component(Signals.LEFT_HANDLER)
// public class LeftConversation implements SignalHandler {
// 
//     private NextRTCEventBus eventBus;
//     private ConversationRepository conversations;
// 
//     @Inject
//     public LeftConversation(NextRTCEventBus eventBus, ConversationRepository conversations) {
//         this.eventBus = eventBus;
//         this.conversations = conversations;
//     }
// 
//     public void execute(InternalMessage context) {
//         final Member leaving = context.getFrom();
//         Conversation conversation = checkPrecondition(leaving.getConversation());
// 
//         conversation.left(leaving);
//     }
// 
//     public void destroy(Conversation toRemove, Member last) {
//         eventBus.post(CONVERSATION_DESTROYED.basedOn(
//                 builder()
//                         .conversation(conversations.remove(toRemove.getId()))
//                         .from(last)));
//     }
// 
//     private Conversation checkPrecondition(Optional<Conversation> conversation) {
//         if (!conversation.isPresent()) {
//             throw CONVERSATION_NOT_FOUND.exception();
//         }
//         return conversation.get();
//     }
// 
// }


import lombok.Getter;
import org.nextrtc.signalingserver.api.dto.NextRTCConversation;
import org.nextrtc.signalingserver.cases.LeftConversation;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.inject.Inject;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
package org.nextrtc.signalingserver.domain;



@Getter
@Component
@Scope("prototype")
// Path: src/main/java/org/nextrtc/signalingserver/api/dto/NextRTCConversation.java
// public interface NextRTCConversation extends Closeable {
//     String getId();
// 
//     NextRTCMember getCreator();
// 
//     Set<NextRTCMember> getMembers();
// }
// 
// Path: src/main/java/org/nextrtc/signalingserver/cases/LeftConversation.java
// @Component(Signals.LEFT_HANDLER)
// public class LeftConversation implements SignalHandler {
// 
//     private NextRTCEventBus eventBus;
//     private ConversationRepository conversations;
// 
//     @Inject
//     public LeftConversation(NextRTCEventBus eventBus, ConversationRepository conversations) {
//         this.eventBus = eventBus;
//         this.conversations = conversations;
//     }
// 
//     public void execute(InternalMessage context) {
//         final Member leaving = context.getFrom();
//         Conversation conversation = checkPrecondition(leaving.getConversation());
// 
//         conversation.left(leaving);
//     }
// 
//     public void destroy(Conversation toRemove, Member last) {
//         eventBus.post(CONVERSATION_DESTROYED.basedOn(
//                 builder()
//                         .conversation(conversations.remove(toRemove.getId()))
//                         .from(last)));
//     }
// 
//     private Conversation checkPrecondition(Optional<Conversation> conversation) {
//         if (!conversation.isPresent()) {
//             throw CONVERSATION_NOT_FOUND.exception();
//         }
//         return conversation.get();
//     }
// 
// }


// Path: src/main/java/org/nextrtc/signalingserver/domain/Conversation.java
import lombok.Getter;
import org.nextrtc.signalingserver.api.dto.NextRTCConversation;
import org.nextrtc.signalingserver.cases.LeftConversation;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.inject.Inject;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

package org.nextrtc.signalingserver.domain;



@Getter
@Component
@Scope("prototype")
public abstract class Conversation implements NextRTCConversation {