View Javadoc
1 /* 2 * $Header: /cvsroot/ebxmlrr/jaxr/src/com/sun/xml/registry/ebxml/BusinessLifeCycleManagerImpl.java,v 1.6 2003/07/22 00:45:04 farrukh_najmi Exp $ 3 * 4 * 5 */ 6 7 package com.sun.xml.registry.ebxml; 8 9 import javax.xml.registry.*; 10 import javax.xml.registry.infomodel.*; 11 import java.util.*; 12 13 import com.sun.xml.registry.ebxml.infomodel.AssociationImpl; 14 15 /*** 16 * Class Declaration for Class1 17 */ 18 public class BusinessLifeCycleManagerImpl extends LifeCycleManagerImpl 19 implements BusinessLifeCycleManager 20 { 21 BusinessLifeCycleManagerImpl(RegistryServiceImpl service) { 22 super(service); 23 } 24 25 /*** 26 * Saves specified Organizations. 27 * If the object is not in the registry, then it is created in the registry. 28 * If it already exists in the registry and has been modified, then its 29 * state is updated (replaced) in the registry. 30 * 31 * Partial commits are allowed. Processing stops on first SaveException encountered. 32 * 33 * <p><DL><DT><B>Capability Level: 0 </B></DL> 34 * 35 * @return BulkResponse containing the Collection of keys for those objects that were 36 * saved successfully and any SaveException that was encountered in case of partial commit. 37 * 38 */ 39 public BulkResponse saveOrganizations(Collection organizations) throws JAXRException{ 40 Iterator iter = organizations.iterator(); 41 while (iter.hasNext()) { 42 Object org = iter.next(); 43 if (!(org instanceof Organization)) { 44 throw new UnexpectedObjectException("Error: Expecting an Organization, got a " + org.getClass().getName()); 45 } 46 } 47 return saveObjects(organizations); 48 } 49 50 /*** 51 * Saves specified Services. 52 * If the object is not in the registry, then it is created in the registry. 53 * If it already exists in the registry and has been modified, then its 54 * state is updated (replaced) in the registry. 55 * 56 * Partial commits are allowed. Processing stops on first SaveException encountered. 57 * 58 * <p><DL><DT><B>Capability Level: 0 </B></DL> 59 * 60 * @return BulkResponse containing the Collection of keys for those objects that were 61 * saved successfully and any SaveException that was encountered in case of partial commit. 62 */ 63 public BulkResponse saveServices(Collection services) throws JAXRException{ 64 Iterator iter = services.iterator(); 65 while (iter.hasNext()) { 66 Object service = iter.next(); 67 if (!(service instanceof Service)) { 68 throw new UnexpectedObjectException("Error: Expecting a Service, got a " + service.getClass().getName()); 69 } 70 } 71 return saveObjects(services); 72 } 73 74 /*** 75 * Saves specified ServiceBindings. 76 * If the object is not in the registry, then it is created in the registry. 77 * If it already exists in the registry and has been modified, then its 78 * state is updated (replaced) in the registry. 79 * 80 * Partial commits are allowed. Processing stops on first SaveException encountered. 81 * 82 * 83 * <p><DL><DT><B>Capability Level: 0 </B></DL> 84 * 85 * @return BulkResponse containing the Collection of keys for those objects that were 86 * saved successfully and any SaveException that was encountered in case of partial commit. 87 */ 88 public BulkResponse saveServiceBindings(Collection bindings) throws JAXRException{ 89 Iterator iter = bindings.iterator(); 90 while (iter.hasNext()) { 91 Object binding = iter.next(); 92 if (!(binding instanceof ServiceBinding)) { 93 throw new UnexpectedObjectException("Error: Expecting a ServiceBinding, got a " + binding.getClass().getName()); 94 } 95 } 96 return saveObjects(bindings); 97 } 98 99 /*** 100 * Saves specified Concepts. 101 * If the object is not in the registry, then it is created in the registry. 102 * If it already exists in the registry and has been modified, then its 103 * state is updated (replaced) in the registry. 104 * 105 * Partial commits are allowed. Processing stops on first SaveException encountered. 106 * 107 * 108 * <p><DL><DT><B>Capability Level: 0 </B></DL> 109 * 110 * @return BulkResponse containing the Collection of keys for those objects that were 111 * saved successfully and any SaveException that was encountered in case of partial commit. 112 */ 113 public BulkResponse saveConcepts(Collection concepts) throws JAXRException{ 114 Iterator iter = concepts.iterator(); 115 while (iter.hasNext()) { 116 Object concept = iter.next(); 117 if (!(concept instanceof Concept)) { 118 throw new UnexpectedObjectException("Error: Expecting a Concept, got a " + concept.getClass().getName()); 119 } 120 } 121 return saveObjects(concepts); 122 } 123 124 /*** 125 * Saves specified ClassificationScheme instances. 126 * If the object is not in the registry, then it is created in the registry. 127 * If it already exists in the registry and has been modified, then its 128 * state is updated (replaced) in the registry. 129 * 130 * Partial commits are allowed. Processing stops on first SaveException encountered. 131 * 132 * 133 * <p><DL><DT><B>Capability Level: 0 </B></DL> 134 * 135 * @return BulkResponse containing the Collection of keys for those objects that were 136 * saved successfully and any SaveException that was encountered in case of partial commit. 137 */ 138 public BulkResponse saveClassificationSchemes(Collection schemes) throws JAXRException{ 139 Iterator iter = schemes.iterator(); 140 while (iter.hasNext()) { 141 Object scheme = iter.next(); 142 if (!(scheme instanceof ClassificationScheme)) { 143 throw new UnexpectedObjectException("Error: Expecting a ClassificationScheme, got a " + scheme.getClass().getName()); 144 } 145 } 146 return saveObjects(schemes); 147 } 148 149 /*** 150 * Saves specified Association instances. 151 * If the object is not in the registry, then it is created in the registry. 152 * If it already exists in the registry and has been modified, then its 153 * state is updated (replaced) in the registry. 154 * 155 * Partial commits are allowed. Processing stops on first SaveException encountered. 156 * 157 * 158 * <p><DL><DT><B>Capability Level: 0 </B></DL> 159 * 160 * @param replace If set to true then the specified associations replace any existing associations owned by the caller. If set to false specif8ied associations are saved while preserving any existing associations that are not being updated by this call. 161 * @return BulkResponse containing the Collection of keys for those objects that were 162 * saved successfully and any SaveException that was encountered in case of partial commit. 163 */ 164 public BulkResponse saveAssociations(Collection associations, boolean replace) throws JAXRException{ 165 Iterator iter = associations.iterator(); 166 while (iter.hasNext()) { 167 Object association = iter.next(); 168 if (!(association instanceof Association)) { 169 throw new UnexpectedObjectException("Error: Expecting an Association, got a " + association.getClass().getName()); 170 } 171 } 172 //??What to do with replace 173 return saveObjects(associations); 174 } 175 176 /*** 177 * Deletes the organizations corresponding to the specified Keys. 178 * Partial commits are allowed. Processing stops on first DeleteException encountered. 179 * 180 * 181 * <p><DL><DT><B>Capability Level: 0 </B></DL> 182 * 183 * @return BulkResponse containing the Collection of keys for those objects that were 184 * deleted successfully and any DeleteException that was encountered in case of partial commit. 185 */ 186 public BulkResponse deleteOrganizations(Collection organizationKeys) throws JAXRException{ 187 return deleteObjects(organizationKeys); 188 } 189 190 /*** 191 * Delete the services corresponding to the specified Keys. 192 * Partial commits are allowed. Processing stops on first DeleteException encountered. 193 * 194 * 195 * <p><DL><DT><B>Capability Level: 0 </B></DL> 196 * 197 * @return BulkResponse containing the Collection of keys for those objects that were 198 * deleted successfully and any DeleteException that was encountered in case of partial commit. 199 */ 200 public BulkResponse deleteServices(Collection serviceKeys) throws JAXRException{ 201 return deleteObjects(serviceKeys); 202 } 203 204 /*** 205 * Delete the ServiceBindings corresponding to the specified Keys. 206 * Partial commits are allowed. Processing stops on first DeleteException encountered. 207 * 208 * 209 * <p><DL><DT><B>Capability Level: 0 </B></DL> 210 * 211 * @return BulkResponse containing the Collection of keys for those objects that were 212 * deleted successfully and any DeleteException that was encountered in case of partial commit. 213 */ 214 public BulkResponse deleteServiceBindings(Collection bindingKeys) throws JAXRException{ 215 return deleteObjects(bindingKeys); 216 } 217 218 /*** 219 * Delete the Concepts corresponding to the specified Keys. 220 * Partial commits are allowed. Processing stops on first DeleteException encountered. 221 * 222 * 223 * <p><DL><DT><B>Capability Level: 0 </B></DL> 224 * 225 * @return BulkResponse containing the Collection of keys for those objects that were 226 * deleted successfully and any DeleteException that was encountered in case of partial commit. 227 */ 228 public BulkResponse deleteConcepts(Collection conceptKeys) throws JAXRException{ 229 return deleteObjects(conceptKeys); 230 } 231 232 /*** 233 * Delete the ClassificationSchemes corresponding to the specified Keys. 234 * Partial commits are allowed. Processing stops on first DeleteException encountered. 235 * 236 * 237 * <p><DL><DT><B>Capability Level: 0 </B></DL> 238 * 239 * @return BulkResponse containing the Collection of keys for those objects that were 240 * deleted successfully and any DeleteException that was encountered in case of partial commit. 241 */ 242 public BulkResponse deleteClassificationSchemes(Collection schemeKeys) throws JAXRException{ 243 return deleteObjects(schemeKeys); 244 } 245 246 /*** 247 * Delete the Associations corresponding to the specified Keys. 248 * Partial commits are allowed. Processing stops on first 249 * DeleteException encountered. 250 * 251 * 252 * <p><DL><DT><B>Capability Level: 0 </B></DL> 253 * 254 * @return BulkResponse containing the Collection of keys for those 255 * objects that were deleted successfully and any DeleteException that 256 * was encountered in case of partial commit. 257 */ 258 public BulkResponse deleteAssociations(Collection assKeys) 259 throws JAXRException 260 { 261 return deleteObjects(assKeys); 262 } 263 264 public void confirmAssociation(Association association) 265 throws JAXRException, InvalidRequestException 266 { 267 if (!association.isExtramural()) { 268 return; 269 } 270 if (association.isConfirmed()) { 271 return; 272 } 273 274 // Confirm the Association by saving the same object again 275 AssociationImpl assImpl = (AssociationImpl)association; 276 assImpl.setNew(true); 277 ArrayList al = new ArrayList(); 278 al.add(assImpl); 279 saveObjects(al); 280 } 281 282 public void unConfirmAssociation(Association association) 283 throws JAXRException, InvalidRequestException 284 { 285 //?? 286 // Send a removeObjectsReq on ass similar to confirm and submitObjects 287 // me = getMyUser 288 // if (src owner is me) then unconfirm src 289 // else if (target owner is me then unconfirm target 290 } 291 }

This page was automatically generated by Maven