1 11 12 package org.jivesoftware.messenger; 13 14 import java.util.Iterator ; 15 import java.util.ArrayList ; 16 17 24 public class ServerPort { 25 26 private int port; 27 private String interfaceName; 28 private ArrayList names; 29 private String address; 30 private boolean secure; 31 private String algorithm; 32 private Type type; 33 34 public ServerPort(int port, String interfaceName, String name, String address, 35 boolean isSecure, String algorithm, Type type) 36 { 37 this.port = port; 38 this.interfaceName = interfaceName; 39 this.names = new ArrayList (1); 40 this.names.add(name); 41 this.address = address; 42 this.secure = isSecure; 43 this.algorithm = algorithm; 44 this.type = type; 45 } 46 47 52 public int getPort() { 53 return port; 54 } 55 56 public String getInterfaceName() { 57 return interfaceName; 58 } 59 60 67 public Iterator getDomainNames() { 68 return names.iterator(); 69 } 70 71 76 public String getIPAddress() { 77 return address; 78 } 79 80 85 public boolean isSecure() { 86 return secure; 87 } 88 89 95 public String getSecurityType() { 96 return algorithm; 97 } 98 99 104 public boolean isServerPort() { 105 return type == Type.server; 106 } 107 108 113 public boolean isClientPort() { 114 return type == Type.client; 115 } 116 117 122 public boolean isComponentPort() { 123 return type == Type.component; 124 } 125 126 public static enum Type { 127 client, 128 129 server, 130 131 component; 132 } 133 } 134 | Popular Tags |