KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > model > IConnection


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.browser.core.model;
22
23
24 import java.io.Serializable JavaDoc;
25 import java.io.Writer JavaDoc;
26
27 import org.apache.directory.ldapstudio.browser.core.BookmarkManager;
28 import org.apache.directory.ldapstudio.browser.core.SearchManager;
29 import org.apache.directory.ldapstudio.browser.core.internal.model.ConnectionException;
30 import org.apache.directory.ldapstudio.browser.core.internal.model.ModificationLogger;
31 import org.apache.directory.ldapstudio.browser.core.jobs.ExtendedProgressMonitor;
32 import org.apache.directory.ldapstudio.browser.core.model.ldif.LdifEnumeration;
33 import org.apache.directory.ldapstudio.browser.core.model.schema.Schema;
34 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.ConnectionPropertyPageProvider;
35 import org.eclipse.core.runtime.IAdaptable;
36
37
38 public interface IConnection extends Serializable JavaDoc, IAdaptable, ConnectionPropertyPageProvider
39 {
40
41     public static final String JavaDoc[] ROOT_DSE_ATTRIBUTES =
42         { IRootDSE.ROOTDSE_ATTRIBUTE_MONITORCONTEXT, IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS,
43             IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDLDAPVERSION, IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY,
44             IRootDSE.ROOTDSE_ATTRIBUTE_ALTSERVER, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION,
45             IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES,
46             IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDSASLMECHANISM, ISearch.ALL_OPERATIONAL_ATTRIBUTES,
47             ISearch.ALL_USER_ATTRIBUTES };
48
49     public static final int AUTH_ANONYMOUS = 0;
50
51     public static final int AUTH_SIMPLE = 1;
52
53     public static final int ENCYRPTION_NONE = 0;
54
55     public static final int ENCYRPTION_LDAPS = 1;
56
57     public static final int ENCYRPTION_STARTTLS = 2;
58
59     public static final int DEREFERENCE_ALIASES_NEVER = 0;
60
61     public static final int DEREFERENCE_ALIASES_ALWAYS = 1;
62
63     public static final int DEREFERENCE_ALIASES_FINDING = 2;
64
65     public static final int DEREFERENCE_ALIASES_SEARCH = 3;
66
67     public static final int HANDLE_REFERRALS_IGNORE = 0;
68
69     public static final int HANDLE_REFERRALS_FOLLOW = 1;
70
71     public static final String JavaDoc CONTROL_MANAGEDSAIT = "2.16.840.1.113730.3.4.2"; //$NON-NLS-1$
72

73
74     public abstract URL getUrl();
75
76
77     public abstract String JavaDoc getName();
78
79
80     public abstract void setName( String JavaDoc name );
81
82
83     public abstract boolean isFetchBaseDNs();
84
85
86     public abstract void setFetchBaseDNs( boolean fetchBaseDNs );
87
88
89     public abstract DN getBaseDN();
90
91
92     public abstract void setBaseDN( DN baseDN );
93
94
95     public abstract int getCountLimit();
96
97
98     public abstract void setCountLimit( int countLimit );
99
100
101     public abstract String JavaDoc getHost();
102
103
104     public abstract void setHost( String JavaDoc host );
105
106
107     public abstract int getPort();
108
109
110     public abstract void setPort( int port );
111
112
113     public abstract int getEncryptionMethod();
114
115
116     public abstract void setEncryptionMethod( int encryptionMethod );
117
118
119     public abstract int getAliasesDereferencingMethod();
120
121
122     public abstract void setAliasesDereferencingMethod( int aliasesDereferencingMethod );
123
124
125     public abstract int getReferralsHandlingMethod();
126
127
128     public abstract void setReferralsHandlingMethod( int referralsHandlingMethod );
129
130
131     public abstract int getTimeLimit();
132
133
134     public abstract void setTimeLimit( int timeLimit );
135
136
137     public String JavaDoc getBindPrincipal();
138
139
140     public void setBindPrincipal( String JavaDoc bindPrincipal );
141
142
143     public String JavaDoc getBindPassword();
144
145
146     public void setBindPassword( String JavaDoc bindPassword );
147
148
149     public int getAuthMethod();
150
151
152     public void setAuthMethod( int authMethod );
153
154
155     public abstract IRootDSE getRootDSE();
156
157
158     public abstract Schema getSchema();
159
160
161     public abstract void setSchema( Schema schema );
162
163
164     public abstract ConnectionParameter getConnectionParameter();
165
166
167     public abstract void setConnectionParameter( ConnectionParameter connectionParameter );
168
169
170     public abstract SearchManager getSearchManager();
171
172
173     public abstract BookmarkManager getBookmarkManager();
174
175
176     public abstract ModificationLogger getModificationLogger();
177
178
179     public abstract void reloadSchema( ExtendedProgressMonitor monitor );
180
181
182     /**
183      * Connects to the LDAP server without any authentification:
184      *
185      * @param pm
186      * The progress monitor
187      */

188     public abstract void connect( ExtendedProgressMonitor monitor );
189
190
191     /**
192      * Binds to the LDAP server using the required authentification. Depends
193      * on connect().
194      *
195      * @param pm
196      * The progress monitor
197      */

198     public abstract void bind( ExtendedProgressMonitor monitor );
199
200
201     /**
202      * Fetches the Root DSE and tries to get the base DNs from Root DSE.
203      * Depends on bind().
204      *
205      * @param pm
206      * The progress monitor
207      */

208     public abstract void fetchRootDSE( ExtendedProgressMonitor monitor );
209
210
211     /**
212      * Opens the connection to the LDAP server and loads the schema if
213      * required. Depends on fetchRootDSE().
214      *
215      * @param pm
216      * The progress monitor
217      */

218     public abstract void open( ExtendedProgressMonitor monitor );
219
220
221     public abstract boolean isOpened();
222
223
224     public abstract boolean canOpen();
225
226
227     public abstract boolean canClose();
228
229
230     public abstract void close();
231
232
233     public abstract boolean existsEntry( DN dn, ExtendedProgressMonitor monitor );
234
235
236     public abstract IEntry getEntry( DN dn, ExtendedProgressMonitor monitor );
237
238
239     public abstract IEntry getEntryFromCache( DN dn );
240
241
242     public abstract void search( ISearch searchRequest, ExtendedProgressMonitor monitor );
243
244
245     public abstract void delete( IEntry entryToDelete, ExtendedProgressMonitor monitor );
246
247
248     public abstract void delete( IValue valuesToDelete[], ExtendedProgressMonitor monitor );
249
250
251     public abstract void delete( IAttribute attriubtesToDelete[], ExtendedProgressMonitor monitor );
252
253
254     public abstract void create( IEntry entryToCreate, ExtendedProgressMonitor monitor );
255
256
257     public abstract void create( IValue valuesToCreate[], ExtendedProgressMonitor monitor );
258
259
260     public abstract void modify( IValue oldValue, IValue newVaue, ExtendedProgressMonitor monitor );
261
262
263     public abstract void rename( IEntry entryToRename, DN newDn, boolean deleteOldRdn, ExtendedProgressMonitor monitor );
264
265
266     public abstract void move( IEntry entryToMove, DN newSuperior, ExtendedProgressMonitor monitor );
267
268
269     public abstract Object JavaDoc clone();
270
271
272     public abstract void importLdif( LdifEnumeration enumeration, Writer JavaDoc logWriter, boolean continueOnError,
273         ExtendedProgressMonitor monitor );
274
275
276     public abstract LdifEnumeration exportLdif( SearchParameter searchParameter, ExtendedProgressMonitor pm )
277         throws ConnectionException;
278
279
280     /**
281      * Suspends the commitment of modifications.
282      *
283      */

284     public abstract void suspend();
285
286
287     /**
288      * Resume the commitment of modifications.
289      *
290      */

291     public abstract void resume( ExtendedProgressMonitor monitor );
292
293
294     /**
295      * Resets the state and deletes all uncommitted modifications
296      *
297      */

298     public abstract void reset();
299
300
301     public abstract boolean isSuspended();
302
303
304     public abstract int hashCode();
305
306
307     public abstract boolean equals( Object JavaDoc obj );
308 }
Popular Tags