public interface P2PConnection extends Connection
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BACKEND_HOST
The ID of the remote backend host.
|
static java.lang.String |
HOST_ROLES
The mPRM host roles of the remote backend host.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(P2PConnectionListener listener)
Adds a listener which will receives notification for changing the status of this point-to-point
connection.
|
void |
close(int code)
Closes the connection.
|
java.lang.Object |
getConnectionContext(java.lang.String key)
Returns the object associated with the supplied key, or null of there is no such key.
|
ConnectionManager |
getConnectionManager()
Returns the ConnectionManager instance which is managing this point-to-point connection.
|
NetService |
getNetService(java.lang.String netServiceName)
Returns the NetService instance representing the net service with the given name registered
on the remote host.
|
java.lang.String |
getProperty(java.lang.String propertyName)
Returns the value of the basic remote backend host configuration property with a given name -
i.e.
|
java.lang.String |
getRemoteHostId()
Returns the identifier of the remote mPRM host or
null if the remote host is not mPRM
backend server. |
java.lang.String[] |
getRemoteHostRoles()
Returns the roles of the remote mPRM host or
null if the remote host is not mPRM
backend server. |
java.lang.String |
getRemoteURL()
Returns the url of the remote end point of this point-to-point connection.
|
boolean |
isClosed()
Returns if this connection is closed
|
boolean |
isConnectedToBackendHost()
Returns if the remote host of this connection is a mPRM backend server.
|
boolean |
isOriginator()
Returns
true if this connection was initiated by the local host or false if it is accepted
from the remote host |
void |
removeConnectionListener(P2PConnectionListener listener)
Removes the listener from the list of the registsred connection listeners.
|
void |
setConnectionAcceptor(java.lang.String netServiceName,
ServiceConnectionAcceptor acceptor)
Registers a Net service with a given name and associated with this net service
connection acceptor.
|
void |
setConnectionContext(java.lang.String key,
java.lang.Object context)
Associates a named object with this point-to-point connection.
|
closestatic final java.lang.String BACKEND_HOST
static final java.lang.String HOST_ROLES
java.lang.String getRemoteURL()
boolean isConnectedToBackendHost()
true if the remote host is a mPRM backend server, false otherwise (Remote
Access client).java.lang.String getRemoteHostId()
null if the remote host is not mPRM
backend server.java.lang.String[] getRemoteHostRoles()
null if the remote host is not mPRM
backend server.java.lang.String getProperty(java.lang.String propertyName)
BACKEND_HOST or HOST_ROLES.propertyName - the key of the property.boolean isOriginator()
true if this connection was initiated by the local host or false if it is accepted
from the remote hostvoid setConnectionAcceptor(java.lang.String netServiceName,
ServiceConnectionAcceptor acceptor)
ConnectionManager.setNetService(String, ServiceConnectionAcceptor) method.netServiceName - the identifier of the Net serviceacceptor - Net service specific instance which will handle connection request
in the scope of this Net service.NetService getNetService(java.lang.String netServiceName) throws java.io.IOException
NetService instance but it cannot be used until the correspodning Net
service is registered on the remote side by registering the correspodning
ServiceConnectionAcceptor.netServiceName - the name of the remote Net service.java.io.IOException - if communication level error has occured.void addConnectionListener(P2PConnectionListener listener)
listener - the listener instance.void removeConnectionListener(P2PConnectionListener listener)
listener - the listener being removed.void close(int code)
code - specifies the reason for closing the connection.boolean isClosed()
true if the connection is closed, false otherwise.void setConnectionContext(java.lang.String key,
java.lang.Object context)
key - the key of the objectcontext - the object which will be assigned to the key in the scope of this
connection object.java.lang.Object getConnectionContext(java.lang.String key)
key - the key of the association.ConnectionManager getConnectionManager()
Copyright © 2019 Bosch Software Innovations GmbH. All Rights Reserved.