@Override
  public void printPlanEndpoints() {
    this.init();
    this.em.getTransaction().begin();
    List<WSDLEndpoint> endpoints = null;
    Query queryWSDLEndpoint = this.em.createQuery("SELECT e FROM WSDLEndpoint e");

    endpoints = queryWSDLEndpoint.getResultList();
    this.em.getTransaction().commit();

    StringBuilder builder = new StringBuilder();
    String ls = System.getProperty("line.separator");
    builder.append(
        "debug output for stored endpoints of management plans, flags: csarid, planid, ianame, porttype "
            + ls);
    for (WSDLEndpoint endpoint : endpoints) {
      builder.append(
          "endpoint: "
              + endpoint.getCSARId()
              + " "
              + endpoint.getPlanId()
              + " "
              + endpoint.getIaName()
              + " "
              + endpoint.getPortType()
              + ls);
    }
    CoreInternalEndpointServiceImpl.LOG.debug(builder.toString());
  }
  @Override
  /** {@Inheritdoc} */
  public void storeWSDLEndpoint(WSDLEndpoint endpoint) {
    this.init();
    CoreInternalEndpointServiceImpl.LOG.debug(
        "Storing WSDL Endpoint with CSARID: \""
            + endpoint.getCSARId()
            + "\", portType: \""
            + endpoint.getPortType()
            + "\", IAName: \""
            + endpoint.getIaName()
            + "\", NodeTypeImplementation: \""
            + endpoint.getNodeTypeImplementation()
            + "\", URI: \""
            + endpoint.getURI().toString()
            + "\"");

    // TODO this check is a hack because of the problem with deploying of
    // multiple deployment artifacts
    if (!this.existsWSDLEndpoint(endpoint)) {
      this.em.getTransaction().begin();
      CoreInternalEndpointServiceImpl.LOG.debug(
          "The endpoint for \"{}\" is not stored. Thus store it.", endpoint.getPortType());
      this.em.persist(endpoint);
      this.em.getTransaction().commit();
    } else {
      CoreInternalEndpointServiceImpl.LOG.debug(
          "The endpoint for \"{}\" is stored already.", endpoint.getPortType());
    }
  }
 public void _endpoint_show_wsdl(CommandInterpreter commandInterpreter) {
   this.em.getTransaction().begin();
   Query query = this.em.createQuery("SELECT e FROM WSDLEndpoint e");
   @SuppressWarnings("unchecked")
   List<WSDLEndpoint> queryResults = query.getResultList();
   for (WSDLEndpoint e : queryResults) {
     commandInterpreter.println("CSARId: " + e.getCSARId());
     commandInterpreter.println("PortType: " + e.getPortType().toString());
     commandInterpreter.println(
         "PlanId: " + (e.getPlanId() == null ? "" : e.getPlanId().toString()));
     commandInterpreter.println(
         "NodeTypeImpl: "
             + (e.getNodeTypeImplementation() == null
                 ? ""
                 : e.getNodeTypeImplementation().toString()));
     commandInterpreter.println("IaName: " + (e.getIaName() == null ? "" : e.getIaName()));
     commandInterpreter.println("URI: " + e.getURI().toString());
     commandInterpreter.println("");
   }
   this.em.getTransaction().commit();
 }