โรงงาน
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ใช้คลาสโรงงานของ Samsung และ Google เพื่อสร้างออบเจ็กต์ ResellerService
เมื่อใช้ออบเจ็กต์ ResellerService
คุณจะใช้เมธอดชุดเดียวกันเพื่ออ้างสิทธิ์และลงทะเบียน Samsung และอุปกรณ์ Android เครื่องอื่นๆ ได้
SamsungResellerServiceFactory
ก่อนที่จะใช้คลาส SamsungResellerServiceFactory
เพื่อสร้างออบเจ็กต์ ResellerService
คุณต้องเริ่มต้นใช้งาน KDP
ด้านล่างคือลายเซ็นเมธอดสำหรับการสร้างออบเจ็กต์ ResellerService
โดยใช้คลาส SamsungResellerServiceFactory
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
ได้
นี่คือลายเซ็นเมธอดสำหรับการสร้างออบเจ็กต์ ResellerService
โดยใช้คลาส GoogleResellerServiceFactory
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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003e\u003ccode\u003eResellerService\u003c/code\u003e objects, created using Samsung and Google factory classes, enable claiming and enrolling Samsung and other Android devices.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSamsungResellerServiceFactory\u003c/code\u003e requires onboarding with KDP and uses \u003ccode\u003eresellerId\u003c/code\u003e, \u003ccode\u003eserviceAccountKeyFilePath\u003c/code\u003e, and \u003ccode\u003eclientIdentifier\u003c/code\u003e to create a \u003ccode\u003eResellerService\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGoogleResellerServiceFactory\u003c/code\u003e requires onboarding with zero-touch enrollment and uses \u003ccode\u003eresellerId\u003c/code\u003e and \u003ccode\u003eserviceAccountKeyFilePath\u003c/code\u003e to create a \u003ccode\u003eResellerService\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBoth factories throw a \u003ccode\u003eCommonException\u003c/code\u003e when errors occur, with specific error codes like \u003ccode\u003eINVALID_RESELLER_ID\u003c/code\u003e and \u003ccode\u003eAUTHORIZATION_FAIL\u003c/code\u003e for Samsung and \u003ccode\u003eINVALID_PARAM_DEFAULT\u003c/code\u003e and \u003ccode\u003eINTERNAL_SERVER_ERROR\u003c/code\u003e for Google.\u003c/p\u003e\n"]]],["`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"],null,["Use the Samsung and Google factory classes to create `ResellerService` objects.\nWith `ResellerService` objects, a common set of [methods](/zero-touch/reseller-library/reference/methods)\nis available to claim and enroll Samsung and other Android devices.\n\nSamsungResellerServiceFactory\n\nBefore you can use the `SamsungResellerServiceFactory` class to generate a\n`ResellerService` object, you need to [onboard with KDP](/zero-touch/guides/reseller-library/get-started#knox_deployment_program).\nBelow is the method signature for creating a `ResellerService` object using the\n`SamsungResellerServiceFactory` class: \n\n public static ResellerService createResellerService(String resellerId, String serviceAccountKeyFilePath, String clientIdentifier) throws CommonException;\n\nInput parameters\n\n| Property name | Value | Required | Description |\n|-----------------------------|----------|----------|-----------------------------------------------------------|\n| `resellerId` | `string` | Yes | Reseller's unique identifier, provided by the KDP system. |\n| `serviceAccountKeyFilePath` | `string` | Yes | File path to the service account key. |\n| `clientIdentifier` | `string` | Yes | Client identifier provided by the KDP system. |\n\nError behavior\n\nWhen an error occurs, the library throws a\n[`CommonException`](/zero-touch/reseller-library/reference/objects#commonexception)\ncontaining one of the following error codes:\n\n| Error code |\n|-----------------------|\n| `INVALID_RESELLER_ID` |\n| `AUTHORIZATION_FAIL` |\n\nGoogleResellerServiceFactory\n\nBefore you can use the `GoogleResellerServiceFactory` class to generate a\n`ResellerService` object, you must [onboard to zero-touch enrollment](/zero-touch/guides/reseller-library/get-started#zero-touch_enrollment)\nas a reseller.\n\nHere's the method signature for creating a `ResellerService` object using the\n`GoogleResellerServiceFactory` class: \n\n public static ResellerService createResellerService(long resellerId, String serviceAccountKeyFilePath) throws CommonException, InterruptedException;\n\nInput parameters\n\n| Property name | Value | Required | Description |\n|-----------------------------|----------|----------|------------------------------------------------------------------|\n| `resellerId` | `long` | Yes | Reseller's unique identifier, provided by the zero-touch system. |\n| `serviceAccountKeyFilePath` | `string` | Yes | File path to the service account key. |\n\nError behavior\n\nWhen an error occurs, the library throws a\n[`CommonException`](/zero-touch/reseller-library/reference/objects#commonexception)\ncontaining one of the following error codes:\n\n| Error code |\n|-------------------------|\n| `INVALID_PARAM_DEFAULT` |\n| `INVALID_RESELLER_ID` |\n| `INTERNAL_SERVER_ERROR` |"]]