Search in sources :

Example 1 with ImplementationArtifactsResource

use of org.eclipse.winery.repository.rest.resources.artifacts.ImplementationArtifactsResource in project winery by eclipse.

the class NodeTypeImplementationResource method getImplementationArtifacts.

/**
 * Even if both node type implementations and relationship type implementations have implementation artifacts, there
 * is no common supertype. To avoid endless casts, we just implement the method here
 */
@Path("implementationartifacts/")
public ImplementationArtifactsResource getImplementationArtifacts() {
    TImplementationArtifacts implementationArtifacts;
    implementationArtifacts = this.getNTI().getImplementationArtifacts();
    if (implementationArtifacts == null) {
        implementationArtifacts = new TImplementationArtifacts();
        this.getNTI().setImplementationArtifacts(implementationArtifacts);
    }
    return new ImplementationArtifactsResource(implementationArtifacts.getImplementationArtifact(), this);
}
Also used : TImplementationArtifacts(org.eclipse.winery.model.tosca.TImplementationArtifacts) ImplementationArtifactsResource(org.eclipse.winery.repository.rest.resources.artifacts.ImplementationArtifactsResource) Path(javax.ws.rs.Path)

Example 2 with ImplementationArtifactsResource

use of org.eclipse.winery.repository.rest.resources.artifacts.ImplementationArtifactsResource in project winery by eclipse.

the class RelationshipTypeImplementationResource method getImplementationArtifacts.

/**
 * Even if both node type implementations and relationship type
 * implementations have implementation artifacts, there is no common
 * supertype. To avoid endless casts, we just implement the method here
 */
@Path("implementationartifacts/")
public ImplementationArtifactsResource getImplementationArtifacts() {
    TImplementationArtifacts implementationArtifacts;
    implementationArtifacts = this.getRTI().getImplementationArtifacts();
    if (implementationArtifacts == null) {
        implementationArtifacts = new TImplementationArtifacts();
        this.getRTI().setImplementationArtifacts(implementationArtifacts);
    }
    return new ImplementationArtifactsResource(implementationArtifacts.getImplementationArtifact(), this);
}
Also used : TImplementationArtifacts(org.eclipse.winery.model.tosca.TImplementationArtifacts) ImplementationArtifactsResource(org.eclipse.winery.repository.rest.resources.artifacts.ImplementationArtifactsResource) Path(javax.ws.rs.Path)

Aggregations

Path (javax.ws.rs.Path)2 TImplementationArtifacts (org.eclipse.winery.model.tosca.TImplementationArtifacts)2 ImplementationArtifactsResource (org.eclipse.winery.repository.rest.resources.artifacts.ImplementationArtifactsResource)2