summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierrick MARIE2012-07-03 05:43:22 (EDT)
committer Benjamin Cabé2012-07-03 05:43:22 (EDT)
commitcc382df5edb112aeb53702f4e6ac231b10f75aee (patch)
treebf6e821236688625a2ad9671e4c5956cc64da574
parent4eaf4cb53b6847b97dca20b8c57664e6c605cabd (diff)
downloadorg.eclipse.koneki.simulators-cc382df5edb112aeb53702f4e6ac231b10f75aee.zip
org.eclipse.koneki.simulators-cc382df5edb112aeb53702f4e6ac231b10f75aee.tar.gz
org.eclipse.koneki.simulators-cc382df5edb112aeb53702f4e6ac231b10f75aee.tar.bz2
First step to authentications
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java9
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model.edit/plugin.properties2
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecore2
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecorediag8
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.genmodel2
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/AuthenticationType.java52
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java279
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java638
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/OMADMSimulatorPackageImpl.java2
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/util/NodeHelpers.java1
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm/src/org/eclipse/koneki/simulators/omadm/basic/DMBasicSimulation.java25
-rw-r--r--omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java73
12 files changed, 656 insertions, 437 deletions
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java
index 4c3a594..d304795 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.editor/src/org/eclipse/koneki/simulators/omadm/editor/internal/configuration/ConfigurationPage.java
@@ -28,7 +28,9 @@ import org.eclipse.koneki.simulators.omadm.editor.Messages;
import org.eclipse.koneki.simulators.omadm.editor.OMADMSimulatorEditor;
import org.eclipse.koneki.simulators.omadm.model.AuthenticationType;
import org.eclipse.koneki.simulators.omadm.model.Device;
+import org.eclipse.koneki.simulators.omadm.model.Node;
import org.eclipse.koneki.simulators.omadm.model.OMADMSimulatorPackage;
+import org.eclipse.koneki.simulators.omadm.model.util.NodeHelpers;
import org.eclipse.pde.emfforms.editor.AbstractEmfFormPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
@@ -72,6 +74,9 @@ public class ConfigurationPage extends AbstractEmfFormPage {
AuthenticationType auth = AuthenticationType.get(value.toString());
device.setAuthentication(auth);
+ Node authPref = NodeHelpers.findFirstNode(NodeHelpers.getNode(device.getTree(), "./DMAcc"), "AuthPref");
+ authPref.setData(auth.getName());
+
return auth;
}
@@ -113,8 +118,8 @@ public class ConfigurationPage extends AbstractEmfFormPage {
// AuthenticationType
bindingContext.bindValue(WidgetProperties.selection().observe(this.authenticationType.getCombo()), EMFEditObservables.observeDetailValue(
- Realm.getDefault(), editingDomain, deviceObservable, OMADMSimulatorPackage.Literals.AUTHENTICATION_TYPE.eContainingFeature()),
- targetToModel, modelToTarget);
+ Realm.getDefault(), editingDomain, deviceObservable, OMADMSimulatorPackage.Literals.DEVICE__AUTHENTICATION), targetToModel,
+ modelToTarget);
}
@Override
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model.edit/plugin.properties b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model.edit/plugin.properties
index 07db704..5ec4631 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model.edit/plugin.properties
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model.edit/plugin.properties
@@ -106,3 +106,5 @@ _UI_Device_serverUrl_feature = Server Url
_UI_AuthenticationType_BASIC_literal = basic
_UI_AuthenticationType_NONE_literal = none
_UI_Device_authentication_feature = Authentication
+_UI_AuthenticationType_HMAC_literal = hmac
+_UI_AuthenticationType_MD5_literal = md5
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecore b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecore
index edcab64..7a8a2a2 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecore
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecore
@@ -110,5 +110,7 @@
<eClassifiers xsi:type="ecore:EEnum" name="AuthenticationType">
<eLiterals name="BASIC" literal="basic"/>
<eLiterals name="NONE" value="1" literal="none"/>
+ <eLiterals name="HMAC" value="2" literal="hmac"/>
+ <eLiterals name="MD5" value="3" literal="md5"/>
</eClassifiers>
</ecore:EPackage>
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecorediag b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecorediag
index 40ac590..ce959f7 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecorediag
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.ecorediag
@@ -308,6 +308,14 @@
<element xmi:type="ecore:EEnumLiteral" href="omadmsimulation.ecore#//AuthenticationType/NONE"/>
<layoutConstraint xmi:type="notation:Location" xmi:id="_8EraMbU_EeG5SZFd1R_ZqQ"/>
</children>
+ <children xmi:type="notation:Node" xmi:id="_KH_6ccQnEeGbRPixwywypQ" type="2006">
+ <element xmi:type="ecore:EEnumLiteral" href="omadmsimulation.ecore#//AuthenticationType/HMAC"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_KIAhgMQnEeGbRPixwywypQ"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_s7juQcROEeGvM_YzF1yMnw" type="2006">
+ <element xmi:type="ecore:EEnumLiteral" href="omadmsimulation.ecore#//AuthenticationType/MD5"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_s7kVUMROEeGvM_YzF1yMnw"/>
+ </children>
<styles xmi:type="notation:DrawerStyle" xmi:id="_yErU4bU_EeG5SZFd1R_ZqQ"/>
<styles xmi:type="notation:SortingStyle" xmi:id="_yErU4rU_EeG5SZFd1R_ZqQ"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_yErU47U_EeG5SZFd1R_ZqQ"/>
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.genmodel b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.genmodel
index 3c92929..9d1d96f 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.genmodel
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/model/omadmsimulation.genmodel
@@ -43,6 +43,8 @@
<genEnums typeSafeEnumCompatible="false" ecoreEnum="omadmsimulation.ecore#//AuthenticationType">
<genEnumLiterals ecoreEnumLiteral="omadmsimulation.ecore#//AuthenticationType/BASIC"/>
<genEnumLiterals ecoreEnumLiteral="omadmsimulation.ecore#//AuthenticationType/NONE"/>
+ <genEnumLiterals ecoreEnumLiteral="omadmsimulation.ecore#//AuthenticationType/HMAC"/>
+ <genEnumLiterals ecoreEnumLiteral="omadmsimulation.ecore#//AuthenticationType/MD5"/>
</genEnums>
<genClasses ecoreClass="omadmsimulation.ecore#//OMADMSimulation">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference omadmsimulation.ecore#//OMADMSimulation/device"/>
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/AuthenticationType.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/AuthenticationType.java
index f913835..f10324f 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/AuthenticationType.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/AuthenticationType.java
@@ -40,7 +40,23 @@ public enum AuthenticationType implements Enumerator {
* @generated
* @ordered
*/
- NONE(1, "NONE", "none");
+ NONE(1, "NONE", "none"), /**
+ * The '<em><b>HMAC</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #HMAC_VALUE
+ * @generated
+ * @ordered
+ */
+ HMAC(2, "HMAC", "hmac"), /**
+ * The '<em><b>MD5</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #MD5_VALUE
+ * @generated
+ * @ordered
+ */
+ MD5(3, "MD5", "md5");
/**
* The '<em><b>BASIC</b></em>' literal value.
@@ -73,6 +89,36 @@ public enum AuthenticationType implements Enumerator {
public static final int NONE_VALUE = 1;
/**
+ * The '<em><b>HMAC</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>HMAC</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #HMAC
+ * @model literal="hmac"
+ * @generated
+ * @ordered
+ */
+ public static final int HMAC_VALUE = 2;
+
+ /**
+ * The '<em><b>MD5</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>MD5</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #MD5
+ * @model literal="md5"
+ * @generated
+ * @ordered
+ */
+ public static final int MD5_VALUE = 3;
+
+ /**
* An array of all the '<em><b>Authentication Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -82,6 +128,8 @@ public enum AuthenticationType implements Enumerator {
new AuthenticationType[] {
BASIC,
NONE,
+ HMAC,
+ MD5,
};
/**
@@ -134,6 +182,8 @@ public enum AuthenticationType implements Enumerator {
switch (value) {
case BASIC_VALUE: return BASIC;
case NONE_VALUE: return NONE;
+ case HMAC_VALUE: return HMAC;
+ case MD5_VALUE: return MD5;
}
return null;
}
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java
index e7295e0..f035ef8 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java
@@ -32,22 +32,22 @@ import org.eclipse.koneki.simulators.omadm.model.util.NodeHelpers;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getDeviceIdType <em>Device Id Type</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getTree <em>Tree</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getDeviceId <em>Device Id</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getLogin <em>Login</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getPassword <em>Password</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getServerUrl <em>Server Url</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getAuthentication <em>Authentication</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getDeviceIdType <em>Device Id Type</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getTree <em>Tree</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getDeviceId <em>Device Id</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getLogin <em>Login</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getPassword <em>Password</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getServerUrl <em>Server Url</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.DeviceImpl#getAuthentication <em>Authentication</em>}</li>
* </ul>
* </p>
- *
+ *
* @generated
*/
public class DeviceImpl extends EObjectImpl implements Device {
/**
- * The default value of the '{@link #getDeviceIdType() <em>Device Id Type</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getDeviceIdType() <em>Device Id Type</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getDeviceIdType()
* @generated
* @ordered
@@ -55,8 +55,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected static final DeviceIdType DEVICE_ID_TYPE_EDEFAULT = DeviceIdType.FREE;
/**
- * The cached value of the '{@link #getDeviceIdType() <em>Device Id Type</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getDeviceIdType() <em>Device Id Type</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getDeviceIdType()
* @generated
* @ordered
@@ -64,8 +64,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected DeviceIdType deviceIdType = DEVICE_ID_TYPE_EDEFAULT;
/**
- * The cached value of the '{@link #getTree() <em>Tree</em>}' containment reference.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getTree() <em>Tree</em>}' containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getTree()
* @generated
* @ordered
@@ -73,8 +73,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected Node tree;
/**
- * The default value of the '{@link #getDeviceId() <em>Device Id</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getDeviceId() <em>Device Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getDeviceId()
* @generated
* @ordered
@@ -82,8 +82,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected static final String DEVICE_ID_EDEFAULT = null;
/**
- * The cached value of the '{@link #getDeviceId() <em>Device Id</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getDeviceId() <em>Device Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getDeviceId()
* @generated
* @ordered
@@ -91,8 +91,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected String deviceId = DEVICE_ID_EDEFAULT;
/**
- * The default value of the '{@link #getLogin() <em>Login</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getLogin() <em>Login</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getLogin()
* @generated
* @ordered
@@ -100,8 +100,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected static final String LOGIN_EDEFAULT = null;
/**
- * The cached value of the '{@link #getLogin() <em>Login</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getLogin() <em>Login</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getLogin()
* @generated
* @ordered
@@ -109,8 +109,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected String login = LOGIN_EDEFAULT;
/**
- * The default value of the '{@link #getPassword() <em>Password</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getPassword() <em>Password</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getPassword()
* @generated
* @ordered
@@ -118,8 +118,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected static final String PASSWORD_EDEFAULT = null;
/**
- * The cached value of the '{@link #getPassword() <em>Password</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getPassword() <em>Password</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getPassword()
* @generated
* @ordered
@@ -127,8 +127,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected String password = PASSWORD_EDEFAULT;
/**
- * The default value of the '{@link #getServerUrl() <em>Server Url</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getServerUrl() <em>Server Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getServerUrl()
* @generated
* @ordered
@@ -136,8 +136,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected static final String SERVER_URL_EDEFAULT = null;
/**
- * The cached value of the '{@link #getServerUrl() <em>Server Url</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getServerUrl() <em>Server Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getServerUrl()
* @generated
* @ordered
@@ -145,9 +145,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected String serverUrl = SERVER_URL_EDEFAULT;
/**
- * The default value of the '{@link #getAuthentication() <em>Authentication</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * The default value of the '{@link #getAuthentication() <em>Authentication</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getAuthentication()
* @generated
* @ordered
@@ -155,9 +154,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
protected static final AuthenticationType AUTHENTICATION_EDEFAULT = AuthenticationType.BASIC;
/**
- * The cached value of the '{@link #getAuthentication() <em>Authentication</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * The cached value of the '{@link #getAuthentication() <em>Authentication</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getAuthentication()
* @generated
* @ordered
@@ -176,6 +174,7 @@ public class DeviceImpl extends EObjectImpl implements Device {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -185,6 +184,7 @@ public class DeviceImpl extends EObjectImpl implements Device {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -220,6 +220,7 @@ public class DeviceImpl extends EObjectImpl implements Device {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -229,6 +230,7 @@ public class DeviceImpl extends EObjectImpl implements Device {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public NotificationChain basicSetTree(Node newTree, NotificationChain msgs) {
@@ -236,13 +238,17 @@ public class DeviceImpl extends EObjectImpl implements Device {
tree = newTree;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.DEVICE__TREE, oldTree, newTree);
- if (msgs == null) msgs = notification; else msgs.add(notification);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -250,13 +256,13 @@ public class DeviceImpl extends EObjectImpl implements Device {
if (newTree != tree) {
NotificationChain msgs = null;
if (tree != null)
- msgs = ((InternalEObject)tree).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OMADMSimulatorPackage.DEVICE__TREE, null, msgs);
+ msgs = ((InternalEObject) tree).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OMADMSimulatorPackage.DEVICE__TREE, null, msgs);
if (newTree != null)
- msgs = ((InternalEObject)newTree).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OMADMSimulatorPackage.DEVICE__TREE, null, msgs);
+ msgs = ((InternalEObject) newTree).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OMADMSimulatorPackage.DEVICE__TREE, null, msgs);
msgs = basicSetTree(newTree, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
+ if (msgs != null)
+ msgs.dispatch();
+ } else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.DEVICE__TREE, newTree, newTree));
}
@@ -453,8 +459,8 @@ public class DeviceImpl extends EObjectImpl implements Device {
}
/**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public AuthenticationType getAuthentication() {
@@ -462,151 +468,178 @@ public class DeviceImpl extends EObjectImpl implements Device {
}
/**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
*/
public void setAuthentication(AuthenticationType newAuthentication) {
+ Node authNode = NodeHelpers.findFirstNode(NodeHelpers.getNode(getTree(), "./DMAcc"), "AuthPref");
AuthenticationType oldAuthentication = authentication;
- authentication = newAuthentication == null ? AUTHENTICATION_EDEFAULT : newAuthentication;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.DEVICE__AUTHENTICATION, oldAuthentication, authentication));
+
+ if (newAuthentication != null) {
+
+ if (authNode != null) {
+ if (!newAuthentication.equals(oldAuthentication)) {
+ authNode.setData(newAuthentication.getName());
+ }
+ authentication = newAuthentication;
+ }
+
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.DEVICE__AUTHENTICATION, oldAuthentication,
+ newAuthentication));
+ } else {
+ authNode.setData(AuthenticationType.BASIC.getName());
+ authentication = AuthenticationType.BASIC;
+
+ if (eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.DEVICE__AUTHENTICATION, oldAuthentication,
+ AuthenticationType.BASIC));
+ }
+ }
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case OMADMSimulatorPackage.DEVICE__TREE:
- return basicSetTree(null, msgs);
+ case OMADMSimulatorPackage.DEVICE__TREE:
+ return basicSetTree(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case OMADMSimulatorPackage.DEVICE__DEVICE_ID_TYPE:
- return getDeviceIdType();
- case OMADMSimulatorPackage.DEVICE__TREE:
- return getTree();
- case OMADMSimulatorPackage.DEVICE__DEVICE_ID:
- return getDeviceId();
- case OMADMSimulatorPackage.DEVICE__LOGIN:
- return getLogin();
- case OMADMSimulatorPackage.DEVICE__PASSWORD:
- return getPassword();
- case OMADMSimulatorPackage.DEVICE__SERVER_URL:
- return getServerUrl();
- case OMADMSimulatorPackage.DEVICE__AUTHENTICATION:
- return getAuthentication();
+ case OMADMSimulatorPackage.DEVICE__DEVICE_ID_TYPE:
+ return getDeviceIdType();
+ case OMADMSimulatorPackage.DEVICE__TREE:
+ return getTree();
+ case OMADMSimulatorPackage.DEVICE__DEVICE_ID:
+ return getDeviceId();
+ case OMADMSimulatorPackage.DEVICE__LOGIN:
+ return getLogin();
+ case OMADMSimulatorPackage.DEVICE__PASSWORD:
+ return getPassword();
+ case OMADMSimulatorPackage.DEVICE__SERVER_URL:
+ return getServerUrl();
+ case OMADMSimulatorPackage.DEVICE__AUTHENTICATION:
+ return getAuthentication();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case OMADMSimulatorPackage.DEVICE__DEVICE_ID_TYPE:
- setDeviceIdType((DeviceIdType)newValue);
- return;
- case OMADMSimulatorPackage.DEVICE__TREE:
- setTree((Node)newValue);
- return;
- case OMADMSimulatorPackage.DEVICE__DEVICE_ID:
- setDeviceId((String)newValue);
- return;
- case OMADMSimulatorPackage.DEVICE__LOGIN:
- setLogin((String)newValue);
- return;
- case OMADMSimulatorPackage.DEVICE__PASSWORD:
- setPassword((String)newValue);
- return;
- case OMADMSimulatorPackage.DEVICE__SERVER_URL:
- setServerUrl((String)newValue);
- return;
- case OMADMSimulatorPackage.DEVICE__AUTHENTICATION:
- setAuthentication((AuthenticationType)newValue);
- return;
+ case OMADMSimulatorPackage.DEVICE__DEVICE_ID_TYPE:
+ setDeviceIdType((DeviceIdType) newValue);
+ return;
+ case OMADMSimulatorPackage.DEVICE__TREE:
+ setTree((Node) newValue);
+ return;
+ case OMADMSimulatorPackage.DEVICE__DEVICE_ID:
+ setDeviceId((String) newValue);
+ return;
+ case OMADMSimulatorPackage.DEVICE__LOGIN:
+ setLogin((String) newValue);
+ return;
+ case OMADMSimulatorPackage.DEVICE__PASSWORD:
+ setPassword((String) newValue);
+ return;
+ case OMADMSimulatorPackage.DEVICE__SERVER_URL:
+ setServerUrl((String) newValue);
+ return;
+ case OMADMSimulatorPackage.DEVICE__AUTHENTICATION:
+ setAuthentication((AuthenticationType) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case OMADMSimulatorPackage.DEVICE__DEVICE_ID_TYPE:
- setDeviceIdType(DEVICE_ID_TYPE_EDEFAULT);
- return;
- case OMADMSimulatorPackage.DEVICE__TREE:
- setTree((Node)null);
- return;
- case OMADMSimulatorPackage.DEVICE__DEVICE_ID:
- setDeviceId(DEVICE_ID_EDEFAULT);
- return;
- case OMADMSimulatorPackage.DEVICE__LOGIN:
- setLogin(LOGIN_EDEFAULT);
- return;
- case OMADMSimulatorPackage.DEVICE__PASSWORD:
- setPassword(PASSWORD_EDEFAULT);
- return;
- case OMADMSimulatorPackage.DEVICE__SERVER_URL:
- setServerUrl(SERVER_URL_EDEFAULT);
- return;
- case OMADMSimulatorPackage.DEVICE__AUTHENTICATION:
- setAuthentication(AUTHENTICATION_EDEFAULT);
- return;
+ case OMADMSimulatorPackage.DEVICE__DEVICE_ID_TYPE:
+ setDeviceIdType(DEVICE_ID_TYPE_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.DEVICE__TREE:
+ setTree((Node) null);
+ return;
+ case OMADMSimulatorPackage.DEVICE__DEVICE_ID:
+ setDeviceId(DEVICE_ID_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.DEVICE__LOGIN:
+ setLogin(LOGIN_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.DEVICE__PASSWORD:
+ setPassword(PASSWORD_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.DEVICE__SERVER_URL:
+ setServerUrl(SERVER_URL_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.DEVICE__AUTHENTICATION:
+ setAuthentication(AUTHENTICATION_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case OMADMSimulatorPackage.DEVICE__DEVICE_ID_TYPE:
- return deviceIdType != DEVICE_ID_TYPE_EDEFAULT;
- case OMADMSimulatorPackage.DEVICE__TREE:
- return tree != null;
- case OMADMSimulatorPackage.DEVICE__DEVICE_ID:
- return DEVICE_ID_EDEFAULT == null ? deviceId != null : !DEVICE_ID_EDEFAULT.equals(deviceId);
- case OMADMSimulatorPackage.DEVICE__LOGIN:
- return LOGIN_EDEFAULT == null ? login != null : !LOGIN_EDEFAULT.equals(login);
- case OMADMSimulatorPackage.DEVICE__PASSWORD:
- return PASSWORD_EDEFAULT == null ? password != null : !PASSWORD_EDEFAULT.equals(password);
- case OMADMSimulatorPackage.DEVICE__SERVER_URL:
- return SERVER_URL_EDEFAULT == null ? serverUrl != null : !SERVER_URL_EDEFAULT.equals(serverUrl);
- case OMADMSimulatorPackage.DEVICE__AUTHENTICATION:
- return authentication != AUTHENTICATION_EDEFAULT;
+ case OMADMSimulatorPackage.DEVICE__DEVICE_ID_TYPE:
+ return deviceIdType != DEVICE_ID_TYPE_EDEFAULT;
+ case OMADMSimulatorPackage.DEVICE__TREE:
+ return tree != null;
+ case OMADMSimulatorPackage.DEVICE__DEVICE_ID:
+ return DEVICE_ID_EDEFAULT == null ? deviceId != null : !DEVICE_ID_EDEFAULT.equals(deviceId);
+ case OMADMSimulatorPackage.DEVICE__LOGIN:
+ return LOGIN_EDEFAULT == null ? login != null : !LOGIN_EDEFAULT.equals(login);
+ case OMADMSimulatorPackage.DEVICE__PASSWORD:
+ return PASSWORD_EDEFAULT == null ? password != null : !PASSWORD_EDEFAULT.equals(password);
+ case OMADMSimulatorPackage.DEVICE__SERVER_URL:
+ return SERVER_URL_EDEFAULT == null ? serverUrl != null : !SERVER_URL_EDEFAULT.equals(serverUrl);
+ case OMADMSimulatorPackage.DEVICE__AUTHENTICATION:
+ return authentication != AUTHENTICATION_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public String toString() {
- if (eIsProxy()) return super.toString();
+ if (eIsProxy())
+ return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (deviceIdType: ");
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java
index f7c3288..a4557a4 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java
@@ -24,6 +24,7 @@ import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.koneki.simulators.omadm.model.AuthenticationType;
import org.eclipse.koneki.simulators.omadm.model.CommandManagement;
import org.eclipse.koneki.simulators.omadm.model.Device;
import org.eclipse.koneki.simulators.omadm.model.Node;
@@ -36,33 +37,33 @@ import org.eclipse.koneki.simulators.omadm.model.util.NodeHelpers;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getFormat <em>Format</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getChildren <em>Children</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getData <em>Data</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getParent <em>Parent</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getGetManagement <em>Get Management</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getGetCode <em>Get Code</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getAddManagement <em>Add Management</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getDeleteManagement <em>Delete Management</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getCopyManagement <em>Copy Management</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getReplaceManagement <em>Replace Management</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getExecManagement <em>Exec Management</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getAddCode <em>Add Code</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getDeleteCode <em>Delete Code</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getCopyCode <em>Copy Code</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getReplaceCode <em>Replace Code</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getExecCode <em>Exec Code</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getFormat <em>Format</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getChildren <em>Children</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getData <em>Data</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getParent <em>Parent</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getGetManagement <em>Get Management</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getGetCode <em>Get Code</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getAddManagement <em>Add Management</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getDeleteManagement <em>Delete Management</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getCopyManagement <em>Copy Management</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getReplaceManagement <em>Replace Management</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getExecManagement <em>Exec Management</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getAddCode <em>Add Code</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getDeleteCode <em>Delete Code</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getCopyCode <em>Copy Code</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getReplaceCode <em>Replace Code</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.impl.NodeImpl#getExecCode <em>Exec Code</em>}</li>
* </ul>
* </p>
- *
+ *
* @generated
*/
public class NodeImpl extends EObjectImpl implements Node {
/**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getName()
* @generated
* @ordered
@@ -70,8 +71,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final String NAME_EDEFAULT = null;
/**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getName()
* @generated
* @ordered
@@ -79,8 +80,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected String name = NAME_EDEFAULT;
/**
- * The default value of the '{@link #getFormat() <em>Format</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getFormat() <em>Format</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getFormat()
* @generated
* @ordered
@@ -88,8 +89,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final NodeFormat FORMAT_EDEFAULT = NodeFormat.CHR;
/**
- * The cached value of the '{@link #getFormat() <em>Format</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getFormat() <em>Format</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getFormat()
* @generated
* @ordered
@@ -97,8 +98,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected NodeFormat format = FORMAT_EDEFAULT;
/**
- * The cached value of the '{@link #getChildren() <em>Children</em>}' containment reference list.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getChildren() <em>Children</em>}' containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getChildren()
* @generated
* @ordered
@@ -106,8 +107,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected EList<Node> children;
/**
- * The default value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getType() <em>Type</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getType()
* @generated
* @ordered
@@ -115,8 +116,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final String TYPE_EDEFAULT = null;
/**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getType() <em>Type</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getType()
* @generated
* @ordered
@@ -124,8 +125,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected String type = TYPE_EDEFAULT;
/**
- * The default value of the '{@link #getData() <em>Data</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getData() <em>Data</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getData()
* @generated
* @ordered
@@ -133,8 +134,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final String DATA_EDEFAULT = null;
/**
- * The cached value of the '{@link #getData() <em>Data</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getData() <em>Data</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getData()
* @generated
* @ordered
@@ -142,8 +143,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected String data = DATA_EDEFAULT;
/**
- * The default value of the '{@link #getGetManagement() <em>Get Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getGetManagement() <em>Get Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getGetManagement()
* @generated
* @ordered
@@ -151,8 +152,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final CommandManagement GET_MANAGEMENT_EDEFAULT = CommandManagement.INHERITED;
/**
- * The cached value of the '{@link #getGetManagement() <em>Get Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getGetManagement() <em>Get Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getGetManagement()
* @generated
* @ordered
@@ -160,8 +161,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected CommandManagement getManagement = GET_MANAGEMENT_EDEFAULT;
/**
- * The default value of the '{@link #getGetCode() <em>Get Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getGetCode() <em>Get Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getGetCode()
* @generated
* @ordered
@@ -169,8 +170,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final int GET_CODE_EDEFAULT = 0;
/**
- * The cached value of the '{@link #getGetCode() <em>Get Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getGetCode() <em>Get Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getGetCode()
* @generated
* @ordered
@@ -178,8 +179,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected int getCode = GET_CODE_EDEFAULT;
/**
- * The default value of the '{@link #getAddManagement() <em>Add Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getAddManagement() <em>Add Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getAddManagement()
* @generated
* @ordered
@@ -187,8 +188,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final CommandManagement ADD_MANAGEMENT_EDEFAULT = CommandManagement.INHERITED;
/**
- * The cached value of the '{@link #getAddManagement() <em>Add Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getAddManagement() <em>Add Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getAddManagement()
* @generated
* @ordered
@@ -196,8 +197,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected CommandManagement addManagement = ADD_MANAGEMENT_EDEFAULT;
/**
- * The default value of the '{@link #getDeleteManagement() <em>Delete Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getDeleteManagement() <em>Delete Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getDeleteManagement()
* @generated
* @ordered
@@ -205,8 +206,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final CommandManagement DELETE_MANAGEMENT_EDEFAULT = CommandManagement.INHERITED;
/**
- * The cached value of the '{@link #getDeleteManagement() <em>Delete Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getDeleteManagement() <em>Delete Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getDeleteManagement()
* @generated
* @ordered
@@ -214,8 +215,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected CommandManagement deleteManagement = DELETE_MANAGEMENT_EDEFAULT;
/**
- * The default value of the '{@link #getCopyManagement() <em>Copy Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getCopyManagement() <em>Copy Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getCopyManagement()
* @generated
* @ordered
@@ -223,8 +224,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final CommandManagement COPY_MANAGEMENT_EDEFAULT = CommandManagement.INHERITED;
/**
- * The cached value of the '{@link #getCopyManagement() <em>Copy Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getCopyManagement() <em>Copy Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getCopyManagement()
* @generated
* @ordered
@@ -232,8 +233,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected CommandManagement copyManagement = COPY_MANAGEMENT_EDEFAULT;
/**
- * The default value of the '{@link #getReplaceManagement() <em>Replace Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getReplaceManagement() <em>Replace Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getReplaceManagement()
* @generated
* @ordered
@@ -241,8 +242,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final CommandManagement REPLACE_MANAGEMENT_EDEFAULT = CommandManagement.INHERITED;
/**
- * The cached value of the '{@link #getReplaceManagement() <em>Replace Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getReplaceManagement() <em>Replace Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getReplaceManagement()
* @generated
* @ordered
@@ -250,8 +251,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected CommandManagement replaceManagement = REPLACE_MANAGEMENT_EDEFAULT;
/**
- * The default value of the '{@link #getExecManagement() <em>Exec Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getExecManagement() <em>Exec Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getExecManagement()
* @generated
* @ordered
@@ -259,8 +260,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final CommandManagement EXEC_MANAGEMENT_EDEFAULT = CommandManagement.INHERITED;
/**
- * The cached value of the '{@link #getExecManagement() <em>Exec Management</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getExecManagement() <em>Exec Management</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getExecManagement()
* @generated
* @ordered
@@ -268,8 +269,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected CommandManagement execManagement = EXEC_MANAGEMENT_EDEFAULT;
/**
- * The default value of the '{@link #getAddCode() <em>Add Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getAddCode() <em>Add Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getAddCode()
* @generated
* @ordered
@@ -277,8 +278,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final int ADD_CODE_EDEFAULT = 0;
/**
- * The cached value of the '{@link #getAddCode() <em>Add Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getAddCode() <em>Add Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getAddCode()
* @generated
* @ordered
@@ -286,8 +287,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected int addCode = ADD_CODE_EDEFAULT;
/**
- * The default value of the '{@link #getDeleteCode() <em>Delete Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getDeleteCode() <em>Delete Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getDeleteCode()
* @generated
* @ordered
@@ -295,8 +296,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final int DELETE_CODE_EDEFAULT = 0;
/**
- * The cached value of the '{@link #getDeleteCode() <em>Delete Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getDeleteCode() <em>Delete Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getDeleteCode()
* @generated
* @ordered
@@ -304,8 +305,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected int deleteCode = DELETE_CODE_EDEFAULT;
/**
- * The default value of the '{@link #getCopyCode() <em>Copy Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getCopyCode() <em>Copy Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getCopyCode()
* @generated
* @ordered
@@ -313,8 +314,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final int COPY_CODE_EDEFAULT = 0;
/**
- * The cached value of the '{@link #getCopyCode() <em>Copy Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getCopyCode() <em>Copy Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getCopyCode()
* @generated
* @ordered
@@ -322,8 +323,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected int copyCode = COPY_CODE_EDEFAULT;
/**
- * The default value of the '{@link #getReplaceCode() <em>Replace Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getReplaceCode() <em>Replace Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getReplaceCode()
* @generated
* @ordered
@@ -331,8 +332,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final int REPLACE_CODE_EDEFAULT = 0;
/**
- * The cached value of the '{@link #getReplaceCode() <em>Replace Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getReplaceCode() <em>Replace Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getReplaceCode()
* @generated
* @ordered
@@ -340,8 +341,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected int replaceCode = REPLACE_CODE_EDEFAULT;
/**
- * The default value of the '{@link #getExecCode() <em>Exec Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The default value of the '{@link #getExecCode() <em>Exec Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getExecCode()
* @generated
* @ordered
@@ -349,8 +350,8 @@ public class NodeImpl extends EObjectImpl implements Node {
protected static final int EXEC_CODE_EDEFAULT = 0;
/**
- * The cached value of the '{@link #getExecCode() <em>Exec Code</em>}' attribute.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached value of the '{@link #getExecCode() <em>Exec Code</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see #getExecCode()
* @generated
* @ordered
@@ -359,6 +360,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
protected NodeImpl() {
@@ -367,6 +369,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -376,6 +379,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public String getName() {
@@ -384,6 +388,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setName(String newName) {
@@ -395,6 +400,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public NodeFormat getFormat() {
@@ -403,6 +409,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setFormat(NodeFormat newFormat) {
@@ -414,17 +421,20 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public EList<Node> getChildren() {
if (children == null) {
- children = new EObjectContainmentWithInverseEList<Node>(Node.class, this, OMADMSimulatorPackage.NODE__CHILDREN, OMADMSimulatorPackage.NODE__PARENT);
+ children = new EObjectContainmentWithInverseEList<Node>(Node.class, this, OMADMSimulatorPackage.NODE__CHILDREN,
+ OMADMSimulatorPackage.NODE__PARENT);
}
return children;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public String getType() {
@@ -433,6 +443,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setType(String newType) {
@@ -444,6 +455,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public String getData() {
@@ -468,6 +480,15 @@ public class NodeImpl extends EObjectImpl implements Node {
device.setLogin(newData);
} else if (NodeHelpers.findFirstNode(NodeHelpers.getNode(getRoot(), "./DMAcc/AppAuth"), "AuthSecret") == this) {
device.setPassword(newData);
+ } else if (NodeHelpers.findFirstNode(NodeHelpers.getNode(getRoot(), "./DMAcc"), "AuthPref") == this) {
+
+ try {
+ AuthenticationType auth = AuthenticationType.getByName(newData);
+
+ device.setAuthentication(auth);
+ } catch (Exception e) {
+ // The authentication type doesn't exist for the value of newData
+ }
} else if (NodeHelpers.findFirstNode(NodeHelpers.getNode(getRoot(), "./DMAcc/AppAddr"), "AddrType") == this) {
Node AddrNode = NodeHelpers.findFirstNode(NodeHelpers.getNode(getRoot(), "./DMAcc/AppAddr"), "Addr");
@@ -555,24 +576,28 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public Node getParent() {
- if (eContainerFeatureID() != OMADMSimulatorPackage.NODE__PARENT) return null;
- return (Node)eContainer();
+ if (eContainerFeatureID() != OMADMSimulatorPackage.NODE__PARENT)
+ return null;
+ return (Node) eContainer();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public NotificationChain basicSetParent(Node newParent, NotificationChain msgs) {
- msgs = eBasicSetContainer((InternalEObject)newParent, OMADMSimulatorPackage.NODE__PARENT, msgs);
+ msgs = eBasicSetContainer((InternalEObject) newParent, OMADMSimulatorPackage.NODE__PARENT, msgs);
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setParent(Node newParent) {
@@ -583,16 +608,17 @@ public class NodeImpl extends EObjectImpl implements Node {
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newParent != null)
- msgs = ((InternalEObject)newParent).eInverseAdd(this, OMADMSimulatorPackage.NODE__CHILDREN, Node.class, msgs);
+ msgs = ((InternalEObject) newParent).eInverseAdd(this, OMADMSimulatorPackage.NODE__CHILDREN, Node.class, msgs);
msgs = basicSetParent(newParent, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
+ if (msgs != null)
+ msgs.dispatch();
+ } else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.NODE__PARENT, newParent, newParent));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public CommandManagement getGetManagement() {
@@ -601,6 +627,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setGetManagement(CommandManagement newGetManagement) {
@@ -612,6 +639,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public int getGetCode() {
@@ -620,6 +648,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setGetCode(int newGetCode) {
@@ -631,6 +660,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public CommandManagement getAddManagement() {
@@ -639,6 +669,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setAddManagement(CommandManagement newAddManagement) {
@@ -650,6 +681,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public CommandManagement getDeleteManagement() {
@@ -658,17 +690,20 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setDeleteManagement(CommandManagement newDeleteManagement) {
CommandManagement oldDeleteManagement = deleteManagement;
deleteManagement = newDeleteManagement == null ? DELETE_MANAGEMENT_EDEFAULT : newDeleteManagement;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT, oldDeleteManagement, deleteManagement));
+ eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT, oldDeleteManagement,
+ deleteManagement));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public CommandManagement getCopyManagement() {
@@ -677,6 +712,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setCopyManagement(CommandManagement newCopyManagement) {
@@ -688,6 +724,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public CommandManagement getReplaceManagement() {
@@ -696,17 +733,20 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setReplaceManagement(CommandManagement newReplaceManagement) {
CommandManagement oldReplaceManagement = replaceManagement;
replaceManagement = newReplaceManagement == null ? REPLACE_MANAGEMENT_EDEFAULT : newReplaceManagement;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT, oldReplaceManagement, replaceManagement));
+ eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT, oldReplaceManagement,
+ replaceManagement));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public CommandManagement getExecManagement() {
@@ -715,6 +755,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setExecManagement(CommandManagement newExecManagement) {
@@ -726,6 +767,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public int getAddCode() {
@@ -734,6 +776,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setAddCode(int newAddCode) {
@@ -745,6 +788,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public int getDeleteCode() {
@@ -753,6 +797,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setDeleteCode(int newDeleteCode) {
@@ -764,6 +809,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public int getCopyCode() {
@@ -772,6 +818,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setCopyCode(int newCopyCode) {
@@ -783,6 +830,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public int getReplaceCode() {
@@ -791,6 +839,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setReplaceCode(int newReplaceCode) {
@@ -802,6 +851,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public int getExecCode() {
@@ -810,6 +860,7 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public void setExecCode(int newExecCode) {
@@ -1032,283 +1083,292 @@ public class NodeImpl extends EObjectImpl implements Node {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case OMADMSimulatorPackage.NODE__CHILDREN:
- return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs);
- case OMADMSimulatorPackage.NODE__PARENT:
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return basicSetParent((Node)otherEnd, msgs);
+ case OMADMSimulatorPackage.NODE__CHILDREN:
+ return ((InternalEList<InternalEObject>) (InternalEList<?>) getChildren()).basicAdd(otherEnd, msgs);
+ case OMADMSimulatorPackage.NODE__PARENT:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return basicSetParent((Node) otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case OMADMSimulatorPackage.NODE__CHILDREN:
- return ((InternalEList<?>)getChildren()).basicRemove(otherEnd, msgs);
- case OMADMSimulatorPackage.NODE__PARENT:
- return basicSetParent(null, msgs);
+ case OMADMSimulatorPackage.NODE__CHILDREN:
+ return ((InternalEList<?>) getChildren()).basicRemove(otherEnd, msgs);
+ case OMADMSimulatorPackage.NODE__PARENT:
+ return basicSetParent(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
- case OMADMSimulatorPackage.NODE__PARENT:
- return eInternalContainer().eInverseRemove(this, OMADMSimulatorPackage.NODE__CHILDREN, Node.class, msgs);
+ case OMADMSimulatorPackage.NODE__PARENT:
+ return eInternalContainer().eInverseRemove(this, OMADMSimulatorPackage.NODE__CHILDREN, Node.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case OMADMSimulatorPackage.NODE__NAME:
- return getName();
- case OMADMSimulatorPackage.NODE__FORMAT:
- return getFormat();
- case OMADMSimulatorPackage.NODE__CHILDREN:
- return getChildren();
- case OMADMSimulatorPackage.NODE__TYPE:
- return getType();
- case OMADMSimulatorPackage.NODE__DATA:
- return getData();
- case OMADMSimulatorPackage.NODE__PARENT:
- return getParent();
- case OMADMSimulatorPackage.NODE__GET_MANAGEMENT:
- return getGetManagement();
- case OMADMSimulatorPackage.NODE__GET_CODE:
- return getGetCode();
- case OMADMSimulatorPackage.NODE__ADD_MANAGEMENT:
- return getAddManagement();
- case OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT:
- return getDeleteManagement();
- case OMADMSimulatorPackage.NODE__COPY_MANAGEMENT:
- return getCopyManagement();
- case OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT:
- return getReplaceManagement();
- case OMADMSimulatorPackage.NODE__EXEC_MANAGEMENT:
- return getExecManagement();
- case OMADMSimulatorPackage.NODE__ADD_CODE:
- return getAddCode();
- case OMADMSimulatorPackage.NODE__DELETE_CODE:
- return getDeleteCode();
- case OMADMSimulatorPackage.NODE__COPY_CODE:
- return getCopyCode();
- case OMADMSimulatorPackage.NODE__REPLACE_CODE:
- return getReplaceCode();
- case OMADMSimulatorPackage.NODE__EXEC_CODE:
- return getExecCode();
+ case OMADMSimulatorPackage.NODE__NAME:
+ return getName();
+ case OMADMSimulatorPackage.NODE__FORMAT:
+ return getFormat();
+ case OMADMSimulatorPackage.NODE__CHILDREN:
+ return getChildren();
+ case OMADMSimulatorPackage.NODE__TYPE:
+ return getType();
+ case OMADMSimulatorPackage.NODE__DATA:
+ return getData();
+ case OMADMSimulatorPackage.NODE__PARENT:
+ return getParent();
+ case OMADMSimulatorPackage.NODE__GET_MANAGEMENT:
+ return getGetManagement();
+ case OMADMSimulatorPackage.NODE__GET_CODE:
+ return getGetCode();
+ case OMADMSimulatorPackage.NODE__ADD_MANAGEMENT:
+ return getAddManagement();
+ case OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT:
+ return getDeleteManagement();
+ case OMADMSimulatorPackage.NODE__COPY_MANAGEMENT:
+ return getCopyManagement();
+ case OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT:
+ return getReplaceManagement();
+ case OMADMSimulatorPackage.NODE__EXEC_MANAGEMENT:
+ return getExecManagement();
+ case OMADMSimulatorPackage.NODE__ADD_CODE:
+ return getAddCode();
+ case OMADMSimulatorPackage.NODE__DELETE_CODE:
+ return getDeleteCode();
+ case OMADMSimulatorPackage.NODE__COPY_CODE:
+ return getCopyCode();
+ case OMADMSimulatorPackage.NODE__REPLACE_CODE:
+ return getReplaceCode();
+ case OMADMSimulatorPackage.NODE__EXEC_CODE:
+ return getExecCode();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case OMADMSimulatorPackage.NODE__NAME:
- setName((String)newValue);
- return;
- case OMADMSimulatorPackage.NODE__FORMAT:
- setFormat((NodeFormat)newValue);
- return;
- case OMADMSimulatorPackage.NODE__CHILDREN:
- getChildren().clear();
- getChildren().addAll((Collection<? extends Node>)newValue);
- return;
- case OMADMSimulatorPackage.NODE__TYPE:
- setType((String)newValue);
- return;
- case OMADMSimulatorPackage.NODE__DATA:
- setData((String)newValue);
- return;
- case OMADMSimulatorPackage.NODE__PARENT:
- setParent((Node)newValue);
- return;
- case OMADMSimulatorPackage.NODE__GET_MANAGEMENT:
- setGetManagement((CommandManagement)newValue);
- return;
- case OMADMSimulatorPackage.NODE__GET_CODE:
- setGetCode((Integer)newValue);
- return;
- case OMADMSimulatorPackage.NODE__ADD_MANAGEMENT:
- setAddManagement((CommandManagement)newValue);
- return;
- case OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT:
- setDeleteManagement((CommandManagement)newValue);
- return;
- case OMADMSimulatorPackage.NODE__COPY_MANAGEMENT:
- setCopyManagement((CommandManagement)newValue);
- return;
- case OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT:
- setReplaceManagement((CommandManagement)newValue);
- return;
- case OMADMSimulatorPackage.NODE__EXEC_MANAGEMENT:
- setExecManagement((CommandManagement)newValue);
- return;
- case OMADMSimulatorPackage.NODE__ADD_CODE:
- setAddCode((Integer)newValue);
- return;
- case OMADMSimulatorPackage.NODE__DELETE_CODE:
- setDeleteCode((Integer)newValue);
- return;
- case OMADMSimulatorPackage.NODE__COPY_CODE:
- setCopyCode((Integer)newValue);
- return;
- case OMADMSimulatorPackage.NODE__REPLACE_CODE:
- setReplaceCode((Integer)newValue);
- return;
- case OMADMSimulatorPackage.NODE__EXEC_CODE:
- setExecCode((Integer)newValue);
- return;
+ case OMADMSimulatorPackage.NODE__NAME:
+ setName((String) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__FORMAT:
+ setFormat((NodeFormat) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__CHILDREN:
+ getChildren().clear();
+ getChildren().addAll((Collection<? extends Node>) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__TYPE:
+ setType((String) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__DATA:
+ setData((String) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__PARENT:
+ setParent((Node) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__GET_MANAGEMENT:
+ setGetManagement((CommandManagement) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__GET_CODE:
+ setGetCode((Integer) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__ADD_MANAGEMENT:
+ setAddManagement((CommandManagement) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT:
+ setDeleteManagement((CommandManagement) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__COPY_MANAGEMENT:
+ setCopyManagement((CommandManagement) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT:
+ setReplaceManagement((CommandManagement) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__EXEC_MANAGEMENT:
+ setExecManagement((CommandManagement) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__ADD_CODE:
+ setAddCode((Integer) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__DELETE_CODE:
+ setDeleteCode((Integer) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__COPY_CODE:
+ setCopyCode((Integer) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__REPLACE_CODE:
+ setReplaceCode((Integer) newValue);
+ return;
+ case OMADMSimulatorPackage.NODE__EXEC_CODE:
+ setExecCode((Integer) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case OMADMSimulatorPackage.NODE__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__FORMAT:
- setFormat(FORMAT_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__CHILDREN:
- getChildren().clear();
- return;
- case OMADMSimulatorPackage.NODE__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__DATA:
- setData(DATA_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__PARENT:
- setParent((Node)null);
- return;
- case OMADMSimulatorPackage.NODE__GET_MANAGEMENT:
- setGetManagement(GET_MANAGEMENT_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__GET_CODE:
- setGetCode(GET_CODE_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__ADD_MANAGEMENT:
- setAddManagement(ADD_MANAGEMENT_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT:
- setDeleteManagement(DELETE_MANAGEMENT_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__COPY_MANAGEMENT:
- setCopyManagement(COPY_MANAGEMENT_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT:
- setReplaceManagement(REPLACE_MANAGEMENT_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__EXEC_MANAGEMENT:
- setExecManagement(EXEC_MANAGEMENT_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__ADD_CODE:
- setAddCode(ADD_CODE_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__DELETE_CODE:
- setDeleteCode(DELETE_CODE_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__COPY_CODE:
- setCopyCode(COPY_CODE_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__REPLACE_CODE:
- setReplaceCode(REPLACE_CODE_EDEFAULT);
- return;
- case OMADMSimulatorPackage.NODE__EXEC_CODE:
- setExecCode(EXEC_CODE_EDEFAULT);
- return;
+ case OMADMSimulatorPackage.NODE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__FORMAT:
+ setFormat(FORMAT_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__CHILDREN:
+ getChildren().clear();
+ return;
+ case OMADMSimulatorPackage.NODE__TYPE:
+ setType(TYPE_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__DATA:
+ setData(DATA_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__PARENT:
+ setParent((Node) null);
+ return;
+ case OMADMSimulatorPackage.NODE__GET_MANAGEMENT:
+ setGetManagement(GET_MANAGEMENT_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__GET_CODE:
+ setGetCode(GET_CODE_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__ADD_MANAGEMENT:
+ setAddManagement(ADD_MANAGEMENT_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT:
+ setDeleteManagement(DELETE_MANAGEMENT_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__COPY_MANAGEMENT:
+ setCopyManagement(COPY_MANAGEMENT_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT:
+ setReplaceManagement(REPLACE_MANAGEMENT_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__EXEC_MANAGEMENT:
+ setExecManagement(EXEC_MANAGEMENT_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__ADD_CODE:
+ setAddCode(ADD_CODE_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__DELETE_CODE:
+ setDeleteCode(DELETE_CODE_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__COPY_CODE:
+ setCopyCode(COPY_CODE_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__REPLACE_CODE:
+ setReplaceCode(REPLACE_CODE_EDEFAULT);
+ return;
+ case OMADMSimulatorPackage.NODE__EXEC_CODE:
+ setExecCode(EXEC_CODE_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case OMADMSimulatorPackage.NODE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OMADMSimulatorPackage.NODE__FORMAT:
- return format != FORMAT_EDEFAULT;
- case OMADMSimulatorPackage.NODE__CHILDREN:
- return children != null && !children.isEmpty();
- case OMADMSimulatorPackage.NODE__TYPE:
- return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
- case OMADMSimulatorPackage.NODE__DATA:
- return DATA_EDEFAULT == null ? data != null : !DATA_EDEFAULT.equals(data);
- case OMADMSimulatorPackage.NODE__PARENT:
- return getParent() != null;
- case OMADMSimulatorPackage.NODE__GET_MANAGEMENT:
- return getManagement != GET_MANAGEMENT_EDEFAULT;
- case OMADMSimulatorPackage.NODE__GET_CODE:
- return getCode != GET_CODE_EDEFAULT;
- case OMADMSimulatorPackage.NODE__ADD_MANAGEMENT:
- return addManagement != ADD_MANAGEMENT_EDEFAULT;
- case OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT:
- return deleteManagement != DELETE_MANAGEMENT_EDEFAULT;
- case OMADMSimulatorPackage.NODE__COPY_MANAGEMENT:
- return copyManagement != COPY_MANAGEMENT_EDEFAULT;
- case OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT:
- return replaceManagement != REPLACE_MANAGEMENT_EDEFAULT;
- case OMADMSimulatorPackage.NODE__EXEC_MANAGEMENT:
- return execManagement != EXEC_MANAGEMENT_EDEFAULT;
- case OMADMSimulatorPackage.NODE__ADD_CODE:
- return addCode != ADD_CODE_EDEFAULT;
- case OMADMSimulatorPackage.NODE__DELETE_CODE:
- return deleteCode != DELETE_CODE_EDEFAULT;
- case OMADMSimulatorPackage.NODE__COPY_CODE:
- return copyCode != COPY_CODE_EDEFAULT;
- case OMADMSimulatorPackage.NODE__REPLACE_CODE:
- return replaceCode != REPLACE_CODE_EDEFAULT;
- case OMADMSimulatorPackage.NODE__EXEC_CODE:
- return execCode != EXEC_CODE_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case OMADMSimulatorPackage.NODE__FORMAT:
+ return format != FORMAT_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__CHILDREN:
+ return children != null && !children.isEmpty();
+ case OMADMSimulatorPackage.NODE__TYPE:
+ return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
+ case OMADMSimulatorPackage.NODE__DATA:
+ return DATA_EDEFAULT == null ? data != null : !DATA_EDEFAULT.equals(data);
+ case OMADMSimulatorPackage.NODE__PARENT:
+ return getParent() != null;
+ case OMADMSimulatorPackage.NODE__GET_MANAGEMENT:
+ return getManagement != GET_MANAGEMENT_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__GET_CODE:
+ return getCode != GET_CODE_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__ADD_MANAGEMENT:
+ return addManagement != ADD_MANAGEMENT_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__DELETE_MANAGEMENT:
+ return deleteManagement != DELETE_MANAGEMENT_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__COPY_MANAGEMENT:
+ return copyManagement != COPY_MANAGEMENT_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__REPLACE_MANAGEMENT:
+ return replaceManagement != REPLACE_MANAGEMENT_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__EXEC_MANAGEMENT:
+ return execManagement != EXEC_MANAGEMENT_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__ADD_CODE:
+ return addCode != ADD_CODE_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__DELETE_CODE:
+ return deleteCode != DELETE_CODE_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__COPY_CODE:
+ return copyCode != COPY_CODE_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__REPLACE_CODE:
+ return replaceCode != REPLACE_CODE_EDEFAULT;
+ case OMADMSimulatorPackage.NODE__EXEC_CODE:
+ return execCode != EXEC_CODE_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public String toString() {
- if (eIsProxy()) return super.toString();
+ if (eIsProxy())
+ return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/OMADMSimulatorPackageImpl.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/OMADMSimulatorPackageImpl.java
index f4962ad..6822212 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/OMADMSimulatorPackageImpl.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/OMADMSimulatorPackageImpl.java
@@ -602,6 +602,8 @@ public class OMADMSimulatorPackageImpl extends EPackageImpl implements OMADMSimu
initEEnum(authenticationTypeEEnum, AuthenticationType.class, "AuthenticationType");
addEEnumLiteral(authenticationTypeEEnum, AuthenticationType.BASIC);
addEEnumLiteral(authenticationTypeEEnum, AuthenticationType.NONE);
+ addEEnumLiteral(authenticationTypeEEnum, AuthenticationType.HMAC);
+ addEEnumLiteral(authenticationTypeEEnum, AuthenticationType.MD5);
// Create resource
createResource(eNS_URI);
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/util/NodeHelpers.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/util/NodeHelpers.java
index d2d4507..bd57c2b 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/util/NodeHelpers.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/util/NodeHelpers.java
@@ -416,6 +416,7 @@ public class NodeHelpers {
Node DMAccNode = NodeHelpers.initNode("DMAcc", root);
NodeHelpers.initLeaf("ServerID", "text/plain", "", NodeFormat.CHR, DMAccNode);
NodeHelpers.initLeaf("AppID", "text/plain", "", NodeFormat.CHR, DMAccNode);
+ NodeHelpers.initLeaf("AuthPref", "text/plain", "BASIC", NodeFormat.CHR, DMAccNode);
Node AppAuthNode = NodeHelpers.initNode("AppAuth", DMAccNode);
Node DefaultAuthNode = NodeHelpers.initNode("Default", AppAuthNode);
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm/src/org/eclipse/koneki/simulators/omadm/basic/DMBasicSimulation.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm/src/org/eclipse/koneki/simulators/omadm/basic/DMBasicSimulation.java
index 1cb05ff..fa41593 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm/src/org/eclipse/koneki/simulators/omadm/basic/DMBasicSimulation.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm/src/org/eclipse/koneki/simulators/omadm/basic/DMBasicSimulation.java
@@ -15,7 +15,6 @@ import java.net.URISyntaxException;
import java.util.LinkedList;
import java.util.List;
-import org.apache.commons.codec.binary.Base64;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.koneki.protocols.omadm.CommandHandler;
import org.eclipse.koneki.protocols.omadm.DMAuthentication;
@@ -103,23 +102,29 @@ final class DMBasicSimulation implements Runnable, CommandHandler {
});
- DMAuthentication dmAuth = null;
+ org.eclipse.koneki.protocols.omadm.AuthenticationType authType = null;
switch (authentication.getValue()) {
case (AuthenticationType.NONE_VALUE):
- dmAuth = new DMAuthentication();
+ // dmAuth = new DMAuthentication();
+ authType = org.eclipse.koneki.protocols.omadm.AuthenticationType.NONE;
break;
case (AuthenticationType.BASIC_VALUE):
- /*
- * Create a Base64 code with the user name and user password value
- */
- String userName = NodeHelpers.findFirstNode(NodeHelpers.getNode(tree, APP_AUTH), AUTH_NAME).getData();
- String userPassword = NodeHelpers.findFirstNode(NodeHelpers.getNode(tree, APP_AUTH), AUTH_SECRET).getData();
- String userAuth = userName + ":" + userPassword; //$NON-NLS-1$
- dmAuth = new DMAuthentication(Base64.encodeBase64(userAuth.getBytes()));
+
+ authType = org.eclipse.koneki.protocols.omadm.AuthenticationType.BASIC;
+ break;
+ case (AuthenticationType.HMAC_VALUE):
+ authType = org.eclipse.koneki.protocols.omadm.AuthenticationType.HMAC;
+ break;
+ case (AuthenticationType.MD5_VALUE):
+ authType = org.eclipse.koneki.protocols.omadm.AuthenticationType.MD5;
break;
}
+ String userName = NodeHelpers.findFirstNode(NodeHelpers.getNode(tree, APP_AUTH), AUTH_NAME).getData();
+ String userPassword = NodeHelpers.findFirstNode(NodeHelpers.getNode(tree, APP_AUTH), AUTH_SECRET).getData();
+ DMAuthentication dmAuth = new DMAuthentication(authType, userName, userPassword);
+
this.dmSimulator.getDMClient().initiateManagementSession(this.server, dmAuth, client, devInfoNodes.toArray(new DMNode[0]), this,
this.protocolListeners, this.genericAlerts);
} catch (final DMSimulatorException e) {
diff --git a/omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java b/omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java
index 49a9150..6badf20 100644
--- a/omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java
+++ b/omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java
@@ -14,6 +14,7 @@ import java.util.Map;
import junit.framework.TestCase;
import junit.textui.TestRunner;
+import org.eclipse.koneki.simulators.omadm.model.AuthenticationType;
import org.eclipse.koneki.simulators.omadm.model.Device;
import org.eclipse.koneki.simulators.omadm.model.DeviceIdType;
import org.eclipse.koneki.simulators.omadm.model.Node;
@@ -25,12 +26,13 @@ import org.eclipse.koneki.simulators.omadm.model.util.NodeHelpers;
* <p>
* The following features are tested:
* <ul>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.Device#getDeviceId() <em>Device Id</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.Device#getLogin() <em>Login</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.Device#getPassword() <em>Password</em>}</li>
- * <li>{@link org.eclipse.koneki.simulators.omadm.model.Device#getServerUrl() <em>Server Url</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.Device#getDeviceId() <em>Device Id</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.Device#getLogin() <em>Login</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.Device#getPassword() <em>Password</em>}</li>
+ * <li>{@link org.eclipse.koneki.simulators.omadm.model.Device#getServerUrl() <em>Server Url</em>}</li>
* </ul>
* </p>
+ *
* @generated
*/
public class DeviceTest extends TestCase {
@@ -80,14 +82,15 @@ public class DeviceTest extends TestCase {
}
/**
- * The fixture for this Device test case.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The fixture for this Device test case. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
protected Device fixture = null;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public static void main(String[] args) {
@@ -95,8 +98,8 @@ public class DeviceTest extends TestCase {
}
/**
- * Constructs a new Device test case with the given name.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Constructs a new Device test case with the given name. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public DeviceTest(String name) {
@@ -104,8 +107,8 @@ public class DeviceTest extends TestCase {
}
/**
- * Sets the fixture for this Device test case.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Sets the fixture for this Device test case. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
protected void setFixture(Device fixture) {
@@ -113,8 +116,8 @@ public class DeviceTest extends TestCase {
}
/**
- * Returns the fixture for this Device test case.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Returns the fixture for this Device test case. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
protected Device getFixture() {
@@ -123,6 +126,7 @@ public class DeviceTest extends TestCase {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see junit.framework.TestCase#setUp()
* @generated
*/
@@ -133,6 +137,7 @@ public class DeviceTest extends TestCase {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@@ -212,6 +217,32 @@ public class DeviceTest extends TestCase {
}
/**
+ * Tests the '{@link org.eclipse.koneki.simulators.omadm.model.Device#getAuthentication() <em>Login</em>}' feature getter. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see org.eclipse.koneki.simulators.omadm.model.Device#getAuthentication()
+ * @generated NOT
+ */
+ public void testGetAuthentication() {
+ initDevice();
+ Node testedNode = NodeHelpers.findFirstNode(NodeHelpers.getNode(getFixture().getTree(), "./DMAcc"), "AuthPref");
+
+ for (AuthenticationType auth : AuthenticationType.values()) {
+ testedNode.setData(auth.getName());
+ assertEquals(auth, getFixture().getAuthentication());
+ }
+
+ Map<String, AuthenticationType> tests = new HashMap<String, AuthenticationType>();
+ tests.put("Foo", AuthenticationType.BASIC);
+ tests.put("", AuthenticationType.BASIC);
+
+ for (Map.Entry<String, AuthenticationType> t : tests.entrySet()) {
+ testedNode.setData(t.getKey());
+ assertEquals(t.getValue(), getFixture().getAuthentication());
+ }
+ }
+
+ /**
* Tests the '{@link org.eclipse.koneki.simulators.omadm.model.Device#getLogin() <em>Login</em>}' feature getter. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -276,6 +307,24 @@ public class DeviceTest extends TestCase {
}
/**
+ * Tests the '{@link org.eclipse.koneki.simulators.omadm.model.Device#setAuthentication(Authentication) <em>Password</em>}' feature setter. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.koneki.simulators.omadm.model.Device#setAuthentication(Authentication)
+ * @generated NOT
+ */
+ public void testSetAuthentication() {
+
+ initDevice();
+
+ for (AuthenticationType auth : AuthenticationType.values()) {
+ getFixture().setAuthentication(auth);
+ assertEquals(auth.getName(), getFixture().getAuthentication().getName());
+ assertEquals(auth.getName(), NodeHelpers.findFirstNode(NodeHelpers.getNode(getFixture().getTree(), "./DMAcc"), "AuthPref").getData());
+ }
+ }
+
+ /**
* Tests the '{@link org.eclipse.koneki.simulators.omadm.model.Device#setPassword(java.lang.String) <em>Password</em>}' feature setter. <!--
* begin-user-doc --> <!-- end-user-doc -->
*