[
https://issues.jboss.org/browse/JBIDE-14514?page=com.atlassian.jira.plugi...
]
Andre Dietisheim commented on JBIDE-14514:
------------------------------------------
I removed the workaround and also implemented a new approach when dealing with embedded
cartridges. Since limited informations are already present within the response when
listing applications...
{code}
{
"api_version":1.2,
"data":[
{
"embedded":{
"mongodb-2.2":{
"connection_url":"mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/",
"username":"admin",
"password":"NNxXMT1z8dVj",
"database_name":"springeap6",
"info":"Connection URL:
mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/"
}
...
],
"type":"applications",
"version":"1.2"
}
{code}
...I'll already include those (with limited informations) when creating the
application instance. If you then access informations that are not present in this initial
embedded cartridge (ex. IEmbeddedCartridge#getDisplayName) then I'll request the
listing of all cartridges...
{code}
{
"api_version":1.2,
"data":[
{
...
},
"name":"mongodb-2.2",
"properties":[
{
"name":"username",
"type":"cart_data",
"description":"Root user on mongo database",
"value":"admin"
},
{
"name":"password",
"type":"cart_data",
"description":"Password for root user on mongo
database",
"value":"NNxXMT1z8dVj"
},
{
"name":"database_name",
"type":"cart_data",
"description":"Mongo DB name",
"value":"springeap6"
},
{
"name":"connection_url",
"type":"cart_data",
"description":"Mongo DB connection URL",
"value":"mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/"
}
],
...
"type":"cartridges",
"version":"1.2"
}
{code}
...and update the embedded cartridge within the application.
The major benefit is that the client library has now 1 request less to do when listing an
application. The embedded cartridges are already present when requesting the application,
no additional request to list embedded cartridges is required if all you need is basic
information about them. To then get the detailled informations, the additional request is
done.
openshift-java-client: remove workaround for
https://bugzilla.redhat.com/show_bug.cgi?id=812046
-----------------------------------------------------------------------------------------------
Key: JBIDE-14514
URL:
https://issues.jboss.org/browse/JBIDE-14514
Project: Tools (JBoss Tools)
Issue Type: Enhancement
Components: openshift
Affects Versions: 4.1.0.Beta1
Reporter: Andre Dietisheim
Assignee: Andre Dietisheim
Fix For: 4.2.0.Alpha1
In the latest implementations the OpenShift broker returns the embedded cartridges within
the application as follows:
{code}
"embedded":{
"mongodb-2.2":{
"connection_url":"mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/",
"username":"admin",
"password":"NNxXMT1z8dVj",
"database_name":"springeap6",
"info":"Connection URL:
mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/"
}
},
{code}
Prior code was only returning the *info* property where we had to exctract the url via
regex. The new broker is returning the *connection_url* which does not require any
regex-treatment any more
The code in openshift-java-client marks this workaround with a TODO:
{code}
protected EmbeddedCartridgeResource(final String name, final String displayName, final
String description, final CartridgeType type, String info, final Map<String, Link>
links,
final Map<String, Message> messages, final ApplicationResource application) {
super(application.getService(), links, messages);
this.name = name;
this.displayName = displayName;
this.description = description;
this.type = type;
// TODO: fix this workaround once
//
https://bugzilla.redhat.com/show_bug.cgi?id=812046 is fixed
this.url = extractUrl(info, messages);
this.application = application;
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira