1 /* 2 * Created on 1 Nov 2006 3 * Created by Paul Gardner 4 * Copyright (C) Azureus Software, Inc, All Rights Reserved. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 */ 19 20 package com.aelitis.azureus.core.networkmanager; 21 22 public interface 23 NetworkConnectionBase 24 { 25 public ConnectionEndpoint getEndpoint()26 getEndpoint(); 27 28 /** 29 * Inform connection of a thrown exception. 30 * @param error exception 31 */ 32 notifyOfException( Throwable error )33 public void notifyOfException( Throwable error ); 34 35 /** 36 * Get the connection's outgoing message queue. 37 * @return outbound message queue 38 */ getOutgoingMessageQueue()39 public OutgoingMessageQueue getOutgoingMessageQueue(); 40 41 42 /** 43 * Get the connection's incoming message queue. 44 * @return inbound message queue 45 */ getIncomingMessageQueue()46 public IncomingMessageQueue getIncomingMessageQueue(); 47 48 /** 49 * Get the connection's data transport interface. 50 * @return the transport - MAY BE NULL if not yet fully connected 51 */ 52 getTransportBase()53 public TransportBase getTransportBase(); 54 55 public int getMssSize()56 getMssSize(); 57 58 public boolean isIncoming()59 isIncoming(); 60 61 /** 62 * Is the connection within the local LAN network. 63 * @return true if within LAN, false of outside the LAN segment 64 */ 65 isLANLocal()66 public boolean isLANLocal(); 67 68 public void setUploadLimit( int limit )69 setUploadLimit( 70 int limit ); 71 72 public int getUploadLimit()73 getUploadLimit(); 74 75 public void setDownloadLimit( int limit )76 setDownloadLimit( 77 int limit ); 78 79 public int getDownloadLimit()80 getDownloadLimit(); 81 82 public LimitedRateGroup[] getRateLimiters( boolean upload )83 getRateLimiters( 84 boolean upload ); 85 86 public void addRateLimiter( LimitedRateGroup limiter, boolean upload )87 addRateLimiter( 88 LimitedRateGroup limiter, 89 boolean upload ); 90 91 public void removeRateLimiter( LimitedRateGroup limiter, boolean upload )92 removeRateLimiter( 93 LimitedRateGroup limiter, 94 boolean upload ); 95 96 public String getString()97 getString(); 98 } 99