1 20 21 package org.apache.directory.ldapstudio.browser.core.jobs; 22 23 24 import java.util.ArrayList ; 25 import java.util.List ; 26 27 import org.apache.directory.ldapstudio.browser.core.BrowserCoreMessages; 28 import org.apache.directory.ldapstudio.browser.core.model.IConnection; 29 30 31 public class CheckBindJob extends AbstractAsyncBulkJob 32 { 33 34 private IConnection connection; 35 36 37 public CheckBindJob( IConnection connection ) 38 { 39 this.connection = connection; 40 setName( BrowserCoreMessages.jobs__check_bind_name ); 41 } 42 43 44 protected IConnection[] getConnections() 45 { 46 return new IConnection[0]; 47 } 48 49 50 protected Object [] getLockedObjects() 51 { 52 List l = new ArrayList (); 53 l.add( connection ); 54 return l.toArray(); 55 } 56 57 58 protected void executeBulkJob( ExtendedProgressMonitor monitor ) 59 { 60 61 monitor.beginTask( BrowserCoreMessages.jobs__check_bind_task, 4 ); 62 monitor.reportProgress( " " ); monitor.worked( 1 ); 64 65 connection.bind( monitor ); 66 67 connection.close(); 68 } 69 70 71 protected String getErrorMessage() 72 { 73 return BrowserCoreMessages.jobs__check_bind_error; 74 } 75 76 77 protected void runNotification() 78 { 79 80 } 81 82 } 83 | Popular Tags |