KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > proxy > view > wrappers > LdapProxyWrapper


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 package org.apache.directory.ldapstudio.proxy.view.wrappers;
21
22
23 import java.util.Iterator JavaDoc;
24 import java.util.List JavaDoc;
25
26 import org.apache.directory.ldapstudio.proxy.model.LdapMessageWithPDU;
27 import org.apache.directory.ldapstudio.proxy.model.LdapProxy;
28 import org.apache.directory.ldapstudio.proxy.view.ProxyView;
29
30
31 /**
32  * This class represents a LDAP Proxy Wrapper.
33  *
34  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
35  * @version $Rev$, $Date$
36  */

37 public class LdapProxyWrapper extends AbstractWrapper
38 {
39     /** The associated view */
40     private ProxyView view;
41
42
43     /**
44      * Creates a new instance of LdapProxyWrapper.
45      *
46      * @param parent
47      * the parent element
48      */

49     public LdapProxyWrapper( ProxyView view )
50     {
51         super( null );
52         this.view = view;
53     }
54
55
56     /* (non-Javadoc)
57      * @see org.apache.directory.ldapstudio.proxy.view.wrappers.Wrapper#createChildren(java.util.List)
58      */

59     protected void createChildren( List JavaDoc<IWrapper> children )
60     {
61         LdapProxy ldapProxy = view.getLdapProxy();
62
63         if ( ldapProxy != null )
64         {
65             List JavaDoc<LdapMessageWithPDU> receivedLdapMessages = ldapProxy.getReceivedLdapMessages();
66             for ( Iterator JavaDoc iter = receivedLdapMessages.iterator(); iter.hasNext(); )
67             {
68                 children.add( new LdapMessageWrapper( this, ( ( LdapMessageWithPDU ) iter.next() ) ) );
69             }
70         }
71         System.out.println( "createChildren" );
72     }
73     
74     public void addChild( IWrapper element )
75     {
76         fChildren.add( element );
77     }
78 }
79
Popular Tags