Defines if alarms are enabled.
If false then no alarms will be triggered.
@param CHECK
16426
public void setAlarmsEnabled(final boolean CHECK) {
        if (null == alarmsEnabled) {
            _alarmsEnabled = CHECK;
            fireUpdateEvent(VISIBILITY_EVENT);
        } else {
            alarmsEnabled.set(CHECK);
        }
    }
968871
public void setAlarms(java.util.Collection<Alarm> alarms) {
        if (alarms == null) {
            this.alarms = null;
            return;
        }

        this.alarms = new java.util.ArrayList<Alarm>(alarms);
    }
1362797
public <T extends Widget & Checkable> boolean addOnCheckChangedListener
            (OnCheckChangedListener listener) {
        final boolean added;
        synchronized (mListeners) {
            added = mListeners.add(listener);
        }
        if (added) {
            List<T> c = getCheckableChildren();
            for (int i = 0; i < c.size(); ++i) {
                listener.onCheckChanged(this, c.get(i), i);
            }
        }
        return added;
    }
182090
def alarm_disable(self):
        
        log.debug("alarm => disable...")
        params = {"enabled": False}
        self._app_exec("com.lametric.clock", "clock.alarm", params=params)
1345196
@Transactional
	protected synchronized void _checkAlertExistence(boolean enabled) {
		for (String alertName : new String[] { FILE_DESCRIPTORS_ALERT, PHYSICAL_MEMORY_ALERT, SWAP_SPACE_ALERT }) {
			if (_alertService.findAlertByNameAndOwner(_constructAlertName(alertName), _adminUser) == null) {
				String metricExpression = null;
				TriggerType triggerType = null;
				String triggerName = null;
				double triggerThreshold = Double.NaN;

				switch (alertName) {
				case FILE_DESCRIPTORS_ALERT:

					String openFileDescMetricExp = MessageFormat.format("-1h:{0}:{1}'{'host={2}'}':avg", Counter.OPEN_DESCRIPTORS.getScope(),
							Counter.OPEN_DESCRIPTORS.getMetric(), HOSTNAME);
					String maxFileDescMetricExp = MessageFormat.format("-1h:{0}:{1}'{'host={2}'}':avg", Counter.MAX_DESCRIPTORS.getScope(),
							Counter.MAX_DESCRIPTORS.getMetric(), HOSTNAME);

					metricExpression = MessageFormat.format("{0}({1}, {2})", Function.DIVIDE.getName(), openFileDescMetricExp,
							maxFileDescMetricExp);
					triggerType = TriggerType.GREATER_THAN;
					triggerName = "Open FD > 95% of Max FD";
					triggerThreshold = 0.95;
					break;
				case PHYSICAL_MEMORY_ALERT:

					String freeMemMetricExp = MessageFormat.format("-1h:{0}:{1}'{'host={2}'}':avg", Counter.FREE_PHYSICAL_MEM.getScope(),
							Counter.FREE_PHYSICAL_MEM.getMetric(), HOSTNAME);
					String maxMemMetricExp = MessageFormat.format("-1h:{0}:{1}'{'host={2}'}':avg", Counter.MAX_PHYSICAL_MEM.getScope(),
							Counter.MAX_PHYSICAL_MEM.getMetric(), HOSTNAME);

					metricExpression = MessageFormat.format("{0}({1}, {2})", Function.DIVIDE.getName(), freeMemMetricExp, maxMemMetricExp);
					triggerType = TriggerType.LESS_THAN;
					triggerName = "Free Mem < 5% of Tot Mem";
					triggerThreshold = 0.05;
					break;
				case SWAP_SPACE_ALERT:

					String freeSSMetricExp = MessageFormat.format("-1h:{0}:{1}'{'host={2}'}':avg", Counter.FREE_SWAP_SPACE.getScope(),
							Counter.FREE_SWAP_SPACE.getMetric(), HOSTNAME);
					String maxSSMetricExp = MessageFormat.format("-1h:{0}:{1}'{'host={2}'}':avg", Counter.MAX_SWAP_SPACE.getScope(),
							Counter.MAX_SWAP_SPACE.getMetric(), HOSTNAME);

					metricExpression = MessageFormat.format("{0}({1}, {2})", Function.DIVIDE.getName(), freeSSMetricExp, maxSSMetricExp);
					triggerType = TriggerType.LESS_THAN;
					triggerName = "Free Swap Space < 5% of Tot Swap Space";
					triggerThreshold = 0.05;
					break;
				default:
					throw new SystemException("Attempting to create an unsupported monitoring alert" + alertName);
				}
				requireArgument(metricExpression != null && triggerType != null & triggerName != null, "Unsupported monitor alert " + alertName);

				Alert alert = new Alert(_adminUser, _adminUser, _constructAlertName(alertName), metricExpression, "0 * * * *");
				Notification notification = new Notification(NOTIFICATION_NAME, alert, AuditNotifier.class.getName(), new ArrayList<String>(),
						60000L);
				Trigger trigger = new Trigger(alert, triggerType, triggerName, triggerThreshold, 0);
				List<Trigger> triggers = Arrays.asList(new Trigger[] { trigger });

				notification.setTriggers(triggers);
				alert.setNotifications(Arrays.asList(new Notification[] { notification }));
				alert.setTriggers(triggers);
				alert.setEnabled(enabled);
				_alertService.updateAlert(alert);
			} else { // end if

				Alert alert = _alertService.findAlertByNameAndOwner(_constructAlertName(alertName), _adminUser);

				alert.setEnabled(enabled);
				_alertService.updateAlert(alert);
			} // end if-else
		} // end for
	}
