@Test public void handleWhiteboardCallback() throws Exception { WhiteboardCallback cb = new WhiteboardCallback(); callbackHandler.handle(new Callback[] {cb}); assertSame(whiteboard, cb.getWhiteboard()); }
@Override public void handle(Callback[] callbacks) throws UnsupportedCallbackException { for (Callback callback : callbacks) { if (callback instanceof CredentialsCallback) { ((CredentialsCallback) callback).setCredentials(credentials); } else if (callback instanceof NameCallback) { ((NameCallback) callback).setName(getName()); } else if (callback instanceof PasswordCallback) { ((PasswordCallback) callback).setPassword(getPassword()); } else if (callback instanceof RepositoryCallback) { RepositoryCallback repositoryCallback = (RepositoryCallback) callback; repositoryCallback.setContentRepository(contentRepository); repositoryCallback.setSecurityProvider(securityProvider); repositoryCallback.setWorkspaceName(workspaceName); repositoryCallback.setLoginModuleMonitor(loginModuleMonitor); } else if (callback instanceof WhiteboardCallback) { ((WhiteboardCallback) callback).setWhiteboard(whiteboard); } else { throw new UnsupportedCallbackException(callback); } } }
CallbackHandlerImpl implements CallbackHandler { @Override public void handle(Callback[] callbacks) throws UnsupportedCallbackException { for (Callback callback : callbacks) { if (callback instanceof CredentialsCallback) { ((CredentialsCallback) callback).setCredentials(credentials); } else if (callback instanceof NameCallback) { ((NameCallback) callback).setName(getName()); } else if (callback instanceof PasswordCallback) { ((PasswordCallback) callback).setPassword(getPassword()); } else if (callback instanceof RepositoryCallback) { RepositoryCallback repositoryCallback = (RepositoryCallback) callback; repositoryCallback.setContentRepository(contentRepository); repositoryCallback.setSecurityProvider(securityProvider); repositoryCallback.setWorkspaceName(workspaceName); repositoryCallback.setLoginModuleMonitor(loginModuleMonitor); } else if (callback instanceof WhiteboardCallback) { ((WhiteboardCallback) callback).setWhiteboard(whiteboard); } else { throw new UnsupportedCallbackException(callback); } } } }
CallbackHandlerImpl implements CallbackHandler { @Override public void handle(Callback[] callbacks) throws UnsupportedCallbackException { for (Callback callback : callbacks) { if (callback instanceof CredentialsCallback) { ((CredentialsCallback) callback).setCredentials(credentials); } else if (callback instanceof NameCallback) { ((NameCallback) callback).setName(getName()); } else if (callback instanceof PasswordCallback) { ((PasswordCallback) callback).setPassword(getPassword()); } else if (callback instanceof RepositoryCallback) { RepositoryCallback repositoryCallback = (RepositoryCallback) callback; repositoryCallback.setContentRepository(contentRepository); repositoryCallback.setSecurityProvider(securityProvider); repositoryCallback.setWorkspaceName(workspaceName); repositoryCallback.setLoginModuleMonitor(loginModuleMonitor); } else if (callback instanceof WhiteboardCallback) { ((WhiteboardCallback) callback).setWhiteboard(whiteboard); } else { throw new UnsupportedCallbackException(callback); } } } CallbackHandlerImpl(Credentials credentials, String workspaceName,
                        ContentRepository contentRepository,
                        SecurityProvider securityProvider,
                        Whiteboard whiteboard,
                        LoginModuleMonitor loginModuleMonitor); }
CallbackHandlerImpl implements CallbackHandler { @Override public void handle(Callback[] callbacks) throws UnsupportedCallbackException { for (Callback callback : callbacks) { if (callback instanceof CredentialsCallback) { ((CredentialsCallback) callback).setCredentials(credentials); } else if (callback instanceof NameCallback) { ((NameCallback) callback).setName(getName()); } else if (callback instanceof PasswordCallback) { ((PasswordCallback) callback).setPassword(getPassword()); } else if (callback instanceof RepositoryCallback) { RepositoryCallback repositoryCallback = (RepositoryCallback) callback; repositoryCallback.setContentRepository(contentRepository); repositoryCallback.setSecurityProvider(securityProvider); repositoryCallback.setWorkspaceName(workspaceName); repositoryCallback.setLoginModuleMonitor(loginModuleMonitor); } else if (callback instanceof WhiteboardCallback) { ((WhiteboardCallback) callback).setWhiteboard(whiteboard); } else { throw new UnsupportedCallbackException(callback); } } } CallbackHandlerImpl(Credentials credentials, String workspaceName,
                        ContentRepository contentRepository,
                        SecurityProvider securityProvider,
                        Whiteboard whiteboard,
                        LoginModuleMonitor loginModuleMonitor); @Override void handle(Callback[] callbacks); }
CallbackHandlerImpl implements CallbackHandler { @Override public void handle(Callback[] callbacks) throws UnsupportedCallbackException { for (Callback callback : callbacks) { if (callback instanceof CredentialsCallback) { ((CredentialsCallback) callback).setCredentials(credentials); } else if (callback instanceof NameCallback) { ((NameCallback) callback).setName(getName()); } else if (callback instanceof PasswordCallback) { ((PasswordCallback) callback).setPassword(getPassword()); } else if (callback instanceof RepositoryCallback) { RepositoryCallback repositoryCallback = (RepositoryCallback) callback; repositoryCallback.setContentRepository(contentRepository); repositoryCallback.setSecurityProvider(securityProvider); repositoryCallback.setWorkspaceName(workspaceName); repositoryCallback.setLoginModuleMonitor(loginModuleMonitor); } else if (callback instanceof WhiteboardCallback) { ((WhiteboardCallback) callback).setWhiteboard(whiteboard); } else { throw new UnsupportedCallbackException(callback); } } } CallbackHandlerImpl(Credentials credentials, String workspaceName,
                        ContentRepository contentRepository,
                        SecurityProvider securityProvider,
                        Whiteboard whiteboard,
                        LoginModuleMonitor loginModuleMonitor); @Override void handle(Callback[] callbacks);  }