1/*
2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package sun.nio.ch.sctp;
26
27import java.net.SocketAddress;
28import java.net.InetAddress;
29import java.io.IOException;
30import java.util.Set;
31import java.nio.ByteBuffer;
32import java.nio.channels.spi.SelectorProvider;
33import com.sun.nio.sctp.Association;
34import com.sun.nio.sctp.MessageInfo;
35import com.sun.nio.sctp.NotificationHandler;
36import com.sun.nio.sctp.SctpChannel;
37import com.sun.nio.sctp.SctpSocketOption;
38
39/**
40 * Unimplemented.
41 */
42public class SctpChannelImpl extends SctpChannel
43{
44    private static final String message = "SCTP not supported on this platform";
45
46    public SctpChannelImpl(SelectorProvider provider) {
47        super(provider);
48        throw new UnsupportedOperationException(message);
49    }
50
51    @Override
52    public Association association() {
53        throw new UnsupportedOperationException(message);
54    }
55
56    @Override
57    public SctpChannel bind(SocketAddress local)
58                            throws IOException {
59        throw new UnsupportedOperationException(message);
60    }
61
62    @Override
63    public SctpChannel bindAddress(InetAddress address)
64         throws IOException {
65        throw new UnsupportedOperationException(message);
66    }
67
68    @Override
69    public SctpChannel unbindAddress(InetAddress address)
70         throws IOException {
71        throw new UnsupportedOperationException(message);
72    }
73
74    @Override
75    public boolean connect(SocketAddress remote) throws IOException {
76        throw new UnsupportedOperationException(message);
77    }
78
79    @Override
80    public boolean connect(SocketAddress remote, int maxOutStreams,
81       int maxInStreams) throws IOException {
82        throw new UnsupportedOperationException(message);
83    }
84
85    @Override
86    public boolean isConnectionPending() {
87        throw new UnsupportedOperationException(message);
88    }
89
90    @Override
91    public boolean finishConnect() throws IOException {
92        throw new UnsupportedOperationException(message);
93    }
94
95    @Override
96    public Set<SocketAddress> getAllLocalAddresses()
97            throws IOException {
98        throw new UnsupportedOperationException(message);
99    }
100
101    @Override
102    public Set<SocketAddress> getRemoteAddresses()
103            throws IOException {
104        throw new UnsupportedOperationException(message);
105    }
106
107    @Override
108    public SctpChannel shutdown() throws IOException {
109        throw new UnsupportedOperationException(message);
110    }
111
112    @Override
113    public <T> T getOption(SctpSocketOption<T> name)
114            throws IOException {
115        throw new UnsupportedOperationException(message);
116    }
117
118    @Override
119    public <T> SctpChannel setOption(SctpSocketOption<T> name, T value)
120        throws IOException {
121        throw new UnsupportedOperationException(message);
122    }
123
124    @Override
125    public Set<SctpSocketOption<?>> supportedOptions() {
126        throw new UnsupportedOperationException(message);
127    }
128
129    @Override
130    public <T> MessageInfo receive(ByteBuffer dst, T attachment,
131            NotificationHandler<T> handler) throws IOException {
132        throw new UnsupportedOperationException(message);
133    }
134
135    @Override
136    public int send(ByteBuffer src, MessageInfo messageInfo)
137            throws IOException {
138        throw new UnsupportedOperationException(message);
139    }
140
141    @Override
142    protected void implConfigureBlocking(boolean block) throws IOException {
143        throw new UnsupportedOperationException(message);
144    }
145
146    @Override
147    public void implCloseSelectableChannel() throws IOException {
148        throw new UnsupportedOperationException(message);
149    }
150}
151