1 /*
2  * Created on 10-May-2004
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 org.gudy.azureus2.plugins.utils;
21 
22 /**
23  * @author parg
24  *
25  */
26 
27 import org.gudy.azureus2.plugins.download.*;
28 
29 public interface
30 ShortCuts
31 {
32 		/**
33 		 * A quick way of looking up a download given its hash
34 		 * @param hash
35 		 * @return
36 		 * @throws DownloadException
37 		 */
38 
39 	public Download
getDownload( byte[] hash )40 	getDownload(
41 		byte[]		hash )
42 
43 		throws DownloadException;
44 
45 		/**
46 		 * A quick way of getting a download's statistics given its hash
47 		 * @param hash
48 		 * @return
49 		 * @throws DownloadException
50 		 */
51 
52 	public DownloadStats
getDownloadStats( byte[] hash )53 	getDownloadStats(
54 		byte[]		hash )
55 
56 		throws DownloadException;
57 
58 		/**
59 		 * A quick way of restarting a download given its hash
60 		 * @param hash
61 		 * @throws DownloadException
62 		 */
63 
64 	public void
restartDownload( byte[] hash )65 	restartDownload(
66 		byte[]		hash )
67 
68 		throws DownloadException;
69 
70 		/**
71 		 * A quick way of stopping a download given its hash
72 		 * @param hash
73 		 * @throws DownloadException
74 		 */
75 
76 	public void
stopDownload( byte[] hash )77 	stopDownload(
78 		byte[]		hash )
79 
80 		throws DownloadException;
81 
82 		/**
83 		 * A quick way of deleting a download given its hash
84 		 * @param hash
85 		 * @throws DownloadException
86 		 * @throws DownloadRemovalVetoException
87 		 */
88 
89 	public void
removeDownload( byte[] hash )90 	removeDownload(
91 		byte[]		hash )
92 
93 		throws DownloadException, DownloadRemovalVetoException;
94 }
95