Tabnine Logo
ActivationStateType$ActivationState.newBuilder
Code IndexAdd Tabnine to your IDE (free)

How to use
newBuilder
method
in
rst.domotic.state.ActivationStateType$ActivationState

Best Java code snippets using rst.domotic.state.ActivationStateType$ActivationState.newBuilder (Showing top 20 results out of 315)

origin: org.openbase/jul.extension.openhab

public static ActivationState transform(final OnOffHolder.OnOff onOffType) throws CouldNotTransformException {
  switch (onOffType) {
    case OFF:
      return ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build();
    case ON:
      return ActivationState.newBuilder().setValue(ActivationState.State.ACTIVE).build();
    default:
      throw new CouldNotTransformException("Could not transform " + OnOffHolder.OnOff.class.getName() + "! " + OnOffHolder.OnOff.class.getSimpleName() + "[" + onOffType.name() + "] is unknown!");
  }
}
origin: org.openbase.bco/manager.app.binding.openhab

public static ActivationState transform(OnOffHolderType.OnOffHolder.OnOff onOffType) throws CouldNotTransformException {
  switch (onOffType) {
    case OFF:
      return ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build();
    case ON:
      return ActivationState.newBuilder().setValue(ActivationState.State.ACTIVE).build();
    default:
      throw new CouldNotTransformException("Could not transform " + OnOffHolderType.OnOffHolder.OnOff.class.getName() + "! " + OnOffHolderType.OnOffHolder.OnOff.class.getSimpleName() + "[" + onOffType.name() + "] is unknown!");
  }
}
origin: org.openbase.bco/manager.scene.binding.openhab

public static ActivationState transform(OnOffHolderType.OnOffHolder.OnOff onOffType) throws CouldNotTransformException {
  switch (onOffType) {
    case OFF:
      return ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build();
    case ON:
      return ActivationState.newBuilder().setValue(ActivationState.State.ACTIVE).build();
    default:
      throw new CouldNotTransformException("Could not transform " + OnOffHolderType.OnOffHolder.OnOff.class.getName() + "! " + OnOffHolderType.OnOffHolder.OnOff.class.getSimpleName() + "[" + onOffType.name() + "] is unknown!");
  }
}
origin: org.openbase.bco/dal.remote

public GenericBCOTrigger(final UR unitRemote, final STE targetState, final ServiceType serviceType) throws InstantiationException {
  super();
  this.unitRemote = unitRemote;
  this.targetState = targetState;
  this.serviceType = serviceType;
  dataObserver = (Observable<DT> source, DT data) -> {
    verifyCondition(data);
  };
  connectionObserver = (Observable<ConnectionState> source, ConnectionState data) -> {
    if (data.equals(ConnectionState.CONNECTED)) {
      verifyCondition((DT) unitRemote.getData());
    } else {
      notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.UNKNOWN).build()));
    }
  };
}
origin: org.openbase.bco/dal.lib

@Override
public void enable() throws CouldNotPerformException, InterruptedException {
  try {
    synchronized (enablingLock) {
      enabled = true;
      activate();
      if (detectAutostart()) {
        setActivationState(ActivationState.newBuilder().setValue(ActivationState.State.ACTIVE).build()).get();
      } else {
        setActivationState(ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build()).get();
      }
    }
  } catch (ExecutionException ex) {
    throw new CouldNotPerformException("Could not enable " + this, ex);
  }
}
origin: org.openbase/jul.extension.rsb.com

@Override
public void enable() throws CouldNotPerformException, InterruptedException {
  try {
    synchronized (enablingLock) {
      super.enable();
      if (detectAutostart()) {
        setActivationState(ActivationState.newBuilder().setValue(ActivationState.State.ACTIVE).build()).get();
      } else {
        setActivationState(ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build()).get();
      }
    }
  } catch (ExecutionException ex) {
    throw new CouldNotPerformException("Could not diable " + this, ex);
  }
}
origin: org.openbase.bco/dal.lib

@RPCMethod
public Future<ActionFuture> setActivationState(final ActivationState activationState) throws CouldNotPerformException;
origin: org.openbase.bco/dal.remote

public NeighborConnectionPresenceTrigger(final LocationRemote locationRemote, final ConnectionRemote connectionRemote) throws org.openbase.jul.exception.InstantiationException {
  super();
  this.locationRemote = locationRemote;
  this.connectionRemote = connectionRemote;
  dataObserver = (source, data) -> {
    verifyCondition();
  };
  connectionObserver = (Observable<Remote.ConnectionState> source, Remote.ConnectionState data) -> {
    if (data.equals(Remote.ConnectionState.CONNECTED)) {
      verifyCondition();
    } else {
      notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.UNKNOWN).build()));
    }
  };
}
origin: org.openbase.bco/dal.remote

  private void verifyCondition() {
    try {
      if (locationRemote.getData().getPresenceState().getValue().equals(PresenceState.State.PRESENT)
          && (connectionRemote.getDoorState().getValue().equals(DoorState.State.OPEN)
          || connectionRemote.getWindowState().getValue().equals(WindowState.State.OPEN))) {
        notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.ACTIVE).build()));
      } else {
        notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build()));
      }
    } catch (CouldNotPerformException ex) {
      ExceptionPrinter.printHistory("Could not verify trigger state " + this, ex, LoggerFactory.getLogger(getClass()));
    }
  }
}
origin: org.openbase.bco/manager.scene.core

