public String getKey() {
   if (device != null) {
     return getKey(device);
   } else if (service != null) {
     return getKey(service);
   } else if (profile != null) {
     return profile.getId();
   }
   return null;
 }
 public void setProfile(DcdComponentInstantiation profile) {
   this.profile = profile;
   setKey(profile.getId());
 }