Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 1.34 KB

README.md

File metadata and controls

38 lines (31 loc) · 1.34 KB

Add repository

<repositories>
    <repository>
        <id>d42-java-client-mvn-repo</id>
        <url>https://github.com/device42/d42-java-client/mvn-repo/</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

Add dependency to pom.xml

<dependency>
    <groupId>com.device42</groupId>
     <artifactId>d42-java-client</artifactId>
     <version>1.0.13</version>
</dependency>

Example for ApplicationComponent

ApplicationComponentsRestClient appCompsRestClient=Device42ClientFactory.createApplicationComponentsRestClient("https://example.device42.com","username","password");
                                                   
ApplicationComponentParameters.ApplicationComponentParametersBuilder appCompsParametersBuilder=new ApplicationComponentParameters.ApplicationComponentParametersBuilder();

ApplicationComponentParameters appCompsParameters=appCompsParametersBuilder.deviceId(2018l).build();
List<ApplicationComponent> list=appCompsRestClient.getApplicationComponents(appCompsParameters);

ApplicationComponent appComponent=new ApplicationComponent("app-name", "device-name");
appComponent.setJsonConfig("{\"config\":\"parameters\"}");

appCompsRestClient.createOrUpdateApplicationComponent(appComponent);