계량 라이센스
Contents
[
Hide
]Aspose.CAD는 개발자가 계량 키를 적용할 수 있도록 허용합니다. 이것은 새로운 라이센스 메커니즘입니다. 새로운 라이센스 메커니즘은 기존 라이센스 방법과 함께 사용됩니다. API 기능의 사용량에 따라 청구되기를 원하는 고객은 계량 라이센스를 사용할 수 있습니다. 자세한 내용은 계량 라이센스 FAQ 섹션을 참조하세요.
계량 라이센스
계량 클래스를 사용하는 간단한 단계는 다음과 같습니다.
- Metered 클래스의 인스턴스를 생성합니다.
- setMeteredKey 메서드에 공개 및 비공개 키를 전달합니다.
- 처리 작업을 수행합니다.
- Metered 클래스의 getConsumptionQuantity 메서드를 호출합니다.
- 지금까지 소비한 API 요청의 양/수량을 반환합니다.
다음은 계량 공개 및 비공식 키를 설정하는 방법을 보여주는 샘플 코드입니다:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cad/Aspose.CAD-for-Java | |
// Create an instance of OCR Metered class | |
com.aspose.cad.Metered metered = new com.aspose.cad.Metered(); | |
// Access the setMeteredKey property and pass public and private keys as parameters | |
metered.setMeteredKey("<valid pablic key>", "<valid private key>"); | |
// Get consumed qantity value before accessing API | |
double quantityOld = com.aspose.cad.Metered.getConsumptionQuantity(); | |
System.out.println("Consumption quantity" + quantityOld); | |
// DO PROCESSING | |
//com.aspose.cad.fileformats.cad.CadImage image = | |
// (com.aspose.cad.fileformats.cad.CadImage)com.aspose.cad.Image.load("BlockRefDgn.dwg"); | |
// Get consumed qantity value after accessing API | |
double quantity = com.aspose.cad.Metered.getConsumptionQuantity(); | |
System.out.println("Consumption quantity" + quantity()); |