Class ConnectionImpl
- java.lang.Object
-
- org.apache.qpid.proton.engine.impl.EndpointImpl
-
- org.apache.qpid.proton.engine.impl.ConnectionImpl
-
- All Implemented Interfaces:
Connection
,Endpoint
,Extendable
,ProtonJConnection
,ProtonJEndpoint
,ReactorChild
public class ConnectionImpl extends EndpointImpl implements ProtonJConnection
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.qpid.proton.engine.Connection
Connection.Factory
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_CHANNELS
-
Constructor Summary
Constructors Constructor Description ConnectionImpl()
Application code should useConnection.Factory.create()
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.qpid.proton.engine.impl.LinkNode<LinkImpl>
addLinkEndpoint(LinkImpl endpoint)
protected org.apache.qpid.proton.engine.impl.LinkNode<SessionImpl>
addSessionEndpoint(SessionImpl endpoint)
void
collect(Collector collector)
protected ConnectionImpl
getConnectionImpl()
java.lang.String
getContainer()
java.lang.Object
getContext()
java.lang.String
getHostname()
java.lang.String
getLocalContainerId()
int
getMaxChannels()
Reactor
getReactor()
java.lang.String
getRemoteContainer()
Symbol[]
getRemoteDesiredCapabilities()
java.lang.String
getRemoteHostname()
Symbol[]
getRemoteOfferedCapabilities()
java.util.Map<Symbol,java.lang.Object>
getRemoteProperties()
TransportImpl
getTransport()
DeliveryImpl
getWorkHead()
Returns the head of the delivery work list.java.util.Iterator<DeliveryImpl>
getWorkSequence()
Link
linkHead(java.util.EnumSet<EndpointState> local, java.util.EnumSet<EndpointState> remote)
Returns the head of the list of links in the specified states.void
removeTransportWork(DeliveryImpl delivery)
SessionImpl
session()
Returns a newly created session TODO does the Connection's channel-max property limit how many sessions can be created, or opened, or neither?Session
sessionHead(java.util.EnumSet<EndpointState> local, java.util.EnumSet<EndpointState> remote)
Returns the head of the list of sessions in the specified states.void
setContainer(java.lang.String container)
void
setContext(java.lang.Object context)
Sets an arbitrary an application owned object on the end-point.void
setDesiredCapabilities(Symbol[] capabilities)
void
setHostname(java.lang.String hostname)
Set the name of the host (either fully qualified or relative) to which this connection is connecting to.void
setLocalContainerId(java.lang.String localContainerId)
void
setOfferedCapabilities(Symbol[] capabilities)
void
setProperties(java.util.Map<Symbol,java.lang.Object> properties)
void
setReactor(Reactor reactor)
-
Methods inherited from class org.apache.qpid.proton.engine.impl.EndpointImpl
attachments, close, free, getCondition, getLocalState, getRemoteCondition, getRemoteState, open, setCondition
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.proton.engine.Endpoint
close, free, getCondition, getLocalState, getRemoteCondition, getRemoteState, open, setCondition
-
Methods inherited from interface org.apache.qpid.proton.engine.Extendable
attachments
-
Methods inherited from interface org.apache.qpid.proton.reactor.ReactorChild
free
-
-
-
-
Field Detail
-
MAX_CHANNELS
public static final int MAX_CHANNELS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConnectionImpl
public ConnectionImpl()
Application code should useConnection.Factory.create()
instead.
-
-
Method Detail
-
session
public SessionImpl session()
Description copied from interface:Connection
Returns a newly created session TODO does the Connection's channel-max property limit how many sessions can be created, or opened, or neither?- Specified by:
session
in interfaceConnection
- Specified by:
session
in interfaceProtonJConnection
-
addSessionEndpoint
protected org.apache.qpid.proton.engine.impl.LinkNode<SessionImpl> addSessionEndpoint(SessionImpl endpoint)
-
addLinkEndpoint
protected org.apache.qpid.proton.engine.impl.LinkNode<LinkImpl> addLinkEndpoint(LinkImpl endpoint)
-
sessionHead
public Session sessionHead(java.util.EnumSet<EndpointState> local, java.util.EnumSet<EndpointState> remote)
Description copied from interface:Connection
Returns the head of the list of sessions in the specified states. Typically used to discover sessions whose remote state has acquired particular values, e.g. sessions that have been remotely opened or closed. TODO what ordering guarantees on the returned "linked list" are provided?- Specified by:
sessionHead
in interfaceConnection
- See Also:
Session.next(EnumSet, EnumSet)
-
linkHead
public Link linkHead(java.util.EnumSet<EndpointState> local, java.util.EnumSet<EndpointState> remote)
Description copied from interface:Connection
Returns the head of the list of links in the specified states. Typically used to discover links whose remote state has acquired particular values, e.g. links that have been remotely opened or closed.- Specified by:
linkHead
in interfaceConnection
- See Also:
Link.next(EnumSet, EnumSet)
-
getConnectionImpl
protected ConnectionImpl getConnectionImpl()
- Specified by:
getConnectionImpl
in classEndpointImpl
-
getMaxChannels
public int getMaxChannels()
- Specified by:
getMaxChannels
in interfaceProtonJConnection
-
getLocalContainerId
public java.lang.String getLocalContainerId()
-
setLocalContainerId
public void setLocalContainerId(java.lang.String localContainerId)
- Specified by:
setLocalContainerId
in interfaceProtonJConnection
-
getWorkHead
public DeliveryImpl getWorkHead()
Description copied from interface:Connection
Returns the head of the delivery work list. The delivery work list consists of unsettled deliveries whose state has been changed by the other container and not yet locally processed.- Specified by:
getWorkHead
in interfaceConnection
- See Also:
Receiver.recv(byte[], int, int)
,Delivery.settle()
,Delivery.getWorkNext()
-
setContainer
public void setContainer(java.lang.String container)
- Specified by:
setContainer
in interfaceConnection
-
getContainer
public java.lang.String getContainer()
- Specified by:
getContainer
in interfaceConnection
-
setHostname
public void setHostname(java.lang.String hostname)
Description copied from interface:Connection
Set the name of the host (either fully qualified or relative) to which this connection is connecting to. This information may be used by the remote peer to determine the correct back-end service to connect the client to. This value will be sent in the Open performative. Note that it is illegal to set the hostname to a numeric IP address or include a port number.- Specified by:
setHostname
in interfaceConnection
- Parameters:
hostname
- the RFC1035 compliant host name.
-
getRemoteContainer
public java.lang.String getRemoteContainer()
- Specified by:
getRemoteContainer
in interfaceConnection
-
getRemoteHostname
public java.lang.String getRemoteHostname()
- Specified by:
getRemoteHostname
in interfaceConnection
-
setOfferedCapabilities
public void setOfferedCapabilities(Symbol[] capabilities)
- Specified by:
setOfferedCapabilities
in interfaceConnection
-
setDesiredCapabilities
public void setDesiredCapabilities(Symbol[] capabilities)
- Specified by:
setDesiredCapabilities
in interfaceConnection
-
getRemoteOfferedCapabilities
public Symbol[] getRemoteOfferedCapabilities()
- Specified by:
getRemoteOfferedCapabilities
in interfaceConnection
-
getRemoteDesiredCapabilities
public Symbol[] getRemoteDesiredCapabilities()
- Specified by:
getRemoteDesiredCapabilities
in interfaceConnection
-
setProperties
public void setProperties(java.util.Map<Symbol,java.lang.Object> properties)
- Specified by:
setProperties
in interfaceConnection
-
getRemoteProperties
public java.util.Map<Symbol,java.lang.Object> getRemoteProperties()
- Specified by:
getRemoteProperties
in interfaceConnection
-
getHostname
public java.lang.String getHostname()
- Specified by:
getHostname
in interfaceConnection
-
getWorkSequence
public java.util.Iterator<DeliveryImpl> getWorkSequence()
-
getTransport
public TransportImpl getTransport()
- Specified by:
getTransport
in interfaceConnection
-
removeTransportWork
public void removeTransportWork(DeliveryImpl delivery)
-
getContext
public java.lang.Object getContext()
- Specified by:
getContext
in interfaceConnection
- Specified by:
getContext
in interfaceEndpoint
- Overrides:
getContext
in classEndpointImpl
- See Also:
Endpoint.setContext(Object)
-
setContext
public void setContext(java.lang.Object context)
Description copied from interface:Endpoint
Sets an arbitrary an application owned object on the end-point. This object is not used by Proton.- Specified by:
setContext
in interfaceConnection
- Specified by:
setContext
in interfaceEndpoint
- Overrides:
setContext
in classEndpointImpl
-
collect
public void collect(Collector collector)
- Specified by:
collect
in interfaceConnection
-
getReactor
public Reactor getReactor()
- Specified by:
getReactor
in interfaceConnection
-
setReactor
public void setReactor(Reactor reactor)
-
-