KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > events > ConnectionUpdateEvent


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.events;
22
23
24 /**
25  * An ConnectionUpdateEvent indicates that an {@link IConnection} was modified.
26  *
27  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
28  * @version $Rev$, $Date$
29  */

30 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
31
32
33 /**
34  * An ConnectionUpdateEvent indicates that an {@link IConnection} was modified.
35  *
36  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
37  * @version $Rev$, $Date$
38  */

39 public class ConnectionUpdateEvent
40 {
41
42     /**
43      * Contains constants to specify the event detail.
44      */

45     public enum EventDetail
46     {
47         /** Indicates that the connection to the directory was opened. */
48         CONNECTION_OPENED,
49
50         /** Indicates that the connection to the directory was closed. */
51         CONNECTION_CLOSED,
52
53         /** Indicates that the schema was loaded from directory. */
54         SCHEMA_LOADED,
55
56         /** Indicates that the connection was added to the connection pool. */
57         CONNECTION_ADDED,
58
59         /** Indicates that the connection was removed from the connection pool. */
60         CONNECTION_REMOVED,
61
62         /**
63          * Indicates that the connection parameters were updated.
64          * Note: This event detail doesn't include the renaming of a connection!
65          * */

66         CONNECTION_PARAMETER_UPDATED,
67
68         /** Indicates that the connection was renamed. */
69         CONNECTION_RENAMED
70     }
71
72     /** The event detail. */
73     private EventDetail detail;
74
75     /** The updated connection. */
76     private IConnection connection;
77
78
79     /**
80      * Creates a new instance of ConnectionUpdateEvent.
81      *
82      * @param detail the event detail
83      * @param connection the updated connection
84      */

85     public ConnectionUpdateEvent( IConnection connection, EventDetail detail )
86     {
87         this.connection = connection;
88         this.detail = detail;
89     }
90
91
92     /**
93      * Gets the updated connection.
94      *
95      * @return the updated connection
96      */

97     public IConnection getConnection()
98     {
99         return connection;
100     }
101
102
103     /**
104      * Gets the event detail.
105      *
106      * @return the event detail
107      */

108     public EventDetail getDetail()
109     {
110         return detail;
111     }
112
113 }
114
Popular Tags