Skip to content

Added REST services that leverage the CLI#1207

Merged
rfecher merged 32 commits intomasterfrom
rest-project-0.9.6-final
Oct 31, 2017
Merged

Added REST services that leverage the CLI#1207
rfecher merged 32 commits intomasterfrom
rest-project-0.9.6-final

Conversation

@emacthecav
Copy link
Copy Markdown
Contributor

No description provided.

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013-2017 Contributors to the Eclipse Foundation
+6 * Copyright (c) 2013-2017 Contributors to the Eclipse Foundation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+6?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still there

// given
// parameters as the Default parameters. It's also done so that we can
// parse prefix annotations and special delegate processing.
JCommanderPrefixTranslator translator = new JCommanderPrefixTranslator();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know why the logic here got re-arranged?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even think this is relevant to REST services, probably should convert back

/*******************************************************************************
* Copyright (c) 2013-2017 Contributors to the Eclipse Foundation
*
*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this happens often, removing a space on this one line

"=");
key = parts[0];
value = converter.convert(parts[1]);
value = parts[1];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we got rid of password converter, seems like a discrepancy with the old code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when execute() call this set a flag to indicate we still want to use the password converter, except only use the password converter if isPassword

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return setKeyValue(params);
}
catch (WritePropertiesException | ParameterException e) {
// TODO GEOWAVE-rest-project server error status message
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we throw an exception or does returning null set error status?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we log these?

private Object setKeyValue(
final OperationParams params ) {

final File f = (File) params.getContext().get(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason we don't use getGeoConfigProperties() like the non-service code?

final String indexList = parameters.get(1);

// Config file
final File configFile = (File) params.getContext().get(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again it looks like a slight change from previous in not using getGeoWaveConfig() ... my suspicion is that this is simply a mistake in one of the merges from master not reflecting that change rather than something that was consciously done

final String indexList = parameters.get(2);

// Config file
final File configFile = (File) params.getContext().get(
Copy link
Copy Markdown
Contributor

@rfecher rfecher Oct 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getGeoWaveConfig() ?


// Config file
File configFile = getGeoWaveConfigFile(params);
final File configFile = (File) params.getContext().get(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

final String indexList = parameters.get(3);

// Config file
final File configFile = (File) params.getContext().get(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

// Try to load the 'default' options.

String defaultIndex = existingProps.getProperty(IndexPluginOptions.DEFAULT_PROPERTY_NAMESPACE);
final File configFile = (File) params.getContext().get(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

"No type could be infered");
}

final File propFile = (File) params.getContext().get(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

addIndexGroup(params);
}
catch (WritePropertiesException | ParameterException e) {
// TODO GEOWAVE-rest-project server error status message
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we supply server error status through some means

*/
private void addIndexGroup(
final OperationParams params ) {
final File propFile = (File) params.getContext().get(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same


@Parameter(description = "<workspace name>")
private List<String> parameters = new ArrayList<String>();
private final List<String> parameters = new ArrayList<String>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

getConfig().getUser(),
getConfig().getPass()));
webTarget = client.target(url);
try {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this getWebTarget() is an issue (we should technically cache the client based on URL, user, and password, or invalidate it when one of those things changes)

Comment thread .gitignore Outdated
docker-root
generated
.metadata
swagger.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just take them out

Comment thread services/rest/.gitignore Outdated
@@ -0,0 +1 @@
swagger.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this up a level to services because I believe it actually show up in webapp (and add api.db)

value = parameters.get(1);
}
else {
value = converter.convert(parameters.get(1));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (isPassword)

value = parts[1];
}
else {
value = converter.convert(parts[1]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (isPassword)

OperationParams params ) {
File configFile = (File) params.getContext().get(
ConfigOptions.PROPERTIES_FILE_CONTEXT);
;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange addition

// Config file
final File configFile = (File) params.getContext().get(
ConfigOptions.PROPERTIES_FILE_CONTEXT);
;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange

OperationParams params ) {
File configFile = (File) params.getContext().get(
ConfigOptions.PROPERTIES_FILE_CONTEXT);
;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same


import mil.nga.giat.geowave.core.cli.annotations.GeowaveOperation;
import mil.nga.giat.geowave.core.cli.api.DefaultOperation;
import mil.nga.giat.geowave.core.cli.api.OperationParams;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange addition

@rfecher rfecher merged commit e75d8ea into master Oct 31, 2017
@rfecher rfecher deleted the rest-project-0.9.6-final branch October 31, 2017 12:44
mcarrier7 added a commit that referenced this pull request Nov 14, 2017
…document process, and consolidating into one location for each. Correcting a few locations missed for the dynamic project version. Also, re-wrote the releases dropdown code to not be driven by static list items code

Updating documentation to have a simpler format for the different release versions, as well as updating some of the asciidoc files to add the project version at the top of the page. Also adding a simple documentation archive page to store the older versions of geowave as time goes on.

Adding a few tweaks to the index page to remove some quickstart links. Also updating documentation files to try and make all internal document links relative and not static, so to preserve document versions from release to release. Also changing some file names to adhere to the overall naming convention.

Modified geowave tools script (#1209)

Signed-off-by: Srinivas Varala <srinivas.varala@gmail.com>

Added REST services that leverage the CLI (#1207)

* REST services added

* Implemented parsers and other classes to make service compatible with swagger

* Various rest fixes/implementations. Command and section changes

* Added AddStore and AddIndex commands for the different types of stores/indexes. Various other small REST fixes/implementations

* Improved RESTful practices and refactored code to make it more maintainable

* fixed twitter serialization

* locationtech ip fixes (#1189)

* fixed minor issues with config commands

* fixes for encrypted passwords

* Fixed issues with converter handling and swaggerpaths. Continued to improve RESTful practices

* Deployed Rest Server as a web application, implemented Oauth2 for Facebook

* Removed mandatory Oauth, updated swaggerpaths

* fixed fileupload and removed security

* Improved upon responses and response codes for certain REST calls, minor bug fixes

* findbugs fix

* removed superfluous 'final' denotations

* Fixed config file getters

* gave set command a failure response

* added validate line back in

* deleted spi file

* updated gitignores

* fixed converter in setcommand

* fixed bug and refactored geoserver commands

* Reverted changes from non-serviceenabled config commands

* reverted help command

* added logging to set and AddIndexGroup commands

* added getGeowaveContext

* formatting and small replacements

* geoserver fixes

* set command and format fixes

* took out binary

Removed HADOOP_OPTS from geowave-tools.sh (#1211)

Signed-off-by: Srinivas Varala <srinivas.varala@gmail.com>

HP Fortify comments and fixes (#1213)
mcarrier7 added a commit that referenced this pull request Nov 14, 2017
…document process, and consolidating into one location for each. Correcting a few locations missed for the dynamic project version. Also, re-wrote the releases dropdown code to not be driven by static list items code

Updating documentation to have a simpler format for the different release versions, as well as updating some of the asciidoc files to add the project version at the top of the page. Also adding a simple documentation archive page to store the older versions of geowave as time goes on.

Adding a few tweaks to the index page to remove some quickstart links. Also updating documentation files to try and make all internal document links relative and not static, so to preserve document versions from release to release. Also changing some file names to adhere to the overall naming convention.

Modified geowave tools script (#1209)

Signed-off-by: Srinivas Varala <srinivas.varala@gmail.com>

Added REST services that leverage the CLI (#1207)

* REST services added

* Implemented parsers and other classes to make service compatible with swagger

* Various rest fixes/implementations. Command and section changes

* Added AddStore and AddIndex commands for the different types of stores/indexes. Various other small REST fixes/implementations

* Improved RESTful practices and refactored code to make it more maintainable

* fixed twitter serialization

* locationtech ip fixes (#1189)

* fixed minor issues with config commands

* fixes for encrypted passwords

* Fixed issues with converter handling and swaggerpaths. Continued to improve RESTful practices

* Deployed Rest Server as a web application, implemented Oauth2 for Facebook

* Removed mandatory Oauth, updated swaggerpaths

* fixed fileupload and removed security

* Improved upon responses and response codes for certain REST calls, minor bug fixes

* findbugs fix

* removed superfluous 'final' denotations

* Fixed config file getters

* gave set command a failure response

* added validate line back in

* deleted spi file

* updated gitignores

* fixed converter in setcommand

* fixed bug and refactored geoserver commands

* Reverted changes from non-serviceenabled config commands

* reverted help command

* added logging to set and AddIndexGroup commands

* added getGeowaveContext

* formatting and small replacements

* geoserver fixes

* set command and format fixes

* took out binary

Removed HADOOP_OPTS from geowave-tools.sh (#1211)

Signed-off-by: Srinivas Varala <srinivas.varala@gmail.com>

HP Fortify comments and fixes (#1213)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants