01: /*
02: * ServiceImpl.java
03: *
04: * Created on September 24, 2006, 5:47 PM
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09:
10: package org.netbeans.modules.e2e.wsdl;
11:
12: import java.util.ArrayList;
13: import java.util.Collections;
14: import java.util.HashMap;
15: import java.util.List;
16: import java.util.Map;
17: import org.netbeans.modules.e2e.api.wsdl.Port;
18: import org.netbeans.modules.e2e.api.wsdl.Service;
19:
20: /**
21: *
22: * @author Michal Skvor
23: */
24: public class ServiceImpl implements Service {
25:
26: private String name;
27: private Map<String, Port> ports;
28:
29: /** Creates a new instance of ServiceImpl */
30: public ServiceImpl(String name) {
31: this .name = name;
32: ports = new HashMap();
33: }
34:
35: public void setName(String name) {
36: this .name = name;
37: }
38:
39: public String getName() {
40: return name;
41: }
42:
43: public void addPort(Port port) {
44: ports.put(port.getName(), port);
45: }
46:
47: public Port getPort(String name) {
48: return ports.get(name);
49: }
50:
51: public List<Port> getPorts() {
52: return Collections.unmodifiableList(new ArrayList(ports
53: .values()));
54: }
55:
56: }
|