View Javadoc
1   // Copyright (c) Microsoft Corporation. All rights reserved.
2   // Licensed under the MIT License.
3   
4   package com.microsoft.azure.servicebus.primitives;
5   
6   /**
7    * All TransportType switches available for communicating to EventHubs service.
8    */
9   public enum TransportType {
10      /**
11       * AMQP over TCP. Uses port 5671 - assigned by IANA for secure AMQP (AMQPS).
12       */
13      AMQP("Amqp"),
14  
15      /**
16       * AMQP over Web Sockets. Uses port 443.
17       */
18      AMQP_WEB_SOCKETS("AmqpWebSockets");
19  
20      private final String value;
21  
22      TransportType(final String value) {
23          this.value = value;
24      }
25  
26      @Override
27      public String toString() {
28          return this.value;
29      }
30  
31      static TransportType fromString(final String value) {
32          for (TransportType transportType : values()) {
33              if (transportType.value.equalsIgnoreCase(value)) {
34                  return transportType;
35              }
36          }
37  
38          throw new IllegalArgumentException();
39      }
40  }