Package ch.ethz.iks.slp

Examples of ch.ethz.iks.slp.ServiceType


   * {@link ch.ethz.iks.slp.Locator}.
   */
  public void testService() throws Exception {
    int count = 0;
    for (ServiceLocationEnumeration services = TestActivator.locator
        .findServices(new ServiceType("service:osgi"), null, null); services
        .hasMoreElements();) {
      assertEquals(services.next().toString(),
          "service:osgi://"  + HOST_AND_PORT);
      count++;
    }
View Full Code Here


    int count = 0;
   
    // not fast but DRY
    outter:
    for (ServiceLocationEnumeration attributes = TestActivator.locator
        .findAttributes(new ServiceType("service:osgi"), null, null); attributes
        .hasMoreElements();) {
      final String attribute = attributes.next().toString();

      // inner loop over the dict
      Enumeration elements = properties.keys();
View Full Code Here

   * {@link ch.ethz.iks.slp.Locator}.
   */
  public void testFilter() throws Exception {
    int count = 0;
    for (ServiceLocationEnumeration services = TestActivator.locator
        .findServices(new ServiceType("service:osgi"), null,
            "(attr=false)"); services.hasMoreElements();) {
      assertEquals(services.next().toString(),
          "service:osgi://" + HOST_AND_PORT);
      count++;
    }
View Full Code Here

   * {@link ch.ethz.iks.slp.Locator}.
   */
  public void testFilterWithWildcard() throws Exception {
    int count = 0;
    for (ServiceLocationEnumeration services = TestActivator.locator
        .findServices(new ServiceType("service:osgi"), null, "(attr=*)"); services
        .hasMoreElements();) {
      assertEquals(services.next().toString(),
          "service:osgi://" + HOST_AND_PORT);
      count++;
    }
View Full Code Here

   * characters should be escaped by preceding them with the backslash '\' character.
   */
  public void testFilterWithBrokenParenthesis() throws Exception {
    try {
      // correct filter is (service-type=\(service:osgi\))
      TestActivator.locator.findServices(new ServiceType("service:osgi"), null,
        "(service-type=(service:osgi))");
    } catch (ServiceLocationException e) {
      if(e.getErrorCode() == 20) {
        return;
      }
View Full Code Here

  private final ServiceType st;

  protected JSLPServiceTypeID(final Namespace namespace, final String type) {
    super(namespace);
    try {
      st = new ServiceType(type);
      // verify that the ServiceType is proper
      Assert.isNotNull(st.toString());
      Assert.isTrue(!st.toString().equals("")); //$NON-NLS-1$

      final String na = st.getNamingAuthority();
View Full Code Here

      }
      buf.append(':');
    }
    // remove dangling colon
    final String string = buf.toString();
    st = new ServiceType(string.substring(0, string.length() - 1));
  }
View Full Code Here

      return new JSLPServiceTypeID(this, (ServiceType) parameters[0]);
      //return new JSLPServiceID(this, stid, (String) parameters[1]);

      // create by jSLP ServiceType String representation (from external)
    } else if (parameters[0] instanceof String && ((String) parameters[0]).startsWith("service:")) { //$NON-NLS-1$
      parameters[0] = new ServiceType((String) parameters[0]);
      return createInstance(parameters);

      // create IServiceID by ECF discovery generic String representation
    } else if (parameters.length == 2 && parameters[0] instanceof String && ((String) parameters[0]).startsWith("_") && parameters[1] instanceof URI) { //$NON-NLS-1$
      final String type = (String) parameters[0];
View Full Code Here

   *             in case that the IO caused an exception.
   * @throws IOException
   */
  protected ServiceRequest(final DataInputStream input) throws IOException {
    prevRespList = stringToList(input.readUTF(), ",");
    serviceType = new ServiceType(input.readUTF());
    scopeList = stringToList(input.readUTF(), ",");
    try {
      final String filterStr = input.readUTF();
      predicate = "".equals(filterStr) ? null : SLPCore.platform
          .createFilter(filterStr);
View Full Code Here

            "Configuration 'net.slp.noDaDiscovery=true' requires a non-empty list of preconfigured DAs");
      }
    } else {
      try {
        // process the preconfigured DAs
        final ServiceRequest req = new ServiceRequest(new ServiceType(
            SLP_DA_TYPE), null, null, null);
        req.port = SLP_PORT;
        for (int i = 0; i < daAddresses.length; i++) {
          try {
            req.address = InetAddress.getByName(daAddresses[i]);
View Full Code Here

TOP

Related Classes of ch.ethz.iks.slp.ServiceType

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.