Package ch.ethz.iks.slp

Examples of ch.ethz.iks.slp.ServiceLocationException


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


   * @throws ServiceLocationException
   *             always.
   */
  public void addAttributes(final ServiceURL url, final Dictionary attributes)
      throws ServiceLocationException {
    throw new ServiceLocationException(
        ServiceLocationException.NOT_IMPLEMENTED,
        "incremental registration not supported");
  }
View Full Code Here

   * @throws ServiceLocationException
   *             always.
   */
  public void deleteAttributes(final ServiceURL url,
      final Dictionary attributes) throws ServiceLocationException {
    throw new ServiceLocationException(
        ServiceLocationException.NOT_IMPLEMENTED,
        "incremental registration not supported");
  }
View Full Code Here

      }
    } catch (IllegalArgumentException ise) {
      platform.logDebug("May never happen, no filter set", ise);
    } catch (UnknownHostException uhe) {
      platform.logWarning("Unknown net.slp.interfaces address: " + myIPs[i], uhe);
      throw new ServiceLocationException(
          ServiceLocationException.NETWORK_ERROR, uhe.getMessage());
    } catch (IOException e) {
      platform.logWarning("Error connecting to: " + myIPs[i], e);
      throw new ServiceLocationException(
          ServiceLocationException.NETWORK_ERROR, e.getMessage());
    }
  }
View Full Code Here

      final ReplyMessage reply = (ReplyMessage) SLPMessage.parse(
          msg.address, msg.port, in, true);
      socket.close();
      return reply;
    } catch (Exception e) {
      throw new ServiceLocationException(
          ServiceLocationException.NETWORK_ERROR, e.getMessage());
    }
  }
View Full Code Here

          new ByteArrayInputStream(received.getData()));
      ReplyMessage reply = (ReplyMessage) SLPMessage.parse(received
          .getAddress(), received.getPort(), in, false);
      return reply;
    } catch (SocketException se) {
      throw new ServiceLocationException(
          ServiceLocationException.NETWORK_INIT_FAILED, se
              .getMessage());
    } catch (ProtocolException pe) {
      // Overflow, retry with TCP
      return sendMessageTCP(msg);
    } catch (IOException ioe) {
      platform.logError("Exception during sending of " + msg);
      platform.logError("to " + msg.address + ":" + msg.port);
      platform.logError("Exception:", ioe);
      throw new ServiceLocationException(
          ServiceLocationException.NETWORK_ERROR, ioe.getMessage());
    } catch (Throwable t) {
      platform.logDebug(t.getMessage(), t);
      throw new ServiceLocationException((short) 1, t.getMessage());
    }
  }
View Full Code Here

            + (System.currentTimeMillis() - start)
            + " ms, result: " + responses);
      return responses;
    } catch (IOException ioe) {
      platform.logDebug(ioe.getMessage(), ioe);
      throw new ServiceLocationException(
          ServiceLocationException.NETWORK_ERROR, ioe.getMessage());
    }
  }
View Full Code Here

    attList = attributeStringToList(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(spi);
      dos.writeUTF(listToString(attList, ","));
      dos.writeInt(timestamp);
      return bos.toByteArray();
    } catch (IOException ioe) {
      throw new ServiceLocationException(
          ServiceLocationException.INTERNAL_SYSTEM_ERROR, ioe
              .getMessage());
    }
  }
View Full Code Here

                  dereg.sign(spiList);
                }
                ReplyMessage reply = SLPCore.sendMessage(dereg,
                    true);
                if (reply.errorCode != 0) {
                  throw new ServiceLocationException(
                      (short) reply.errorCode,
                      "Error during deregistration: "
                          + reply.errorCode);
                }
              } catch (UnknownHostException uhe) {
                throw new ServiceLocationException(
                    ServiceLocationException.NETWORK_ERROR,
                    uhe.getMessage());
              }
            }
          }
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.