| 1 |  |   | 
  | 2 |  |   | 
  | 3 |  |   | 
  | 4 |  |   | 
  | 5 |  |   | 
  | 6 |  |   | 
  | 7 |  |   | 
  | 8 |  |   | 
  | 9 |  |   | 
  | 10 |  |   | 
  | 11 |  |   | 
  | 12 |  |   | 
  | 13 |  |   | 
  | 14 |  |   | 
  | 15 |  |   | 
  | 16 |  |   | 
  | 17 |  |  package org.apache.ws.scout.registry.infomodel; | 
  | 18 |  |   | 
  | 19 |  |  import javax.xml.registry.JAXRException; | 
  | 20 |  |  import javax.xml.registry.LifeCycleManager; | 
  | 21 |  |  import javax.xml.registry.infomodel.Association; | 
  | 22 |  |  import javax.xml.registry.infomodel.Concept; | 
  | 23 |  |  import javax.xml.registry.infomodel.InternationalString; | 
  | 24 |  |  import javax.xml.registry.infomodel.Key; | 
  | 25 |  |  import javax.xml.registry.infomodel.RegistryObject; | 
  | 26 |  |   | 
  | 27 |  |   | 
  | 28 |  |   | 
  | 29 |  |   | 
  | 30 |  |   | 
  | 31 |  |   | 
  | 32 |  |   | 
  | 33 |  |  public class AssociationImpl extends RegistryObjectImpl implements Association | 
  | 34 |  |  { | 
  | 35 | 10 |      private Concept type = null; | 
  | 36 | 10 |      private RegistryObject source = null; | 
  | 37 | 10 |      private RegistryObject target = null; | 
  | 38 | 10 |      private boolean isConfirmed = true; | 
  | 39 | 10 |      private boolean isConfirmedBySourceOwner = true; | 
  | 40 | 10 |      private boolean isConfirmedByTargetOwner = true; | 
  | 41 | 10 |      private boolean isExtramural = true; | 
  | 42 |  |   | 
  | 43 |  |      public AssociationImpl(LifeCycleManager lifeCycleManager) | 
  | 44 |  |      { | 
  | 45 | 10 |          super(lifeCycleManager); | 
  | 46 | 10 |      } | 
  | 47 |  |   | 
  | 48 |  |      public AssociationImpl(LifeCycleManager lifeCycleManager, InternationalString n) | 
  | 49 |  |      { | 
  | 50 | 0 |          super(lifeCycleManager, n); | 
  | 51 | 0 |      } | 
  | 52 |  |   | 
  | 53 |  |      public Concept getAssociationType() throws JAXRException | 
  | 54 |  |      { | 
  | 55 | 8 |          return type; | 
  | 56 |  |      } | 
  | 57 |  |   | 
  | 58 |  |      public RegistryObject getSourceObject() throws JAXRException | 
  | 59 |  |      { | 
  | 60 | 32 |          return source; | 
  | 61 |  |      } | 
  | 62 |  |   | 
  | 63 |  |      public RegistryObject getTargetObject() throws JAXRException | 
  | 64 |  |      { | 
  | 65 | 24 |          return target; | 
  | 66 |  |      } | 
  | 67 |  |   | 
  | 68 |  |      public boolean isConfirmed() throws JAXRException | 
  | 69 |  |      { | 
  | 70 | 0 |          return isConfirmed; | 
  | 71 |  |      } | 
  | 72 |  |   | 
  | 73 |  |      public boolean isConfirmedBySourceOwner() throws JAXRException | 
  | 74 |  |      { | 
  | 75 | 0 |          return isConfirmedBySourceOwner; | 
  | 76 |  |      } | 
  | 77 |  |   | 
  | 78 |  |      public boolean isConfirmedByTargetOwner() throws JAXRException | 
  | 79 |  |      { | 
  | 80 | 0 |          return isConfirmedByTargetOwner; | 
  | 81 |  |      } | 
  | 82 |  |   | 
  | 83 |  |      public boolean isExtramural() throws JAXRException | 
  | 84 |  |      { | 
  | 85 | 0 |          return isExtramural; | 
  | 86 |  |      } | 
  | 87 |  |   | 
  | 88 |  |      public void setAssociationType(Concept concept) throws JAXRException | 
  | 89 |  |      { | 
  | 90 | 16 |          type = concept; | 
  | 91 | 16 |      } | 
  | 92 |  |   | 
  | 93 |  |      public void setSourceObject(RegistryObject ro) throws JAXRException | 
  | 94 |  |      { | 
  | 95 | 8 |          source = ro; | 
  | 96 | 8 |      } | 
  | 97 |  |   | 
  | 98 |  |      public void setTargetObject(RegistryObject ro) throws JAXRException | 
  | 99 |  |      { | 
  | 100 | 8 |          target = ro; | 
  | 101 | 8 |      } | 
  | 102 |  |   | 
  | 103 |  |      | 
  | 104 |  |   | 
  | 105 |  |   | 
  | 106 |  |   | 
  | 107 |  |     public Key getKey() | 
  | 108 |  |     { | 
  | 109 | 14 |        String id = null; | 
  | 110 | 14 |        Key key = null; | 
  | 111 |  |        try | 
  | 112 |  |        { | 
  | 113 | 14 |           id = source.getKey().getId(); | 
  | 114 | 14 |           id += "|" + target.getKey().getId(); | 
  | 115 | 14 |           Key k = null; | 
  | 116 | 14 |           if(type != null ) k = type.getKey(); | 
  | 117 | 14 |           if(k == null || k.getId() == "" ) id +="|NULL"; | 
  | 118 |  |           else | 
  | 119 | 14 |            id+="|"+k.getId(); | 
  | 120 | 14 |           id += "|" + "Concept";   | 
  | 121 |  |            | 
  | 122 | 14 |           if(type!= null)  id += "|" + type.getValue(); | 
  | 123 | 0 |           else  id +="|NULL"; | 
  | 124 |  |   | 
  | 125 |  |        } | 
  | 126 | 0 |        catch (JAXRException e) | 
  | 127 |  |        { | 
  | 128 | 0 |          throw new RuntimeException(e); | 
  | 129 | 14 |        } | 
  | 130 |  |   | 
  | 131 | 14 |        if(id != null) key = new KeyImpl(id); | 
  | 132 | 14 |        return key; | 
  | 133 |  |     } | 
  | 134 |  |   | 
  | 135 |  |     public void setConfirmed(boolean b) | 
  | 136 |  |     { | 
  | 137 | 0 |        this.isConfirmed = b; | 
  | 138 | 0 |     } | 
  | 139 |  |   | 
  | 140 |  |     public void setConfirmedBySourceOwner(boolean b) | 
  | 141 |  |     { | 
  | 142 | 0 |        isConfirmedBySourceOwner = b; | 
  | 143 | 0 |     } | 
  | 144 |  |   | 
  | 145 |  |     public void setConfirmedByTargetOwner(boolean b) | 
  | 146 |  |     { | 
  | 147 | 0 |        isConfirmedByTargetOwner = b; | 
  | 148 | 0 |     } | 
  | 149 |  |   | 
  | 150 |  |     public void setExtramural(boolean b) | 
  | 151 |  |     { | 
  | 152 | 0 |        isExtramural = b; | 
  | 153 | 0 |     }  | 
  | 154 |  |   | 
  | 155 |  |  } |