com.addc.commons.slp.NetworkManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of addc-slp Show documentation
Show all versions of addc-slp Show documentation
The addc-slp library supplies client classes for registering objects with a Service Location Protocol Daemon and
for looking theses objects up later.
package com.addc.commons.slp;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import com.addc.commons.slp.messages.SLPMessage;
/**
* The NetworkManager interface defines the contract for classes supplying
* networl management for Service and User Agents.
*/
public interface NetworkManager {
/**
* Opens a TCP connection to the slp daemon running on the localhost. This
* connection is used for all SA requests/responses.
*
* @return The socket.
* @throws IOException
* If fails.
*/
Socket connectToSlpd() throws IOException;
/**
* Searches for a DA
*/
void findDA();
/**
* Get either the current DA's address, or the SLP multicast address if no
* DAs are available.
*
* @return The address.
*/
InetAddress getDaAddress();
/**
* Get the next XID to use.
*
* @return the next XID to use.
*/
int nextXid();
/**
* Sends a message as an SA. SA Messages are to the slp daemon running on
* the localhost. Note that this is a TCP connection.
*
* @param message
* The message
* @throws ServiceLocationException
* If the service cannot be located.
*/
void saMessage(SLPMessage message) throws ServiceLocationException;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy