View Javadoc

1   package org.kuali.common.deploy;
2   
3   import org.kuali.common.util.service.DefaultMavenService;
4   import org.kuali.common.util.service.MavenContext;
5   import org.kuali.common.util.service.MavenService;
6   import org.slf4j.Logger;
7   import org.slf4j.LoggerFactory;
8   import org.springframework.util.Assert;
9   
10  public class MavenDatabaseHandler implements DatabaseHandler {
11  
12  	private static final Logger logger = LoggerFactory.getLogger(MavenDatabaseHandler.class);
13  
14  	MavenService service = new DefaultMavenService();
15  	MavenContext context;
16  	boolean skip;
17  
18  	@Override
19  	public void reset() {
20  		if (skip) {
21  			logger.info("Skipping database reset");
22  			return;
23  		}
24  		Assert.notNull(service);
25  		Assert.notNull(context);
26  		logger.info("Database reset");
27  		service.execute(context);
28  	}
29  
30  	public MavenService getService() {
31  		return service;
32  	}
33  
34  	public void setService(MavenService service) {
35  		this.service = service;
36  	}
37  
38  	public MavenContext getContext() {
39  		return context;
40  	}
41  
42  	public void setContext(MavenContext context) {
43  		this.context = context;
44  	}
45  
46  	public boolean isSkip() {
47  		return skip;
48  	}
49  
50  	public void setSkip(boolean skip) {
51  		this.skip = skip;
52  	}
53  
54  }