Skip to content

Commit

Permalink
add default attributes to entity occi.core.id with format: urn:uuid:
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Gourdin committed Mar 8, 2016
1 parent 35e1d94 commit a9005c9
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@
import java.util.Map;
import java.util.UUID;

import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
Expand Down Expand Up @@ -56,6 +62,7 @@
import org.occiware.clouddesigner.occi.Entity;
import org.occiware.clouddesigner.occi.Kind;
import org.occiware.clouddesigner.occi.Mixin;
import org.occiware.clouddesigner.occi.OCCIFactory;
import org.occiware.clouddesigner.occi.OCCIPackage;
import org.occiware.clouddesigner.occi.OCCITables;
import org.occiware.clouddesigner.occi.OCCIUtils;
Expand Down Expand Up @@ -148,6 +155,11 @@ protected EntityImpl() {
exc.printStackTrace(System.err);
}
}
// Add a default attribute occi.core.id (mandatory ref. GFD.185 section 3.1 p6).
AttributeState attrState = OCCIFactory.eINSTANCE.createAttributeState();
attrState.setName("occi.core.id");
attrState.setValue("urn:uuid:" + getId());
getAttributes().add(attrState);
}

/**
Expand Down

0 comments on commit a9005c9

Please sign in to comment.