publicvoidinitialize(ServiceExtensionContext context){ messageDispatcher.registerMessage( TransferRequestMessage.class, new PostDspHttpRequestFactory<>(remoteMessageSerializer, m -> BASE_PATH + TRANSFER_INITIAL_REQUEST), new TransferRequestDelegate(remoteMessageSerializer) ); messageDispatcher.registerMessage( TransferCompletionMessage.class, new PostDspHttpRequestFactory<>(remoteMessageSerializer, m -> BASE_PATH + m.getProcessId() + TRANSFER_COMPLETION), new TransferCompletionDelegate(remoteMessageSerializer) ); messageDispatcher.registerMessage( TransferStartMessage.class, new PostDspHttpRequestFactory<>(remoteMessageSerializer, m -> BASE_PATH + m.getProcessId() + TRANSFER_START), new TransferStartDelegate(remoteMessageSerializer) ); messageDispatcher.registerMessage( TransferTerminationMessage.class, new PostDspHttpRequestFactory<>(remoteMessageSerializer, m -> BASE_PATH + m.getProcessId() + TRANSFER_TERMINATION), new TransferTerminationDelegate(remoteMessageSerializer) ); }
var httpRequestFactory = new HttpRequestFactory();
var sourceFactory = new HttpDataSourceFactory(httpClient, paramsProvider, monitor, httpRequestFactory); pipelineService.registerFactory(sourceFactory);
var sinkFactory = new HttpDataSinkFactory(httpClient, executorContainer.getExecutorService(), sinkPartitionSize, monitor, paramsProvider, httpRequestFactory); pipelineService.registerFactory(sinkFactory);
Data PlaneのパブリックAPIはデータプロキシであり、データコンシューマがData Planeインスタンスを通じて、プロバイダのデータソース(バックエンドのRest APIや内部データベースなど)から能動的にデータを問い合わせることを可能にします。 Data PlaneのパブリックAPIはプロキシであるため、すべての動詞(GET、POST、PUT、PATCH、DELETEなど)をサポートしており、データソースが必要になるまでデータを転送することができます。これは、実際のデータソースがRest APIそのものである場合に特に便利です。同じように、任意のクエリパラメータ、パスパラメータ、リクエストボディのセットも(HTTPサーバによって固定された範囲内で)サポートされ、実際のデータソースに伝えることができます。
openapi:3.0.1 paths: /token: get: description:"Checks that the provided token has been signed by the present\ \ entity and asserts its validity. If token is valid, then the data address\ \ contained in its claims is decrypted and returned back to the caller." operationId:validate parameters: - in:header name:Authorization schema: type:string responses: "200": description:Tokenisvalid "400": description:Requestwasmalformed "403": description:Tokenisinvalid tags: -ConsumerPullTokenValidation components: schemas: DataAddress: type:object properties: properties: type:object additionalProperties: type:object
/transferprocess/{processId}/complete: post: description:"Requests completion of the transfer process. Due to the asynchronous\ \ nature of transfers, a successful response only indicates that the request\ \ was successfully received" operationId:complete parameters: - in:path name:processId required:true schema: type:string responses: "400": content: application/json: schema: type:array items: $ref:'#/components/schemas/ApiErrorDetail' description:"Request was malformed, e.g. id was null" tags: -TransferProcessControlApi
post: description:"Requests completion of the transfer process. Due to the asynchronous\ \ nature of transfers, a successful response only indicates that the request\ \ was successfully received" operationId:fail parameters: - in:path name:processId required:true schema: type:string requestBody: content: application/json: schema: $ref:'#/components/schemas/TransferProcessFailStateDto' responses: "400": content: application/json: schema: type:array items: $ref:'#/components/schemas/ApiErrorDetail' description:"Request was malformed, e.g. id was null" tags: -TransferProcessControlApi
var jsonLdMapper = typeManager.getMapper(JSON_LD); webService.registerResource(config.getContextAlias(), new ObjectMapperProvider(jsonLdMapper)); webService.registerResource(config.getContextAlias(), new JerseyJsonLdInterceptor(jsonLd, jsonLdMapper));
// message is de-serialized as Map<String, Object> by Jersey var document = JsonDocument.of(mapper.convertValue(message, JsonObject.class));
try {
var compacted = JsonLd.compact(document,EMPTY_CONTEXT).get(); var convertedDocument = mapper.convertValue(compacted,Map.class); // process converted document
var document = JsonDocument.of(jsonObject); var expanded = JsonLd.expand(document).get();
シリアライズは以下のように行われると例示されている。
1 2 3
var document = JsonDocument.of(jsonObject); var compacted = JsonLd.compact(document,EMPTY_CONTEXT).get(); var compacted = mapper.convertValue(compacted,Map.class);
[dobachi@home HexoPandocDocker]$ cat Dockerfile FROM ubuntu:20.04
# You may need to configure the time zone ENV TZ=Asia/Tokyo RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install minimal packages to prepare Hexo RUN apt-get update && \ apt-get install -y git-core npm wget
# Install Pandoc using deb package RUN wget https://github.com/jgm/pandoc/releases/download/2.18/pandoc-2.18-1-amd64.deb RUN apt-get install -y ./pandoc-2.18-1-amd64.deb
# Copy script for GitHub Action COPY entrypoint.sh /entrypoint.sh
# Configure entrypointo for GitHub Action ENTRYPOINT ["/entrypoint.sh"]
action.yml
最低限の設定のみ使用。
1 2 3 4 5 6 7
[dobachi@home HexoPandocDocker]$ cat action.yml # action.yml name: 'Build Hexo with Pandoc' description: 'build Hexo blog using Pandoc generator' runs: using: 'docker' image: 'Dockerfile'
$ docker-compose down $ docker rmi -f docker_ckan docker_db $ docker rmi $(docker images -f dangling=true -q) $ docker volume rm docker_ckan_config docker_ckan_home docker_ckan_storage docker_pg_data docker_solr_data $ docker-compose build $ docker-compose up -d $ docker-compose restart ckan # give the db service time to initialize the db cluster on first run