View Javadoc
1   /*
2    * Copyright 2012 The Kuali Foundation.
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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  }