Java DTV API 1.3
18-Nov-2009

com.sun.dtv.net
Interface NetworkDeviceStatusListener


public interface NetworkDeviceStatusListener

Defines the listener interface for events related to network devices.


Method Summary
 void connected(NetworkDevice device, NetworkInterface netif)
          Reports when device has been connected.
 void connectionFailed(NetworkDevice device, String reason)
          Reports when device could not connect for some reason.
 void currentDataRate(NetworkDevice device, long dataRate)
          Reports the current data rate of a given device if it has changed since the last report.
 void disconnected(NetworkDevice device)
          Reports when device has been disconnected.
 boolean timingOut(NetworkDevice device)
          Reports when device is about to be disconnected because the inactivity timeout period given at construction time has elapsed.
 

Method Detail

connected

void connected(NetworkDevice device,
               NetworkInterface netif)
Reports when device has been connected.

Along that call, the implementation passes a NetworkInterface object that represents the interface that has been assigned to that connection. Among other facilities, this class allows to retrieve the associated Internet addresses.

Parameters:
device - The network device which has been connected.
netif - The associated NetworkInterface object.

connectionFailed

void connectionFailed(NetworkDevice device,
                      String reason)
Reports when device could not connect for some reason.

Parameters:
device - The network device which connection failed.
reason - A short string describing the error that occurred.

currentDataRate

void currentDataRate(NetworkDevice device,
                     long dataRate)
Reports the current data rate of a given device if it has changed since the last report. Data rate is informed only when the network device has been connected beforehand. Right after a connection, the platform must call this method at least one time.

The implementation should not excessively call this method and by no means oftener than every one second.

Parameters:
device - The network device which data rate has changed.
dataRate - The current data rate in kbps.
See Also:
NetworkDevice.getMaximumSpeed()

timingOut

boolean timingOut(NetworkDevice device)
Reports when device is about to be disconnected because the inactivity timeout period given at construction time has elapsed.

The application is given hereby the chance to react accordingly in the case it does not want to be disconnect: if the implementation of this method returns true, then the implementation must disconnect the device on return of this method. If the method returns false, then the implementation must reset the timer to the original timeout value allowing it to re-trigger the application at the next timeout.

When calling this method, certain platforms may define a timespan until when this method is expected to return. If it does not return within that timeframe, the implementation must behave as if the method returned true. This mechanism allows to avoid blocking this method unnecessarily.

Parameters:
device - The network device which timeout has expired.
Returns:
A boolean to indicate whether the application is willing to accept the timeout. The value true indicates the implementation to disconnect the given device.

disconnected

void disconnected(NetworkDevice device)
Reports when device has been disconnected.

Parameters:
device - The network device which has been disconnected.

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.