@PUT
	@Path("/services/{id}")
	@Produces({ "application/json", "application/xml" })
	@PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.UPDATE_SERVICE + "\")")
	public RangerService updateService(RangerService service) {
		if(LOG.isDebugEnabled()) {
			LOG.debug("==> ServiceREST.updateService(): " + service);
		}
		RangerService    ret  = null;
		RangerPerfTracer perf = null;
		try {
			if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
				perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "ServiceREST.updateService(serviceName=" + service.getName() + ")");
			}
			RangerServiceValidator validator = validatorFactory.getServiceValidator(svcStore);
			validator.validate(service, Action.UPDATE);
			bizUtil.hasAdminPermissions("Services");
			// TODO: As of now we are allowing SYS_ADMIN to create all the
			// services including KMS
			XXServiceDef xxServiceDef = daoManager.getXXServiceDef().findByName(service.getType());
			bizUtil.hasKMSPermissions("Service", xxServiceDef.getImplclassname());
			ret = svcStore.updateService(service);
		} catch(WebApplicationException excp) {
			throw excp;
		} catch(Throwable excp) {
			LOG.error("updateService(" + service + ") failed", excp);
			throw restErrorUtil.createRESTException(excp.getMessage());
		} finally {
			RangerPerfTracer.log(perf);
		}
		if(LOG.isDebugEnabled()) {
			LOG.debug("<== ServiceREST.updateService(" + service + "): " + ret);
		}
		return ret;
	}
@PUT
	@Path("/services/{id}")
	@Produces({ "application/json", "application/xml" })
	@PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.UPDATE_SERVICE + "\")")
	public RangerService updateService(RangerService service) {
		if(LOG.isDebugEnabled()) {
			LOG.debug("==> ServiceREST.updateService(): " + service);
		}
		RangerService    ret  = null;
		RangerPerfTracer perf = null;
		try {
			if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
				perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "ServiceREST.updateService(serviceName=" + service.getName() + ")");
			}
			RangerServiceValidator validator = validatorFactory.getServiceValidator(svcStore);
			validator.validate(service, Action.UPDATE);
			bizUtil.hasAdminPermissions("Services");
		
		
			XXServiceDef xxServiceDef = daoManager.getXXServiceDef().findByName(service.getType());
			bizUtil.hasKMSPermissions("Service", xxServiceDef.getImplclassname());
			ret = svcStore.updateService(service);
		} catch(WebApplicationException excp) {
			throw excp;
		} catch(Throwable excp) {
			LOG.error("updateService(" + service + ") failed", excp);
			throw restErrorUtil.createRESTException(excp.getMessage());
		} finally {
			RangerPerfTracer.log(perf);
		}
		if(LOG.isDebugEnabled()) {
			LOG.debug("<== ServiceREST.updateService(" + service + "): " + ret);
		}
		return ret;
	}
@put @path("/services/{id}") @produces({ "application/json", "application/xml" }) @preauthorize("@rangerpreauthsecurityhandler.isapiaccessible(\"" + rangerapilist.update_service + "\")") public rangerservice updateservice(rangerservice service) { if(log.isdebugenabled()) { log.debug("==> servicerest.updateservice(): " + service); } rangerservice ret = null; rangerperftracer perf = null; try { if(rangerperftracer.isperftraceenabled(perf_log)) { perf = rangerperftracer.getperftracer(perf_log, "servicerest.updateservice(servicename=" + service.getname() + ")"); } rangerservicevalidator validator = validatorfactory.getservicevalidator(svcstore); validator.validate(service, action.update); bizutil.hasadminpermissions("services"); xxservicedef xxservicedef = daomanager.getxxservicedef().findbyname(service.gettype()); bizutil.haskmspermissions("service", xxservicedef.getimplclassname()); ret = svcstore.updateservice(service); } catch(webapplicationexception excp) { throw excp; } catch(throwable excp) { log.error("updateservice(" + service + ") failed", excp); throw resterrorutil.createrestexception(excp.getmessage()); } finally { rangerperftracer.log(perf); } if(log.isdebugenabled()) { log.debug("<== servicerest.updateservice(" + service + "): " + ret); } return ret; }