1 /*
2 * This file is part of NetPisteur.
3 *
4 * Copyright 2001-2002 : Olivier CORNEC, David BOUANCHEAU, Loic LOPEZ,
5 * Gaetan BOUDARD, Mael LE LANNOU, Julien ROBINEAU
6 *
7 * Copyright 2002-2003 : Olivier BRIENS, Simon DEZE, Florence FRIGOULT,
8 * Olivier JOURNEAULT, Francois MARTINIER, Damien RAUDE-MORVAN
9 *
10 * Copyright 2004-2007 : Damien RAUDE-MORVAN
11 *
12 * NetPisteur is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * NetPisteur is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with NetPisteur; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 *
26 */
27 package com.drazzib.netpisteur.loader;
28
29 import java.io.InputStreamReader;
30 import java.net.URL;
31
32 /**
33 * <P>
34 * <STRONG>Description </STRONG>
35 * <P>
36 * Defines the methods implemented in the class ConnexionHttp and ConnexionLocal
37 *
38 *
39 * @version 1.0
40 * @since 2002/03/18
41 * @author Netpisteur Team
42 */
43
44 public abstract class Connexion {
45
46 /**
47 * Represents the Url of the connexion
48 */
49 protected URL url;
50
51 /**
52 * Creates a Connexion Object
53 *
54 * @param uneUrl :
55 * Url to connect
56 */
57 public Connexion(URL uneUrl) {
58 this.url = uneUrl;
59 }
60
61 // /////////////////////////////////////
62 // access methods for attributes
63
64 /**
65 * Return the Url of the connexion
66 *
67 * @return URL : url of the connexion
68 */
69
70 public URL getURL() {
71 return this.url;
72 }
73
74 // /////////////////////////////////////
75 // modification methods for attributes
76
77 /**
78 * Sets the url to connect
79 *
80 * @param uneUrl :
81 * url to connect
82 */
83
84 public void setURL(URL uneUrl) {
85 this.url = uneUrl;
86 }
87
88 // ///////////////////////////////////
89 // Definition of operations implemented in extended classes
90
91 public abstract boolean connexion();
92
93 public abstract boolean deconnexion();
94
95 public abstract String traitementErreur(int unTypeErreur);
96
97 public abstract String getSourceByString();
98
99 public abstract InputStreamReader getSourceByReader();
100
101 public abstract URL getTheUrl();
102
103 public abstract String getMessageErreur();
104
105 } // -------------------------------------endofclass
106