All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.addc.commons.slp.ServiceLocationException Maven / Gradle / Ivy

Go to download

The addc-slp library supplies client classes for registering objects with a Service Location Protocol Daemon and for looking theses objects up later.

There is a newer version: 2.6
Show newest version
package com.addc.commons.slp;

/**
 * Implementation of the ServiceLocationException class defined in RFC 2614.
 * 
 * A ServiceLocationException is thrown by all methods when errors occur.
 */
public class ServiceLocationException extends Exception {
    private static final long serialVersionUID= 3435503520643386670L;
    private final int errorCode;

    /**
     * Create a new ServiceLocationException
     * 
     * @param reason
     *            The reasom message
     * @param errorCode
     *            The error code (one of the error constants)
     */
    public ServiceLocationException(String reason, int errorCode) {
        super(reason);
        this.errorCode= errorCode;
    }

    /**
     * Create a new ServiceLocationException
     * 
     * @param reason
     *            The reasom message
     * @param cause
     *            The Exception that caused the error
     * @param errorCode
     *            The error code (one of the error constants)
     */
    public ServiceLocationException(String reason, Throwable cause, int errorCode) {
        super(reason, cause);
        this.errorCode= errorCode;
    }

    /**
     * Get the error code. The error code is on one of the static field values.
     * 
     * @return the error code.
     */
    public int getErrorCode() {
        return errorCode;
    }

    @Override
    public String getMessage() {
        return super.getMessage() + " Error code: " + errorCode;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy