1 17 package org.alfresco.filesys.smb; 18 19 import org.alfresco.filesys.util.*; 20 21 24 public class ServerType 25 { 26 27 29 public static final int WorkStation = 0x00000001; 30 public static final int Server = 0x00000002; 31 public static final int SQLServer = 0x00000004; 32 public static final int DomainCtrl = 0x00000008; 33 public static final int DomainBakCtrl = 0x00000010; 34 public static final int TimeSource = 0x00000020; 35 public static final int AFPServer = 0x00000040; 36 public static final int NovellServer = 0x00000080; 37 public static final int DomainMember = 0x00000100; 38 public static final int PrintServer = 0x00000200; 39 public static final int DialinServer = 0x00000400; 40 public static final int UnixServer = 0x00000800; 41 public static final int NTServer = 0x00001000; 42 public static final int WfwServer = 0x00002000; 43 public static final int MFPNServer = 0x00004000; 44 public static final int NTNonDCServer = 0x00008000; 45 public static final int PotentialBrowse = 0x00010000; 46 public static final int BackupBrowser = 0x00020000; 47 public static final int MasterBrowser = 0x00040000; 48 public static final int DomainMaster = 0x00080000; 49 public static final int OSFServer = 0x00100000; 50 public static final int VMSServer = 0x00200000; 51 public static final int Win95Plus = 0x00400000; 52 public static final int DFSRoot = 0x00800000; 53 public static final int NTCluster = 0x01000000; 54 public static final int TerminalServer = 0x02000000; 55 public static final int DCEServer = 0x10000000; 56 public static final int AlternateXport = 0x20000000; 57 public static final int LocalListOnly = 0x40000000; 58 59 public static final int DomainEnum = 0x80000000; 60 61 63 private static final String [] _srvType = { 64 "Workstation", 65 "Server", 66 "SQLServer", 67 "DomainController", 68 "BackupDomainController", 69 "TimeSource", 70 "AFPServer", 71 "NovellServer", 72 "DomainMember", 73 "PrintServer", 74 "DialinServer", 75 "UnixServer", 76 "NTServer", 77 "WfwServer", 78 "MFPNServer", 79 "NtNonDCServer", 80 "PotentialBrowse", 81 "BackupBrowser", 82 "MasterBrowser", 83 "DomainMaster", 84 "OSFServer", 85 "VMSServer", 86 "Win95Plus", 87 "DFSRoot", 88 "NTCluster", 89 "TerminalServer", 90 "", 91 "", 92 "DCEServer" }; 93 94 100 public static final StringList TypeAsStrings(int typ) 101 { 102 104 StringList strs = new StringList(); 105 106 108 for (int i = 0; i < _srvType.length; i++) 109 { 110 112 int mask = 1 << i; 113 if ((typ & mask) != 0) 114 strs.addString(_srvType[i]); 115 } 116 117 119 return strs; 120 } 121 122 128 public static final boolean isWorkStation(int typ) 129 { 130 return (typ & WorkStation) != 0 ? true : false; 131 } 132 133 139 public static final boolean isServer(int typ) 140 { 141 return (typ & Server) != 0 ? true : false; 142 } 143 144 150 public static final boolean isSQLServer(int typ) 151 { 152 return (typ & SQLServer) != 0 ? true : false; 153 } 154 155 161 public static final boolean isDomainController(int typ) 162 { 163 return (typ & DomainCtrl) != 0 ? true : false; 164 } 165 166 172 public static final boolean isBackupDomainController(int typ) 173 { 174 return (typ & DomainBakCtrl) != 0 ? true : false; 175 } 176 177 183 public static final boolean isTimeSource(int typ) 184 { 185 return (typ & TimeSource) != 0 ? true : false; 186 } 187 188 194 public static final boolean isAFPServer(int typ) 195 { 196 return (typ & AFPServer) != 0 ? true : false; 197 } 198 199 205 public static final boolean isNovellServer(int typ) 206 { 207 return (typ & NovellServer) != 0 ? true : false; 208 } 209 210 216 public static final boolean isDomainMember(int typ) 217 { 218 return (typ & DomainMember) != 0 ? true : false; 219 } 220 221 227 public static final boolean isPrintServer(int typ) 228 { 229 return (typ & PrintServer) != 0 ? true : false; 230 } 231 232 238 public static final boolean isDialinServer(int typ) 239 { 240 return (typ & DialinServer) != 0 ? true : false; 241 } 242 243 249 public static final boolean isUnixServer(int typ) 250 { 251 return (typ & UnixServer) != 0 ? true : false; 252 } 253 254 260 public static final boolean isNTServer(int typ) 261 { 262 return (typ & NTServer) != 0 ? true : false; 263 } 264 265 271 public static final boolean isWFWServer(int typ) 272 { 273 return (typ & WfwServer) != 0 ? true : false; 274 } 275 276 282 public static final boolean isMFPNServer(int typ) 283 { 284 return (typ & MFPNServer) != 0 ? true : false; 285 } 286 287 293 public static final boolean isNTNonDomainServer(int typ) 294 { 295 return (typ & NTNonDCServer) != 0 ? true : false; 296 } 297 298 304 public static final boolean isPotentialBrowseMaster(int typ) 305 { 306 return (typ & PotentialBrowse) != 0 ? true : false; 307 } 308 309 315 public static final boolean isBackupBrowser(int typ) 316 { 317 return (typ & BackupBrowser) != 0 ? true : false; 318 } 319 320 326 public static final boolean isBrowserMaster(int typ) 327 { 328 return (typ & MasterBrowser) != 0 ? true : false; 329 } 330 331 337 public static final boolean isDomainMaster(int typ) 338 { 339 return (typ & DomainMaster) != 0 ? true : false; 340 } 341 342 348 public static final boolean isOSFServer(int typ) 349 { 350 return (typ & OSFServer) != 0 ? true : false; 351 } 352 353 359 public static final boolean isVMSServer(int typ) 360 { 361 return (typ & VMSServer) != 0 ? true : false; 362 } 363 364 370 public static final boolean isWin95Plus(int typ) 371 { 372 return (typ & Win95Plus) != 0 ? true : false; 373 } 374 375 381 public static final boolean isDFSRoot(int typ) 382 { 383 return (typ & DFSRoot) != 0 ? true : false; 384 } 385 386 392 public static final boolean isNTCluster(int typ) 393 { 394 return (typ & NTCluster) != 0 ? true : false; 395 } 396 397 403 public static final boolean isTerminalServer(int typ) 404 { 405 return (typ & TerminalServer) != 0 ? true : false; 406 } 407 408 414 public static final boolean isDCEServer(int typ) 415 { 416 return (typ & DCEServer) != 0 ? true : false; 417 } 418 } 419 | Popular Tags |