// Path: src/com/ndtorrent/client/tracker/Session.java
// public abstract class Session {
// 	// Session and its subclasses are not thread safe.
// 	// Do not call any query method while Session.isUpdating() returns true.
// 
// 	protected ClientInfo client_info;
// 	protected String info_hash;
// 
// 	protected Session(ClientInfo client_info, String info_hash) {
// 		this.client_info = client_info;
// 		this.info_hash = info_hash;
// 	}
// 
// 	public static final Session create(String url, ClientInfo client_info,
// 			String info_hash) {
// 		if (url != null)
// 			if (url.startsWith("udp"))
// 				return new UdpSession(url, client_info, info_hash);
// 			else if (url.startsWith("http"))
// 				return new HttpSession(url, client_info, info_hash);
// 
// 		return new NullSession(url, client_info, info_hash);
// 	}
// 
// 	public abstract String getUrl();
// 
// 	public abstract void update(Event event, long uploaded, long downloaded,
// 			long left);
// 
// 	public abstract Event lastEvent();
// 
// 	public abstract long updatedAt();
// 
// 	public final boolean isUpdateError() {
// 		if (isUpdating())
// 			return false;
// 		if (isConnectionTimeout())
// 			return true;
// 		if (isConnectionError())
// 			return true;
// 		if (isTrackerError())
// 			return true;
// 		return false;
// 	}
// 
// 	public abstract boolean isConnectionError();
// 
// 	public abstract boolean isConnectionTimeout();
// 
// 	public abstract boolean isUpdating();
// 
// 	public abstract boolean isValidResponse();
// 
// 	public abstract boolean isTrackerError();
// 
// 	public abstract int getInterval();
// 
// 	public abstract int getLeechers();
// 
// 	public abstract int getSeeders();
// 
// 	public abstract Collection<InetSocketAddress> getPeers();
// 
// 	final InetSocketAddress peerAddress(ByteBuffer bb, int ofs, int ip_length) {
// 		if (ofs < 0 || ofs >= bb.capacity())
// 			return null;
// 
// 		byte[] ip = ByteBuffer.allocate(ip_length).putInt(bb.getInt(ofs)).array();
// 		int port = bb.getShort(ofs + ip_length) & 0xFFFF;
// 
// 		try {
// 			return new InetSocketAddress(InetAddress.getByAddress(ip), port);
// 		} catch (UnknownHostException e) {
// 			e.printStackTrace();
// 			return null;
// 		}
// 	}
// 
// }


import com.ndtorrent.client.tracker.Session;
package com.ndtorrent.client.status;


public final class TrackerInfo {

	private final String url;
	private final int seeders;
	private final int leechers;
	private final int interval;
	private final long updated_at;
	private final boolean is_updating;
	private final boolean is_error;
	private final boolean is_timeout;
	private final boolean is_tracker_error;

// Path: src/com/ndtorrent/client/tracker/Session.java
// public abstract class Session {
// 	// Session and its subclasses are not thread safe.
// 	// Do not call any query method while Session.isUpdating() returns true.
// 
// 	protected ClientInfo client_info;
// 	protected String info_hash;
// 
// 	protected Session(ClientInfo client_info, String info_hash) {
// 		this.client_info = client_info;
// 		this.info_hash = info_hash;
// 	}
// 
// 	public static final Session create(String url, ClientInfo client_info,
// 			String info_hash) {
// 		if (url != null)
// 			if (url.startsWith("udp"))
// 				return new UdpSession(url, client_info, info_hash);
// 			else if (url.startsWith("http"))
// 				return new HttpSession(url, client_info, info_hash);
// 
// 		return new NullSession(url, client_info, info_hash);
// 	}
// 
// 	public abstract String getUrl();
// 
// 	public abstract void update(Event event, long uploaded, long downloaded,
// 			long left);
// 
// 	public abstract Event lastEvent();
// 
// 	public abstract long updatedAt();
// 
// 	public final boolean isUpdateError() {
// 		if (isUpdating())
// 			return false;
// 		if (isConnectionTimeout())
// 			return true;
// 		if (isConnectionError())
// 			return true;
// 		if (isTrackerError())
// 			return true;
// 		return false;
// 	}
// 
// 	public abstract boolean isConnectionError();
// 
// 	public abstract boolean isConnectionTimeout();
// 
// 	public abstract boolean isUpdating();
// 
// 	public abstract boolean isValidResponse();
// 
// 	public abstract boolean isTrackerError();
// 
// 	public abstract int getInterval();
// 
// 	public abstract int getLeechers();
// 
// 	public abstract int getSeeders();
// 
// 	public abstract Collection<InetSocketAddress> getPeers();
// 
// 	final InetSocketAddress peerAddress(ByteBuffer bb, int ofs, int ip_length) {
// 		if (ofs < 0 || ofs >= bb.capacity())
// 			return null;
// 
// 		byte[] ip = ByteBuffer.allocate(ip_length).putInt(bb.getInt(ofs)).array();
// 		int port = bb.getShort(ofs + ip_length) & 0xFFFF;
// 
// 		try {
// 			return new InetSocketAddress(InetAddress.getByAddress(ip), port);
// 		} catch (UnknownHostException e) {
// 			e.printStackTrace();
// 			return null;
// 		}
// 	}
// 
// }


// Path: src/com/ndtorrent/client/status/TrackerInfo.java
import com.ndtorrent.client.tracker.Session;

package com.ndtorrent.client.status;


public final class TrackerInfo {

	private final String url;
	private final int seeders;
	private final int leechers;
	private final int interval;
	private final long updated_at;
	private final boolean is_updating;
	private final boolean is_error;
	private final boolean is_timeout;
	private final boolean is_tracker_error;

	public TrackerInfo(Session session) {