Search in sources :

Example 1 with ServiceTypeID

use of org.eclipse.ecf.discovery.identity.ServiceTypeID in project ecf by eclipse.

the class ServiceIDTest method createIDFromStringWithEx.

protected IServiceTypeID createIDFromStringWithEx(String serviceType) {
    Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
    ServiceTypeID serviceTypeID = new ServiceTypeID(namespaceByName, serviceType);
    return ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, serviceTypeID);
}
Also used : ServiceTypeID(org.eclipse.ecf.discovery.identity.ServiceTypeID) IServiceTypeID(org.eclipse.ecf.discovery.identity.IServiceTypeID) Namespace(org.eclipse.ecf.core.identity.Namespace)

Example 2 with ServiceTypeID

use of org.eclipse.ecf.discovery.identity.ServiceTypeID in project ecf by eclipse.

the class ServiceIDTest method testServiceIDFactory2.

/*
	 * 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());
}
Also used : IServiceTypeID(org.eclipse.ecf.discovery.identity.IServiceTypeID) ServiceTypeID(org.eclipse.ecf.discovery.identity.ServiceTypeID) IServiceTypeID(org.eclipse.ecf.discovery.identity.IServiceTypeID) Namespace(org.eclipse.ecf.core.identity.Namespace)

Aggregations

Namespace (org.eclipse.ecf.core.identity.Namespace)2 IServiceTypeID (org.eclipse.ecf.discovery.identity.IServiceTypeID)2 ServiceTypeID (org.eclipse.ecf.discovery.identity.ServiceTypeID)2