Examples of RemoteNode


Examples of org.eclipse.egit.ui.internal.repository.tree.RemoteNode

  private RemoteConfig getRemoteConfig(RepositoryTreeNode node)
      throws ExecutionException {
    if (node instanceof FetchNode)
      try {
        RemoteNode remote = (RemoteNode) node.getParent();
        return  new RemoteConfig(node.getRepository().getConfig(),
            remote.getObject());
      } catch (URISyntaxException e) {
        throw new ExecutionException(e.getMessage());
      }

    if (node instanceof RemoteNode)
      try {
        RemoteNode remote = (RemoteNode) node;
        return new RemoteConfig(node.getRepository().getConfig(),
            remote.getObject());
      } catch (URISyntaxException e) {
        throw new ExecutionException(e.getMessage());
      }

    if (node instanceof RepositoryNode)
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RemoteNode

  private static final String PUSHURL = "pushurl"; //$NON-NLS-1$

  public Object execute(ExecutionEvent event) throws ExecutionException {
    FetchNode node = getSelectedNodes(event).get(0);
    RemoteNode remote = (RemoteNode) node.getParent();

    StoredConfig config = node.getRepository().getConfig();
    String fetchUrl = config.getString(REMOTE, remote.getObject(), URL);
    config.unset(REMOTE, remote.getObject(), FETCH);
    config.unset(REMOTE, remote.getObject(), URL);
    // the push URL may still be needed for fetch
    if (fetchUrl != null) {
      boolean hasPush = config.getStringList(REMOTE, remote.getObject(),
          PUSH).length > 0;
      if (hasPush) {
        String[] pushurls = config.getStringList(REMOTE, remote
            .getObject(), PUSHURL);
        // if there are not specific push urls,
        // copy the former fetch url into push url
        if (pushurls.length == 0)
          config.setString(REMOTE, remote.getObject(), PUSHURL,
              fetchUrl);
      }
    }

    try {
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RemoteNode

*/
public class ConfigureGerritRemoteCommand extends
    RepositoriesViewCommandHandler<RemoteNode> {

  public Object execute(ExecutionEvent event) throws ExecutionException {
    final RemoteNode node = getSelectedNodes(event).get(0);
    Repository repository = node.getRepository();
    final String remoteName = node.getObject();

    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
        .getShell();
    ConfigureGerritWizard configureGerritWizard = new ConfigureGerritWizard(
        repository, remoteName);
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RemoteNode

    if (node instanceof RepositoryNode)
      return SimpleConfigurePushDialog.getConfiguredRemote(node
          .getRepository());

    if (node instanceof RemoteNode || node instanceof PushNode) {
      RemoteNode remoteNode;
      if (node instanceof PushNode)
        remoteNode = (RemoteNode) node.getParent();
      else
        remoteNode = (RemoteNode) node;

      try {
        RemoteConfig config = new RemoteConfig(remoteNode
            .getRepository().getConfig(), remoteNode.getObject());
        boolean fetchConfigured = !config.getFetchRefSpecs().isEmpty();
        boolean pushConfigured = !config.getPushRefSpecs().isEmpty();
        if (fetchConfigured || pushConfigured)
          return config;
        else
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RemoteNode

* Deletes the Push
*/
public class DeletePushCommand extends RepositoriesViewCommandHandler<PushNode> {
  public Object execute(ExecutionEvent event) throws ExecutionException {
    PushNode node = getSelectedNodes(event).get(0);
    RemoteNode remote = (RemoteNode) node.getParent();
    StoredConfig config = node.getRepository().getConfig();
    config.unset("remote", remote.getObject(), "pushurl"); //$NON-NLS-1$ //$NON-NLS-2$
    config.unset("remote", remote.getObject(), "push"); //$NON-NLS-1$ //$NON-NLS-2$
    try {
      config.save();
    } catch (IOException e1) {
      Activator.handleError(e1.getMessage(), e1, true);
    }
View Full Code Here

Examples of org.saf.business.RemoteNode

          int port = 0;
          try {
            port = Integer.parseInt(node.substring(idx + 1));
          } catch (NumberFormatException e) {
          }
          RemoteNode rm = new RemoteNode(address, port);
          if(rm.isValidNode() == true) {
            this.nodes.add(rm);
          } else {
            rm = null;
            logger.error("no valid node data for " + address);
          }
View Full Code Here

Examples of org.ugate.service.entity.jpa.RemoteNode

        @Override
        public void handle(final EmailEvent event) {
          String msg;
          if (event.type == EmailEvent.Type.EXECUTE_COMMAND) {
            if (ServiceProvider.IMPL.getWirelessService().isConnected()) {
              RemoteNode rn;
              final List<String> commandMsgs = new ArrayList<String>();
              // send command to all the nodes defined in the email
              for (final String toAddress : event.toAddresses) {
                commandMsgs.clear();
                rn = ServiceProvider.IMPL.getRemoteNodeService().findByAddress(toAddress);
View Full Code Here

Examples of org.ugate.service.entity.jpa.RemoteNode

          // need to update the existing dirty host
          getActor().setHost((Host) event.getSource());
          getActorPA().setBean(getActor());
        } else if (event.getType() == UGateEvent.Type.WIRELESS_REMOTE_NODE_COMMITTED) {
          // need to update the existing dirty remote node
          final RemoteNode rn = (RemoteNode) event.getSource();
          final boolean isViewNode = rn.getAddress()
              .equalsIgnoreCase(getRemoteNode().getAddress());
          final LinkedHashSet<RemoteNode> rns = new LinkedHashSet<>(
              ServiceProvider.IMPL.getRemoteNodeService()
                  .findForHost(getActor().getHost().getId()));
          getActor().getHost().setRemoteNodes(rns);
          RemoteNode prn = null;
          if (isViewNode && event.getNewValue() == null) {
            // node removed- show another node
            prn = getActor().getHost().getRemoteNodes().iterator()
                .next();
          } else if (isViewNode) {
            // update performed- refresh node
            for (final RemoteNode nrn : getActor().getHost().getRemoteNodes()) {
              if (nrn.getAddress().equalsIgnoreCase(rn.getAddress())) {
                prn = nrn;
                break;
              }
            }
          }
          setHelpText(RS.rbLabel(KEY.WIRELESS_NODE_REMOTE_SAVED_LOCAL, rn.getAddress()));
          // synchronize the remote node with the remote device
          if (prn != null) {
            getRemoteNodePA().setBean(prn);
            if (!prn.isDeviceSynchronized() && prn.getDeviceAutoSynchronize() == 1) {
              // automatically send the changes to the remote node device
              createCommandService(Command.SENSOR_SEND_SETTINGS, true);
            } else if (!prn.isDeviceSynchronized() && isViewNode) {
              validateRemoteNodeSynchronization();
            }
          }
        } else if (event.getType() == UGateEvent.Type.WIRELESS_DATA_TX_SUCCESS) {
          final RemoteNode rn = (RemoteNode) event.getSource();
          if (rn.getAddress().equalsIgnoreCase(getRemoteNode().getAddress())) {
            settingsSetTimeline.stop();
          }
        } else if (event.getType() == UGateEvent.Type.WIRELESS_DATA_RX_SUCCESS) {
          final RemoteNode rn = (RemoteNode) event.getSource();
          if (event.getNewValue() instanceof RxTxRemoteNodeReadingDTO) {
            final RxTxRemoteNodeReadingDTO sr = (RxTxRemoteNodeReadingDTO) event.getNewValue();
            ServiceProvider.IMPL.getRemoteNodeService().saveReading(sr.getRemoteNodeReading());
          } else if (event.getNewValue() instanceof RxTxRemoteNodeDTO) {
            final RxTxRemoteNodeDTO ndto = (RxTxRemoteNodeDTO) event.getNewValue();
            if (!RemoteNodeType.remoteEquivalent(rn, ndto.getRemoteNode())) {
              // remote device values do not match the local device values
              rn.setDeviceSynchronized(false);
              ndto.getRemoteNode().setDeviceSynchronized(false);
              if (rn.getDeviceAutoSynchronize() == 1) {
                // automatically send the changes to the remote node
                // (consume event so no other notifications for the
                // event will be processed)
                event.setConsumed(true);
                createCommandService(Command.SENSOR_SEND_SETTINGS, true);
              } else if (rn.getAddress().equalsIgnoreCase(getRemoteNode().getAddress())) {
                validateRemoteNodeSynchronization();
              }
            }
          }
        } else if (event.getType() == UGateEvent.Type.WIRELESS_REMOTE_NODE_CHANGED) {
View Full Code Here

Examples of org.ugate.service.entity.jpa.RemoteNode

      log.error(String .format("Received data from an unknown address %1$s... Discarding response...",
          "NONE"));
      return null;
    }
    // TODO : RemoteNode should not be queried every time a response is received when multi-chunking data (like image)
    final RemoteNode rn = ServiceProvider.IMPL.getRemoteNodeService().findByAddress(remoteAddress);
    if (rn == null) {
      log.error(String .format("Received data from an unknown address %1$s... Discarding response...",
          remoteAddress));
      return null;
    }
View Full Code Here

Examples of org.ugate.service.entity.jpa.RemoteNode

   */
  public void handleSound(final UGateEvent<?, ?> event) {
    if (!(event.getSource() instanceof RemoteNode)) {
      return;
    }
    final RemoteNode rn = (RemoteNode) event.getSource();
    if (rn == null || rn.getDeviceSoundsOn() != 1) {
      return;
    }
    if (event.getType() == UGateEvent.Type.WIRELESS_DATA_TX_STATUS_RESPONSE_UNRECOGNIZED) {
      RS.mediaPlayerConfirm.play();
    } else if (event.getType() == UGateEvent.Type.WIRELESS_DATA_TX_STATUS_RESPONSE_SUCCESS) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.