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 getInjectorOptions() throws Exception {
          this.setRevisionTo("84d064a2f7390b3274ca8b3641a5902ba4c822d7");
          this.assertGet("servicetemplates/http%253A%252F%252Fwinery.opentosca.org%252Ftest%252Fservicetemplates%252Fponyuniverse%252Finjector/FoodandHouseInjectionTest/injector/options",
              "servicetemplates/ServiceTemplateResource-getInjectionOptions.json");
      }
test_case.class_method_signature: ServiceTemplateResourceTest.getInjectorOptions()
test_case.full_signature: @Test public void getInjectorOptions()
test_case.identifier: getInjectorOptions
test_case.invocations: setRevisionTo assertGet
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getInjectorOptions()
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: @GET
      @Path("injector/options")
      @Produces( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
      public Response getInjectorOptions() {
          Splitting splitting = new Splitting();
          TTopologyTemplate topologyTemplate = this.getServiceTemplate().getTopologyTemplate();
          Map<String, List<TTopologyTemplate>> hostMatchingOptions;
          Map<String, List<TTopologyTemplate>> connectionMatchingOptions;
          InjectorReplaceOptions injectionReplaceOptions = new InjectorReplaceOptions();
  
          try {
  
              Map<TRequirement, String> requirementsAndMatchingBasisCapabilityTypes =
                  splitting.getOpenRequirementsAndMatchingBasisCapabilityTypeNames(this.getServiceTemplate().getTopologyTemplate());
              // Output check
              for (TRequirement req : requirementsAndMatchingBasisCapabilityTypes.keySet()) {
                  System.out.println("open Requirement: " + req.getId());
                  System.out.println("matchingBasisType: " + requirementsAndMatchingBasisCapabilityTypes.get(req));
              }
  
              if (requirementsAndMatchingBasisCapabilityTypes.containsValue("Container")) {
                  hostMatchingOptions = splitting.getHostingMatchingOptionsWithDefaultLabeling(topologyTemplate);
              } else {
                  hostMatchingOptions = null;
              }
              if (requirementsAndMatchingBasisCapabilityTypes.containsValue("Endpoint")) {
                  connectionMatchingOptions = splitting.getConnectionInjectionOptions(topologyTemplate);
              } else {
                  connectionMatchingOptions = null;
              }
  
              injectionReplaceOptions.setTopologyTemplate(topologyTemplate);
              injectionReplaceOptions.setHostInjectionOptions(hostMatchingOptions);
              injectionReplaceOptions.setConnectionInjectionOptions(connectionMatchingOptions);
  
              if (hostMatchingOptions == null && connectionMatchingOptions == null) {
                  return Response.status(Status.BAD_REQUEST).type(MediaType.TEXT_PLAIN).entity("No need for matching").build();
              }
          } catch (SplittingException e) {
              LOGGER.error("Could not match", e);
              return Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build();
          }
          return Response.ok().entity(injectionReplaceOptions).build();
      }
focal_method.class_method_signature: ServiceTemplateResource.getInjectorOptions()
focal_method.full_signature: @GET @Path("injector/options") @Produces( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) public Response getInjectorOptions()
focal_method.identifier: getInjectorOptions
focal_method.invocations: getTopologyTemplate getServiceTemplate getOpenRequirementsAndMatchingBasisCapabilityTypeNames getTopologyTemplate getServiceTemplate keySet println getId println get containsValue getHostingMatchingOptionsWithDefaultLabeling containsValue getConnectionInjectionOptions setTopologyTemplate setHostInjectionOptions setConnectionInjectionOptions build entity type status error build entity status getMessage build entity ok
focal_method.modifiers: @GET @Path("injector/options") @Produces( {MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.APPLICATION_JSON}) public
focal_method.parameters: ()
focal_method.return: Response
focal_method.signature: Response getInjectorOptions()