Development documentation

Schema location

The schema is located in the folder: src/main/resources.

Adding the schemas to the main project web site

During the site phase the schema is copied to the main site in the pineapple-project. The schema is copied to the directory: /ns/plugin.

This is implemented in the pom.xml for the pineapple-docker-plugin project.

Generation of classes from XML schemas

The project uses JAXB through the Maven plugin cxf-xjc-plugin to generate classes from XML schema.

Customized package names

The generated classes are mapping into the package com.alpha.pineapple.plugin.docker.model using the JAXB bindings file at: src/main/resources/bindings.xjb.

Customized type names

The JAXB bindings file also defines mappings of Schema type into Java types. The applied rule is to remove the postfixed Type from the Schema type in the corresponding Java types, i.e. from the schema type named NiceType a Java type named Nice is generated by JAXB.

Internal configuration

Logging

The plugin uses Log4j for logging. Each project which links to this project must provide a Log4j configuration which is accessible at runtime as a result of the build process.

For testing the project uses the Log4j configuration supplied by the pineapple-test-utils project.

Spring configuration file

The plugin contains a configuration file which defines a Spring application context. The Spring application context defines the input unmarshalling for the plugin. The file is located in src/main/resources/com.alpha.pineapple.plugin.docker-config.xml.

Internationalization (I18N) configuration file

The report generator uses internationalization. Messages used by classes in the project are located in the file src/main/resources/com.alpha.pineapple.plugin.docker-messages.properties.

JAXB binding file

JAXB bindings file used during generation of model objects from the plugin schema is located at src/main/resources/bindings.xjb.

Test

Unit test

Implementation

Plugin class

The package com.alpha.pineapple.plugin.docker is the root package of the plugin and contains the plugin class PluginImpl.

Furthermore the package contains the interface DockerConstants which constant used by the plugin.

Session class

The package com.alpha.pineapple.plugin.docker.session contains the session classes for the plugin:

  • DockerPluginSessionImpl extends the DockerSessionImpl class which implements logic for connecting and invoking REST services at a Docker daemon. DockerSessionImpl and its interface are implemented in the pineapple-docker-support project.

Operation classes

The package com.alpha.pineapple.plugin.docker.operation contains the operation classes for the plugin.

The plugin implement these default operations:

  • DeployConfiguration implements the operation deploy-configuration.
  • UndeployConfiguration implements the operation undeploy-configuration.
  • CreateReport>> implements the operation <<<create-report.

Model helper classes

The package com.alpha.pineapple.plugin.docker.model contains model mapper classes for mapping values from the plugin model (e.g. the schema generated classes) to the command contexts:

  • Mapper defines the interface for mapping values defined in the plugin model to command contexts.
  • MapperImpl implements the Mapper interface.

Commands

The command objects from the pineapple-docker-support are used.