public class Nexus
extends java.lang.Object
implements com.illposed.osc.OSCListener
Constructor and Description |
---|
Nexus() |
Modifier and Type | Method and Description |
---|---|
void |
acceptMessage(java.util.Date time,
com.illposed.osc.OSCMessage message)
Accepts certain OSC messages.
|
void |
clearRejectedMessages()
Removes all rejected NDEF messages.
|
java.lang.String |
getListeningAddress()
Returns the current IP address used to listen for incoming OSC messages.
|
int |
getListeningPort()
Returns the current port number used to listen for incoming OSC messages.
|
java.lang.String |
getLocalAddress()
Returns the local IP address of the device running this Dispatcher.
|
java.lang.String[] |
getRejectedMessages()
Returns any rejected NDEF messages.
|
Relay |
getRelay(int r)
Returns the specified Relay.
|
int |
getRelayCount()
Returns the number of Relays contained in this Dispatcher.
|
Relay[] |
getRelays()
Returns the NDEF message mapping Relays associated with this Dispatcher as an array.
|
boolean |
isConnected(Relay r)
Determines whether the specified Relay is connected.
|
boolean |
isConnected(java.lang.String ip,
int port)
Determines whether the specified combination of IP address and port number is connected.
|
void |
loadXML(java.io.InputStream input)
Loads Junction, Relay, and Event data from XML.
|
void |
saveXML(java.io.OutputStream output)
Saves Junction, Relay, and Event data to XML.
|
void |
sendConnectionLabel(java.lang.String label)
Sends an NDEF connection label command to the default target.
|
void |
sendConnectionLabel(java.lang.String ip,
int port,
java.lang.String label)
Sends an NDEF connection label command to the specified IP address and port.
|
void |
sendConnectionPing()
Sends an NDEF connection ping to the default target.
|
void |
sendConnectionPing(java.lang.String ip,
int port)
Sends an NDEF connection ping to the specified IP address and port.
|
void |
sendConnectionRequest()
Sends an NDEF connection request to the IP address and port of the default target node.
|
void |
sendConnectionRequest(java.lang.String label)
Sends an NDEF connection request with a label to the IP address and port of the default target node.
|
void |
sendConnectionRequest(java.lang.String ip,
int port)
Sends an NDEF connection request to the specified IP address and port.
|
void |
sendConnectionRequest(java.lang.String ip,
int port,
java.lang.String label)
Sends an NDEF connection request with a label to the specified IP address and port.
|
void |
sendMessageAdd(java.lang.String m)
Sends an add message request to the default target.
|
void |
sendMessageAdd(java.lang.String ip,
int port,
java.lang.String message)
Sends an add message request to the specified target.
|
void |
sendMessageCount()
Sends an NDEF message count request to the default target.
|
void |
sendMessageCount(java.lang.String ip,
int port)
Sends an NDEF message count request to the specified IP address and port.
|
void |
sendMessageRemove(java.lang.String m)
Sends a remove message request to the default target.
|
void |
sendMessageRemove(java.lang.String ip,
int port,
java.lang.String message)
Sends a remove message request to the specified target.
|
void |
sendMessageReplace(java.lang.String ip,
int port,
java.lang.String oldMessage,
java.lang.String newMessage)
Sends a replace message request to the specified target.
|
void |
sendMessageReplace(java.lang.String oldM,
java.lang.String newM)
Sends a replace message request to the default target.
|
void |
sendMessageRequest()
Sends an NDEF message request to the IP address and port of the default target node.
|
void |
sendMessageRequest(java.lang.String ip,
int port)
Sends an NDEF message request to the specified IP address and port.
|
void |
startListening(int port)
Listen for incoming OSC messages on the given port.
|
void |
startListening(java.lang.String address,
int port)
Listen for incoming OSC messages on the given socket.
|
void |
stopListening()
Stop listening for incoming OSC messages.
|
public java.lang.String getLocalAddress()
public void startListening(int port)
getLocalAddress()
method.port
- the port numberpublic void startListening(java.lang.String address, int port)
address
- the IP addressport
- the port numberpublic void stopListening()
public java.lang.String getListeningAddress()
public int getListeningPort()
public void sendConnectionRequest(java.lang.String ip, int port)
ip
- the IP addressport
- the port numberpublic void sendConnectionRequest(java.lang.String ip, int port, java.lang.String label)
ip
- the IP addressport
- the port numberlabel
- the labelpublic void sendConnectionRequest()
public void sendConnectionRequest(java.lang.String label)
label
- the labelpublic boolean isConnected(java.lang.String ip, int port)
ip
- the IP address to checkport
- the port number to checkpublic boolean isConnected(Relay r)
r
- the Relay to checkpublic void sendConnectionLabel(java.lang.String ip, int port, java.lang.String label)
ip
- the IP addressport
- the port numberpublic void sendConnectionLabel(java.lang.String label)
public void sendConnectionPing(java.lang.String ip, int port)
ip
- the IP addressport
- the port numberpublic void sendConnectionPing()
public void sendMessageRequest(java.lang.String ip, int port)
ip
- the target IP addressport
- the target portpublic void sendMessageRequest()
public void sendMessageCount(java.lang.String ip, int port)
ip
- the IP addressport
- the port numberpublic void sendMessageCount()
public void sendMessageAdd(java.lang.String ip, int port, java.lang.String message)
ip
- the target IP addressport
- the target portmessage
- the message to addpublic void sendMessageAdd(java.lang.String m)
m
- the message to addpublic void sendMessageRemove(java.lang.String ip, int port, java.lang.String message)
ip
- the target IP addressport
- the target portmessage
- the message to removepublic void sendMessageRemove(java.lang.String m)
m
- the message to removepublic void sendMessageReplace(java.lang.String ip, int port, java.lang.String oldMessage, java.lang.String newMessage)
ip
- the target IP addressport
- the target portoldMessage
- the message to replacenewMessage
- the new messagepublic void sendMessageReplace(java.lang.String oldM, java.lang.String newM)
oldM
- the message to replacenewM
- the new messagepublic void acceptMessage(java.util.Date time, com.illposed.osc.OSCMessage message)
acceptMessage
in interface com.illposed.osc.OSCListener
time
- the time associated with the messagemessage
- the OSC messagepublic Relay getRelay(int r)
r
- the index of the Relaypublic Relay[] getRelays()
public int getRelayCount()
public java.lang.String[] getRejectedMessages()
public void clearRejectedMessages()
public void saveXML(java.io.OutputStream output)
output
- the file to save topublic void loadXML(java.io.InputStream input)
input
- the file to load from