1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.ole.sys.batch.service.impl;
17  
18  import org.kuali.ole.sys.batch.service.LockModuleService;
19  import org.kuali.ole.sys.service.impl.OleParameterConstants;
20  import org.kuali.rice.coreservice.api.parameter.Parameter;
21  import org.kuali.rice.krad.service.BusinessObjectService;
22  import org.kuali.rice.krad.util.KRADConstants;
23  import org.kuali.rice.coreservice.framework.parameter.ParameterService;
24  
25  public class LockModuleServiceImpl implements LockModuleService {
26      private BusinessObjectService businessObjectService;
27      private ParameterService parameterService;
28      
29      public void lockModule(String namespaceCode , boolean lockModule) {
30          Parameter parameter  = parameterService.getParameter(namespaceCode, OleParameterConstants.PARAMETER_ALL_DETAIL_TYPE, KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_ACTIVE_IND);
31          Parameter.Builder updatedParameter = Parameter.Builder.create(parameter);
32          if (lockModule) {
33              updatedParameter.setValue("Y");
34          }
35          else {
36              updatedParameter.setValue("N");
37          }
38          parameterService.updateParameter(updatedParameter.build());
39          
40      }
41  
42      public BusinessObjectService getBusinessObjectService() {
43          return businessObjectService;
44      }
45  
46      public void setBusinessObjectService(BusinessObjectService businessObjectService) {
47          this.businessObjectService = businessObjectService;
48      }
49  
50      public ParameterService getParameterService() {
51          return parameterService;
52      }
53  
54      public void setParameterService(ParameterService parameterService) {
55          this.parameterService = parameterService;
56      }
57      
58  }