Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 4.02 KB

DEVELOPING.md

File metadata and controls

47 lines (32 loc) · 4.02 KB

Configuration Parameter Contributions

This is a brief guide for developers interested in making open-source contributions to the configuration parameters for java-manta. Java-Manta is a community-maintained Java SDK for interacting with Joyent's Manta object storage system.

Recommended Prerequisite References

Adding a Configuration Parameter to the SDK

Configuration parameters allow users to flexibly leverage SDK features to match their performance, authentication, and encryption requirements.

To submit a new configuration parameter to the Java-Manta SDK:

  • Determine the nature of the new parameter. Consider basic design decisions such as conditions that govern its use, its datatype, etc.

    • For example, if the new configuration parameter is a Boolean, find the line Boolean isClientEncryptionEnabled(); in ConfigContext. Use that section of code as a template to implement the new configuration variable.
  • Add a method in SettableConfigContext and imitate the pre-existing implementations in the class. Include additions to detailed information in the JavaDocs.

  • Add keys for constants in MapConfigContext and EnvVarConfigContext. Include an implementation for the required interface methods.

  • Add a default setting in DefaultsConfigContext. This determines a default value for the parameter when none is provided via command line or environment variable.

  • Add code to the methods overwriteWithContext() and overwriteWithDefaultContext() in BaseChainedConfigContext to ensure the overwrite behavior works correctly.

  • Add introduced configuration parameter in AuthAwareConfigContext and ConfigContextMBean. The latter determines which configuration parameters of the SDK are exposed leveraging the MetricReporterSupplier class using JMX or SLF4J.

  • Update the test file ChainedConfigContextTest to verify the behavior for the added parameter.

  • Update USAGE.md to include the new configuration parameter and to add clear instructions on how to use it.

  • Add information about the new parameter in the CHANGELOG.md.

Note: Adding a new configuration parameter manta.content_type_detection can help developers find and edit the appropriate classes.