ClusterHostUtil

public class ClusterHostUtil
extends Object

java.lang.Object
com.android.tradefed.cluster.ClusterHostUtil


ฟังก์ชันการใช้งานแบบคงที่สำหรับ TF Cluster เพื่อรับอินสแตนซ์การกำหนดค่าส่วนกลาง ข้อมูลโฮสต์ ฯลฯ

สรุป

ผู้รับเหมาก่อสร้างสาธารณะ

ClusterHostUtil ()

วิธีการสาธารณะ

static IClusterClient getClusterClient ()

รับอินสแตนซ์ IClusterClient ที่ใช้ในการโต้ตอบกับแบ็กเอนด์ TFC

static IClusterOptions getClusterOptions ()

รับอินสแตนซ์ IClusterOptions ที่ใช้ในการจัดเก็บการตั้งค่าที่เกี่ยวข้องกับคลัสเตอร์

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

รับ CurrentTimeMillis

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 ชื่อโฮสต์หรือเป็นโมฆะหากเราไม่สามารถดึงข้อมูลได้

รับ LocalDeviceSerial

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 วิ่งเป้าหมาย

รับTestHarness

public static String getTestHarness ()

การส่งคืน
String

getTfStartTimeMillis

public static long getTfStartTimeMillis ()

การส่งคืน
long

getTfVersion

public static String getTfVersion ()

รับเวอร์ชัน TF ทำงานบนโฮสต์นี้

การส่งคืน
String เวอร์ชัน TF ของเจ้าบ้านนี้

รับ UniqueDeviceSerial

public static String getUniqueDeviceSerial (DeviceDescriptor device)

ส่งคืนอนุกรมอุปกรณ์ที่ไม่ซ้ำกันสำหรับอุปกรณ์

อุปกรณ์ที่ไม่ใช่ทางกายภาพ (เช่น โปรแกรมจำลอง) มีซีเรียลหลอกซึ่งไม่ซ้ำกันในโฮสต์ วิธีการนี้จะนำหน้าชื่อโฮสต์เพื่อทำให้ไม่ซ้ำกัน

พารามิเตอร์
device DeviceDescriptor : ตัวอธิบายอุปกรณ์

การส่งคืน
String อนุกรมอุปกรณ์ที่ไม่ซ้ำใคร

isLocalhostIpPort

public static boolean isLocalhostIpPort (String input)

ตรวจสอบว่าอินพุตที่กำหนดเป็นสตริง localhost IP:PORT หรือไม่

พารามิเตอร์
input String : สตริงที่จะตรวจสอบ

การส่งคืน
boolean เป็นจริงหากอินพุตที่กำหนดเป็นสตริง localhost IP:PORT

วิธีการที่ได้รับการป้องกัน

ถึงValidTfVersion

protected static String toValidTfVersion (String version)

ตรวจสอบเวอร์ชัน TF และส่งคืนหากใช้ได้

พารามิเตอร์
version String : สตริงสำหรับเวอร์ชัน TF จัดทำโดย VersionParser

การส่งคืน
String เวอร์ชันหากถูกต้องหรือเป็นค่าเริ่มต้นหากไม่ใช่