1348800
public void setBoardEnabled(boolean enable) {
        final NotificationRootView root = mWindow.mRoot;
        root.setBoardEnabled(enable);
        if (enable && mBoard == null) {
            mBoard = root.getBoard();
            mBoard.addStateListener(new BoardStateListener());
        }
    }
345878
@Override
  public boolean enables(DiagnosticGroup group) {
    for (WarningsGuard guard : guards) {
      if (guard.enables(group)) {
        return true;
      } else if (guard.disables(group)) {
        return false;
      }
    }

    return false;
  }
725213
public function checkIntegrity($check=true,$schema='')
	{
		$enable=$check ? 'ENABLE' : 'DISABLE';
		$tableNames=$this->getTableNames($schema);
		$db=$this->getDbConnection();
		foreach($tableNames as $tableName)
		{
			$tableName='"'.$tableName.'"';
			if(strpos($tableName,'.')!==false)
				$tableName=str_replace('.','"."',$tableName);
			$db->createCommand("ALTER TABLE $tableName $enable TRIGGER ALL")->execute();
		}
	}
895108
@Scheduled(initialDelayString = PROP_SCHEDULER_DELAY_PLACEHOLDER, fixedDelayString = PROP_SCHEDULER_DELAY_PLACEHOLDER)
    public void autoAssignScheduler() {
        LOGGER.debug("auto assign schedule checker has been triggered.");
        // run this code in system code privileged to have the necessary
        // permission to query and create entities.
        systemSecurityContext.runAsSystem(this::executeAutoAssign);
    }
672354
def set_checked(self, state):
        

        if not self.__checkable:
            return False

        if state:
            self.__checked = True
            self.setPixmap(self.__active_pixmap)
        else:
            self.__checked = False
            self.setPixmap(self.__default_pixmap)
        self.toggled.emit(state)
        return True
257373
public void setCheckedImmediately(boolean checked){
        if(mChecked != checked) {
            mChecked = checked;
            if(mOnCheckedChangeListener != null)
                mOnCheckedChangeListener.onCheckedChanged(this, mChecked);
        }
        mThumbPosition = mChecked ? 1f : 0f;
        invalidate();
    }
585083
public void setCheckInterval(long checkInterval)
  {
    if (checkInterval < 0 || checkInterval > Long.MAX_VALUE / 2)
      _checkInterval = Long.MAX_VALUE / 2;
    else
      _checkInterval = checkInterval;

    _checkExpiresTime = 0;
  }
753990
@VisibleForTesting
  void setSleeper(Sleeper sleeper) {
    Preconditions.checkArgument(sleeper != null, "sleeper must not be null!");
    this.sleeper = sleeper;
  }
