Package javax.jmdns

Examples of javax.jmdns.ServiceInfo


        int port = MapHelper.getInt(map, "port", 0);

        if (log.isDebugEnabled()) {
            log.debug("Registering service type: " + type + " name: " + name + " details: " + map);
        }
        return new ServiceInfo(type, name, port, weight, priority, new Hashtable(map));
    }
View Full Code Here


  /**
   * @{inheritDoc}
   */
  public void registerService(ServiceDescription description) {
    ServiceInfo serviceInfo = ServiceInfo.create(description.serviceType, description.serviceName, description.servicePort,
        0, 0, description.serviceProperties);   
    try {
      logger.debug("Registering new service " + description.serviceType + " at port " +
          String.valueOf(description.servicePort));
      jmdns.registerService(serviceInfo);
View Full Code Here

  /**
   * @{inheritDoc}
   */
  public void unregisterService(ServiceDescription description) {
    ServiceInfo serviceInfo = ServiceInfo.create(description.serviceType, description.serviceName, description.servicePort,
        0, 0, description.serviceProperties);
    logger.debug("Unregistering service " + description.serviceType + " at port " +
        String.valueOf(description.servicePort));
    jmdns.unregisterService(serviceInfo);
  }
View Full Code Here

      try {
        // ECF discovery API defines identity to be the service type and the URI (location)
        // see https://bugs.eclipse.org/266723
        final ServiceInfo[] serviceInfos = jmdns.list(service.getServiceTypeID().getInternal());
        for (int i = 0; i < serviceInfos.length; i++) {
          ServiceInfo serviceInfo = serviceInfos[i];
          IServiceInfo iServiceInfo = createIServiceInfoFromServiceInfo(serviceInfo);
          Assert.isNotNull(iServiceInfo);
          Assert.isNotNull(iServiceInfo.getServiceID());
          if (iServiceInfo.getServiceID().equals(service)) {
            return iServiceInfo;
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#registerService(org.eclipse.ecf.discovery.IServiceInfo)
   */
  public void registerService(final IServiceInfo serviceInfo) {
    Assert.isNotNull(serviceInfo);
    final ServiceInfo svcInfo = createServiceInfoFromIServiceInfo(serviceInfo);
    checkServiceInfo(svcInfo);
    try {
      jmdns.registerService(svcInfo);
    } catch (final IOException e) {
      throw new ECFRuntimeException("Exception registering service", e); //$NON-NLS-1$
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ecf.discovery.IDiscoveryContainerAdapter#unregisterService(org.eclipse.ecf.discovery.IServiceInfo)
   */
  public void unregisterService(final IServiceInfo serviceInfo) {
    Assert.isNotNull(serviceInfo);
    final ServiceInfo si = createServiceInfoFromIServiceInfo(serviceInfo);
    jmdns.unregisterService(si);
  }
View Full Code Here

            return;
          }

          // explicitly get the service to determine the naming authority (part of the service properties)
          try {
            final ServiceInfo info = arg0.getDNS().getServiceInfo(serviceType, serviceName);
            aServiceInfo = createIServiceInfoFromServiceInfo(info);
            services.put(serviceType + serviceName, aServiceInfo);
            serviceTypes.add(aServiceInfo.getServiceID().getServiceTypeID());
          } catch (final Exception e) {
            Trace.trace(JMDNSPlugin.PLUGIN_ID, "Failed to resolve in serviceAdded(" + arg0.getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    if (location != null) {
      props.put(SCHEME_PROPERTY, location.getScheme());
      props.put(URI_PATH_PROPERTY, location.getPath());
    }
    props.put(NAMING_AUTHORITY_PROPERTY, serviceInfo.getServiceID().getServiceTypeID().getNamingAuthority());
    final ServiceInfo si = ServiceInfo.create(sID.getServiceTypeID().getInternal(), serviceInfo.getServiceName(), location.getPort(), serviceInfo.getWeight(), serviceInfo.getPriority(), props);
    return si;
  }
View Full Code Here

TOP

Related Classes of javax.jmdns.ServiceInfo

Copyright © 2018 www.massapicom. 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.