Package ch.ethz.iks.slp

Examples of ch.ethz.iks.slp.ServiceLocationException


   */
  public synchronized Object next() throws ServiceLocationException {
    try {
      return iterator.next();
    } catch (Exception e) {
      throw new ServiceLocationException(
          ServiceLocationException.INTERNAL_SYSTEM_ERROR, e
              .getMessage());
    }
  }
View Full Code Here


      url = url.substring(0, pos);
    }
    origScopes = input.readUTF();
    scopeList = stringToList(origScopes, ",");
    if (scopeList.isEmpty()) {
      throw new ServiceLocationException(
          ServiceLocationException.PARSE_ERROR, "received DAadvert "
              + "with empty scope list");
    }
    origAttrs = input.readUTF();
    attrList = attributeStringToList(origAttrs);
    spi = input.readUTF();
    authBlocks = AuthenticationBlock.parse(input);
    if (SLPCore.CONFIG.getSecurityEnabled()) {
      if (!verify()) {
        throw new ServiceLocationException(
            ServiceLocationException.AUTHENTICATION_FAILED,
            "could not verify " + toString());
      }
    }
  }
View Full Code Here

      dos.writeUTF(spi);
      dos.writeInt(timestamp);

      return bos.toByteArray();
    } catch (IOException ioe) {
      throw new ServiceLocationException(
          ServiceLocationException.INTERNAL_SYSTEM_ERROR, ioe
              .getMessage());
    }
  }
View Full Code Here

    for (int i = 0; i < entryCount; i++) {
      urlList.add(ServiceURL.fromBytes(input));
    }
    if (SLPCore.CONFIG.getSecurityEnabled()) {
      if (!verify())
        throw new ServiceLocationException(
            ServiceLocationException.AUTHENTICATION_FAILED,
            toString());
    }
  }
View Full Code Here

      RequestMessage srvReq = new ServiceRequest(type, scopes,
          searchFilter, locale);
      return new ServiceLocationEnumerationImpl(sendRequest(srvReq,
          scopes));
    } catch (IllegalArgumentException ise) {
      throw new ServiceLocationException(
          ServiceLocationException.INTERNAL_SYSTEM_ERROR, ise
              .getMessage()
              + ": " + searchFilter);
    }
  }
View Full Code Here

          result.addAll(SLPCore.multicastConvergence(req));
        }
        continue;
      } else {
        if (SLPCore.noDiscovery) {
          throw new ServiceLocationException(
              ServiceLocationException.SCOPE_NOT_SUPPORTED,
              "Scope " + scope + " is not supported");
        }

        // still no DA available, use multicast
View Full Code Here

        // Try the next DA in the list.
        continue;
      }
    }
    // did not work. Return an empty result array.
    throw new ServiceLocationException(
        ServiceLocationException.INTERNAL_SYSTEM_ERROR,
        "No DA reachable");
  }
View Full Code Here

    attributes = attributeStringToListLiberal(input.readUTF());
    authBlocks = AuthenticationBlock.parse(input);

    if (SLPCore.CONFIG.getSecurityEnabled()) {
      if (!verify()) {
        throw new ServiceLocationException(
            ServiceLocationException.AUTHENTICATION_FAILED,
            "Authentication failed for " + toString());
      }
    }
  }
View Full Code Here

      dos.writeUTF(spiStr);
      dos.writeUTF(listToString(attributes, ","));
      dos.writeInt(timestamp);
      return bos.toByteArray();
    } catch (IOException ioe) {
      throw new ServiceLocationException(
          ServiceLocationException.INTERNAL_SYSTEM_ERROR, ioe
              .getMessage());
    }
  }
View Full Code Here

    }
    reg.port = SLPCore.SLP_PORT;
    ServiceAcknowledgement ack = (ServiceAcknowledgement) SLPCore
        .sendMessage(reg, true);
    if (ack.errorCode != 0) {
      throw new ServiceLocationException((short) ack.errorCode,
          "Registration failed");
    }
  }
View Full Code Here

TOP

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

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.