Package org.eclipse.ecf.discovery.identity

Examples of org.eclipse.ecf.discovery.identity.ServiceTypeID


      } else if (parameters.length == 2
          && parameters[0] instanceof String
          && parameters[1] instanceof URI) {
        final String type = (String) parameters[0];
        return new ZooDiscoveryServiceID(this,
            new ServiceTypeID(this, type), ((URI) parameters[1]));
      }

    } catch (Exception e) {
      throw new IDCreateException(getName()+" createInstance()", e); //$NON-NLS-1$
    }
View Full Code Here


    return null;
  }

  protected IServiceTypeID createIDFromStringWithEx(String serviceType) {
    Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
    ServiceTypeID serviceTypeID = new ServiceTypeID(namespaceByName, serviceType);
    return ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, serviceTypeID);
  }
View Full Code Here

  /*
   * org.eclipse.ecf.discovery.identity.IServiceIDFactory.createServiceID(Namespace, String, String)
   */
  public void testServiceIDFactory2() {
    Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
    ServiceTypeID serviceTypeID = new ServiceTypeID(new TestNamespace(), "_service._ecf._foo._bar._tcp.ecf.eclipse.org._IANA");
    IServiceTypeID aServiceTypeID = ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, serviceTypeID);
    assertNotNull(aServiceTypeID);
   
    // members should be the same
    assertEquals(aServiceTypeID.getNamingAuthority(), serviceTypeID.getNamingAuthority());
    assertTrue(Arrays.equals(aServiceTypeID.getServices(), serviceTypeID.getServices()));
    assertTrue(Arrays.equals(aServiceTypeID.getScopes(), serviceTypeID.getScopes()));
    assertTrue(Arrays.equals(aServiceTypeID.getProtocols(), serviceTypeID.getProtocols()));
   
    assertSame(namespaceByName, aServiceTypeID.getNamespace());
  }
View Full Code Here

   */
  public ID createInstance(final Object[] parameters) {
    if (parameters == null || parameters.length < 1 || parameters.length > 2) {
      throw new IDCreateException("parameter count must be non null and of length >= 1 and =< 2"); //$NON-NLS-1$
    } else if (parameters.length == 2 && parameters[0] instanceof String && parameters[1] instanceof URI) {
      return new CompositeServiceID(this, new ServiceTypeID(this, (String) parameters[0]), (URI) parameters[1]);
    } else if (parameters.length == 2 && parameters[0] instanceof IServiceTypeID && parameters[1] instanceof URI) {
      return new CompositeServiceID(this, (IServiceTypeID) parameters[0], (URI) parameters[1]);
    } else if (parameters.length == 1 && parameters[0] instanceof IServiceTypeID) {
      final IServiceTypeID iServiceTypeID = (IServiceTypeID) parameters[0];
      return new ServiceTypeID(this, iServiceTypeID.getName());
    } else {
      throw new IDCreateException("wrong parameters"); //$NON-NLS-1$
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.discovery.identity.ServiceTypeID

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.