org.fourthline.cling.model.message

## Class UpnpMessage<O extends UpnpOperation>

- java.lang.Object
- - org.fourthline.cling.model.message.UpnpMessage<O>

- Direct Known Subclasses:
    IncomingDatagramMessage, OutgoingDatagramMessage, StreamRequestMessage, StreamResponseMessage

      public abstract class UpnpMessage<O extends UpnpOperation>
      extends Object

  A non-streaming message, the interface between the transport layer and the protocols.

  Defaults to UDA version 1.0 and a string body type. Message content is not streamed, it is always read into memory and transported as a string or bytes message body.

  Subtypes of this class typically implement the integrity rules for individual UPnP messages, for example, what headers a particular message requires.

  Messages are not thread-safe.

  Author:
    Christian Bauer

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `UpnpMessage.BodyType`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `UpnpMessage(O operation)`
    `protected` | `UpnpMessage(O operation, UpnpMessage.BodyType bodyType, Object body)`
    `protected` | `UpnpMessage(UpnpMessage<O> source)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getBody()`
    `byte[]` | `getBodyBytes()`
    `String` | `getBodyString()`
    `UpnpMessage.BodyType` | `getBodyType()`
    `String` | `getContentTypeCharset()`
    `ContentTypeHeader` | `getContentTypeHeader()`
    `UpnpHeaders` | `getHeaders()`
    `O` | `getOperation()`
    `int` | `getUdaMajorVersion()`
    `int` | `getUdaMinorVersion()`
    `boolean` | `hasBody()`
    `boolean` | `hasHostHeader()`
    `boolean` | `isBodyNonEmptyString()`
    `boolean` | `isContentTypeMissingOrText()`
    `boolean` | `isContentTypeText()`
    `boolean` | `isContentTypeTextUDA()`
    `void` | `setBody(String string)`
    `void` | `setBody(UpnpMessage.BodyType bodyType, Object body)`
    `void` | `setBodyCharacters(byte[] characterData)`
    `void` | `setBodyType(UpnpMessage.BodyType bodyType)`
    `void` | `setHeaders(UpnpHeaders headers)`
    `void` | `setUdaMajorVersion(int udaMajorVersion)`
    `void` | `setUdaMinorVersion(int udaMinorVersion)`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### UpnpMessage

          protected UpnpMessage(UpnpMessage<O> source)

    - #### UpnpMessage

          protected UpnpMessage(O operation)

    - #### UpnpMessage

          protected UpnpMessage(O operation,
                                UpnpMessage.BodyType bodyType,
                                Object body)

  - ### Method Detail

    - #### getUdaMajorVersion

          public int getUdaMajorVersion()

    - #### setUdaMajorVersion

          public void setUdaMajorVersion(int udaMajorVersion)

    - #### getUdaMinorVersion

          public int getUdaMinorVersion()

    - #### setUdaMinorVersion

          public void setUdaMinorVersion(int udaMinorVersion)

    - #### getHeaders

          public UpnpHeaders getHeaders()

    - #### setHeaders

          public void setHeaders(UpnpHeaders headers)

    - #### getBody

          public Object getBody()

    - #### setBody

          public void setBody(String string)

    - #### setBody

          public void setBody(UpnpMessage.BodyType bodyType,
                              Object body)

    - #### setBodyCharacters

          public void setBodyCharacters(byte[] characterData)
                                 throws UnsupportedEncodingException

      Throws:
        `UnsupportedEncodingException`

    - #### hasBody

          public boolean hasBody()

    - #### getBodyType

          public UpnpMessage.BodyType getBodyType()

    - #### setBodyType

          public void setBodyType(UpnpMessage.BodyType bodyType)

    - #### getBodyString

          public String getBodyString()

    - #### getBodyBytes

          public byte[] getBodyBytes()

    - #### getOperation

          public O getOperation()

    - #### isContentTypeMissingOrText

          public boolean isContentTypeMissingOrText()

    - #### getContentTypeHeader

          public ContentTypeHeader getContentTypeHeader()

    - #### isContentTypeText

          public boolean isContentTypeText()

    - #### isContentTypeTextUDA

          public boolean isContentTypeTextUDA()

    - #### getContentTypeCharset

          public String getContentTypeCharset()

    - #### hasHostHeader

          public boolean hasHostHeader()

    - #### isBodyNonEmptyString

          public boolean isBodyNonEmptyString()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.