de.hfu.anybeam.networkCore

## Class NetworkEnvironmentSettings

- java.lang.Object
- - de.hfu.anybeam.networkCore.NetworkEnvironmentSettings

-     public class NetworkEnvironmentSettings
      extends java.lang.Object

  A class containing all necessary settings for an `NetworkEnvironment`
  Since:
    1.0
  Version:
    1.0
  Author:
    chrwuer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetworkEnvironmentSettings(java.io.InputStream savedInstace)` Creates a new `NetworkEnvironmentSettings` instance using the saved information in the `InputStream`.
    `NetworkEnvironmentSettings(java.lang.String deviceName, DeviceType deviceType, EncryptionType encryptionType, int dataPort, int braocastPort, byte[] encryptionKey)` Creates a new `NetworkEnvironmentSettings` instance guessing the operating system (will use 'Linux' for Android).
    `NetworkEnvironmentSettings(java.lang.String deviceName, DeviceType deviceType, EncryptionType encryptionType, int dataPort, int braocastPort, byte[] encryptionKey, java.lang.String osName)` Creates a new `NetworkEnvironmentSettings` instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getBroadcastPort()` Returns the port o which broadcasts are send.
    `int` | `getDataPort()` Returns the port on which data is transmitted.
    `java.lang.String` | `getDeviceName()` Returns the device name.
    `DeviceType` | `getDeviceType()` Returns the `DeviceType`.
    `byte[]` | `getEncryptionKey()` Returns the encryption key used.
    `EncryptionType` | `getEncryptionType()` Returns the `EncryptionType` used.
    `java.lang.String` | `getLocalId()` Returns the local id.
    `java.lang.String` | `getOsName()` Returns the operating system's name.
    `void` | `save(java.io.OutputStream out)` Saves this `NetworkEnvironmentSettings` instance to the `OutputStream`.

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

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

- - ### Constructor Detail

    - #### NetworkEnvironmentSettings

          public NetworkEnvironmentSettings(java.io.InputStream savedInstace)
                                     throws java.lang.Exception

      Creates a new `NetworkEnvironmentSettings` instance using the saved information in the `InputStream`. The `InputStream` is not closed. Please close the give `InputStream` after invoking this constructor.
      Parameters:
        `savedInstace` - a `InputStream` containing a saved instance, e.g. a `FileInputStream` to a save file
      Throws:
        `java.lang.Exception`
      See Also:
        `#save(OutputStream)}`

    - #### NetworkEnvironmentSettings

          public NetworkEnvironmentSettings(java.lang.String deviceName,
                                    DeviceType deviceType,
                                    EncryptionType encryptionType,
                                    int dataPort,
                                    int braocastPort,
                                    byte[] encryptionKey)

      Creates a new `NetworkEnvironmentSettings` instance guessing the operating system (will use 'Linux' for Android).
      Parameters:
        `groupName` - the name of the group
        `deviceName` - the name of the device
        `deviceType` - the name of the type
        `encryptionType` - the type of the encryption
        `dataPort` - the port on which data is transmitted
        `braocastPort` - the port for broadcast messages
        `encryptionKey` - the encryption key used

    - #### NetworkEnvironmentSettings

          public NetworkEnvironmentSettings(java.lang.String deviceName,
                                    DeviceType deviceType,
                                    EncryptionType encryptionType,
                                    int dataPort,
                                    int braocastPort,
                                    byte[] encryptionKey,
                                    java.lang.String osName)

      Creates a new `NetworkEnvironmentSettings` instance.
      Parameters:
        `groupName` - the name of the group
        `deviceName` - the name of the device
        `deviceType` - the name of the type
        `encryptionType` - the type of the encryption
        `dataPort` - the port on which data is transmitted
        `braocastPort` - the port for broadcast messages
        `encryptionKey` - the encryption key used
        `osName` - the name of the operating system

  - ### Method Detail

    - #### save

          public void save(java.io.OutputStream out)
                    throws java.lang.Exception

      Saves this `NetworkEnvironmentSettings` instance to the `OutputStream`. The given `OutputStream` is never closed, please close the `OutputStream` after invoking this method if necessary.
      Parameters:
        `out` - a `OutputStream` to a resource which saves the data, e.g. a `FileOutputStream` to a save file.
      Throws:
        `java.lang.Exception`
      See Also:
        `#NetworkEnvironmentSettings(InputStream)}`

    - #### getDataPort

          public int getDataPort()

      Returns the port on which data is transmitted.
      Returns:
        the port on which data is transmitted

    - #### getBroadcastPort

          public int getBroadcastPort()

      Returns the port o which broadcasts are send.
      Returns:
        the port o which broadcasts are send

    - #### getDeviceName

          public java.lang.String getDeviceName()

      Returns the device name.
      Returns:
        the device name

    - #### getDeviceType

          public DeviceType getDeviceType()

      Returns the `DeviceType`.
      Returns:
        the `DeviceType`

    - #### getOsName

          public java.lang.String getOsName()

      Returns the operating system's name.
      Returns:
        the operating system's name

    - #### getLocalId

          public java.lang.String getLocalId()

      Returns the local id.
      Returns:
        the local id

    - #### getEncryptionType

          public EncryptionType getEncryptionType()

      Returns the `EncryptionType` used.
      Returns:
        the `EncryptionType` used

    - #### getEncryptionKey

          public byte[] getEncryptionKey()

      Returns the encryption key used.
      Returns:
        the encryption key used