Package org.apache.qpid.proton.engine.impl

# 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 final int`
`MAX_CHANNELS`

## Constructor Summary

Constructors
Constructor
Description
`ConnectionImpl()`
Application code should use `Connection.Factory.create()` instead.

## Method Summary

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()`
`String`
`getContainer()`
`Object`
`getContext()`
`String`
`getHostname()`
`String`
`getLocalContainerId()`
`int`
`getMaxChannels()`
`Reactor`
`getReactor()`
`String`
`getRemoteContainer()`
`Symbol[]`
`getRemoteDesiredCapabilities()`
`String`
`getRemoteHostname()`
`Symbol[]`
`getRemoteOfferedCapabilities()`
`Map<Symbol,Object>`
`getRemoteProperties()`
`TransportImpl`
`getTransport()`
`DeliveryImpl`
`getWorkHead()`
Returns the head of the delivery work list.
`Iterator<DeliveryImpl>`
`getWorkSequence()`
`Link`
`linkHead(EnumSet<EndpointState> local, 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(EnumSet<EndpointState> local, EnumSet<EndpointState> remote)`
Returns the head of the list of sessions in the specified states.
`void`
`setContainer(String container)`
`void`
`setContext(Object context)`
Sets an arbitrary an application owned object on the end-point.
`void`
`setDesiredCapabilities(Symbol[] capabilities)`
`void`
`setHostname(String hostname)`
Set the name of the host (either fully qualified or relative) to which this connection is connecting to.
`void`
`setLocalContainerId(String localContainerId)`
`void`
`setOfferedCapabilities(Symbol[] capabilities)`
`void`
`setProperties(Map<Symbol,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 Details

### MAX_CHANNELS

public static final int MAX_CHANNELS

See Also:
  - Constant Field Values

## Constructor Details

### ConnectionImpl

public ConnectionImpl()
Application code should use `Connection.Factory.create()` instead.

## Method Details

### 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 interface `Connection`
Specified by:
  `session` in interface `ProtonJConnection`

### 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(EnumSet<EndpointState> local, 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 interface `Connection`
See Also:
  - `Session.next(EnumSet, EnumSet)`

### linkHead

public Link linkHead(EnumSet<EndpointState> local, 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 interface `Connection`
See Also:
  - `Link.next(EnumSet, EnumSet)`

### getConnectionImpl

protected ConnectionImpl getConnectionImpl()

Specified by:
  `getConnectionImpl` in class `EndpointImpl`

### getMaxChannels

public int getMaxChannels()

Specified by:
  `getMaxChannels` in interface `ProtonJConnection`

### getLocalContainerId

public String getLocalContainerId()

### setLocalContainerId

public void setLocalContainerId(String localContainerId)

Specified by:
  `setLocalContainerId` in interface `ProtonJConnection`

### 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 interface `Connection`
See Also:
  - `Receiver.recv(byte[], int, int)`
  - `Delivery.settle()`
  - `Delivery.getWorkNext()`

### setContainer

public void setContainer(String container)

Specified by:
  `setContainer` in interface `Connection`

### getContainer

public String getContainer()

Specified by:
  `getContainer` in interface `Connection`

### setHostname

public void setHostname(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 interface `Connection`
Parameters:
  `hostname` - the RFC1035 compliant host name.

### getRemoteContainer

public String getRemoteContainer()

Specified by:
  `getRemoteContainer` in interface `Connection`

### getRemoteHostname

public String getRemoteHostname()

Specified by:
  `getRemoteHostname` in interface `Connection`

### setOfferedCapabilities

public void setOfferedCapabilities(Symbol[] capabilities)

Specified by:
  `setOfferedCapabilities` in interface `Connection`

### setDesiredCapabilities

public void setDesiredCapabilities(Symbol[] capabilities)

Specified by:
  `setDesiredCapabilities` in interface `Connection`

### getRemoteOfferedCapabilities

public Symbol[] getRemoteOfferedCapabilities()

Specified by:
  `getRemoteOfferedCapabilities` in interface `Connection`

### getRemoteDesiredCapabilities

public Symbol[] getRemoteDesiredCapabilities()

Specified by:
  `getRemoteDesiredCapabilities` in interface `Connection`

### setProperties

public void setProperties(Map<Symbol,Object> properties)

Specified by:
  `setProperties` in interface `Connection`

### getRemoteProperties

public Map<Symbol,Object> getRemoteProperties()

Specified by:
  `getRemoteProperties` in interface `Connection`

### getHostname

public String getHostname()

Specified by:
  `getHostname` in interface `Connection`

### getWorkSequence

public Iterator<DeliveryImpl> getWorkSequence()

### getTransport

public TransportImpl getTransport()

Specified by:
  `getTransport` in interface `Connection`

### removeTransportWork

public void removeTransportWork(DeliveryImpl delivery)

### getContext

public Object getContext()

Specified by:
  `getContext` in interface `Connection`
Specified by:
  `getContext` in interface `Endpoint`
Overrides:
  `getContext` in class `EndpointImpl`
See Also:
  - `Endpoint.setContext(Object)`

### setContext

public void setContext(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 interface `Connection`
Specified by:
  `setContext` in interface `Endpoint`
Overrides:
  `setContext` in class `EndpointImpl`

### collect

public void collect(Collector collector)

Specified by:
  `collect` in interface `Connection`

### getReactor

public Reactor getReactor()

Specified by:
  `getReactor` in interface `Connection`

### setReactor

public void setReactor(Reactor reactor)