Package javax.naming.ldap

Examples of javax.naming.ldap.UnsolicitedNotificationEvent


        "MockUnsolicitedNotification: naming exception");
    String[] referral = { "Red", "Blue", };
    UnsolicitedNotification notification = new MockUnsolicitedNotification(
        referral, exception);
    Object src = "source";
    UnsolicitedNotificationEvent event = new UnsolicitedNotificationEvent(
        src, notification);

    assertEquals(src, event.getSource());
    assertEquals(notification, event.getNotification());

    assertSame(notification, event.getNotification());
    assertSame(src, event.getSource());
  }
View Full Code Here


    String[] referral = { "Red", "Blue", };
    UnsolicitedNotification notification = new MockUnsolicitedNotification(
        referral, exception);
    Object src = null;
    try {
      new UnsolicitedNotificationEvent(
          src, notification);
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

    }
  }

  public void testConstructor_notification_null() {
    Object src = "source";
    UnsolicitedNotificationEvent event = new UnsolicitedNotificationEvent(
        src, null);

    assertEquals(src, event.getSource());
    assertNull(event.getNotification());
  }
View Full Code Here

        "MockUnsolicitedNotification: naming exception");
    String[] referral = { "Red", "Blue", };
    UnsolicitedNotification notification = new MockUnsolicitedNotification(
        referral, exception);
    Object src = "source";
    UnsolicitedNotificationEvent event = new UnsolicitedNotificationEvent(
        src, notification);
    MockUnsolicitedNotificationListener listener = new MockUnsolicitedNotificationListener();
    event.dispatch(listener);
    assertTrue(listener.hasEvent(event));
  }
View Full Code Here

            public void receiveNotification(UnsolicitedNotificationImpl un,
                    Control[] cs) {
                EventObject event = null;
                try {
                    un.setControls(narrowingControls(cs));
                    event = new UnsolicitedNotificationEvent(
                            LdapContextImpl.this, un);
                } catch (NamingException e) {
                    event = new NamingExceptionEvent(LdapContextImpl.this, e);
                }
View Full Code Here

                    namingEvent.dispatch(listener);
                } else if (event instanceof NamingExceptionEvent) {
                    NamingExceptionEvent exceptionEvent = (NamingExceptionEvent) event;
                    listener.namingExceptionThrown(exceptionEvent);
                } else if (event instanceof UnsolicitedNotificationEvent) {
                    UnsolicitedNotificationEvent namingEvent = (UnsolicitedNotificationEvent) event;
                    namingEvent
                            .dispatch((UnsolicitedNotificationListener) listener);
                }

            }
View Full Code Here

            public void receiveNotification(UnsolicitedNotificationImpl un,
                    Control[] cs) {
                EventObject event = null;
                try {
                    un.setControls(narrowingControls(cs));
                    event = new UnsolicitedNotificationEvent(
                            LdapContextImpl.this, un);
                } catch (NamingException e) {
                    event = new NamingExceptionEvent(LdapContextImpl.this, e);
                }
View Full Code Here

                    namingEvent.dispatch(listener);
                } else if (event instanceof NamingExceptionEvent) {
                    NamingExceptionEvent exceptionEvent = (NamingExceptionEvent) event;
                    listener.namingExceptionThrown(exceptionEvent);
                } else if (event instanceof UnsolicitedNotificationEvent) {
                    UnsolicitedNotificationEvent namingEvent = (UnsolicitedNotificationEvent) event;
                    namingEvent
                            .dispatch((UnsolicitedNotificationListener) listener);
                }

            }
View Full Code Here

TOP

Related Classes of javax.naming.ldap.UnsolicitedNotificationEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.