47035
public static void endThreads(String check){
    //(error check)
    if(currentThread != -1L){
      throw new IllegalStateException("endThreads() called, but thread " + currentThread + " has not finished (exception in thread?)");
    }
    //(end threaded environment)
    assert !control.isHeldByCurrentThread();
    isThreaded = false;
    //(write remaining threads)
    boolean cleanPass = false;
    while(!cleanPass){
      cleanPass = true;
      for(long thread : threadedLogQueue.keySet()){
        assert currentThread < 0L;
        if(threadedLogQueue.get(thread) != null && !threadedLogQueue.get(thread).isEmpty()){
          //(mark queue as unclean)
          cleanPass = false;
          //(variables)
          Queue<Runnable> backlog = threadedLogQueue.get(thread);
          currentThread = thread;
          //(clear buffer)
          while(currentThread >= 0){
            if(currentThread != thread){ throw new IllegalStateException("Redwood control shifted away from flushing thread"); }
            if(backlog.isEmpty()){ throw new IllegalStateException("Forgot to call finishThread() on thread " + currentThread); }
            assert !control.isHeldByCurrentThread();
            backlog.poll().run();
          }
          //(unregister thread)
          threadsWaiting.remove(thread);
        }
      }
    }
    while(threadsWaiting.size() > 0){
      assert currentThread < 0L;
      assert control.tryLock();
      assert !threadsWaiting.isEmpty();
      control.lock();
      attemptThreadControlThreadsafe(-1);
      control.unlock();
    }
    //(clean up)
    for(long threadId : threadedLogQueue.keySet()){
      assert threadedLogQueue.get(threadId).isEmpty();
    }
    assert threadsWaiting.isEmpty();
    assert currentThread == -1L;
    endTrack("Threads( "+check+" )");
  }
279428
private void setupCheckBoxes() {

        m_includeResource.setValue(new Boolean(true));
        m_includeUnchanged.setValue(new Boolean(true));
        m_includeSystem.setValue(new Boolean(true));
        m_recursive.setValue(new Boolean(true));
    }
936892
private void checkAlarms(final ZonedDateTime TIME) {
        alarmsToRemove.clear();
        for (Alarm alarm : alarms) {
            final ZonedDateTime ALARM_TIME = alarm.getTime();
            switch (alarm.getRepetition()) {
                case ONCE:
                    if (TIME.isAfter(ALARM_TIME)) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                        alarmsToRemove.add(alarm);
                    }
                    break;
                case HALF_HOURLY:
                    if ((ALARM_TIME.getMinute() == TIME.getMinute() ||
                        ALARM_TIME.plusMinutes(30).getMinute() == TIME.getMinute()) &&
                        ALARM_TIME.getSecond() == TIME.getSecond()) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                    }
                    break;
                case HOURLY:
                    if (ALARM_TIME.getMinute() == TIME.getMinute() &&
                        ALARM_TIME.getSecond() == TIME.getSecond()) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                    }
                    break;
                case DAILY:
                    if (ALARM_TIME.getHour()   == TIME.getHour() &&
                        ALARM_TIME.getMinute() == TIME.getMinute() &&
                        ALARM_TIME.getSecond() == TIME.getSecond()) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                    }
                    break;
                case WEEKLY:
                    if (ALARM_TIME.getDayOfWeek() == TIME.getDayOfWeek() &&
                        ALARM_TIME.getHour()      == TIME.getHour() &&
                        ALARM_TIME.getMinute()    == TIME.getMinute() &&
                        ALARM_TIME.getSecond()    == TIME.getSecond()) {
                        if (alarm.isArmed()) {
                            fireAlarmEvent(new AlarmEvent(Clock.this, alarm));
                            alarm.executeCommand();
                        }
                    }
                    break;
            }
        }
        for (Alarm alarm : alarmsToRemove) {
            removeAlarm(alarm);
        }
    }
581138
public void setChecks(java.util.Collection<TrustedAdvisorCheckDescription> checks) {
        if (checks == null) {
            this.checks = null;
            return;
        }

        this.checks = new com.amazonaws.internal.SdkInternalList<TrustedAdvisorCheckDescription>(checks);
    }