001    package org.kuali.common.jdbc;
002    
003    import org.kuali.common.jdbc.DatabaseService;
004    import org.kuali.common.jdbc.context.DatabaseResetContext;
005    import org.kuali.common.util.execute.Executable;
006    import org.springframework.util.Assert;
007    
008    public class DatabaseResetExecutor implements Executable {
009    
010            DatabaseService service;
011            DatabaseResetContext context;
012    
013            @Override
014            public void execute() {
015                    Assert.notNull(context, "context is null");
016                    Assert.notNull(service, "service is null");
017                    service.reset(context);
018            }
019    
020            public DatabaseService getService() {
021                    return service;
022            }
023    
024            public void setService(DatabaseService service) {
025                    this.service = service;
026            }
027    
028            public DatabaseResetContext getContext() {
029                    return context;
030            }
031    
032            public void setContext(DatabaseResetContext context) {
033                    this.context = context;
034            }
035    
036    }