ClusterHostUtil
public class ClusterHostUtil
extends Object
java.lang.Obiekt | |
↳ | com.android.tradefed.cluster.ClusterHostUtil |
Statyczne funkcje użytkowe dla TF Cluster w celu uzyskania globalnych instancji konfiguracji, informacji o hoście itp.
Streszczenie
Konstruktory publiczne | |
---|---|
ClusterHostUtil () |
Metody publiczne | |
---|---|
static IClusterClient | getClusterClient () Pobierz instancję |
static IClusterOptions | getClusterOptions () Pobierz instancję |
static long | getCurrentTimeMillis () Zwraca bieżący czas systemowy. |
static String | getHostIpAddress () Pobiera adres IP. |
static String | getHostName () Pobiera nazwę hosta. |
static String | getLocalDeviceSerial (String serial) Zwraca numer seryjny urządzenia lokalnego dla danego unikalnego numeru seryjnego urządzenia. |
static String | getRunTarget ( DeviceDescriptor device, String runTargetFormat, deviceTags) getRunTarget ( DeviceDescriptor device, String runTargetFormat, deviceTags) Zwraca cel uruchomienia dla danego deskryptora urządzenia. |
static String | getTestHarness () |
static long | getTfStartTimeMillis () |
static String | getTfVersion () Pobiera wersję TF działającą na tym hoście. |
static String | getUniqueDeviceSerial ( DeviceDescriptor device) Zwraca unikalny numer seryjny urządzenia dla urządzenia. |
static boolean | isLocalhostIpPort (String input) Sprawdza, czy dane wejście jest ciągiem adresów IP:PORT hosta lokalnego. |
Metody chronione | |
---|---|
static String | toValidTfVersion (String version) Sprawdza poprawność wersji TF i zwraca ją, jeśli jest OK. |
Konstruktory publiczne
ClusterHostUtil
public ClusterHostUtil ()
Metody publiczne
getClusterClient
public static IClusterClient getClusterClient ()
Pobierz instancję IClusterClient
używaną do interakcji z zapleczem TFC.
Zwroty | |
---|---|
IClusterClient |
getClusterOptions
public static IClusterOptions getClusterOptions ()
Pobierz instancję IClusterOptions
używaną do przechowywania ustawień związanych z klastrem.
Zwroty | |
---|---|
IClusterOptions |
getCurrentTimeMillis
public static long getCurrentTimeMillis ()
Zwraca bieżący czas systemowy.
Zwroty | |
---|---|
long | czas w milisekundach |
pobierz adres IP hosta
public static String getHostIpAddress ()
Pobiera adres IP.
Zwroty | |
---|---|
String | ciąg adresu IPV4 lub „NIEZNANY”, jeśli nie mogliśmy go pobrać. |
pobierz nazwę hosta
public static String getHostName ()
Pobiera nazwę hosta.
1. Spróbuj uzyskać nazwę hosta z InetAddress. 2. Jeśli się nie powiedzie, spróbuj uzyskać nazwę hosta z HOSTNAME env. 3. Jeśli nie ustawiono, wygeneruj unikalną nazwę hosta.
Zwroty | |
---|---|
String | nazwę hosta lub wartość null, jeśli nie mogliśmy jej pobrać. |
getLocalDeviceSerial
public static String getLocalDeviceSerial (String serial)
Zwraca numer seryjny urządzenia lokalnego dla danego unikalnego numeru seryjnego urządzenia.
TFC wysyła unikalne numery seryjne urządzeń dla urządzeń niefizycznych, których TF nie rozumie. Ta metoda konwertuje je z powrotem na numery seryjne urządzeń lokalnych.
Parametry | |
---|---|
serial | String : unikalny numer seryjny urządzenia z TFC. |
Zwroty | |
---|---|
String | numer seryjny urządzenia lokalnego. |
getRunTarget
public static String getRunTarget (DeviceDescriptor device, String runTargetFormat,deviceTags)
Zwraca cel uruchomienia dla danego deskryptora urządzenia.
Parametry | |
---|---|
device | DeviceDescriptor : DeviceDescriptor dla którego ma zostać pobrany cel uruchomienia. |
runTargetFormat | String |
deviceTags |
Zwroty | |
---|---|
String | uruchomić cel. |
getTestHarness
public static String getTestHarness ()
Zwroty | |
---|---|
String |
getTfStartTimeMillis
public static long getTfStartTimeMillis ()
Zwroty | |
---|---|
long |
getTfVersion
public static String getTfVersion ()
Pobiera wersję TF działającą na tym hoście.
Zwroty | |
---|---|
String | wersja TF tego hosta. |
getUniqueDeviceSerial
public static String getUniqueDeviceSerial (DeviceDescriptor device)
Zwraca unikalny numer seryjny urządzenia dla urządzenia.
Urządzenia niefizyczne (np. emulatory) mają pseudonumery seryjne, które nie są unikalne dla różnych hostów. Ta metoda poprzedza te z nazwą hosta, aby były unikalne.
Parametry | |
---|---|
device | DeviceDescriptor : deskryptor urządzenia. |
Zwroty | |
---|---|
String | unikalny numer seryjny urządzenia. |
isLocalhostIpPort
public static boolean isLocalhostIpPort (String input)
Sprawdza, czy dane wejście jest ciągiem adresów IP:PORT hosta lokalnego.
Parametry | |
---|---|
input | String : ciąg znaków do sprawdzenia |
Zwroty | |
---|---|
boolean | true, jeśli podane dane wejściowe to ciąg adresów IP:PORT hosta lokalnego |
Metody chronione
do prawidłowej wersjiTf
protected static String toValidTfVersion (String version)
Sprawdza poprawność wersji TF i zwraca ją, jeśli jest OK.
Parametry | |
---|---|
version | String : Ciąg dla wersji TF dostarczonej przez VersionParser |
Zwroty | |
---|---|
String | wersja, jeśli jest ważna, lub domyślna, jeśli nie. |