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.Connection;
009: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.SSL;
010: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.componentflowPackage;
011:
012: import org.eclipse.emf.common.notify.Notification;
013: import org.eclipse.emf.common.notify.NotificationChain;
014:
015: import org.eclipse.emf.ecore.EClass;
016: import org.eclipse.emf.ecore.InternalEObject;
017:
018: import org.eclipse.emf.ecore.impl.ENotificationImpl;
019: import org.eclipse.emf.ecore.impl.EObjectImpl;
020:
021: /**
022: * <!-- begin-user-doc -->
023: * An implementation of the model object '<em><b>Connection</b></em>'.
024: * <!-- end-user-doc -->
025: * <p>
026: * The following features are implemented:
027: * <ul>
028: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.ConnectionImpl#getHost <em>Host</em>}</li>
029: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.ConnectionImpl#getPort <em>Port</em>}</li>
030: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.ConnectionImpl#getUser <em>User</em>}</li>
031: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.ConnectionImpl#getPassword <em>Password</em>}</li>
032: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.ConnectionImpl#isUseSSL <em>Use SSL</em>}</li>
033: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.ConnectionImpl#getSSL <em>SSL</em>}</li>
034: * </ul>
035: * </p>
036: *
037: * @generated
038: */
039: public class ConnectionImpl extends EObjectImpl implements Connection {
040: /**
041: * <!-- begin-user-doc -->
042: * <!-- end-user-doc -->
043: * @generated
044: */
045: public static final String copyright = "Copyright, Bostech Corp.";
046:
047: /**
048: * The default value of the '{@link #getHost() <em>Host</em>}' attribute.
049: * <!-- begin-user-doc -->
050: * <!-- end-user-doc -->
051: * @see #getHost()
052: * @generated
053: * @ordered
054: */
055: protected static final String HOST_EDEFAULT = null;
056:
057: /**
058: * The cached value of the '{@link #getHost() <em>Host</em>}' attribute.
059: * <!-- begin-user-doc -->
060: * <!-- end-user-doc -->
061: * @see #getHost()
062: * @generated
063: * @ordered
064: */
065: protected String host = HOST_EDEFAULT;
066:
067: /**
068: * The default value of the '{@link #getPort() <em>Port</em>}' attribute.
069: * <!-- begin-user-doc -->
070: * <!-- end-user-doc -->
071: * @see #getPort()
072: * @generated
073: * @ordered
074: */
075: protected static final String PORT_EDEFAULT = null;
076:
077: /**
078: * The cached value of the '{@link #getPort() <em>Port</em>}' attribute.
079: * <!-- begin-user-doc -->
080: * <!-- end-user-doc -->
081: * @see #getPort()
082: * @generated
083: * @ordered
084: */
085: protected String port = PORT_EDEFAULT;
086:
087: /**
088: * The default value of the '{@link #getUser() <em>User</em>}' attribute.
089: * <!-- begin-user-doc -->
090: * <!-- end-user-doc -->
091: * @see #getUser()
092: * @generated
093: * @ordered
094: */
095: protected static final String USER_EDEFAULT = null;
096:
097: /**
098: * The cached value of the '{@link #getUser() <em>User</em>}' attribute.
099: * <!-- begin-user-doc -->
100: * <!-- end-user-doc -->
101: * @see #getUser()
102: * @generated
103: * @ordered
104: */
105: protected String user = USER_EDEFAULT;
106:
107: /**
108: * The default value of the '{@link #getPassword() <em>Password</em>}' attribute.
109: * <!-- begin-user-doc -->
110: * <!-- end-user-doc -->
111: * @see #getPassword()
112: * @generated
113: * @ordered
114: */
115: protected static final String PASSWORD_EDEFAULT = null;
116:
117: /**
118: * The cached value of the '{@link #getPassword() <em>Password</em>}' attribute.
119: * <!-- begin-user-doc -->
120: * <!-- end-user-doc -->
121: * @see #getPassword()
122: * @generated
123: * @ordered
124: */
125: protected String password = PASSWORD_EDEFAULT;
126:
127: /**
128: * The default value of the '{@link #isUseSSL() <em>Use SSL</em>}' attribute.
129: * <!-- begin-user-doc -->
130: * <!-- end-user-doc -->
131: * @see #isUseSSL()
132: * @generated
133: * @ordered
134: */
135: protected static final boolean USE_SSL_EDEFAULT = false;
136:
137: /**
138: * The cached value of the '{@link #isUseSSL() <em>Use SSL</em>}' attribute.
139: * <!-- begin-user-doc -->
140: * <!-- end-user-doc -->
141: * @see #isUseSSL()
142: * @generated
143: * @ordered
144: */
145: protected boolean useSSL = USE_SSL_EDEFAULT;
146:
147: /**
148: * The cached value of the '{@link #getSSL() <em>SSL</em>}' containment reference.
149: * <!-- begin-user-doc -->
150: * <!-- end-user-doc -->
151: * @see #getSSL()
152: * @generated
153: * @ordered
154: */
155: protected SSL ssl = null;
156:
157: /**
158: * <!-- begin-user-doc -->
159: * <!-- end-user-doc -->
160: * @generated
161: */
162: protected ConnectionImpl() {
163: super ();
164: }
165:
166: /**
167: * <!-- begin-user-doc -->
168: * <!-- end-user-doc -->
169: * @generated
170: */
171: protected EClass eStaticClass() {
172: return componentflowPackage.Literals.CONNECTION;
173: }
174:
175: /**
176: * <!-- begin-user-doc -->
177: * <!-- end-user-doc -->
178: * @generated
179: */
180: public String getHost() {
181: return host;
182: }
183:
184: /**
185: * <!-- begin-user-doc -->
186: * <!-- end-user-doc -->
187: * @generated
188: */
189: public void setHost(String newHost) {
190: String oldHost = host;
191: host = newHost;
192: if (eNotificationRequired())
193: eNotify(new ENotificationImpl(this , Notification.SET,
194: componentflowPackage.CONNECTION__HOST, oldHost,
195: host));
196: }
197:
198: /**
199: * <!-- begin-user-doc -->
200: * <!-- end-user-doc -->
201: * @generated
202: */
203: public String getPort() {
204: return port;
205: }
206:
207: /**
208: * <!-- begin-user-doc -->
209: * <!-- end-user-doc -->
210: * @generated
211: */
212: public void setPort(String newPort) {
213: String oldPort = port;
214: port = newPort;
215: if (eNotificationRequired())
216: eNotify(new ENotificationImpl(this , Notification.SET,
217: componentflowPackage.CONNECTION__PORT, oldPort,
218: port));
219: }
220:
221: /**
222: * <!-- begin-user-doc -->
223: * <!-- end-user-doc -->
224: * @generated
225: */
226: public String getUser() {
227: return user;
228: }
229:
230: /**
231: * <!-- begin-user-doc -->
232: * <!-- end-user-doc -->
233: * @generated
234: */
235: public void setUser(String newUser) {
236: String oldUser = user;
237: user = newUser;
238: if (eNotificationRequired())
239: eNotify(new ENotificationImpl(this , Notification.SET,
240: componentflowPackage.CONNECTION__USER, oldUser,
241: user));
242: }
243:
244: /**
245: * <!-- begin-user-doc -->
246: * <!-- end-user-doc -->
247: * @generated
248: */
249: public String getPassword() {
250: return password;
251: }
252:
253: /**
254: * <!-- begin-user-doc -->
255: * <!-- end-user-doc -->
256: * @generated
257: */
258: public void setPassword(String newPassword) {
259: String oldPassword = password;
260: password = newPassword;
261: if (eNotificationRequired())
262: eNotify(new ENotificationImpl(this , Notification.SET,
263: componentflowPackage.CONNECTION__PASSWORD,
264: oldPassword, password));
265: }
266:
267: /**
268: * <!-- begin-user-doc -->
269: * <!-- end-user-doc -->
270: * @generated
271: */
272: public boolean isUseSSL() {
273: return useSSL;
274: }
275:
276: /**
277: * <!-- begin-user-doc -->
278: * <!-- end-user-doc -->
279: * @generated
280: */
281: public void setUseSSL(boolean newUseSSL) {
282: boolean oldUseSSL = useSSL;
283: useSSL = newUseSSL;
284: if (eNotificationRequired())
285: eNotify(new ENotificationImpl(this , Notification.SET,
286: componentflowPackage.CONNECTION__USE_SSL,
287: oldUseSSL, useSSL));
288: }
289:
290: /**
291: * <!-- begin-user-doc -->
292: * <!-- end-user-doc -->
293: * @generated
294: */
295: public SSL getSSL() {
296: return ssl;
297: }
298:
299: /**
300: * <!-- begin-user-doc -->
301: * <!-- end-user-doc -->
302: * @generated
303: */
304: public NotificationChain basicSetSSL(SSL newSSL,
305: NotificationChain msgs) {
306: SSL oldSSL = ssl;
307: ssl = newSSL;
308: if (eNotificationRequired()) {
309: ENotificationImpl notification = new ENotificationImpl(
310: this , Notification.SET,
311: componentflowPackage.CONNECTION__SSL, oldSSL,
312: newSSL);
313: if (msgs == null)
314: msgs = notification;
315: else
316: msgs.add(notification);
317: }
318: return msgs;
319: }
320:
321: /**
322: * <!-- begin-user-doc -->
323: * <!-- end-user-doc -->
324: * @generated
325: */
326: public void setSSL(SSL newSSL) {
327: if (newSSL != ssl) {
328: NotificationChain msgs = null;
329: if (ssl != null)
330: msgs = ((InternalEObject) ssl).eInverseRemove(this ,
331: EOPPOSITE_FEATURE_BASE
332: - componentflowPackage.CONNECTION__SSL,
333: null, msgs);
334: if (newSSL != null)
335: msgs = ((InternalEObject) newSSL).eInverseAdd(this ,
336: EOPPOSITE_FEATURE_BASE
337: - componentflowPackage.CONNECTION__SSL,
338: null, msgs);
339: msgs = basicSetSSL(newSSL, msgs);
340: if (msgs != null)
341: msgs.dispatch();
342: } else if (eNotificationRequired())
343: eNotify(new ENotificationImpl(this , Notification.SET,
344: componentflowPackage.CONNECTION__SSL, newSSL,
345: newSSL));
346: }
347:
348: /**
349: * <!-- begin-user-doc -->
350: * <!-- end-user-doc -->
351: * @generated
352: */
353: public NotificationChain eInverseRemove(InternalEObject otherEnd,
354: int featureID, NotificationChain msgs) {
355: switch (featureID) {
356: case componentflowPackage.CONNECTION__SSL:
357: return basicSetSSL(null, msgs);
358: }
359: return super .eInverseRemove(otherEnd, featureID, msgs);
360: }
361:
362: /**
363: * <!-- begin-user-doc -->
364: * <!-- end-user-doc -->
365: * @generated
366: */
367: public Object eGet(int featureID, boolean resolve, boolean coreType) {
368: switch (featureID) {
369: case componentflowPackage.CONNECTION__HOST:
370: return getHost();
371: case componentflowPackage.CONNECTION__PORT:
372: return getPort();
373: case componentflowPackage.CONNECTION__USER:
374: return getUser();
375: case componentflowPackage.CONNECTION__PASSWORD:
376: return getPassword();
377: case componentflowPackage.CONNECTION__USE_SSL:
378: return isUseSSL() ? Boolean.TRUE : Boolean.FALSE;
379: case componentflowPackage.CONNECTION__SSL:
380: return getSSL();
381: }
382: return super .eGet(featureID, resolve, coreType);
383: }
384:
385: /**
386: * <!-- begin-user-doc -->
387: * <!-- end-user-doc -->
388: * @generated
389: */
390: public void eSet(int featureID, Object newValue) {
391: switch (featureID) {
392: case componentflowPackage.CONNECTION__HOST:
393: setHost((String) newValue);
394: return;
395: case componentflowPackage.CONNECTION__PORT:
396: setPort((String) newValue);
397: return;
398: case componentflowPackage.CONNECTION__USER:
399: setUser((String) newValue);
400: return;
401: case componentflowPackage.CONNECTION__PASSWORD:
402: setPassword((String) newValue);
403: return;
404: case componentflowPackage.CONNECTION__USE_SSL:
405: setUseSSL(((Boolean) newValue).booleanValue());
406: return;
407: case componentflowPackage.CONNECTION__SSL:
408: setSSL((SSL) newValue);
409: return;
410: }
411: super .eSet(featureID, newValue);
412: }
413:
414: /**
415: * <!-- begin-user-doc -->
416: * <!-- end-user-doc -->
417: * @generated
418: */
419: public void eUnset(int featureID) {
420: switch (featureID) {
421: case componentflowPackage.CONNECTION__HOST:
422: setHost(HOST_EDEFAULT);
423: return;
424: case componentflowPackage.CONNECTION__PORT:
425: setPort(PORT_EDEFAULT);
426: return;
427: case componentflowPackage.CONNECTION__USER:
428: setUser(USER_EDEFAULT);
429: return;
430: case componentflowPackage.CONNECTION__PASSWORD:
431: setPassword(PASSWORD_EDEFAULT);
432: return;
433: case componentflowPackage.CONNECTION__USE_SSL:
434: setUseSSL(USE_SSL_EDEFAULT);
435: return;
436: case componentflowPackage.CONNECTION__SSL:
437: setSSL((SSL) null);
438: return;
439: }
440: super .eUnset(featureID);
441: }
442:
443: /**
444: * <!-- begin-user-doc -->
445: * <!-- end-user-doc -->
446: * @generated
447: */
448: public boolean eIsSet(int featureID) {
449: switch (featureID) {
450: case componentflowPackage.CONNECTION__HOST:
451: return HOST_EDEFAULT == null ? host != null
452: : !HOST_EDEFAULT.equals(host);
453: case componentflowPackage.CONNECTION__PORT:
454: return PORT_EDEFAULT == null ? port != null
455: : !PORT_EDEFAULT.equals(port);
456: case componentflowPackage.CONNECTION__USER:
457: return USER_EDEFAULT == null ? user != null
458: : !USER_EDEFAULT.equals(user);
459: case componentflowPackage.CONNECTION__PASSWORD:
460: return PASSWORD_EDEFAULT == null ? password != null
461: : !PASSWORD_EDEFAULT.equals(password);
462: case componentflowPackage.CONNECTION__USE_SSL:
463: return useSSL != USE_SSL_EDEFAULT;
464: case componentflowPackage.CONNECTION__SSL:
465: return ssl != null;
466: }
467: return super .eIsSet(featureID);
468: }
469:
470: /**
471: * <!-- begin-user-doc -->
472: * <!-- end-user-doc -->
473: * @generated
474: */
475: public String toString() {
476: if (eIsProxy())
477: return super .toString();
478:
479: StringBuffer result = new StringBuffer(super .toString());
480: result.append(" (host: ");
481: result.append(host);
482: result.append(", port: ");
483: result.append(port);
484: result.append(", user: ");
485: result.append(user);
486: result.append(", password: ");
487: result.append(password);
488: result.append(", useSSL: ");
489: result.append(useSSL);
490: result.append(')');
491: return result.toString();
492: }
493:
494: } //ConnectionImpl
|