Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer's Guide Added #495

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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]((http://joyent.github.com/java-manta)) is a community-maintained Java SDK for interacting with
Joyent's Manta object storage system.

### Recommended Prerequisite References
- [Using The SDK](https://github.com/joyent/java-manta#usage)
- [Contributing to Java-Manta](https://github.com/joyent/java-manta/blob/master/CONTRIBUTING.md)
- [Configuration Documentation](https://github.com/joyent/java-manta/blob/master/USAGE.md#configuration)
- [General Examples](https://github.com/joyent/java-manta#general-examples)

indianwhocodes marked this conversation as resolved.
Show resolved Hide resolved
### 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](https://github.com/joyent/java-manta/blob/master/java-manta-client-unshaded/src/main/java/com/joyent/manta/config/ConfigContext.java).
Use that section of code as a template to implement the new configuration variable.

- Add a method in [SettableConfigContext](https://github.com/joyent/java-manta/blob/master/java-manta-client-unshaded/src/main/java/com/joyent/manta/config/SettableConfigContext.java)
and imitate the pre-existing implementations in the class. Include additions to detailed information in the JavaDocs.

- Add keys for constants in [MapConfigContext](https://github.com/joyent/java-manta/blob/master/java-manta-client-unshaded/src/main/java/com/joyent/manta/config/MapConfigContext.java) and [EnvVarConfigContext](https://github.com/joyent/java-manta/blob/master/java-manta-client-unshaded/src/main/java/com/joyent/manta/config/EnvVarConfigContext.java).
Include an implementation for the required interface methods.

- Add a default setting in [DefaultsConfigContext](https://github.com/joyent/java-manta/blob/master/java-manta-client-unshaded/src/main/java/com/joyent/manta/config/DefaultsConfigContext.java). 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](https://github.com/joyent/java-manta/blob/master/java-manta-client-unshaded/src/main/java/com/joyent/manta/config/SettableConfigContext.java)
to ensure the overwrite behavior works correctly.

- Update the test file [ChainedConfigContextTest](https://github.com/joyent/java-manta/blob/master/java-manta-client-unshaded/src/test/java/com/joyent/manta/config/ChainedConfigContextTest.java) to verify the behavior for the added parameter.

- Update [USAGE.md](https://github.com/joyent/java-manta/blob/master/USAGE.md#configuration) 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](https://github.com/joyent/java-manta/blob/master/CHANGELOG.md).


Note: [Adding a new configuration parameter manta.content_type_detection](https://github.com/joyent/java-manta/pull/494) can help developers find and edit the appropriate classes.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ Known edge cases and other topics are covered in [the FAQ](/FAQ.md).
Contributions are welcome! Please read the [CONTRIBUTING.md](/CONTRIBUTING.md) document for details
on getting started.

indianwhocodes marked this conversation as resolved.
Show resolved Hide resolved
## Developing
indianwhocodes marked this conversation as resolved.
Show resolved Hide resolved

There are portions of the SDK that are somewhat complex or fiddly. Please read the [DEVELOPING.md](/DEVELOPING.md)
document for details, before developing the Java SDK.

### Testing

Please refer to the [testing documentation](/TESTING.md).
Contributing developers are strongly encouraged to add unit-tests and integration-tests. Refer to the [testing documentation](/TESTING.md)
for information on full test suite requirements.

### Releasing

Expand Down