001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl;
007:
008: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.TCPIPServer;
009: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.componentflowPackage;
010:
011: import org.eclipse.emf.common.notify.Notification;
012:
013: import org.eclipse.emf.ecore.EClass;
014:
015: import org.eclipse.emf.ecore.impl.ENotificationImpl;
016:
017: /**
018: * <!-- begin-user-doc -->
019: * An implementation of the model object '<em><b>TCPIP Server</b></em>'.
020: * <!-- end-user-doc -->
021: * <p>
022: * The following features are implemented:
023: * <ul>
024: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.TCPIPServerImpl#getListenPort <em>Listen Port</em>}</li>
025: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.TCPIPServerImpl#getMaxClients <em>Max Clients</em>}</li>
026: * </ul>
027: * </p>
028: *
029: * @generated
030: */
031: public class TCPIPServerImpl extends ConnectionSettingImpl implements
032: TCPIPServer {
033: /**
034: * <!-- begin-user-doc -->
035: * <!-- end-user-doc -->
036: * @generated
037: */
038: public static final String copyright = "Copyright, Bostech Corp.";
039:
040: /**
041: * The default value of the '{@link #getListenPort() <em>Listen Port</em>}' attribute.
042: * <!-- begin-user-doc -->
043: * <!-- end-user-doc -->
044: * @see #getListenPort()
045: * @generated
046: * @ordered
047: */
048: protected static final String LISTEN_PORT_EDEFAULT = null;
049:
050: /**
051: * The cached value of the '{@link #getListenPort() <em>Listen Port</em>}' attribute.
052: * <!-- begin-user-doc -->
053: * <!-- end-user-doc -->
054: * @see #getListenPort()
055: * @generated
056: * @ordered
057: */
058: protected String listenPort = LISTEN_PORT_EDEFAULT;
059:
060: /**
061: * The default value of the '{@link #getMaxClients() <em>Max Clients</em>}' attribute.
062: * <!-- begin-user-doc -->
063: * <!-- end-user-doc -->
064: * @see #getMaxClients()
065: * @generated
066: * @ordered
067: */
068: protected static final int MAX_CLIENTS_EDEFAULT = 20;
069:
070: /**
071: * The cached value of the '{@link #getMaxClients() <em>Max Clients</em>}' attribute.
072: * <!-- begin-user-doc -->
073: * <!-- end-user-doc -->
074: * @see #getMaxClients()
075: * @generated
076: * @ordered
077: */
078: protected int maxClients = MAX_CLIENTS_EDEFAULT;
079:
080: /**
081: * <!-- begin-user-doc -->
082: * <!-- end-user-doc -->
083: * @generated
084: */
085: protected TCPIPServerImpl() {
086: super ();
087: }
088:
089: /**
090: * <!-- begin-user-doc -->
091: * <!-- end-user-doc -->
092: * @generated
093: */
094: protected EClass eStaticClass() {
095: return componentflowPackage.Literals.TCPIP_SERVER;
096: }
097:
098: /**
099: * <!-- begin-user-doc -->
100: * <!-- end-user-doc -->
101: * @generated
102: */
103: public String getListenPort() {
104: return listenPort;
105: }
106:
107: /**
108: * <!-- begin-user-doc -->
109: * <!-- end-user-doc -->
110: * @generated
111: */
112: public void setListenPort(String newListenPort) {
113: String oldListenPort = listenPort;
114: listenPort = newListenPort;
115: if (eNotificationRequired())
116: eNotify(new ENotificationImpl(this , Notification.SET,
117: componentflowPackage.TCPIP_SERVER__LISTEN_PORT,
118: oldListenPort, listenPort));
119: }
120:
121: /**
122: * <!-- begin-user-doc -->
123: * <!-- end-user-doc -->
124: * @generated
125: */
126: public int getMaxClients() {
127: return maxClients;
128: }
129:
130: /**
131: * <!-- begin-user-doc -->
132: * <!-- end-user-doc -->
133: * @generated
134: */
135: public void setMaxClients(int newMaxClients) {
136: int oldMaxClients = maxClients;
137: maxClients = newMaxClients;
138: if (eNotificationRequired())
139: eNotify(new ENotificationImpl(this , Notification.SET,
140: componentflowPackage.TCPIP_SERVER__MAX_CLIENTS,
141: oldMaxClients, maxClients));
142: }
143:
144: /**
145: * <!-- begin-user-doc -->
146: * <!-- end-user-doc -->
147: * @generated
148: */
149: public Object eGet(int featureID, boolean resolve, boolean coreType) {
150: switch (featureID) {
151: case componentflowPackage.TCPIP_SERVER__LISTEN_PORT:
152: return getListenPort();
153: case componentflowPackage.TCPIP_SERVER__MAX_CLIENTS:
154: return new Integer(getMaxClients());
155: }
156: return super .eGet(featureID, resolve, coreType);
157: }
158:
159: /**
160: * <!-- begin-user-doc -->
161: * <!-- end-user-doc -->
162: * @generated
163: */
164: public void eSet(int featureID, Object newValue) {
165: switch (featureID) {
166: case componentflowPackage.TCPIP_SERVER__LISTEN_PORT:
167: setListenPort((String) newValue);
168: return;
169: case componentflowPackage.TCPIP_SERVER__MAX_CLIENTS:
170: setMaxClients(((Integer) newValue).intValue());
171: return;
172: }
173: super .eSet(featureID, newValue);
174: }
175:
176: /**
177: * <!-- begin-user-doc -->
178: * <!-- end-user-doc -->
179: * @generated
180: */
181: public void eUnset(int featureID) {
182: switch (featureID) {
183: case componentflowPackage.TCPIP_SERVER__LISTEN_PORT:
184: setListenPort(LISTEN_PORT_EDEFAULT);
185: return;
186: case componentflowPackage.TCPIP_SERVER__MAX_CLIENTS:
187: setMaxClients(MAX_CLIENTS_EDEFAULT);
188: return;
189: }
190: super .eUnset(featureID);
191: }
192:
193: /**
194: * <!-- begin-user-doc -->
195: * <!-- end-user-doc -->
196: * @generated
197: */
198: public boolean eIsSet(int featureID) {
199: switch (featureID) {
200: case componentflowPackage.TCPIP_SERVER__LISTEN_PORT:
201: return LISTEN_PORT_EDEFAULT == null ? listenPort != null
202: : !LISTEN_PORT_EDEFAULT.equals(listenPort);
203: case componentflowPackage.TCPIP_SERVER__MAX_CLIENTS:
204: return maxClients != MAX_CLIENTS_EDEFAULT;
205: }
206: return super .eIsSet(featureID);
207: }
208:
209: /**
210: * <!-- begin-user-doc -->
211: * <!-- end-user-doc -->
212: * @generated
213: */
214: public String toString() {
215: if (eIsProxy())
216: return super .toString();
217:
218: StringBuffer result = new StringBuffer(super .toString());
219: result.append(" (listenPort: ");
220: result.append(listenPort);
221: result.append(", maxClients: ");
222: result.append(maxClients);
223: result.append(')');
224: return result.toString();
225: }
226:
227: } //TCPIPServerImpl
|