public SceneControllerImpl() throws org.openbase.jul.exception.InstantiationException {
  super(SceneControllerImpl.class, SceneData.newBuilder());
  this.buttonRemoteSet = new HashSet<>();
  this.remoteActionList = new ArrayList<>();
  this.buttonObserver = (final Observable<ButtonData> source, ButtonData data) -> {
    // skip initial button state synchronization during system startup
    if (data.getButtonStateLast().getValue().equals(State.UNKNOWN)) {
      return;
    }
    if (data.getButtonState().getValue().equals(ButtonState.State.PRESSED)) {
      setActivationState(ActivationState.newBuilder().setValue(ActivationState.State.ACTIVE).build());
    }
  };
}
origin: org.openbase/jul.pattern.trigger

@Override
public void deactivate() throws CouldNotPerformException, InterruptedException {
  for (AbstractTrigger abstractTrigger : triggerListAND) {
    abstractTrigger.deregisterObserver(triggerAndObserver);
    abstractTrigger.deactivate();
  }
  for (AbstractTrigger abstractTrigger : triggerListOR) {
    abstractTrigger.deregisterObserver(triggerOrObserver);
    abstractTrigger.deactivate();
  }
  notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.UNKNOWN).build()));
  active = false;
}
origin: org.openbase.bco/manager.agent.core

public OntologyTrigger(TriggerConfig config) throws InstantiationException {
  super();
  triggerObserver = (Observable<ActivationState.State> source, ActivationState.State data) -> {
    notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(data).build()));
  };
  try {
    final TriggerFactory triggerFactory = new TriggerFactory();
    trigger = triggerFactory.newInstance(config);
    trigger.addObserver(triggerObserver);
  } catch (CouldNotPerformException | InterruptedException ex) {
    throw new InstantiationException("Could not instantiate OntologyTrigger", ex);
  }
}
origin: org.openbase.bco/dal.lib

@Override
public void disable() throws CouldNotPerformException, InterruptedException {
  try {
    synchronized (enablingLock) {
      cancelExecution();
      enabled = false;
      setActivationState(ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build()).get();
      deactivate();
    }
  } catch (ExecutionException ex) {
    throw new CouldNotPerformException("Could not disable " + this, ex);
  }
}
origin: org.openbase.bco/dal.remote

@Override
public void deactivate() throws CouldNotPerformException, InterruptedException {
  unitRemote.removeDataObserver(dataObserver);
  unitRemote.removeConnectionStateObserver(connectionObserver);
  active = false;
  notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.UNKNOWN).build()));
}
origin: org.openbase/jul.pattern.trigger

public AbstractTrigger() throws InstantiationException {
  this.triggerObservable = new ObservableImpl<>(this);
  try {
    this.triggerObservable.notifyObservers(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.UNKNOWN).build()));
  } catch (CouldNotPerformException ex) {
    throw new InstantiationException("Could not set initial state", ex);
  }
}
origin: org.openbase.bco/dal.remote

@Override
public void deactivate() throws CouldNotPerformException, InterruptedException {
  unitRemote.removeDataObserver(dataObserver);
  unitRemote.removeConnectionStateObserver(connectionObserver);
  active = false;
  notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.UNKNOWN).build()));
}
origin: org.openbase.bco/dal.remote

@Override
public void deactivate() throws CouldNotPerformException, InterruptedException {
  locationRemote.removeDataObserver(dataObserver);
  connectionRemote.removeDataObserver(dataObserver);
  locationRemote.removeConnectionStateObserver(connectionObserver);
  connectionRemote.removeConnectionStateObserver(connectionObserver);
  active = false;
  notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.UNKNOWN).build()));
}
origin: org.openbase.bco/dal.remote

@Override
public void deactivate() throws CouldNotPerformException, InterruptedException {
  unitRemote.removeDataObserver(dataObserver);
  unitRemote.removeConnectionStateObserver(connectionObserver);
  active = false;
  notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.UNKNOWN).build()));
}
origin: org.openbase/jul.pattern.trigger

private void verifyCondition() throws CouldNotPerformException {
  if (verifyOrCondition() || verifyAndCondition()) {
    if (!getActivationState().getValue().equals(ActivationState.State.ACTIVE)) {
      notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.ACTIVE).build()));
    }
  } else {
    if (!getActivationState().getValue().equals(ActivationState.State.DEACTIVE)) {
      notifyChange(TimestampProcessor.updateTimestampWithCurrentTime(ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build()));
    }
  }
}
origin: org.openbase/jul.extension.rsb.com

@Override
public void disable() throws CouldNotPerformException, InterruptedException {
  try {
    synchronized (enablingLock) {
      executing = false;
      setActivationState(ActivationState.newBuilder().setValue(ActivationState.State.DEACTIVE).build()).get();
      super.disable();
    }
  } catch (ExecutionException ex) {
    throw new CouldNotPerformException("Could not diable " + this, ex);
  }
}
rst.domotic.stateActivationStateType$ActivationStatenewBuilder

Popular methods of ActivationStateType$ActivationState

  • getValue
  • toBuilder

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSystemService (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now