Activate code generation
[bgpcep.git] / framework / src / main / java / org / opendaylight / protocol / framework / SessionStreams.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.io.PipedInputStream;
11 import java.io.PipedOutputStream;
12 import java.util.TimerTask;
13
14 /**
15  * DTO object to be attached to socket channel. Contains session and
16  * streams associated with the socket channel.
17  */
18 final class SessionStreams {
19
20         private final ProtocolInputStream inputStream;
21
22         private final PipedInputStream pipedInputStream;
23
24         private final PipedOutputStream pipedOutputStream;
25
26         private final ProtocolSession session;
27
28         final ProtocolConnection connection;
29         int connectCount = 0;
30         TimerTask timer = null;
31
32         SessionStreams(PipedOutputStream pipedOutputStream,
33                         PipedInputStream pipedInputStream,
34                         ProtocolInputStream inputStream,
35                         ProtocolSession session, ProtocolConnection connection) {
36                 this.pipedOutputStream = pipedOutputStream;
37                 this.pipedInputStream = pipedInputStream;
38                 this.inputStream = inputStream;
39                 this.session = session;
40                 this.connection = connection;
41         }
42
43         PipedOutputStream getPipedOutputStream() {
44                 return this.pipedOutputStream;
45         }
46
47         PipedInputStream getPipedInputStream() {
48                 return this.pipedInputStream;
49         }
50
51         ProtocolInputStream getProtocolInputStream() {
52                 return this.inputStream;
53         }
54
55         ProtocolSession getSession() {
56                 return this.session;
57         }
58 }