ClusterHostUtil
public class ClusterHostUtil
extends Object
java.lang.Object | |
. | com.android.tradefed.cluster.ClusterHostUtil |
ฟังก์ชันยูทิลิตี้แบบคงที่สำหรับ TF Cluster เพื่อรับอินสแตนซ์การกำหนดค่าส่วนกลาง ข้อมูลโฮสต์ ฯลฯ
สรุป
ผู้สร้างสาธารณะ | |
---|---|
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, deviceTags) getRunTarget ( DeviceDescriptor device, String runTargetFormat, deviceTags) ส่งกลับเป้าหมายการทำงานสำหรับตัวอธิบายอุปกรณ์ที่กำหนด |
static String | getTestHarness () |
static long | getTfStartTimeMillis () |
static String | getTfVersion () รับเวอร์ชัน TF ที่ทำงานบนโฮสต์นี้ |
static String | getUniqueDeviceSerial ( DeviceDescriptor device) ส่งคืนซีเรียลของอุปกรณ์ที่ไม่ซ้ำสำหรับอุปกรณ์ |
static boolean | isLocalhostIpPort (String input) ตรวจสอบว่าอินพุตที่กำหนดเป็นสตริง localhost IP:PORT หรือไม่ |
วิธีการป้องกัน | |
---|---|
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 env 3. หากไม่ได้ตั้งค่าไว้ ให้สร้างชื่อโฮสต์เฉพาะ
คืนสินค้า | |
---|---|
String | ชื่อโฮสต์หรือ null หากเราไม่สามารถดึงข้อมูลได้ |
getLocalDeviceSerial
public static String getLocalDeviceSerial (String serial)
ส่งคืนซีเรียลของอุปกรณ์ในเครื่องสำหรับซีเรียลของอุปกรณ์เฉพาะที่กำหนด
TFC ส่ง Serials อุปกรณ์ที่ไม่ซ้ำกันสำหรับอุปกรณ์ที่ไม่ใช่ทางกายภาพซึ่ง 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)
ส่งคืนซีเรียลของอุปกรณ์ที่ไม่ซ้ำสำหรับอุปกรณ์
อุปกรณ์ที่ไม่ใช่อุปกรณ์จริง (เช่น อีมูเลเตอร์) มีอนุกรมเทียมซึ่งไม่ซ้ำกันในโฮสต์ เมธอดนี้นำหน้าชื่อโฮสต์เพื่อทำให้ไม่ซ้ำกัน
พารามิเตอร์ | |
---|---|
device | DeviceDescriptor : ตัวอธิบายอุปกรณ์ |
คืนสินค้า | |
---|---|
String | ซีเรียลของอุปกรณ์ที่ไม่ซ้ำแบบใคร |
isLocalhostIpPort
public static boolean isLocalhostIpPort (String input)
ตรวจสอบว่าอินพุตที่กำหนดเป็นสตริง localhost IP:PORT หรือไม่
พารามิเตอร์ | |
---|---|
input | String : สตริงที่จะตรวจสอบ |
คืนสินค้า | |
---|---|
boolean | true ถ้าอินพุตที่กำหนดเป็น localhost IP:PORT string |
วิธีการป้องกัน
toValidTfVersion
protected static String toValidTfVersion (String version)
ตรวจสอบเวอร์ชัน TF และส่งคืนหากใช้ได้
พารามิเตอร์ | |
---|---|
version | String : สตริงสำหรับเวอร์ชัน TF ที่จัดหาโดย VersionParser |
คืนสินค้า | |
---|---|
String | เวอร์ชันหากถูกต้องหรือเป็นค่าเริ่มต้นหากไม่ใช่ |