Split client module into api and core.

This commit is contained in:
Kai Zimmermann 2019-09-16 07:45:02 +02:00
Родитель 66e5c8e954
Коммит 940f342e30
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5D573D78F64EDBA
168 изменённых файлов: 384 добавлений и 262 удалений

Просмотреть файл

@ -1,6 +1,6 @@
# Azure Digital Twins - Java support collection
This projects aims to provide modules and samples for leveraging [Azure Digital Twins](https://docs.microsoft.com/en-us/azure/digital-twins/about-digital-twins) service from Java based applications. The project is community maintained and will provide generic Java components as well as off-the-shelf Spring Boot integration and auto configuration.
This projects aims to provide modules and samples for leveraging [Azure Digital Twins](https://docs.microsoft.com/en-us/azure/digital-twins/about-digital-twins) service from Java based applications. The project is community maintained and will provide generic Java components as well as off-the-shelf Spring Boot integration with auto configuration.
[![Build status](https://dev.azure.com/kaiatms/Twins-Event-Ingress/_apis/build/status/ADT%20Java%20collection%20-%20MASTER%20build)](https://dev.azure.com/kaiatms/Twins-Event-Ingress/_build/latest?definitionId=20) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.microsoft.twins%3Aazure-digital-twins-java&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.microsoft.twins%3Aazure-digital-twins-java) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.microsoft.twins%3Aazure-digital-twins-java&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=com.microsoft.twins%3Aazure-digital-twins-java) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=com.microsoft.twins%3Aazure-digital-twins-java&metric=security_rating)](https://sonarcloud.io/dashboard?id=com.microsoft.twins%3Aazure-digital-twins-java)

Просмотреть файл

@ -17,6 +17,7 @@
<packaging>pom</packaging>
<modules>
<module>twin-management-client-api</module>
<module>twin-management-client-core</module>
<module>twin-management-client-autoconfigure</module>
<module>twin-management-client-starter</module>

Просмотреть файл

@ -0,0 +1,37 @@
<!--
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.twins</groupId>
<artifactId>twin-management-client</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>twin-management-client-api</artifactId>
<name>Twin Management Client :: Api</name>
<dependencies>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-jackson</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

Просмотреть файл

@ -8,12 +8,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.BlobMetadataRetrieve;
import com.microsoft.twins.model.DeviceCreate;
import com.microsoft.twins.model.DeviceRetrieve;
import com.microsoft.twins.model.DeviceUpdate;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.ExtendedPropertyCreate;
import com.microsoft.twins.model.KeyStoreRetrieve;
import com.microsoft.twins.model.Location;
@ -24,7 +23,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface DevicesApi extends TwinsApiClient.Api {
public interface DevicesApi {
/**
* Creates a device
*

Просмотреть файл

@ -7,8 +7,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.EndpointCreate;
import com.microsoft.twins.model.EndpointRetrieve;
import com.microsoft.twins.model.EventTypesEnum;
@ -17,7 +16,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface EndpointsApi extends TwinsApiClient.Api {
public interface EndpointsApi {
/**
* Creates an endpoint
*

Просмотреть файл

@ -7,8 +7,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.KeyStoreCreate;
import com.microsoft.twins.model.KeyStoreRetrieve;
import com.microsoft.twins.model.KeyStoreUpdate;
@ -19,7 +18,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface KeyStoresApi extends TwinsApiClient.Api {
public interface KeyStoresApi {
/**
* Creates a key store
*
@ -240,8 +239,7 @@ public interface KeyStoresApi extends TwinsApiClient.Api {
*/
@RequestLine("GET /api/v1.0/keystores/{id}?includes={includes}")
@Headers({"Accept: */*",})
KeyStoreRetrieve keyStoresRetrieveById(@Param("id") UUID id,
@Param("includes") String includes);
KeyStoreRetrieve keyStoresRetrieveById(@Param("id") UUID id, @Param("includes") String includes);
/**
* Retrieves a key store
@ -344,8 +342,7 @@ public interface KeyStoresApi extends TwinsApiClient.Api {
*/
@RequestLine("PATCH /api/v1.0/keystores/{id}/keys/{key}")
@Headers({"Accept: */*",})
void keyStoresUpdateKey(SecurityKeyUpdate body, @Param("id") UUID id,
@Param("key") Integer key);
void keyStoresUpdateKey(SecurityKeyUpdate body, @Param("id") UUID id, @Param("key") Integer key);
/**
* Updates the given key

Просмотреть файл

@ -7,10 +7,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.ConditionCreate;
import com.microsoft.twins.model.ConditionUpdate;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.MatcherCreate;
import com.microsoft.twins.model.MatcherEvaluationResults;
import com.microsoft.twins.model.MatcherRetrieve;
@ -20,7 +19,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface MatchersApi extends TwinsApiClient.Api {
public interface MatchersApi {
/**
* Creates a matcher
*
@ -84,8 +83,7 @@ public interface MatchersApi extends TwinsApiClient.Api {
* The following elements may be specified in the query map:
* </p>
* <ul>
* <li>enableLogging - If true, return verbose logs for the evaluation
* (optional)</li>
* <li>enableLogging - If true, return verbose logs for the evaluation (optional)</li>
* </ul>
* @return MatcherEvaluationResults
*
@ -116,8 +114,8 @@ public interface MatchersApi extends TwinsApiClient.Api {
* @param names Optional &#x27;;&#x27; delimited list of names (optional)
* @param includes Comma separated list of what to include, for example
* \&quot;Space,Condition\&quot;. Defaults to None (optional)
* @param spaceId Optionally filter on objects based on their location in the topology
* relative to the specified spaceId (optional)
* @param spaceId Optionally filter on objects based on their location in the topology relative to
* the specified spaceId (optional)
* @param traverse None (the default) for the specified spaceId only, Down for space and
* descendants, Up for spaceId and ancestors, Any for both (optional)
* @param minLevel Optional filter on minimum level, inclusive (optional)
@ -151,17 +149,14 @@ public interface MatchersApi extends TwinsApiClient.Api {
* <li>names - Optional &#x27;;&#x27; delimited list of names (optional)</li>
* <li>includes - Comma separated list of what to include, for example
* \&quot;Space,Condition\&quot;. Defaults to None (optional)</li>
* <li>spaceId - Optionally filter on objects based on their location in the
* topology relative to the specified spaceId (optional)</li>
* <li>traverse - None (the default) for the specified spaceId only, Down for
* space and descendants, Up for spaceId and ancestors, Any for both
* (optional)</li>
* <li>spaceId - Optionally filter on objects based on their location in the topology
* relative to the specified spaceId (optional)</li>
* <li>traverse - None (the default) for the specified spaceId only, Down for space and
* descendants, Up for spaceId and ancestors, Any for both (optional)</li>
* <li>minLevel - Optional filter on minimum level, inclusive (optional)</li>
* <li>maxLevel - Optional filter on maximum level, inclusive (optional)</li>
* <li>minRelative - Specify if min level is absolute or relative
* (optional)</li>
* <li>maxRelative - Specify if max level is absolute or relative
* (optional)</li>
* <li>minRelative - Specify if min level is absolute or relative (optional)</li>
* <li>maxRelative - Specify if max level is absolute or relative (optional)</li>
* </ul>
* @return java.util.List&lt;MatcherRetrieve&gt;
*

Просмотреть файл

@ -6,8 +6,7 @@ package com.microsoft.twins.api;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.OntologyRetrieve;
import com.microsoft.twins.model.OntologyUpdate;
import feign.Headers;
@ -15,7 +14,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface OntologiesApi extends TwinsApiClient.Api {
public interface OntologiesApi {
/**
* Gets a list of ontologies
*

Просмотреть файл

@ -7,17 +7,17 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.ExtendedPropertyKeyCreate;
import com.microsoft.twins.model.ExtendedPropertyKeyRetrieve;
import com.microsoft.twins.model.ExtendedPropertyKeyUpdate;
import com.microsoft.twins.model.ScopeEnum;
import feign.Headers;
import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface PropertyKeysApi extends TwinsApiClient.Api {
public interface PropertyKeysApi {
/**
* Creates a property key
*
@ -138,7 +138,7 @@ public interface PropertyKeysApi extends TwinsApiClient.Api {
return this;
}
public PropertyKeysDeleteBySpaceQueryParams scope(final String value) {
public PropertyKeysDeleteBySpaceQueryParams scope(final ScopeEnum value) {
put("scope", EncodingUtils.encode(value));
return this;
}
@ -214,7 +214,7 @@ public interface PropertyKeysApi extends TwinsApiClient.Api {
* method in a fluent style.
*/
public static class PropertyKeysRetrieveQueryParams extends HashMap<String, Object> {
public PropertyKeysRetrieveQueryParams scope(final String value) {
public PropertyKeysRetrieveQueryParams scope(final ScopeEnum value) {
put("scope", EncodingUtils.encode(value));
return this;
}

Просмотреть файл

@ -7,8 +7,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.SpaceResourceCreate;
import com.microsoft.twins.model.SpaceResourceRetrieve;
import com.microsoft.twins.model.SpaceResourceUpdate;
@ -18,7 +17,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface ResourcesApi extends TwinsApiClient.Api {
public interface ResourcesApi {
/**
* Creates a resource
*

Просмотреть файл

@ -7,8 +7,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.RoleAssignmentCreate;
import com.microsoft.twins.model.RoleAssignmentRetrieve;
import feign.Headers;
@ -16,7 +15,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface RoleAssignmentsApi extends TwinsApiClient.Api {
public interface RoleAssignmentsApi {
/**
* Checks permissions for a given path, user, domain, tenant id, accessType and resource type
*

Просмотреть файл

@ -7,8 +7,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.ExtendedPropertyCreate;
import com.microsoft.twins.model.Location;
import com.microsoft.twins.model.MatcherRetrieve;
@ -21,7 +20,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface SensorsApi extends TwinsApiClient.Api {
public interface SensorsApi {
/**
* Creates a sensor
*

Просмотреть файл

@ -8,9 +8,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.BlobMetadataRetrieve;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.ExtendedPropertyCreate;
import com.microsoft.twins.model.KeyStoreRetrieve;
import com.microsoft.twins.model.Location;
@ -26,7 +25,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface SpacesApi extends TwinsApiClient.Api {
public interface SpacesApi {
/**
* Creates a space
*
@ -367,8 +366,8 @@ public interface SpacesApi extends TwinsApiClient.Api {
*/
@RequestLine("GET /api/v1.0/spaces?ids={ids}&name={name}&types={types}&subtypes={subtypes}&statuses={statuses}&useParentSpace={useParentSpace}&userUpn={userUpn}&sensorDataTypes={sensorDataTypes}&includes={includes}&propertyKey={propertyKey}&propertyValue={propertyValue}&propertyValueSearchType={propertyValueSearchType}&spaceId={spaceId}&traverse={traverse}&minLevel={minLevel}&maxLevel={maxLevel}&minRelative={minRelative}&maxRelative={maxRelative}")
@Headers({"Accept: */*",})
List<SpaceRetrieveWithChildren> spacesRetrieve(@Param("ids") UUID ids,
@Param("name") String name, @Param("types") String types, @Param("subtypes") String subtypes,
List<SpaceRetrieveWithChildren> spacesRetrieve(@Param("ids") UUID ids, @Param("name") String name,
@Param("types") String types, @Param("subtypes") String subtypes,
@Param("statuses") String statuses, @Param("useParentSpace") Boolean useParentSpace,
@Param("userUpn") String userUpn, @Param("sensorDataTypes") String sensorDataTypes,
@Param("includes") String includes, @Param("propertyKey") String propertyKey,
@ -790,8 +789,7 @@ public interface SpacesApi extends TwinsApiClient.Api {
*/
@RequestLine("GET /api/v1.0/spaces/{id}/keystore?includes={includes}")
@Headers({"Accept: */*",})
KeyStoreRetrieve spacesRetrieveKeyStore(@Param("id") UUID id,
@Param("includes") String includes);
KeyStoreRetrieve spacesRetrieveKeyStore(@Param("id") UUID id, @Param("includes") String includes);
/**
* Gets the first keystore by walking up the spaces hierarchy

Просмотреть файл

@ -4,13 +4,12 @@
package com.microsoft.twins.api;
import java.util.List;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.IEnumEntity;
import com.microsoft.twins.model.RoleDefinitionRetrieve;
import feign.Headers;
import feign.RequestLine;
public interface SystemApi extends TwinsApiClient.Api {
public interface SystemApi {
/**
* Retrieve all supported device statuses
*

Просмотреть файл

@ -7,9 +7,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.CategoryEnum;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.ExtendedTypeCreate;
import com.microsoft.twins.model.ExtendedTypeRetrieve;
import com.microsoft.twins.model.ExtendedTypeUpdate;
@ -18,7 +17,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface TypesApi extends TwinsApiClient.Api {
public interface TypesApi {
/**
* Creates an extended type
*

Просмотреть файл

@ -8,15 +8,14 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.UserDefinedFunctionRetrieve;
import feign.Headers;
import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface UserDefinedFunctionsApi extends TwinsApiClient.Api {
public interface UserDefinedFunctionsApi {
/**
* Creates a udf This is a multi-part request. For more information, see doc examples. Key value
* pairs specified in the Content-Disposition header in the udf-chunk of the multipart request
@ -72,10 +71,10 @@ public interface UserDefinedFunctionsApi extends TwinsApiClient.Api {
@RequestLine("GET /api/v1.0/userdefinedfunctions?names={names}&ids={ids}&includes={includes}&spaceId={spaceId}&traverse={traverse}&minLevel={minLevel}&maxLevel={maxLevel}&minRelative={minRelative}&maxRelative={maxRelative}")
@Headers({"Accept: */*",})
List<UserDefinedFunctionRetrieve> userDefinedFunctionsRetrieve(@Param("names") String names,
@Param("ids") UUID ids, @Param("includes") String includes,
@Param("spaceId") String spaceId, @Param("traverse") String traverse,
@Param("minLevel") Integer minLevel, @Param("maxLevel") Integer maxLevel,
@Param("minRelative") Boolean minRelative, @Param("maxRelative") Boolean maxRelative);
@Param("ids") UUID ids, @Param("includes") String includes, @Param("spaceId") String spaceId,
@Param("traverse") String traverse, @Param("minLevel") Integer minLevel,
@Param("maxLevel") Integer maxLevel, @Param("minRelative") Boolean minRelative,
@Param("maxRelative") Boolean maxRelative);
/**
* Gets a list of udfs

Просмотреть файл

@ -8,9 +8,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.microsoft.twins.EncodingUtils;
import com.microsoft.twins.TwinsApiClient;
import com.microsoft.twins.model.BlobMetadataRetrieve;
import com.microsoft.twins.model.EncodingUtils;
import com.microsoft.twins.model.ExtendedPropertyCreate;
import com.microsoft.twins.model.Location;
import com.microsoft.twins.model.UserCreateWithSpace;
@ -21,7 +20,7 @@ import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
public interface UsersApi extends TwinsApiClient.Api {
public interface UsersApi {
/**
* Creates a blob This is a multi-part request. For more information, see sample app or doc
* examples. Key value pairs specified in the Content-Disposition header in the blob-chunk of the

Просмотреть файл

@ -1,7 +1,7 @@
/**
* Copyright (c) Microsoft Corporation. Licensed under the MIT License.
*/
package com.microsoft.twins;
package com.microsoft.twins.model;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше