22ad93065655369e08d4bec3b755abf5e268f219
[controller.git] / opendaylight / commons / protocol-framework / src / test / java / org / opendaylight / protocol / framework / Session.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.protocol.framework;
9
10 import java.util.List;
11
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
14
15 import com.google.common.collect.Lists;
16
17 public class Session extends AbstractProtocolSession<SimpleMessage> {
18
19     private static final Logger logger = LoggerFactory.getLogger(Session.class);
20
21     public final List<SimpleMessage> msgs = Lists.newArrayList();
22
23     public boolean up = false;
24
25     @Override
26     public void close() {
27
28     }
29
30     @Override
31     public void handleMessage(final SimpleMessage msg) {
32         logger.debug("Message received: {}", msg.getMessage());
33         this.up = true;
34         this.msgs.add(msg);
35         logger.debug(this.msgs.size() + "");
36     }
37
38     @Override
39     public void endOfInput() {
40         logger.debug("End of input reported.");
41     }
42
43     @Override
44     protected void sessionUp() {
45         logger.debug("Session up reported.");
46     }
47 }