All Packages Class Hierarchy This Package Previous Next Index
Class uhr.core.msg.ConnectionStd
java.lang.Object
|
+----uhr.core.msg.ConnectionStd
- public class ConnectionStd
- extends Object
- implements Connection,
Serializable
This class describes a single connection between parts in a
cell and the cell's MessageRouter. It is used to connect and
disconnect connections, as well as describe existing connections.
It is immutable.
-
ConnectionStd()
- A no-arg constructor for misc use and serialization.
-
ConnectionStd(int,
String, String, String, MessageSender, MessageReceiver)
- Creates a connection from the arguments.
-
convertTypeToConstant(String)
- Returns the connection constant given its String representation.
-
getConnectionType()
- Returns the connection type.
-
getConnectionTypeString()
- Returns the String for the connection type constant.
-
getMessageName()
- Returns the message name.
-
getMessageReceiver()
- Returns the receiver or null if a sender connection.
-
getMessageSender()
- Returns the sender or null if a receiver connection.
-
getReceiverName()
- Returns the receiver name or null if a sender connection.
-
getSenderName()
- Returns the sender name or null if a receiver connection.
-
isDirectConnection()
- Determines whether this is a direct connection.
-
isReceiverConnection()
- Determines whether this is a receiver connection.
-
isSenderConnection()
- Determines whether this is a sender connection.
-
toString()
- Converts the Connection to an easily readable String representation.
ConnectionStd
public ConnectionStd(int connectionType,
String messageName,
String senderName,
String receiverName,
MessageSender sender,
MessageReceiver receiver)
- Creates a connection from the arguments.
The type and messagename are required. Either senderName and
sender or receiverName and receiver is required, or both can be
supplied for a DIRECT
connection. The type must be SIGNAL_OUT, SIGNAL_IN,
SERVICE_NEED, INTEREST_OUT, INTEREST_IN, SERVICE_SUPPLIER or
DIRECT.
- Parameters:
- type - the type of connection must be one the SIGNAL_OUT,
SIGNAL_IN, SERVICE_NEED, INTEREST_OUT, INTEREST_IN,
SERVICE_SUPPLIER or DIRECT constants in Connection.
- messageName - the name of the message.
- senderName - the name of the sender part.
- receiverName - the name of the receiver part.
- sender - the message sender, required for connection
types SIGNAL_OUT, SIGNAL_IN, SERVICE_NEED or DIRECT.
- receiver - the message receiver, required for connection
types INTEREST_OUT, INTEREST_IN, SERVICE_SUPPLIER or DIRECT.
- Throws: IllegalArgumentException
- if the arguments are
inconsistent.
ConnectionStd
public ConnectionStd()
- A no-arg constructor for misc use and serialization.
isSenderConnection
public boolean isSenderConnection()
- Determines whether this is a sender connection.
- Returns:
- true is this is a sender connection, false if not.
isReceiverConnection
public boolean isReceiverConnection()
- Determines whether this is a receiver connection.
- Returns:
- true is this is a receiver connection, false if not.
isDirectConnection
public boolean isDirectConnection()
- Determines whether this is a direct connection.
- Returns:
- true is this is a direct connection, false if not.
getMessageName
public String getMessageName()
- Returns the message name.
- Returns:
- the the message name.
getConnectionType
public int getConnectionType()
- Returns the connection type.
- Returns:
- the connection type.
getConnectionTypeString
public String getConnectionTypeString()
- Returns the String for the connection type constant. For example
if the type is Connection.DIRECT then "DIRECT" is returned.
- Returns:
- the String for the connection type constant.
convertTypeToConstant
public int convertTypeToConstant(String connectionType)
- Returns the connection constant given its String representation.
For example if given "DIRECT" then Connection.DIRECT is returned.
- Returns:
- the connection constant for the String.
getSenderName
public String getSenderName()
- Returns the sender name or null if a receiver connection.
- Returns:
- the sender name or null if a receiver connection.
getReceiverName
public String getReceiverName()
- Returns the receiver name or null if a sender connection.
- Returns:
- the receiver name or null if a sender connection.
getMessageSender
public MessageSender getMessageSender()
- Returns the sender or null if a receiver connection.
- Returns:
- the sender or null if a receiver connection.
getMessageReceiver
public MessageReceiver getMessageReceiver()
- Returns the receiver or null if a sender connection.
- Returns:
- the receiver or null if a sender connection.
toString
public String toString()
- Converts the Connection to an easily readable String representation.
- Returns:
- the representation in a consistent style.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index