工厂类
使用 Samsung 和 Google 工厂类创建 ResellerService
对象。借助 ResellerService
对象,您可以使用一组常见的方法来声明和注册三星设备及其他 Android 设备。
SamsungResellerServiceFactory
您需要先完成 KDP 初始配置,然后才能使用 SamsungResellerServiceFactory
类生成 ResellerService
对象。以下是使用 SamsungResellerServiceFactory
类创建 ResellerService
对象的方法签名:
public static ResellerService createResellerService(String resellerId, String serviceAccountKeyFilePath, String clientIdentifier) throws CommonException;
属性名称 |
值 |
必填 |
说明 |
resellerId |
string |
是 |
转销商的唯一标识符,由 KDP 系统提供。 |
serviceAccountKeyFilePath |
string |
是 |
指向服务账号密钥的文件路径。 |
clientIdentifier |
string |
是 |
KDP 系统提供的客户端标识符。 |
错误行为
发生错误时,该库会抛出包含以下错误代码之一的 CommonException
:
错误代码 |
INVALID_RESELLER_ID |
AUTHORIZATION_FAIL |
GoogleResellerServiceFactory
您必须先以转销商身份完成零触摸注册,然后才能使用 GoogleResellerServiceFactory
类生成 ResellerService
对象。
以下是使用 GoogleResellerServiceFactory
类创建 ResellerService
对象的方法签名:
public static ResellerService createResellerService(long resellerId, String serviceAccountKeyFilePath) throws CommonException, InterruptedException;
属性名称 |
值 |
必填 |
说明 |
resellerId |
long |
是 |
转销商的唯一标识符,由零触摸系统提供。 |
serviceAccountKeyFilePath |
string |
是 |
服务账号密钥的文件路径。 |
错误行为
发生错误时,该库会抛出一个包含以下错误代码之一的 CommonException
:
错误代码 |
INVALID_PARAM_DEFAULT |
INVALID_RESELLER_ID |
INTERNAL_SERVER_ERROR |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-09。
[null,null,["最后更新时间 (UTC):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"]]