Package ch.ethz.iks.slp

Examples of ch.ethz.iks.slp.ServiceType


      for (; i < myIPs.length; i++) {
        // create a socket bound to the next ip address
        final InetAddress addr = InetAddress.getByName(myIPs[i]);
        DatagramSocket socket = new DatagramSocket(0, addr);

        ServiceRequest sreq = new ServiceRequest(new ServiceType(
            SLP_DA_TYPE), scopes, null, SLPCore.DEFAULT_LOCALE);
        sreq.xid = SLPCore.nextXid();
        sreq.scopeList = scopes;
        sreq.address = MCAST_ADDRESS;
        sreq.multicast = true;
View Full Code Here


  ServiceRegistration(final DataInputStream input)
      throws ServiceLocationException, IOException {
    funcID = SRVREG;
    locale = SLPCore.DEFAULT_LOCALE;
    url = ServiceURL.fromBytes(input);
    serviceType = new ServiceType(input.readUTF());
    scopeList = stringToList(input.readUTF(), ",");
    attList = attributeStringToList(input.readUTF());
    authBlocks = AuthenticationBlock.parse(input);

    if (SLPCore.CONFIG.getSecurityEnabled()) {
View Full Code Here

        }
        // the request can either be for a ServiceURL or a ServiceType
        Object reqService;
        boolean fullurl = false;
        if (attreq.url.indexOf("//") == -1) {
          reqService = new ServiceType(attreq.url);
        } else {
          fullurl = true;
          reqService = new ServiceURL(attreq.url, 0);
        }

        // if spi is sent, the request must be for a full url and
        // the tag list has to be empty
        if (attreq.spi.equals("")
            || (fullurl && attreq.tagList.isEmpty())) {
          for (Iterator srvs = services.iterator(); srvs.hasNext();) {
            Service service = (Service) srvs.next();
            if (service.url.matches(reqService)) {
              attResult.addAll(SLPUtils.findMatches(
                  attreq.tagList, service.attributes));
            }
          }
        }

      }
      reply = new AttributeReply(attreq, attResult);

      if (SLPCore.CONFIG.getSecurityEnabled()) {
        ((AttributeReply) reply).sign(attreq.spi);
      }

      return reply;
    case SLPMessage.SRVTYPERQST:
      ServiceTypeRequest streq = (ServiceTypeRequest) msg;

      ArrayList result = new ArrayList();

      // iterate over scopes
      for (Iterator scopeIter = streq.scopeList.iterator(); scopeIter
          .hasNext();) {

        // iterate over the registered services
        String scope = (String) scopeIter.next();
        List services = ((List) registeredServices
            .get(scope.toLowerCase()));
        if (services == null) {
          continue;
        }
        for (Iterator iter = services.iterator(); iter.hasNext();) {
          Service service = (Service) iter.next();
          ServiceType type = service.url.getServiceType();
          if (streq.namingAuthority.equals("*")
              || streq.namingAuthority.equals("")
              || type.getNamingAuthority().equals(
                  streq.namingAuthority)) {
            if (!result.contains(type)) {
              result.add(type);
            }
          }
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.