- Timestamp:
- 03/11/15 16:59:16 (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/HTTPUtils.java
r1635 r1913 143 143 SOAPEventType eventType = (SOAPEventType) event.getType(); 144 144 newSequence.add(new Event(new SimpleSOAPEventType(eventType.getCalledMethod(), 145 eventType.getServiceName()))); 145 eventType.getServiceName(), 146 eventType.getClientName()))); 146 147 } 147 148 else { -
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SimpleSOAPEventType.java
r1642 r1913 44 44 */ 45 45 private final String serviceName; 46 47 /** 48 * <p> 49 * the name of the client; this is either the host/ip and port of the sender or, if a path 50 * map is available, a human readable name that may be based also on the receiver 51 * </p> 52 */ 53 private final String clientName; 46 54 47 55 /** … … 51 59 * 52 60 */ 53 public SimpleSOAPEventType(String calledMethod, String serviceName ) {61 public SimpleSOAPEventType(String calledMethod, String serviceName, String clientName) { 54 62 if (calledMethod == null) { 55 63 throw new IllegalArgumentException("called method must not be null"); … … 58 66 throw new IllegalArgumentException("serviceName must not be null"); 59 67 } 68 if (clientName == null) { 69 throw new IllegalArgumentException("clientName must not be null"); 70 } 60 71 this.calledMethod = calledMethod; 61 72 this.serviceName = serviceName; 73 this.clientName = clientName; 62 74 } 63 75 … … 82 94 public String getServiceName() { 83 95 return serviceName; 96 } 97 98 /** 99 * <p> 100 * the name of the client calling in this request 101 * </p> 102 * 103 * @return the name of the client calling in this request 104 */ 105 public String getClientName() { 106 return clientName; 84 107 } 85 108 -
trunk/autoquest-plugin-uml-test/src/test/resources/ita_v2_servicenamemap.txt
r1908 r1913 1 /ws/BusinessUnitReferenceImplementationService = materialSupplierService 2 /ws/WarehouseReferenceImplementationService = warehouseService 3 /ws/PointOfSaleReferenceImplementationService = pointOfSaleService 4 /ws/TransportReferenceImplementationService = TransportService 1 serviceName.path./ws/BusinessUnitReferenceImplementationService = materialSupplierService 2 serviceName.path./ws/WarehouseReferenceImplementationService = warehouseService 3 serviceName.path./ws/PointOfSaleReferenceImplementationService = pointOfSaleService 4 serviceName.path./ws/TransportReferenceImplementationService = TransportService 5 clientName.receiver.port.8086 = warehouseService 6 clientName.receiver.port.8087 = TransportService 7 clientName.receiver.port.8088 = pointOfSaleService 8 clientName.receiver.port.8089 = materialSupplierService 9 clientName.receiver.port.8090 = TransportService 10 clientName.receiver.port.8091 = pointOfSaleService 11 clientName.receiver.port.8092 = materialSupplierService 12 clientName.receiver.port.8093 = warehouseService 13 clientName.receiver.port.8094 = pointOfSaleService 14 clientName.receiver.port.8095 = materialSupplierService 15 clientName.receiver.port.8096 = warehouseService 16 clientName.receiver.port.8097 = TransportService 17 clientName.default = Logistics_Environment 18 -
trunk/autoquest-plugin-uml-test/src/test/resources/testCalculateUsageScore_1_properties.txt
r1835 r1913 1 /midas/rlus/query/xdw = rlus_property 2 /midas/rlus/update/xdw = rlus_property 3 /midas/rlus/update/cda2report = rlus_property 4 /midas/ixsmq/update/pocdpatient = ixsmq_property 5 /midas/ixsmq/query/pocdpatient = ixsmq_property 1 serviceName.path./midas/rlus/query/xdw = rlus_property 2 serviceName.path./midas/rlus/update/xdw = rlus_property 3 serviceName.path./midas/rlus/update/cda2report = rlus_property 4 serviceName.path./midas/ixsmq/update/pocdpatient = ixsmq_property 5 serviceName.path./midas/ixsmq/query/pocdpatient = ixsmq_property 6 clientName.receiver.port.6000 = user -
trunk/autoquest-plugin-uml-test/src/test/resources/testCreateInteractionFromEventSequence_1_properties.txt
r1835 r1913 1 /midas/rlus/query/xdw = rlus_property 2 /midas/rlus/update/xdw = rlus_property 3 /midas/rlus/update/cda2report = rlus_property 4 /midas/ixsmq/update/pocdpatient = ixsmq_property 5 /midas/ixsmq/query/pocdpatient = ixsmq_property 1 serviceName.path./midas/rlus/query/xdw = rlus_property 2 serviceName.path./midas/rlus/update/xdw = rlus_property 3 serviceName.path./midas/rlus/update/cda2report = rlus_property 4 serviceName.path./midas/ixsmq/update/pocdpatient = ixsmq_property 5 serviceName.path./midas/ixsmq/query/pocdpatient = ixsmq_property 6 clientName.receiver.port.6000 = user -
trunk/autoquest-plugin-uml-test/src/test/resources/testCreateInteractionFromEventSequence_2_properties.txt
r1835 r1913 1 /ws/BusinessUnitBusinessService = materialSupplier 2 /ws/BusinessUnitWarehouseService = warehouse 3 /ws/BusinessUnitTransportService = transport 4 /ws/WarehouseWarehouseService = warehouse 5 /ws/WarehouseBusinessService = materialSupplier 6 /ws/WarehouseTransportService = transport 7 /ws/TransportTransportService = transport 8 /ws/PointOfSaleBusinessService = pointOfSale 9 /ws/PointOfSaleWarehouseService = pointOfSale 10 /ws/PointOfSaleTransportService = pointOfSale 1 serviceName.path./ws/BusinessUnitBusinessService = materialSupplier 2 serviceName.path./ws/BusinessUnitWarehouseService = warehouse 3 serviceName.path./ws/BusinessUnitTransportService = transport 4 serviceName.path./ws/WarehouseWarehouseService = warehouse 5 serviceName.path./ws/WarehouseBusinessService = materialSupplier 6 serviceName.path./ws/WarehouseTransportService = transport 7 serviceName.path./ws/TransportTransportService = transport 8 serviceName.path./ws/PointOfSaleBusinessService = pointOfSale 9 serviceName.path./ws/PointOfSaleWarehouseService = pointOfSale 10 serviceName.path./ws/PointOfSaleTransportService = pointOfSale 11 clientName.receiver.port.9081 = warehouse 12 clientName.receiver.port.9082 = transport 13 clientName.receiver.port.9083 = warehouse 14 clientName.receiver.port.9084 = warehouse -
trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java
r1908 r1913 486 486 String serviceName = getServiceNameFromEvent(event); 487 487 String methodName = getCalledMethodFromEvent(event); 488 String clientName = getClientNameFromEvent(event); 488 489 // determine lifelines 489 490 Lifeline msgTargetLifeline; 490 491 Lifeline msgSourceLifeline; 491 492 if (serviceName.equals(userLifeline.getName())) { 493 // message being send to user 494 // currently we just select the first lifeline that is not the user 495 // this, obviously, has to be replaced with the real service. 496 // however, identification of the source of a message is still an open issue 497 msgSourceLifeline = null; 498 for (Lifeline lifeline : interaction.getLifelines()) { 499 if (!lifeline.equals(userLifeline)) { 500 msgSourceLifeline = lifeline; 501 break; 502 } 503 } 504 msgTargetLifeline = userLifeline; 505 } 506 else { 507 msgSourceLifeline = userLifeline; 508 msgTargetLifeline = interaction.getLifeline(serviceName); 509 } 492 493 msgSourceLifeline = interaction.getLifeline(clientName); 494 msgTargetLifeline = interaction.getLifeline(serviceName); 495 510 496 if (msgSourceLifeline == null) { 511 497 throw new RuntimeException( 512 "Error creating message: could not determine source lifeline .");498 "Error creating message: could not determine source lifeline for component: " + clientName); 513 499 } 514 500 if (msgTargetLifeline == null) { 515 501 throw new RuntimeException( 516 "Error creating message: could not determine target lifeline .");502 "Error creating message: could not determine target lifeline for component: " + serviceName); 517 503 } 518 504 // determine correct target interface … … 666 652 .getName(); 667 653 } 668 eventSequence.add(new Event(new SimpleSOAPEventType(methodName, serviceName )));654 eventSequence.add(new Event(new SimpleSOAPEventType(methodName, serviceName,""))); // TODO add client name 669 655 } 670 656 } … … 809 795 else if (event.getType() instanceof SimpleSOAPEventType) { 810 796 return ((SimpleSOAPEventType) event.getType()).getCalledMethod(); 797 } 798 else { 799 throw new RuntimeException( 800 "Wrong event type. Only SOAPEventType and SimpleSOAPEventType supported but was: " + 801 event.getType().getClass().getName()); 802 } 803 } 804 805 /** 806 * <p> 807 * Helper function to get the name of a client from a SOAP event. 808 * </p> 809 * 810 * @param event 811 * event for which the client name is retrieved 812 * @return service name 813 */ 814 protected static String getClientNameFromEvent(Event event) { 815 if (event.getType() instanceof SOAPEventType) { 816 return ((SOAPEventType) event.getType()).getClientName(); 817 } 818 else if (event.getType() instanceof SimpleSOAPEventType) { 819 return ((SimpleSOAPEventType) event.getType()).getClientName(); 811 820 } 812 821 else { … … 1013 1022 InstanceSpecification instSpec = (InstanceSpecification) serviceInstSpecPkg.createPackagedElement("instspec_"+type.getName(), UMLPackage.Literals.INSTANCE_SPECIFICATION); 1014 1023 instSpec.getClassifiers().add(type); 1015 System.out.println(type.getName());1016 1024 for( Property prop : type.getAllAttributes() ) { 1017 1025 // TODO handle multiplicity
Note: See TracChangeset
for help on using the changeset viewer.