org.openmuc.josistack

## Class AcseAssociation

- java.lang.Object
- - org.openmuc.josistack.AcseAssociation

    public final class AcseAssociation
    extends java.lang.Object

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `accept(java.nio.ByteBuffer payload)` A server that got an Association Request Indication may use this function to accept the association.
`void` `close()` Closes the connection simply by closing the socket.
`void` `disconnect()` Disconnects by sending a disconnect request at the Transport Layer and then closing the socket.
`java.nio.ByteBuffer` `getAssociateResponseAPdu()`
`int` `getMessageTimeout()`
`static java.lang.String` `getSPDUTypeString(byte spduType)`
`byte[]` `receive(java.nio.ByteBuffer pduBuffer)` Listens for a new PDU and writes it into the given buffer.
`void` `send(java.nio.ByteBuffer payload)`
`void` `setMessageTimeout(int i)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### accept

    public void accept(java.nio.ByteBuffer payload)
                throws java.io.IOException

A server that got an Association Request Indication may use this function to accept the association.

Parameters:
  `payload` - the payload to send with the accept message
Throws:
  `java.io.IOException` - if an error occures accepting the association

#### getAssociateResponseAPdu

    public java.nio.ByteBuffer getAssociateResponseAPdu()

#### send

    public void send(java.nio.ByteBuffer payload)
              throws java.io.IOException

Throws:
  `java.io.IOException`

#### receive

    public byte[] receive(java.nio.ByteBuffer pduBuffer)
                   throws DecodingException,
                          java.io.IOException,
                          java.util.concurrent.TimeoutException

Listens for a new PDU and writes it into the given buffer. Decodes all ACSE and lower layer headers. The resulting buffer's position points to the beginning of the ACSE SDU. The limit will point to the byte after the last byte of the ACSE SDU.

Parameters:
  `pduBuffer` - buffer to write the received pdu into
Throws:
  `DecodingException` - if a decoding error occurs
  `java.io.IOException` - if a non recoverable error occurs. Afterwards the association should be closed by the user
  `java.util.concurrent.TimeoutException` - if a timeout occurs

#### disconnect

    public void disconnect()

Disconnects by sending a disconnect request at the Transport Layer and then closing the socket.

#### close

    public void close()

Closes the connection simply by closing the socket.

#### getMessageTimeout

    public int getMessageTimeout()

#### setMessageTimeout

    public void setMessageTimeout(int i)

#### getSPDUTypeString

    public static java.lang.String getSPDUTypeString(byte spduType)