工廠課程
使用 Samsung 和 Google 工廠類別建立 ResellerService
物件。使用 ResellerService
物件時,可使用一組常見的方法來宣告及註冊 Samsung 和其他 Android 裝置。
SamsungResellerServiceFactory
您必須先啟用 KDP,才能使用 SamsungResellerServiceFactory
類別產生 ResellerService
物件。以下是使用 SamsungResellerServiceFactory
類別建立 ResellerService
物件的方法簽章:
public static ResellerService createResellerService(String resellerId, String serviceAccountKeyFilePath, String clientIdentifier) throws CommonException;
屬性名稱 |
值 |
必填 |
說明 |
resellerId |
string |
是 |
KDP 系統提供的經銷商專屬 ID。 |
serviceAccountKeyFilePath |
string |
是 |
服務帳戶金鑰的檔案路徑。 |
clientIdentifier |
string |
是 |
KDP 系統提供的用戶端 ID。 |
錯誤行為
發生錯誤時,程式庫會擲回 CommonException
,其中包含下列其中一個錯誤代碼:
錯誤代碼 |
INVALID_RESELLER_ID |
AUTHORIZATION_FAIL |
GoogleResellerServiceFactory
您必須先加入零接觸註冊,才能使用 GoogleResellerServiceFactory
類別產生 ResellerService
物件。
以下是使用 GoogleResellerServiceFactory
類別建立 ResellerService
物件的方法簽章:
public static ResellerService createResellerService(long resellerId, String serviceAccountKeyFilePath) throws CommonException, InterruptedException;
屬性名稱 |
值 |
必填 |
說明 |
resellerId |
long |
是 |
經銷商的專屬 ID,由零接觸系統提供。 |
serviceAccountKeyFilePath |
string |
是 |
服務帳戶金鑰的檔案路徑。 |
錯誤行為
發生錯誤時,程式庫會擲回 CommonException
,其中包含下列其中一個錯誤代碼:
錯誤代碼 |
INVALID_PARAM_DEFAULT |
INVALID_RESELLER_ID |
INTERNAL_SERVER_ERROR |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-09 (世界標準時間)。
[null,null,["上次更新時間:2024-11-09 (世界標準時間)。"],[[["`ResellerService` objects, created using Samsung and Google factory classes, enable claiming and enrolling Samsung and other Android devices."],["The `SamsungResellerServiceFactory` requires onboarding with KDP and uses `resellerId`, `serviceAccountKeyFilePath`, and `clientIdentifier` to create a `ResellerService`."],["The `GoogleResellerServiceFactory` requires onboarding with zero-touch enrollment and uses `resellerId` and `serviceAccountKeyFilePath` to create a `ResellerService`."],["Both factories throw a `CommonException` when errors occur, with specific error codes like `INVALID_RESELLER_ID` and `AUTHORIZATION_FAIL` for Samsung and `INVALID_PARAM_DEFAULT` and `INTERNAL_SERVER_ERROR` for Google."]]],["`ResellerService` objects are created using `SamsungResellerServiceFactory` or `GoogleResellerServiceFactory` classes. Each factory requires onboarding as a reseller and uses a unique `resellerId` and `serviceAccountKeyFilePath`. Samsung's factory also needs a `clientIdentifier`. `ResellerService` objects offer methods for device management. Errors trigger a `CommonException` with specific codes, like `INVALID_RESELLER_ID` or `AUTHORIZATION_FAIL` for Samsung and `INVALID_PARAM_DEFAULT` or `INTERNAL_SERVER_ERROR` for Google.\n"]]