ClusterHostUtil
public
class
ClusterHostUtil
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.cluster.ClusterHostUtil |
ฟังก์ชันยูทิลิตีแบบคงที่สําหรับคลัสเตอร์ TF เพื่อรับอินสแตนซ์การกําหนดค่าส่วนกลาง ข้อมูลโฮสต์ ฯลฯ
สรุป
ตัวสร้างแบบสาธารณะ | |
|---|---|
ClusterHostUtil()
|
|
เมธอดสาธารณะ | |
|---|---|
static
IClusterClient
|
getClusterClient()
รับอินสแตนซ์ |
static
IClusterOptions
|
getClusterOptions()
รับอินสแตนซ์ |
static
long
|
getCurrentTimeMillis()
แสดงผลเวลาปัจจุบันของระบบ |
static
String
|
getHostIpAddress()
รับที่อยู่ IP |
static
String
|
getHostName()
รับชื่อโฮสต์ |
static
String
|
getLocalDeviceSerial(String serial)
แสดงผลซีเรียลของอุปกรณ์ในเครื่องสำหรับซีเรียลของอุปกรณ์ที่ไม่ซ้ำกันที่กำหนด |
static
String
|
getRunTarget(DeviceDescriptor device, String runTargetFormat,
แสดงผลเป้าหมายการเรียกใช้สำหรับตัวระบุอุปกรณ์ที่ระบุ |
static
String
|
getTestHarness()
|
static
long
|
getTfStartTimeMillis()
|
static
String
|
getTfVersion()
รับเวอร์ชัน TF ที่ทำงานบนโฮสต์นี้ |
static
String
|
getUniqueDeviceSerial(DeviceDescriptor device)
แสดงผลซีเรียลอุปกรณ์ที่ไม่ซ้ำกันสำหรับอุปกรณ์ |
static
boolean
|
isLocalhostIpPort(String input)
ตรวจสอบว่าอินพุตที่ระบุเป็นสตริง IP:PORT ของ localhost หรือไม่ |
วิธีการที่มีการป้องกัน | |
|---|---|
static
String
|
toValidTfVersion(String version)
ตรวจสอบเวอร์ชัน TF และแสดงผลหากถูกต้อง |
ตัวสร้างแบบสาธารณะ
ClusterHostUtil
public ClusterHostUtil ()
เมธอดสาธารณะ
getClusterClient
public static IClusterClient getClusterClient ()
รับอินสแตนซ์ IClusterClient ที่ใช้ในการโต้ตอบกับแบ็กเอนด์ TFC
| คิกรีเทิร์น | |
|---|---|
IClusterClient |
|
getClusterOptions
public static IClusterOptions getClusterOptions ()
รับอินสแตนซ์ IClusterOptions ที่ใช้จัดเก็บการตั้งค่าที่เกี่ยวข้องกับคลัสเตอร์
| คิกรีเทิร์น | |
|---|---|
IClusterOptions |
|
getCurrentTimeMillis
public static long getCurrentTimeMillis ()
แสดงผลเวลาปัจจุบันของระบบ
| คิกรีเทิร์น | |
|---|---|
long |
เวลาในหน่วยมิลลิวินาที |
getHostIpAddress
public static String getHostIpAddress ()
รับที่อยู่ IP
| คิกรีเทิร์น | |
|---|---|
String |
สตริงที่อยู่ IPV4 หรือ "UNKNOWN" หากเราดึงข้อมูลไม่ได้ |
getHostName
public static String getHostName ()
รับชื่อโฮสต์
1. ลองรับชื่อโฮสต์จาก InetAddress 2. หากไม่สำเร็จ ให้ลองรับชื่อโฮสต์จากสภาพแวดล้อม HOSTNAME 3. หากไม่ได้ตั้งค่าไว้ ให้สร้างชื่อโฮสต์ที่ไม่ซ้ำกัน
| คิกรีเทิร์น | |
|---|---|
String |
ชื่อโฮสต์ หรือเป็นค่า Null หากดึงข้อมูลไม่ได้ |
getLocalDeviceSerial
public static String getLocalDeviceSerial (String serial)
แสดงผลซีเรียลของอุปกรณ์ในเครื่องสำหรับซีเรียลของอุปกรณ์ที่ไม่ซ้ำกันที่กำหนด
TFC ส่งหมายเลขซีเรียลที่ไม่ซ้ำกันของอุปกรณ์สำหรับอุปกรณ์ที่จับต้องไม่ได้ซึ่ง TF ไม่เข้าใจ วิธีนี้จะแปลงหมายเลขดังกล่าวกลับเป็นหมายเลขซีเรียลของอุปกรณ์ในเครื่อง
| พารามิเตอร์ | |
|---|---|
serial |
String: ซีเรียลอุปกรณ์ที่ไม่ซ้ำกันจาก TFC |
| คิกรีเทิร์น | |
|---|---|
String |
หมายเลขซีเรียลของอุปกรณ์ |
getRunTarget
public static String getRunTarget (DeviceDescriptor device, String runTargetFormat,deviceTags)
แสดงผลเป้าหมายการเรียกใช้สำหรับตัวระบุอุปกรณ์ที่ระบุ
| พารามิเตอร์ | |
|---|---|
device |
DeviceDescriptor: DeviceDescriptor เพื่อดูเป้าหมายการเรียกใช้ |
runTargetFormat |
String |
deviceTags |
|
| คิกรีเทิร์น | |
|---|---|
String |
เป้าหมายการเรียกใช้ |
getTestHarness
public static String getTestHarness ()
| คิกรีเทิร์น | |
|---|---|
String |
|
getTfStartTimeMillis
public static long getTfStartTimeMillis ()
| คิกรีเทิร์น | |
|---|---|
long |
|
getTfVersion
public static String getTfVersion ()
รับเวอร์ชัน TF ที่ทำงานบนโฮสต์นี้
| คิกรีเทิร์น | |
|---|---|
String |
เวอร์ชัน TF ของโฮสต์นี้ |
getUniqueDeviceSerial
public static String getUniqueDeviceSerial (DeviceDescriptor device)
แสดงผลซีเรียลอุปกรณ์ที่ไม่ซ้ำกันสำหรับอุปกรณ์
อุปกรณ์ที่ไม่ใช่อุปกรณ์จริง (เช่น โปรแกรมจำลอง) จะมีซีเรียลจำลองซึ่งไม่ซ้ำกันในแต่ละโฮสต์ เมธอดนี้จะใส่ชื่อโฮสต์ไว้ข้างหน้า URL เหล่านั้นเพื่อให้ไม่ซ้ำกัน
| พารามิเตอร์ | |
|---|---|
device |
DeviceDescriptor: ข้อบ่งชี้อุปกรณ์ |
| คิกรีเทิร์น | |
|---|---|
String |
หมายเลขซีเรียลของอุปกรณ์ที่ไม่ซ้ำกัน |
isLocalhostIpPort
public static boolean isLocalhostIpPort (String input)
ตรวจสอบว่าอินพุตที่ระบุเป็นสตริง IP:PORT ของ localhost หรือไม่
| พารามิเตอร์ | |
|---|---|
input |
String: สตริงที่จะตรวจสอบ |
| คิกรีเทิร์น | |
|---|---|
boolean |
จริงหากอินพุตที่ระบุคือสตริง IP:PORT ของ localhost |
วิธีการที่มีการป้องกัน
toValidTfVersion
protected static String toValidTfVersion (String version)
ตรวจสอบเวอร์ชัน TF และแสดงผลหากถูกต้อง
| พารามิเตอร์ | |
|---|---|
version |
String: สตริงสำหรับเวอร์ชัน TF ที่ VersionParser ระบุ |
| คิกรีเทิร์น | |
|---|---|
String |
เวอร์ชันหากถูกต้อง หรือค่าเริ่มต้นหากไม่ถูกต้อง |