Skip to content

Commit

Permalink
TDefinitions -> Definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Kopp <kopp.dev@gmail.com>
  • Loading branch information
koppor committed Aug 11, 2017
1 parent 95abb33 commit 5830455
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.eclipse.winery.common.ids.definitions.TOSCAComponentId;
import org.eclipse.winery.common.interfaces.QNameAlreadyExistsException;
import org.eclipse.winery.common.interfaces.QNameWithName;
import org.eclipse.winery.model.tosca.Definitions;
import org.eclipse.winery.model.tosca.TDefinitions;
import org.eclipse.winery.model.tosca.TEntityType;
import org.eclipse.winery.model.tosca.TExtensibleElements;
Expand Down Expand Up @@ -542,10 +543,10 @@ public <T extends TEntityType> T getType(QName qname, Class<T> type) {
}

@Override
public Optional<TDefinitions> getDefinitions(TOSCAComponentId id) {
public Optional<Definitions> getDefinitions(TOSCAComponentId id) {
for (WebResource wr : this.repositoryResources) {
String path = Util.getUrlPathForId(id);
TDefinitions definitions = WineryRepositoryClient.getDefinitions(wr.path(path));
Definitions definitions = WineryRepositoryClient.getDefinitions(wr.path(path));
if (definitions == null) {
// in case of an error, just try the next one
continue;
Expand All @@ -570,7 +571,7 @@ private static TDefinitions getDefinitions(WebResource wr, String path, String n
return WineryRepositoryClient.getDefinitions(componentListResource, ns, localPart);
}

private static TDefinitions getDefinitions(WebResource instanceResource) {
private static Definitions getDefinitions(WebResource instanceResource) {
// TODO: org.eclipse.winery.repository.resources.AbstractComponentInstanceResource.getDefinitionsWithAssociatedThings() could be used to do the resolving at the server

ClientResponse response = instanceResource.accept(MimeTypes.MIMETYPE_TOSCA_DEFINITIONS).get(ClientResponse.class);
Expand All @@ -579,12 +580,12 @@ private static TDefinitions getDefinitions(WebResource instanceResource) {
return null;
}

TDefinitions definitions;
Definitions definitions;
try {
Unmarshaller um = WineryRepositoryClient.createUnmarshaller();
definitions = (TDefinitions) um.unmarshal(response.getEntityInputStream());
definitions = (Definitions) um.unmarshal(response.getEntityInputStream());
} catch (JAXBException e) {
LOGGER.error("Could not umarshal TDefinitions", e);
LOGGER.error("Could not unmarshal Definitions", e);
// try next service
return null;
}
Expand Down

0 comments on commit 5830455

Please sign in to comment.