KickJava   Java API By Example, From Geeks To Geeks.

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


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.internal.model;
22
23
24 import org.apache.directory.ldapstudio.browser.core.BrowserCoreMessages;
25 import org.apache.directory.ldapstudio.browser.core.model.DN;
26 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
27 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
28 import org.apache.directory.ldapstudio.browser.core.model.ModelModificationException;
29 import org.apache.directory.ldapstudio.browser.core.model.RDN;
30
31
32 public class BaseDNEntry extends AbstractEntry
33 {
34
35     private static final long serialVersionUID = -5444229580355372176L;
36
37     protected DN baseDn;
38
39     // protected String connectionName;
40
protected IConnection connection;
41
42
43     protected BaseDNEntry()
44     {
45     }
46
47
48     public BaseDNEntry( DN baseDn, IConnection connection ) throws ModelModificationException
49     {
50         super();
51
52         if ( baseDn == null )
53         {
54             throw new ModelModificationException( BrowserCoreMessages.model__empty_dn );
55         }
56         if ( connection == null )
57         {
58             throw new ModelModificationException( BrowserCoreMessages.model__empty_connection );
59         }
60
61         this.setDirectoryEntry( true );
62         this.baseDn = baseDn;
63         // this.connectionName = connection.getName();
64
this.connection = connection;
65     }
66
67
68     public DN getDn()
69     {
70         return this.baseDn;
71     }
72
73
74     public IEntry getParententry()
75     {
76         return getConnection().getRootDSE();
77     }
78
79
80     public IConnection getConnection()
81     {
82         // return
83
// BrowserCorePlugin.getDefault().getConnectionManager().getConnection(this.connectionName);
84
return this.connection;
85     }
86
87
88     protected void setRdn( RDN newRdn )
89     {
90     }
91
92
93     protected void setParent( IEntry newParent )
94     {
95     }
96
97 }
98
Popular Tags