Examples of IServiceProperties


Examples of org.eclipse.ecf.discovery.IServiceProperties

    return null;
  }

  protected org.osgi.service.remoteserviceadmin.EndpointDescription createEndpointDescription(
      IDiscoveryLocator locator, IServiceInfo discoveredServiceInfo) {
    IServiceProperties discoveredServiceProperties = discoveredServiceInfo
        .getServiceProperties();
    return decodeEndpointDescription(discoveredServiceProperties);

  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceProperties

            endpointDescription, advertiser);
        String serviceName = createServiceName(endpointDescription,
            advertiser, serviceTypeID);
        URI uri = createURI(endpointDescription, advertiser,
            serviceTypeID, serviceName);
        IServiceProperties serviceProperties = createServiceProperties(
            endpointDescription, advertiser, serviceTypeID,
            serviceName, uri);
        IServiceInfo newServiceInfo = createServiceInfo(uri,
            serviceName, serviceTypeID, serviceProperties);
        return newServiceInfo;
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceProperties

   * .ExecutionEvent)
   */
  public Object execute(ExecutionEvent event) throws ExecutionException {
    final IServiceInfo serviceInfo = DiscoveryHandlerUtil
        .getActiveIServiceInfoChecked(event);
    final IServiceProperties serviceProperties = serviceInfo
        .getServiceProperties();

    final String clazz = serviceProperties
        .getPropertyString(Constants.OBJECTCLASS);
    final String serviceId = new String(
        serviceProperties
            .getPropertyString(RemoteConstants.SERVICE_IMPORTED_ENDPOINT_SERVICE_ID));
    final String containerId = new String(
        serviceProperties
            .getPropertyString(RemoteConstants.SERVICE_IMPORTED_ENDPOINT_ID));

    // get the service via the osgi service registry
    final BundleContext context = Activator.getDefault().getBundle()
        .getBundleContext();
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceProperties

  public ECFServiceEndpointDescriptionImpl(IServiceInfo serviceInfo) {
    super(((ServiceProperties)serviceInfo.getServiceProperties()).asProperties());
    this.serviceId = serviceInfo.getServiceID();

    // create the endpoint id
    IServiceProperties serviceProperties = serviceInfo.getServiceProperties();
    final byte[] endpointBytes =
      serviceProperties.getPropertyBytes(ECFServicePublication.PROP_KEY_ENDPOINT_CONTAINERID);
    if (endpointBytes == null)
      throw new IDCreateException(
          "ServiceEndpointDescription endpointBytes cannot be null");
    final String endpointStr = new String(endpointBytes);
    final String namespaceStr =
      serviceProperties.getPropertyString(ECFServicePublication.PROP_KEY_ENDPOINT_CONTAINERID_NAMESPACE);
    if (namespaceStr == null) {
      throw new IDCreateException(
      "ServiceEndpointDescription namespaceStr cannot be null");
    }
    endpointId = IDFactory.getDefault().createID(namespaceStr,
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceProperties

    final Name zone = Name.fromString(DnsSdTestHelper.REG_DOMAIN + ".");
    final Name name = Name.fromString("_" + DnsSdTestHelper.REG_SCHEME + "._" + DnsSdTestHelper.PROTO, zone);

    Update update = null;
   
    final IServiceProperties properties = serviceInfo.getServiceProperties();
    final Enumeration enumeration = properties.getPropertyNames();
    while (enumeration.hasMoreElements()) {
      final Object property = enumeration.nextElement();
      final String key = property.toString();
      final String value = (String) properties.getProperty(key).toString();
      final Record record = Record.fromString(name, Type.TXT, DClass.IN,
          serviceInfo.getTTL(), key + "=" + value, zone);
      update = new Update(zone);
      update.add(record);
    }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceProperties

      final boolean naSame = firstNA.equals(secondsSA);
      final URI firstLocation = first.getLocation();
      final URI secondLocation = second.getLocation();
      final boolean locationSame = firstLocation.equals(secondLocation);
      final boolean scopesSame = Arrays.equals(firstTypeID.getScopes(), secondTypeID.getScopes());
      final IServiceProperties firstProperty = first.getServiceProperties();
      final IServiceProperties secondProperty = second.getServiceProperties();
      final boolean propertySame = firstProperty.equals(secondProperty);
      final boolean result = protocolsSame && weightSame && prioSame && nameSame && namespaceSame && serviceSame && naSame && locationSame && scopesSame && propertySame;
      if(result == true) {
        return 0;
      }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceProperties

  /**
   * Test method for {@link org.eclipse.ecf.discovery.ServiceInfo#getServiceProperties()}.
   */
  public void testGetServiceProperties() {
    final IServiceProperties sprops = serviceInfo.getServiceProperties();
    assertEquals(sprops, serviceProperties);
  }
View Full Code Here

Examples of org.eclipse.ecf.discovery.IServiceProperties

   * @return A relative TXT record independent of a given domain/zone
   * @throws IOException
   */
  Record[] toTXTRecords(final Record aRecord) throws IOException {
    final List result = new ArrayList();
    final IServiceProperties properties = serviceInfo.getServiceProperties();
    final Enumeration enumeration = properties.getPropertyNames();
    while (enumeration.hasMoreElements()) {
      final Object property = enumeration.nextElement();
      final String key = property.toString();
      final String value = (String) properties.getProperty(key).toString();
      final long ttl = serviceInfo.getTTL();
      result.add(new TXTRecord(aRecord.getName(), DClass.IN, ttl, key + "=" + value)); //$NON-NLS-1$
    }
    return (Record[]) result.toArray(new Record[result.size()]);
  }
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.