test_class.file: org.eclipse.winery.repository.rest/src/test/java/org/eclipse/winery/repository/rest/resources/servicetemplates/ServiceTemplateResourceTest.java
test_class.identifier: ServiceTemplateResourceTest
test_class.superclass: extends AbstractResourceTest
test_case.body: @Test
      public void createNewStatefulVersion() throws Exception {
          this.setRevisionTo("eb37f5cfec50c046985eac308e46482ce8bea8e3");
          String response = this.assertPostWithNoContent("servicetemplates/http%253A%252F%252Fplain.winery.opentosca.org%252Fservicetemplates/ServiceTemplateWithOneNodeTemplate_w1-wip1/createnewstatefulversion", ContentType.JSON);
  
          QNameApiData newId = JacksonProvider.mapper.readValue(response, QNameApiData.class);
  
          assertNonNull(newId);
          WineryVersion version = VersionUtils.getVersion(newId.localname);
          assertNonNull(version);
          assertTrue(version.getComponentVersion().startsWith("stateful-w1-wip1-"));
      }
test_case.class_method_signature: ServiceTemplateResourceTest.createNewStatefulVersion()
test_case.full_signature: @Test public void createNewStatefulVersion()
test_case.identifier: createNewStatefulVersion
test_case.invocations: setRevisionTo assertPostWithNoContent readValue assertNonNull getVersion assertNonNull assertTrue startsWith getComponentVersion
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createNewStatefulVersion()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(ServiceTemplateResource.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(ServiceTemplateResource.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: org.eclipse.winery.repository.rest/src/main/java/org/eclipse/winery/repository/rest/resources/servicetemplates/ServiceTemplateResource.java
focal_class.identifier: ServiceTemplateResource
focal_class.interfaces: implements IHasName
focal_class.class_method_signature: ServiceTemplateResource.ServiceTemplateResource(ServiceTemplateId id)
focal_class.full_signature: public  ServiceTemplateResource(ServiceTemplateId id)
focal_class.identifier: ServiceTemplateResource
focal_class.modifiers: public
focal_class.parameters: (ServiceTemplateId id)
focal_class.signature:  ServiceTemplateResource(ServiceTemplateId id)
focal_class.class_method_signature: ServiceTemplateResource.getServiceTemplate()
focal_class.full_signature: public TServiceTemplate getServiceTemplate()
focal_class.identifier: getServiceTemplate
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TServiceTemplate
focal_class.signature: TServiceTemplate getServiceTemplate()
focal_class.class_method_signature: ServiceTemplateResource.setTopology(TTopologyTemplate topologyTemplate, String type)
focal_class.full_signature: @Override public void setTopology(TTopologyTemplate topologyTemplate, String type)
focal_class.identifier: setTopology
focal_class.modifiers: @Override public
focal_class.parameters: (TTopologyTemplate topologyTemplate, String type)
focal_class.return: void
focal_class.signature: void setTopology(TTopologyTemplate topologyTemplate, String type)
focal_class.class_method_signature: ServiceTemplateResource.getTopologyTemplateResource()
focal_class.full_signature: @Path("topologytemplate/") public TopologyTemplateResource getTopologyTemplateResource()
focal_class.identifier: getTopologyTemplateResource
focal_class.modifiers: @Path("topologytemplate/") public
focal_class.parameters: ()
focal_class.return: TopologyTemplateResource
focal_class.signature: TopologyTemplateResource getTopologyTemplateResource()
focal_class.class_method_signature: ServiceTemplateResource.getPlansResource()
focal_class.full_signature: @Path("plans/") public PlansResource getPlansResource()
focal_class.identifier: getPlansResource
focal_class.modifiers: @Path("plans/") public
focal_class.parameters: ()
focal_class.return: PlansResource
focal_class.signature: PlansResource getPlansResource()
focal_class.class_method_signature: ServiceTemplateResource.getSelfServicePortalResource()
focal_class.full_signature: @Path("selfserviceportal/") public SelfServicePortalResource getSelfServicePortalResource()
focal_class.identifier: getSelfServicePortalResource
focal_class.modifiers: @Path("selfserviceportal/") public
focal_class.parameters: ()
focal_class.return: SelfServicePortalResource
focal_class.signature: SelfServicePortalResource getSelfServicePortalResource()
focal_class.class_method_signature: ServiceTemplateResource.getBoundaryDefinitionsResource()
focal_class.full_signature: @Path("boundarydefinitions/") public BoundaryDefinitionsResource getBoundaryDefinitionsResource()
focal_class.identifier: getBoundaryDefinitionsResource
focal_class.modifiers: @Path("boundarydefinitions/") public
focal_class.parameters: ()
focal_class.return: BoundaryDefinitionsResource
focal_class.signature: BoundaryDefinitionsResource getBoundaryDefinitionsResource()
focal_class.class_method_signature: ServiceTemplateResource.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: ServiceTemplateResource.setName(String name)
focal_class.full_signature: @Override public Response setName(String name)
focal_class.identifier: setName
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: Response
focal_class.signature: Response setName(String name)
focal_class.class_method_signature: ServiceTemplateResource.getSubstitutableNodeTypeAsResponse()
focal_class.full_signature: @GET @ApiOperation(value = "Returns the associated node type, which can be substituted by this service template.") @ApiResponses(value = { @ApiResponse(code = 200, response = QName.class, message = "QName of the form {namespace}localName") }) @Path("substitutableNodeType") @Produces(MediaType.TEXT_PLAIN) public Response getSubstitutableNodeTypeAsResponse()
focal_class.identifier: getSubstitutableNodeTypeAsResponse
focal_class.modifiers: @GET @ApiOperation(value = "Returns the associated node type, which can be substituted by this service template.") @ApiResponses(value = { @ApiResponse(code = 200, response = QName.class, message = "QName of the form {namespace}localName") }) @Path("substitutableNodeType") @Produces(MediaType.TEXT_PLAIN) public
focal_class.parameters: ()
focal_class.return: Response
focal_class.signature: Response getSubstitutableNodeTypeAsResponse()
focal_class.class_method_signature: ServiceTemplateResource.getSubstitutableNodeType()
focal_class.full_signature: public QName getSubstitutableNodeType()
focal_class.identifier: getSubstitutableNodeType
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: QName
focal_class.signature: QName getSubstitutableNodeType()
focal_class.class_method_signature: ServiceTemplateResource.deleteSubstitutableNodeType()
focal_class.full_signature: @DELETE @ApiOperation(value = "Removes the association to substitutable node type") @Path("substitutableNodeType") public Response deleteSubstitutableNodeType()
focal_class.identifier: deleteSubstitutableNodeType
focal_class.modifiers: @DELETE @ApiOperation(value = "Removes the association to substitutable node type") @Path("substitutableNodeType") public
focal_class.parameters: ()
focal_class.return: Response
focal_class.signature: Response deleteSubstitutableNodeType()
focal_class.class_method_signature: ServiceTemplateResource.getInjectorOptions()
focal_class.full_signature: @GET @Path("injector/options") @Produces( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) public Response getInjectorOptions()
focal_class.identifier: getInjectorOptions
focal_class.modifiers: @GET @Path("injector/options") @Produces( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) public
focal_class.parameters: ()
focal_class.return: Response
focal_class.signature: Response getInjectorOptions()
focal_class.class_method_signature: ServiceTemplateResource.injectNodeTemplates(InjectorReplaceData injectorReplaceData, @Context UriInfo uriInfo)
focal_class.full_signature: @POST @Path("injector/replace") @Consumes( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) @Produces( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) public Response injectNodeTemplates(InjectorReplaceData injectorReplaceData, @Context UriInfo uriInfo)
focal_class.identifier: injectNodeTemplates
focal_class.modifiers: @POST @Path("injector/replace") @Consumes( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) @Produces( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) public
focal_class.parameters: (InjectorReplaceData injectorReplaceData, @Context UriInfo uriInfo)
focal_class.return: Response
focal_class.signature: Response injectNodeTemplates(InjectorReplaceData injectorReplaceData, @Context UriInfo uriInfo)
focal_class.class_method_signature: ServiceTemplateResource.complianceChecking(@Context UriInfo uriInfo)
focal_class.full_signature: @Path("constraintchecking") @Produces(MediaType.APPLICATION_XML) @POST public Response complianceChecking(@Context UriInfo uriInfo)
focal_class.identifier: complianceChecking
focal_class.modifiers: @Path("constraintchecking") @Produces(MediaType.APPLICATION_XML) @POST public
focal_class.parameters: (@Context UriInfo uriInfo)
focal_class.return: Response
focal_class.signature: Response complianceChecking(@Context UriInfo uriInfo)
focal_class.class_method_signature: ServiceTemplateResource.substitute()
focal_class.full_signature: @Path("substitute") @Produces(MediaType.APPLICATION_JSON) @GET public ServiceTemplateId substitute()
focal_class.identifier: substitute
focal_class.modifiers: @Path("substitute") @Produces(MediaType.APPLICATION_JSON) @GET public
focal_class.parameters: ()
focal_class.return: ServiceTemplateId
focal_class.signature: ServiceTemplateId substitute()
focal_class.class_method_signature: ServiceTemplateResource.createNewStatefulVersion()
focal_class.full_signature: @POST() @Path("createnewstatefulversion") @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public Response createNewStatefulVersion()
focal_class.identifier: createNewStatefulVersion
focal_class.modifiers: @POST() @Path("createnewstatefulversion") @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public
focal_class.parameters: ()
focal_class.return: Response
focal_class.signature: Response createNewStatefulVersion()
focal_class.class_method_signature: ServiceTemplateResource.threatModeling()
focal_class.full_signature: @Path("threatmodeling") @Produces(MediaType.APPLICATION_JSON) @GET public ThreatAssessment threatModeling()
focal_class.identifier: threatModeling
focal_class.modifiers: @Path("threatmodeling") @Produces(MediaType.APPLICATION_JSON) @GET public
focal_class.parameters: ()
focal_class.return: ThreatAssessment
focal_class.signature: ThreatAssessment threatModeling()
focal_class.class_method_signature: ServiceTemplateResource.createNewElement()
focal_class.full_signature: @Override protected TExtensibleElements createNewElement()
focal_class.identifier: createNewElement
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: TExtensibleElements
focal_class.signature: TExtensibleElements createNewElement()
focal_class.class_method_signature: ServiceTemplateResource.synchronizeReferences()
focal_class.full_signature: @Override public void synchronizeReferences()
focal_class.identifier: synchronizeReferences
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void synchronizeReferences()
focal_class.class_method_signature: ServiceTemplateResource.getParameterResource()
focal_class.full_signature: @Path("parameters") public ParameterResource getParameterResource()
focal_class.identifier: getParameterResource
focal_class.modifiers: @Path("parameters") public
focal_class.parameters: ()
focal_class.return: ParameterResource
focal_class.signature: ParameterResource getParameterResource()
focal_class.class_method_signature: ServiceTemplateResource.getToscaLightCompatibility()
focal_class.full_signature: @Path("toscalight") @Produces(MediaType.APPLICATION_JSON) @GET public Map<String, Object> getToscaLightCompatibility()
focal_class.identifier: getToscaLightCompatibility
focal_class.modifiers: @Path("toscalight") @Produces(MediaType.APPLICATION_JSON) @GET public
focal_class.parameters: ()
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> getToscaLightCompatibility()
focal_class.superclass: extends AbstractComponentInstanceResourceContainingATopology
focal_method.body: @POST()
      @Path("createnewstatefulversion")
      @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
      public Response createNewStatefulVersion() {
          LOGGER.debug("Creating new stateful version of Service Template {}...", this.getId());
          ServiceTemplateId id = (ServiceTemplateId) this.getId();
          WineryVersion version = VersionUtils.getVersion(id);
  
          SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss");
          WineryVersion newVersion = new WineryVersion(
              "stateful-" + version.toString() + "-" + dateFormat.format(new Date()),
              1,
              0
          );
  
          ServiceTemplateId newId = new ServiceTemplateId(id.getNamespace().getDecoded(),
              VersionUtils.getNameWithoutVersion(id) + WineryVersion.WINERY_NAME_FROM_VERSION_SEPARATOR + newVersion.toString(),
              false);
          ResourceResult response = RestUtils.duplicate(id, newId);
  
          if (response.getStatus() == Status.CREATED) {
              response.setUri(null);
              response.setMessage(new QNameApiData(newId));
          }
  
          LOGGER.debug("Created Service Template {}", newId.getQName());
  
          return response.getResponse();
      }
focal_method.class_method_signature: ServiceTemplateResource.createNewStatefulVersion()
focal_method.full_signature: @POST() @Path("createnewstatefulversion") @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public Response createNewStatefulVersion()
focal_method.identifier: createNewStatefulVersion
focal_method.invocations: debug getId getId getVersion toString format getDecoded getNamespace getNameWithoutVersion toString duplicate getStatus setUri setMessage debug getQName getResponse
focal_method.modifiers: @POST() @Path("createnewstatefulversion") @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public
focal_method.parameters: ()
focal_method.return: Response
focal_method.signature: Response createNewStatefulVersion()