Author: geirm
Date: Sat Feb 12 05:24:35 2005
New Revision: 153502
URL: http://svn.apache.org/viewcvs?view=rev&rev=153502
Log:
looks scary, but it isn't (scary is from a minor code reformat)
upshot : in LifeCycleManager, there are two methods saveObjects() and
deleteObjects() that are useless w/o helper support from
BusinessLifeCycleManager,
it's decendent. (BLCM extends LCM).
THe methods in LCM were dummies, returning an empty BulkResponseImpl, which
was just usless anyway. Now, since there is no need ever to do a
new LifeCycleManagerImpl(), I made those two methods abstract. There are
more to do this too if there are no howls of protest. Had to add a
concrete impl in the test case.
Modified:
webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/LifeCycleManagerImpl.java
webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/LifeCycleManagerTest.java
Modified:
webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
URL:
http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java?view=diff&r1=153501&r2=153502
==============================================================================
---
webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
(original)
+++
webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
Sat Feb 12 05:24:35 2005
@@ -43,6 +43,7 @@
import javax.xml.registry.SaveException;
import javax.xml.registry.UnexpectedObjectException;
import javax.xml.registry.LifeCycleManager;
+import javax.xml.registry.UnsupportedCapabilityException;
import javax.xml.registry.infomodel.Association;
import javax.xml.registry.infomodel.ClassificationScheme;
import javax.xml.registry.infomodel.Concept;
@@ -67,142 +68,159 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
*/
public class BusinessLifeCycleManagerImpl extends LifeCycleManagerImpl
- implements BusinessLifeCycleManager, Serializable
-{
+ implements BusinessLifeCycleManager, Serializable {
- public BusinessLifeCycleManagerImpl(RegistryService registry)
- {
+ public BusinessLifeCycleManagerImpl(RegistryService registry) {
super(registry);
}
- //Override from Base Class
- public BulkResponse deleteObjects(Collection keys, String objectType)
throws JAXRException
- {
- BulkResponse bulk = null;
+ /**
+ * Deletes one or more previously submitted objects from the registry
+ * using the object keys and a specified objectType attribute.
+ *
+ * @param keys
+ * @param objectType
+ * @return
+ * @throws JAXRException
+ */
+ public BulkResponse deleteObjects(Collection keys, String objectType)
throws JAXRException {
+ BulkResponse bulk = null;
- if(objectType == LifeCycleManager.ASSOCIATION)
- {
+ if (objectType == LifeCycleManager.ASSOCIATION) {
bulk = this.deleteAssociations(keys);
- } else
- if(objectType == LifeCycleManager.CLASSIFICATION_SCHEME)
- {
+ }
+ else if (objectType == LifeCycleManager.CLASSIFICATION_SCHEME) {
bulk = this.deleteClassificationSchemes(keys);
- } else
- if(objectType == LifeCycleManager.CONCEPT)
- {
+ }
+ else if (objectType == LifeCycleManager.CONCEPT) {
bulk = this.deleteConcepts(keys);
- } else
- if(objectType == LifeCycleManager.ORGANIZATION)
- {
- bulk = this.deleteOrganizations(keys) ;
- } else
- if(objectType == LifeCycleManager.SERVICE)
- {
+ }
+ else if (objectType == LifeCycleManager.ORGANIZATION) {
+ bulk = this.deleteOrganizations(keys);
+ }
+ else if (objectType == LifeCycleManager.SERVICE) {
bulk = this.deleteServices(keys);
- }else
- if(objectType == LifeCycleManager.SERVICE_BINDING)
- {
+ }
+ else if (objectType == LifeCycleManager.SERVICE_BINDING) {
bulk = this.deleteServiceBindings(keys);
- }else
- throw new JAXRException( "Delete Operation for "+objectType + " not
implemented by Scout");
+ }
+ else {
+ throw new JAXRException("Delete Operation for " + objectType + "
not implemented by Scout");
+ }
return bulk;
}
- public BulkResponse deleteAssociations(Collection associationKeys) throws
JAXRException
- {
+ public BulkResponse deleteAssociations(Collection associationKeys) throws
JAXRException {
return this.deleteOperation(associationKeys, "DELETE_ASSOCIATION");
}
- public BulkResponse deleteClassificationSchemes(Collection schemeKeys)
throws JAXRException
- {
+ public BulkResponse deleteClassificationSchemes(Collection schemeKeys)
throws JAXRException {
return this.deleteOperation(schemeKeys, "DELETE_CLASSIFICATIONSCHEME");
}
- public BulkResponse deleteConcepts(Collection conceptKeys) throws
JAXRException
- {
+ public BulkResponse deleteConcepts(Collection conceptKeys) throws
JAXRException {
return this.deleteOperation(conceptKeys, "DELETE_CONCEPT");
}
- public BulkResponse deleteOrganizations(Collection orgkeys) throws
JAXRException
- {
+ public BulkResponse deleteOrganizations(Collection orgkeys) throws
JAXRException {
return this.deleteOperation(orgkeys, "DELETE_ORG");
}
- public BulkResponse deleteServiceBindings(Collection bindingKeys) throws
JAXRException
- {
+ public BulkResponse deleteServiceBindings(Collection bindingKeys) throws
JAXRException {
return this.deleteOperation(bindingKeys, "DELETE_SERVICEBINDING");
}
- public BulkResponse deleteServices(Collection serviceKeys) throws
JAXRException
- {
+ public BulkResponse deleteServices(Collection serviceKeys) throws
JAXRException {
return this.deleteOperation(serviceKeys, "DELETE_SERVICE");
}
- public BulkResponse saveObjects(Collection col ) throws JAXRException
- {
- BulkResponseImpl bulk = new BulkResponseImpl();
+ /**
+ * aves one or more Objects to the registry. An object may be a
+ * RegistryObject subclass instance. If an object is not in the registry,
+ * it is created in the registry. If it already exists in the registry
+ * and has been modified, then its state is updated (replaced) in the
+ * registry
+ * <p/>
+ * TODO:Check if juddi can provide a facility to store a collection of
heterogenous
+ * objects
+ * <p/>
+ * TODO - does this belong here? it's really an overload of
+ * LifecycleManager.saveObjects, but all the help we need
+ * like saveOrganization() is up here...
+ *
+ * @param col
+ * @return a BulkResponse containing the Collection of keys for those
objects
+ * that were saved successfully and any SaveException that was
encountered
+ * in case of partial commit
+ * @throws JAXRException
+ */
+ public BulkResponse saveObjects(Collection col) throws JAXRException {
Iterator iter = col.iterator();
- //TODO:Check if juddi can provide a facility to store a collection of
heterogenous
- //objects
- Collection keys = new ArrayList();
+
Collection suc = new ArrayList();
Collection exc = new ArrayList();
- bulk.setCollection(suc);
- bulk.setExceptions(exc);
- while(iter.hasNext())
- {
- keys.clear();
- RegistryObject reg = (RegistryObject)iter.next();
- keys.add(reg.getKey());
- BulkResponse br = null;
+ while (iter.hasNext()) {
+ RegistryObject reg = (RegistryObject) iter.next();
+
+ BulkResponse br = null;
Collection c = new ArrayList();
c.add(reg);
- if(reg instanceof javax.xml.registry.infomodel.Association)
- {
+ if (reg instanceof javax.xml.registry.infomodel.Association) {
br = saveAssociations(c, true);
- } else
- if(reg instanceof
javax.xml.registry.infomodel.ClassificationScheme)
- {
+ }
+ else if (reg instanceof
javax.xml.registry.infomodel.ClassificationScheme) {
br = saveClassificationSchemes(c);
}
- else
- if(reg instanceof javax.xml.registry.infomodel.Concept)
- {
+ else if (reg instanceof javax.xml.registry.infomodel.Concept) {
br = saveConcepts(c);
- }else
- if(reg instanceof javax.xml.registry.infomodel.Organization)
- {
+ }
+ else if (reg instanceof javax.xml.registry.infomodel.Organization)
{
br = saveOrganizations(c);
- }else
- if(reg instanceof javax.xml.registry.infomodel.Service)
- {
+ }
+ else if (reg instanceof javax.xml.registry.infomodel.Service) {
br = saveServices(c);
- }else
- if(reg instanceof javax.xml.registry.infomodel.ServiceBinding)
- {
+ }
+ else if (reg instanceof
javax.xml.registry.infomodel.ServiceBinding) {
br = saveServiceBindings(c);
}
+ else {
+ throw new JAXRException("Delete Operation for " +
reg.getClass()
+ + " not implemented by Scout");
+ }
- if(br != null ) {
- updateBulkResponse(bulk,br);
+ if (br.getCollection() != null) {
+ suc.addAll(br.getCollection());
+ }
+
+ if (br.getExceptions() != null) {
+ suc.addAll(br.getExceptions());
}
}
+ BulkResponseImpl bulk = new BulkResponseImpl();
+
+ /*
+ * TODO - what is the right status?
+ */
+ bulk.setStatus(JAXRResponse.STATUS_SUCCESS);
+
+ bulk.setCollection(suc);
+ bulk.setExceptions(exc);
+
return bulk;
}
- public BulkResponse saveAssociations(Collection associationObjects,
boolean replace) throws JAXRException
- { //TODO
+
+ public BulkResponse saveAssociations(Collection associationObjects,
boolean replace) throws JAXRException { //TODO
return null;
}
- public BulkResponse saveClassificationSchemes(Collection schemes) throws
JAXRException
- {
+ public BulkResponse saveClassificationSchemes(Collection schemes) throws
JAXRException {
//Now we need to convert the collection into a vector for juddi
BulkResponseImpl bulk = new BulkResponseImpl();
Vector entityvect = new Vector();
@@ -212,34 +230,30 @@
Iterator iter = schemes.iterator();
- while (iter.hasNext())
- {
- try
- {
+ while (iter.hasNext()) {
+ try {
TModel en =
ScoutJaxrUddiHelper.getTModelFromJAXRClassificationScheme((ClassificationScheme)
iter.next());
entityvect.add(en);
- } catch (ClassCastException ce)
- {
+ }
+ catch (ClassCastException ce) {
throw new UnexpectedObjectException();
}
}
System.out.println("Method:save_classificationscheme: ENlength=" +
entityvect.size());
// Save business
TModelDetail td = null;
- try
- {
+ try {
td = (TModelDetail) executeOperation(entityvect, "SAVE_TMODEL");
- } catch (RegistryException e)
- {
+ }
+ catch (RegistryException e) {
exceptions.add(new SaveException(e.getLocalizedMessage()));
bulk.setStatus(JAXRResponse.STATUS_FAILURE);
}
entityvect = td.getTModelVector();
System.out.println("After Saving TModel. Obtained vector size:" +
entityvect.size());
- for (int i = 0; entityvect != null && i < entityvect.size(); i++)
- {
+ for (int i = 0; entityvect != null && i < entityvect.size(); i++) {
TModel tm = (TModel) entityvect.elementAt(i);
coll.add(new KeyImpl(tm.getTModelKey()));
}
@@ -250,8 +264,7 @@
return bulk;
}
- public BulkResponse saveConcepts(Collection concepts) throws JAXRException
- {
+ public BulkResponse saveConcepts(Collection concepts) throws JAXRException
{
//Now we need to convert the collection into a vector for juddi
BulkResponseImpl bulk = new BulkResponseImpl();
Vector entityvect = new Vector();
@@ -261,34 +274,30 @@
Iterator iter = concepts.iterator();
- while (iter.hasNext())
- {
- try
- {
+ while (iter.hasNext()) {
+ try {
TModel en =
ScoutJaxrUddiHelper.getTModelFromJAXRConcept((Concept)
iter.next());
entityvect.add(en);
- } catch (ClassCastException ce)
- {
+ }
+ catch (ClassCastException ce) {
throw new UnexpectedObjectException();
}
}
System.out.println("Method:save_concept: ENlength=" +
entityvect.size());
// Save business
TModelDetail td = null;
- try
- {
+ try {
td = (TModelDetail) executeOperation(entityvect, "SAVE_TMODEL");
- } catch (RegistryException e)
- {
+ }
+ catch (RegistryException e) {
exceptions.add(new SaveException(e.getLocalizedMessage()));
bulk.setStatus(JAXRResponse.STATUS_FAILURE);
}
entityvect = td.getTModelVector();
System.out.println("After Saving TModel. Obtained vector size:" +
entityvect.size());
- for (int i = 0; entityvect != null && i < entityvect.size(); i++)
- {
+ for (int i = 0; entityvect != null && i < entityvect.size(); i++) {
TModel tm = (TModel) entityvect.elementAt(i);
coll.add(new KeyImpl(tm.getTModelKey()));
}
@@ -299,8 +308,7 @@
return bulk;
}
- public BulkResponse saveOrganizations(Collection organizations) throws
JAXRException
- {
+ public BulkResponse saveOrganizations(Collection organizations) throws
JAXRException {
//Now we need to convert the collection into a vector for juddi
BulkResponseImpl bulk = new BulkResponseImpl();
Vector entityvect = new Vector();
@@ -310,34 +318,30 @@
Iterator iter = organizations.iterator();
- while (iter.hasNext())
- {
- try
- {
+ while (iter.hasNext()) {
+ try {
BusinessEntity en =
ScoutJaxrUddiHelper.getBusinessEntityFromJAXROrg((Organization) iter.next());
entityvect.add(en);
- } catch (ClassCastException ce)
- {
+ }
+ catch (ClassCastException ce) {
throw new UnexpectedObjectException();
}
}
System.out.println("Method:save_business: ENlength=" +
entityvect.size());
// Save business
BusinessDetail bd = null;
- try
- {
+ try {
bd = (BusinessDetail) executeOperation(entityvect, "SAVE_ORG");
- } catch (RegistryException e)
- {
+ }
+ catch (RegistryException e) {
exceptions.add(new SaveException(e.getLocalizedMessage()));
bulk.setStatus(JAXRResponse.STATUS_FAILURE);
}
entityvect = bd.getBusinessEntityVector();
System.out.println("After Saving Business. Obtained vector size:" +
entityvect.size());
- for (int i = 0; entityvect != null && i < entityvect.size(); i++)
- {
+ for (int i = 0; entityvect != null && i < entityvect.size(); i++) {
BusinessEntity entity = (BusinessEntity) entityvect.elementAt(i);
coll.add(new KeyImpl(entity.getBusinessKey()));
}
@@ -348,8 +352,7 @@
return bulk;
}
- public BulkResponse saveServiceBindings(Collection bindings) throws
JAXRException
- {
+ public BulkResponse saveServiceBindings(Collection bindings) throws
JAXRException {
BulkResponseImpl bulk = new BulkResponseImpl();
Vector sbvect = new Vector();
@@ -357,31 +360,27 @@
Collection exceptions = new ArrayList();
Iterator iter = bindings.iterator();
- while (iter.hasNext())
- {
- try
- {
+ while (iter.hasNext()) {
+ try {
BindingTemplate bs =
ScoutJaxrUddiHelper.getBindingTemplateFromJAXRSB((ServiceBinding) iter.next());
sbvect.add(bs);
- } catch (ClassCastException ce)
- {
+ }
+ catch (ClassCastException ce) {
throw new UnexpectedObjectException();
}
}
// Save ServiceBinding
BindingDetail bd = null;
- try
- {
+ try {
bd = (BindingDetail) executeOperation(sbvect,
"SAVE_SERVICE_BINDING");
- } catch (RegistryException e)
- {
+ }
+ catch (RegistryException e) {
exceptions.add(new SaveException(e.getLocalizedMessage()));
bulk.setStatus(JAXRResponse.STATUS_FAILURE);
}
sbvect = bd.getBindingTemplateVector();
- for (int i = 0; sbvect != null && i < sbvect.size(); i++)
- {
+ for (int i = 0; sbvect != null && i < sbvect.size(); i++) {
BindingTemplate bt = (BindingTemplate) sbvect.elementAt(i);
coll.add(new KeyImpl(bt.getBindingKey()));
}
@@ -391,8 +390,7 @@
return bulk;
}
- public BulkResponse saveServices(Collection services) throws JAXRException
- {
+ public BulkResponse saveServices(Collection services) throws JAXRException
{
BulkResponseImpl bulk = new BulkResponseImpl();
Vector svect = new Vector();
@@ -401,31 +399,27 @@
Iterator iter = services.iterator();
- while (iter.hasNext())
- {
- try
- {
+ while (iter.hasNext()) {
+ try {
BusinessService bs =
ScoutJaxrUddiHelper.getBusinessServiceFromJAXRService((Service) iter.next());
svect.add(bs);
- } catch (ClassCastException ce)
- {
+ }
+ catch (ClassCastException ce) {
throw new UnexpectedObjectException();
}
}
// Save Service
ServiceDetail sd = null;
- try
- {
+ try {
sd = (ServiceDetail) executeOperation(svect, "SAVE_SERVICE");
- } catch (RegistryException e)
- {
+ }
+ catch (RegistryException e) {
exceptions.add(new SaveException(e.getLocalizedMessage()));
bulk.setStatus(JAXRResponse.STATUS_FAILURE);
}
svect = sd.getBusinessServiceVector();
- for (int i = 0; svect != null && i < svect.size(); i++)
- {
+ for (int i = 0; svect != null && i < svect.size(); i++) {
BusinessService entity = (BusinessService) svect.elementAt(i);
coll.add(new KeyImpl(entity.getServiceKey()));
}
@@ -435,60 +429,60 @@
return bulk;
}
- public void confirmAssociation(Association assoc) throws JAXRException,
InvalidRequestException
- {
+ public void confirmAssociation(Association assoc) throws JAXRException,
InvalidRequestException {
//TODO
}
- public void unConfirmAssociation(Association assoc) throws JAXRException,
InvalidRequestException
- { //TODO
+ public void unConfirmAssociation(Association assoc) throws JAXRException,
InvalidRequestException { //TODO
}
//Protected Methods
protected org.apache.juddi.datatype.RegistryObject executeOperation(Vector
datavect, String op)
- throws org.apache.juddi.error.RegistryException, JAXRException
- {
+ throws org.apache.juddi.error.RegistryException, JAXRException {
org.apache.juddi.datatype.RegistryObject regobj = null;
IRegistry ireg = null;
- if (registry != null) ireg = registry.getRegistry();
+ if (registry != null) {
+ ireg = registry.getRegistry();
+ }
ConnectionImpl connection = registry.getConnection();
AuthToken token = getAuthToken(connection, ireg);
- if (op.equalsIgnoreCase("SAVE_SERVICE"))
- {
+ if (op.equalsIgnoreCase("SAVE_SERVICE")) {
regobj = ireg.saveService(token.getAuthInfo(), datavect);
- } else if (op.equalsIgnoreCase("SAVE_SERVICE_BINDING"))
- {
+ }
+ else if (op.equalsIgnoreCase("SAVE_SERVICE_BINDING")) {
regobj = ireg.saveBinding(token.getAuthInfo(), datavect);
- } else if (op.equalsIgnoreCase("SAVE_ORG"))
- {
+ }
+ else if (op.equalsIgnoreCase("SAVE_ORG")) {
regobj = ireg.saveBusiness(token.getAuthInfo(), datavect);
- } else if (op.equalsIgnoreCase("SAVE_TMODEL"))
- {
+ }
+ else if (op.equalsIgnoreCase("SAVE_TMODEL")) {
regobj = ireg.saveTModel(token.getAuthInfo(), datavect);
- } else if (op.equalsIgnoreCase("DELETE_ORG"))
- {
+ }
+ else if (op.equalsIgnoreCase("DELETE_ORG")) {
regobj = ireg.deleteBusiness(token.getAuthInfo(), datavect);
- } else if (op.equalsIgnoreCase("DELETE_SERVICE"))
- {
+ }
+ else if (op.equalsIgnoreCase("DELETE_SERVICE")) {
regobj = ireg.deleteService(token.getAuthInfo(), datavect);
- } else if (op.equalsIgnoreCase("DELETE_SERVICEBINDING"))
- {
+ }
+ else if (op.equalsIgnoreCase("DELETE_SERVICEBINDING")) {
regobj = ireg.deleteBinding(token.getAuthInfo(), datavect);
- } else if (op.equalsIgnoreCase("DELETE_CONCEPT"))
- {
+ }
+ else if (op.equalsIgnoreCase("DELETE_CONCEPT")) {
regobj = ireg.deleteTModel(token.getAuthInfo(), datavect);
- } else if (op.equalsIgnoreCase("DELETE_ASSOCIATION"))
- {
+ }
+ else if (op.equalsIgnoreCase("DELETE_ASSOCIATION")) {
regobj = ireg.deletePublisherAssertions(token.getAuthInfo(),
datavect);
- } else if (op.equalsIgnoreCase("DELETE_CLASSIFICATIONSCHEME"))
- {
+ }
+ else if (op.equalsIgnoreCase("DELETE_CLASSIFICATIONSCHEME")) {
regobj = ireg.deleteTModel(token.getAuthInfo(), datavect);
- } else
+ }
+ else {
throw new JAXRException("Unsupported operation:" + op);
+ }
return regobj;
@@ -496,8 +490,7 @@
protected BulkResponse deleteOperation(Collection keys, String op)
- throws JAXRException
- {
+ throws JAXRException {
//Now we need to convert the collection into a vector for juddi
BulkResponseImpl bulk = new BulkResponseImpl();
Vector keyvect = new Vector();
@@ -505,12 +498,10 @@
Collection coll = new ArrayList();
Collection exceptions = new ArrayList();
- try
- {
+ try {
Iterator iter = keys.iterator();
- while (iter.hasNext())
- {
+ while (iter.hasNext()) {
Key key = (Key) iter.next();
keyvect.add(key.getId());
}
@@ -520,14 +511,13 @@
keyvect = bd.getResultVector();
System.out.println("After deleting Business. Obtained vector
size:" + keyvect.size());
- for (int i = 0; keyvect != null && i < keyvect.size(); i++)
- {
+ for (int i = 0; keyvect != null && i < keyvect.size(); i++) {
Result result = (Result) keyvect.elementAt(i);
int errno = result.getErrno();
- if (errno == 0)
+ if (errno == 0) {
coll.addAll(keys);
- else
- {
+ }
+ else {
ErrInfo errinfo = result.getErrInfo();
DeleteException de = new
DeleteException(errinfo.getErrCode() + ":" + errinfo.getErrMsg());
bulk.setStatus(JAXRResponse.STATUS_FAILURE);
@@ -548,8 +538,7 @@
bulk.setStatus(JAXRResponse.STATUS_FAILURE);
exceptions.add(de);
}
- catch (JAXRException tran)
- {
+ catch (JAXRException tran) {
exceptions.add(new JAXRException("Apache JAXR Impl:", tran));
bulk.setStatus(JAXRResponse.STATUS_FAILURE);
}
@@ -570,77 +559,22 @@
* @throws JAXRException
*/
private AuthToken getAuthToken(ConnectionImpl connection, IRegistry ireg)
- throws JAXRException
- {
+ throws JAXRException {
Set creds = connection.getCredentials();
Iterator it = creds.iterator();
String username = "", pwd = "";
- while (it.hasNext())
- {
+ while (it.hasNext()) {
PasswordAuthentication pass = (PasswordAuthentication) it.next();
username = pass.getUserName();
pwd = new String(pass.getPassword());
}
AuthToken token = null;
- try
- {
+ try {
token = ireg.getAuthToken(username, pwd);
- } catch (Exception e)
- {
+ }
+ catch (Exception e) {
throw new JAXRException(e);
}
return token;
}
-
-
- /**
- * TODO - fix me!
- * @param bulk
- * @param br
- * @throws JAXRException
- */
- private void updateBulkResponse(BulkResponseImpl bulk, BulkResponse br)
- throws JAXRException
- {
- if (bulk == null || br == null) {
- return;
- }
-
- /**
- * TODO - fix when we fix BulkResponse
- */
-
- Collection data = br.getCollection();
-
- if (data != null) {
-
- Collection c = bulk.getCollection();
-
- if (c == null) {
- c = new ArrayList();
- }
-
- bulk.setCollection(c);
- c.addAll(data);
- }
-
- data = br.getExceptions();
-
- if (data != null) {
- Collection c = bulk.getExceptions();
-
- if (c == null) {
- c = new ArrayList();
- }
-
- c.addAll(data);
-
- bulk.setExceptions(c);
- }
-
- if(bulk.getStatus() == JAXRResponse.STATUS_SUCCESS) {
- bulk.setStatus(br.getStatus());
- }
- }
-
}
Modified:
webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/LifeCycleManagerImpl.java
URL:
http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/LifeCycleManagerImpl.java?view=diff&r1=153501&r2=153502
==============================================================================
---
webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/LifeCycleManagerImpl.java
(original)
+++
webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/LifeCycleManagerImpl.java
Sat Feb 12 05:24:35 2005
@@ -21,8 +21,26 @@
import org.apache.juddi.datatype.response.BusinessDetail;
import org.apache.juddi.datatype.response.BusinessInfo;
import org.apache.juddi.datatype.response.ServiceInfo;
-import org.apache.ws.scout.registry.infomodel.*;
import org.apache.ws.scout.util.ScoutUddiJaxrHelper;
+import org.apache.ws.scout.registry.infomodel.PostalAddressImpl;
+import org.apache.ws.scout.registry.infomodel.KeyImpl;
+import org.apache.ws.scout.registry.infomodel.InternationalStringImpl;
+import org.apache.ws.scout.registry.infomodel.LocalizedStringImpl;
+import org.apache.ws.scout.registry.infomodel.ExternalIdentifierImpl;
+import org.apache.ws.scout.registry.infomodel.ExternalLinkImpl;
+import org.apache.ws.scout.registry.infomodel.ConceptImpl;
+import org.apache.ws.scout.registry.infomodel.EmailAddressImpl;
+import org.apache.ws.scout.registry.infomodel.ClassificationImpl;
+import org.apache.ws.scout.registry.infomodel.ClassificationSchemeImpl;
+import org.apache.ws.scout.registry.infomodel.AssociationImpl;
+import org.apache.ws.scout.registry.infomodel.OrganizationImpl;
+import org.apache.ws.scout.registry.infomodel.PersonNameImpl;
+import org.apache.ws.scout.registry.infomodel.ServiceImpl;
+import org.apache.ws.scout.registry.infomodel.ServiceBindingImpl;
+import org.apache.ws.scout.registry.infomodel.SpecificationLinkImpl;
+import org.apache.ws.scout.registry.infomodel.SlotImpl;
+import org.apache.ws.scout.registry.infomodel.TelephoneNumberImpl;
+import org.apache.ws.scout.registry.infomodel.UserImpl;
import javax.activation.DataHandler;
import javax.xml.registry.BulkResponse;
@@ -31,7 +49,28 @@
import javax.xml.registry.LifeCycleManager;
import javax.xml.registry.RegistryService;
import javax.xml.registry.UnsupportedCapabilityException;
-import javax.xml.registry.infomodel.*;
+import javax.xml.registry.infomodel.User;
+import javax.xml.registry.infomodel.TelephoneNumber;
+import javax.xml.registry.infomodel.ExtrinsicObject;
+import javax.xml.registry.infomodel.Slot;
+import javax.xml.registry.infomodel.ServiceBinding;
+import javax.xml.registry.infomodel.Service;
+import javax.xml.registry.infomodel.SpecificationLink;
+import javax.xml.registry.infomodel.PostalAddress;
+import javax.xml.registry.infomodel.PersonName;
+import javax.xml.registry.infomodel.InternationalString;
+import javax.xml.registry.infomodel.Key;
+import javax.xml.registry.infomodel.LocalizedString;
+import javax.xml.registry.infomodel.Organization;
+import javax.xml.registry.infomodel.ClassificationScheme;
+import javax.xml.registry.infomodel.ExternalIdentifier;
+import javax.xml.registry.infomodel.ExternalLink;
+import javax.xml.registry.infomodel.Concept;
+import javax.xml.registry.infomodel.EmailAddress;
+import javax.xml.registry.infomodel.Classification;
+import javax.xml.registry.infomodel.Association;
+import javax.xml.registry.infomodel.RegistryObject;
+import javax.xml.registry.infomodel.RegistryPackage;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -45,114 +84,108 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Anil Saldhana</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
*/
-public class LifeCycleManagerImpl implements LifeCycleManager
-{
+public abstract class LifeCycleManagerImpl implements LifeCycleManager {
protected final RegistryServiceImpl registry;
- public LifeCycleManagerImpl(RegistryService registry)
- {
+ public LifeCycleManagerImpl(RegistryService registry) {
this.registry = (RegistryServiceImpl) registry;
}
- public RegistryService getRegistryService()
- {
+ public RegistryService getRegistryService() {
return registry;
}
- public Object createObject(String interfaceName) throws JAXRException
- {
+ public Object createObject(String interfaceName) throws JAXRException {
// we don't use reflection so that we can work in environments where
// we may not have permission to do so
- if (LifeCycleManager.ASSOCIATION.equals(interfaceName))
- {
+ if (LifeCycleManager.ASSOCIATION.equals(interfaceName)) {
return new AssociationImpl(this);
- } else if (LifeCycleManager.AUDITABLE_EVENT.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.AUDITABLE_EVENT.equals(interfaceName)) {
throw new UnsupportedCapabilityException();
- } else if (LifeCycleManager.CLASSIFICATION.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.CLASSIFICATION.equals(interfaceName)) {
return new ClassificationImpl(this);
- } else if
(LifeCycleManager.CLASSIFICATION_SCHEME.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.CLASSIFICATION_SCHEME.equals(interfaceName))
{
return new ClassificationSchemeImpl(this);
- } else if (LifeCycleManager.CONCEPT.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.CONCEPT.equals(interfaceName)) {
return new ConceptImpl(this);
- } else if (LifeCycleManager.EMAIL_ADDRESS.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.EMAIL_ADDRESS.equals(interfaceName)) {
return new EmailAddressImpl();
- } else if (LifeCycleManager.EXTERNAL_IDENTIFIER.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.EXTERNAL_IDENTIFIER.equals(interfaceName)) {
return new ExternalIdentifierImpl(this);
- } else if (LifeCycleManager.EXTERNAL_LINK.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.EXTERNAL_LINK.equals(interfaceName)) {
return new ExternalLinkImpl(this);
- } else if (LifeCycleManager.EXTRINSIC_OBJECT.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.EXTRINSIC_OBJECT.equals(interfaceName)) {
throw new UnsupportedCapabilityException();
- } else if (LifeCycleManager.INTERNATIONAL_STRING.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.INTERNATIONAL_STRING.equals(interfaceName)) {
return new InternationalStringImpl();
- } else if (LifeCycleManager.KEY.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.KEY.equals(interfaceName)) {
return new KeyImpl();
- } else if (LifeCycleManager.LOCALIZED_STRING.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.LOCALIZED_STRING.equals(interfaceName)) {
return new LocalizedStringImpl();
- } else if (LifeCycleManager.ORGANIZATION.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.ORGANIZATION.equals(interfaceName)) {
return new OrganizationImpl(this);
- } else if (LifeCycleManager.PERSON_NAME.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.PERSON_NAME.equals(interfaceName)) {
return new PersonNameImpl();
- } else if (LifeCycleManager.POSTAL_ADDRESS.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.POSTAL_ADDRESS.equals(interfaceName)) {
return new PostalAddressImpl(registry.getDefaultPostalScheme());
- } else if (LifeCycleManager.REGISTRY_ENTRY.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.REGISTRY_ENTRY.equals(interfaceName)) {
throw new UnsupportedCapabilityException();
- } else if (LifeCycleManager.REGISTRY_PACKAGE.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.REGISTRY_PACKAGE.equals(interfaceName)) {
throw new UnsupportedCapabilityException();
- } else if (LifeCycleManager.SERVICE.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.SERVICE.equals(interfaceName)) {
return new ServiceImpl(this);
- } else if (LifeCycleManager.SERVICE_BINDING.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.SERVICE_BINDING.equals(interfaceName)) {
return new ServiceBindingImpl(this);
- } else if (LifeCycleManager.SLOT.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.SLOT.equals(interfaceName)) {
return new SlotImpl();
- } else if (LifeCycleManager.SPECIFICATION_LINK.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.SPECIFICATION_LINK.equals(interfaceName)) {
return new SpecificationLinkImpl(this);
- } else if (LifeCycleManager.TELEPHONE_NUMBER.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.TELEPHONE_NUMBER.equals(interfaceName)) {
return new TelephoneNumberImpl();
- } else if (LifeCycleManager.USER.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.USER.equals(interfaceName)) {
return new UserImpl(this);
- } else if (LifeCycleManager.VERSIONABLE.equals(interfaceName))
- {
+ }
+ else if (LifeCycleManager.VERSIONABLE.equals(interfaceName)) {
throw new UnsupportedCapabilityException();
- } else
- {
+ }
+ else {
throw new InvalidRequestException("Unknown interface: " +
interfaceName);
}
}
- public Association createAssociation(RegistryObject targetObject, Concept
associationType) throws JAXRException
- {
+ public Association createAssociation(RegistryObject targetObject, Concept
associationType) throws JAXRException {
Association assoc = (Association)
this.createObject(LifeCycleManager.ASSOCIATION);
assoc.setTargetObject(targetObject);
assoc.setAssociationType(associationType);
return assoc;
}
- public Classification createClassification(Concept concept) throws
JAXRException, InvalidRequestException
- {
- if (concept.getClassificationScheme() == null)
+ public Classification createClassification(Concept concept) throws
JAXRException, InvalidRequestException {
+ if (concept.getClassificationScheme() == null) {
throw new InvalidRequestException("Concept is not under
classification scheme");
+ }
Classification classify = (Classification)
this.createObject(LifeCycleManager.CLASSIFICATION);
classify.setConcept(concept);
return classify;
@@ -160,30 +193,28 @@
public Classification createClassification(ClassificationScheme scheme,
InternationalString name,
- String value) throws
JAXRException
- {
+ String value) throws
JAXRException {
Classification cl = (Classification)
this.createObject(LifeCycleManager.CLASSIFICATION);
cl.setClassificationScheme(scheme);
cl.setName(name);
cl.setValue(value);
- ((ClassificationImpl)cl).setExternal(true);
+ ((ClassificationImpl) cl).setExternal(true);
return cl;
}
public Classification createClassification(ClassificationScheme scheme,
String name, String value)
- throws JAXRException
- {
+ throws JAXRException {
return createClassification(scheme,
this.createInternationalString(name), value);
}
- public ClassificationScheme createClassificationScheme(Concept concept)
throws JAXRException, InvalidRequestException
- {
+ public ClassificationScheme createClassificationScheme(Concept concept)
throws JAXRException, InvalidRequestException {
//Check if the passed concept has a classificationscheme or has a
parent concept
- if (concept.getParentConcept() != null ||
concept.getClassificationScheme() != null)
+ if (concept.getParentConcept() != null ||
concept.getClassificationScheme() != null) {
throw new InvalidRequestException("Concept has
classificationscheme or has a parent");
+ }
ClassificationScheme cs = new ClassificationSchemeImpl(this);
@@ -193,8 +224,7 @@
public ClassificationScheme createClassificationScheme(InternationalString
name,
InternationalString
des)
- throws JAXRException, InvalidRequestException
- {
+ throws JAXRException, InvalidRequestException {
ClassificationScheme cs = new ClassificationSchemeImpl(this);
cs.setName(name);
cs.setDescription(des);
@@ -202,110 +232,92 @@
}
public ClassificationScheme createClassificationScheme(String name, String
desc)
- throws JAXRException, InvalidRequestException
- {
+ throws JAXRException, InvalidRequestException {
return createClassificationScheme(this.createInternationalString(name),
this.createInternationalString(desc));
}
public Concept createConcept(RegistryObject parent, InternationalString
name, String value)
- throws JAXRException
- {
+ throws JAXRException {
ConceptImpl concept = new ConceptImpl(this);
- concept.setClassificationScheme((ClassificationScheme)parent);
+ concept.setClassificationScheme((ClassificationScheme) parent);
concept.setParent(parent);
concept.setName(name);
concept.setValue(value);
return concept;
}
- public Concept createConcept(RegistryObject parent, String name, String
value) throws JAXRException
- {
+ public Concept createConcept(RegistryObject parent, String name, String
value) throws JAXRException {
return createConcept(parent, this.createInternationalString(name),
value);
}
- public EmailAddress createEmailAddress(String address) throws JAXRException
- {
+ public EmailAddress createEmailAddress(String address) throws
JAXRException {
return new EmailAddressImpl(address);
}
- public EmailAddress createEmailAddress(String address, String type) throws
JAXRException
- {
+ public EmailAddress createEmailAddress(String address, String type) throws
JAXRException {
return new EmailAddressImpl(address, type);
}
public ExternalIdentifier createExternalIdentifier(ClassificationScheme
ids,
InternationalString
name,
- String value) throws
JAXRException
- {
+ String value) throws
JAXRException {
return new ExternalIdentifierImpl(this, ids, name, value);
}
public ExternalIdentifier createExternalIdentifier(ClassificationScheme
ids,
- String name, String
value) throws JAXRException
- {
+ String name, String
value) throws JAXRException {
return createExternalIdentifier(ids,
this.createInternationalString(name), value);
}
- public ExternalLink createExternalLink(String uri, InternationalString
desc) throws JAXRException
- {
+ public ExternalLink createExternalLink(String uri, InternationalString
desc) throws JAXRException {
ExternalLink ext = new ExternalLinkImpl(this);
ext.setExternalURI(uri);
ext.setDescription(desc);
return ext;
}
- public ExternalLink createExternalLink(String uri, String desc) throws
JAXRException
- {
+ public ExternalLink createExternalLink(String uri, String desc) throws
JAXRException {
return createExternalLink(uri, createInternationalString(desc));
}
- public InternationalString createInternationalString() throws JAXRException
- {
+ public InternationalString createInternationalString() throws
JAXRException {
return new InternationalStringImpl();
}
- public InternationalString createInternationalString(String value) throws
JAXRException
- {
+ public InternationalString createInternationalString(String value) throws
JAXRException {
return new InternationalStringImpl(Locale.getDefault(), value,
LocalizedString.DEFAULT_CHARSET_NAME);
}
- public InternationalString createInternationalString(Locale locale, String
value) throws JAXRException
- {
+ public InternationalString createInternationalString(Locale locale, String
value) throws JAXRException {
return new InternationalStringImpl(locale, value,
LocalizedString.DEFAULT_CHARSET_NAME);
}
- public Key createKey(String id)
- {
+ public Key createKey(String id) {
return new KeyImpl(id);
}
- public LocalizedString createLocalizedString(Locale locale, String value)
throws JAXRException
- {
+ public LocalizedString createLocalizedString(Locale locale, String value)
throws JAXRException {
return new LocalizedStringImpl(locale, value,
LocalizedString.DEFAULT_CHARSET_NAME);
}
- public LocalizedString createLocalizedString(Locale locale, String value,
String charsetName) throws JAXRException
- {
+ public LocalizedString createLocalizedString(Locale locale, String value,
String charsetName) throws JAXRException {
return new LocalizedStringImpl(locale, value, charsetName);
}
- public Organization createOrganization(InternationalString name) throws
JAXRException
- {
+ public Organization createOrganization(InternationalString name) throws
JAXRException {
Organization org = (Organization)
this.createObject(LifeCycleManager.ORGANIZATION);
org.setName(name);
return org;
}
- public Organization createOrganization(String name) throws JAXRException
- {
+ public Organization createOrganization(String name) throws JAXRException {
Organization org = (Organization)
this.createObject(LifeCycleManager.ORGANIZATION);
org.setName(this.createInternationalString(name));
return org;
}
- public PersonName createPersonName(String fullName) throws JAXRException
- {
+ public PersonName createPersonName(String fullName) throws JAXRException {
PersonName pn = (PersonName)
this.createObject(LifeCycleManager.PERSON_NAME);
pn.setFullName(fullName);
return pn;
@@ -316,8 +328,7 @@
String city,
String stateOrProvince,
String country,
- String postalCode, String type)
throws JAXRException
- {
+ String postalCode, String type)
throws JAXRException {
PostalAddress post = new PostalAddressImpl();
post.setStreetNumber(streetNumber);
post.setStreet(street);
@@ -329,25 +340,21 @@
return post;
}
- public Service createService(InternationalString name) throws JAXRException
- {
+ public Service createService(InternationalString name) throws
JAXRException {
Service ser = (Service) this.createObject(LifeCycleManager.SERVICE);
ser.setName(name);
return ser;
}
- public Service createService(String name) throws JAXRException
- {
+ public Service createService(String name) throws JAXRException {
return createService(this.createInternationalString(name));
}
- public ServiceBinding createServiceBinding() throws JAXRException
- {
+ public ServiceBinding createServiceBinding() throws JAXRException {
return (ServiceBinding)
this.createObject(LifeCycleManager.SERVICE_BINDING);
}
- public Slot createSlot(String name, String value, String slotType) throws
JAXRException
- {
+ public Slot createSlot(String name, String value, String slotType) throws
JAXRException {
Collection col = new ArrayList();
col.add(value);
Slot slot = (Slot) this.createObject(LifeCycleManager.SLOT);
@@ -357,8 +364,7 @@
return slot;
}
- public Slot createSlot(String name, Collection values, String slotType)
throws JAXRException
- {
+ public Slot createSlot(String name, Collection values, String slotType)
throws JAXRException {
Slot slot = (Slot) this.createObject(LifeCycleManager.SLOT);
slot.setName(name);
slot.setValues(values);
@@ -366,34 +372,45 @@
return slot;
}
- public SpecificationLink createSpecificationLink() throws JAXRException
- {
+ public SpecificationLink createSpecificationLink() throws JAXRException {
return (SpecificationLink)
this.createObject(LifeCycleManager.SPECIFICATION_LINK);
}
- public TelephoneNumber createTelephoneNumber() throws JAXRException
- {
+ public TelephoneNumber createTelephoneNumber() throws JAXRException {
return (TelephoneNumber)
this.createObject(LifeCycleManager.TELEPHONE_NUMBER);
}
- public User createUser() throws JAXRException
- {
+ public User createUser() throws JAXRException {
return (User) this.createObject(LifeCycleManager.USER);
}
- public BulkResponse deleteObjects(Collection keys, String objectType)
throws JAXRException
- {
- BulkResponse bulk = new BulkResponseImpl();
+ /**
+ * aves one or more Objects to the registry. An object may be a
+ * RegistryObject subclass instance. If an object is not in the registry,
+ * it is created in the registry. If it already exists in the registry
+ * and has been modified, then its state is updated (replaced) in the
+ * registry
+ *
+ * @param objects
+ * @return a BulkResponse containing the Collection of keys for those
objects
+ * that were saved successfully and any SaveException that was
encountered
+ * in case of partial commit
+ * @throws JAXRException
+ */
- return bulk;
- }
+ public abstract BulkResponse saveObjects(Collection objects) throws
JAXRException;
- public BulkResponse saveObjects(Collection col ) throws JAXRException
- {
- BulkResponse bulk = new BulkResponseImpl();
+ /**
+ * Deletes one or more previously submitted objects from the registry
+ * using the object keys and a specified objectType attribute.
+ *
+ * @param keys
+ * @param objectType
+ * @return
+ * @throws JAXRException
+ */
+ public abstract BulkResponse deleteObjects(Collection keys, String
objectType) throws JAXRException;
- return bulk;
- }
/*************************************************************************
* Level 1 Features
@@ -404,62 +421,50 @@
* @return
* @throws JAXRException
*/
- public ExtrinsicObject createExtrinsicObject(DataHandler repositoryItem)
throws JAXRException
- {
+ public ExtrinsicObject createExtrinsicObject(DataHandler repositoryItem)
throws JAXRException {
throw new UnsupportedCapabilityException();
}
- public PersonName createPersonName(String firstName, String middleName,
String lastName) throws JAXRException
- {
+ public PersonName createPersonName(String firstName, String middleName,
String lastName) throws JAXRException {
throw new UnsupportedCapabilityException();
}
- public RegistryPackage createRegistryPackage(InternationalString name)
throws JAXRException
- {
+ public RegistryPackage createRegistryPackage(InternationalString name)
throws JAXRException {
throw new UnsupportedCapabilityException();
}
- public RegistryPackage createRegistryPackage(String name) throws
JAXRException
- {
+ public RegistryPackage createRegistryPackage(String name) throws
JAXRException {
throw new UnsupportedCapabilityException();
}
- public BulkResponse deprecateObjects(Collection keys) throws JAXRException
- {
+ public BulkResponse deprecateObjects(Collection keys) throws JAXRException
{
throw new UnsupportedCapabilityException();
}
- public BulkResponse unDeprecateObjects(Collection keys) throws
JAXRException
- {
+ public BulkResponse unDeprecateObjects(Collection keys) throws
JAXRException {
throw new UnsupportedCapabilityException();
}
- public BulkResponse deleteObjects(Collection keys) throws JAXRException
- {
+ public BulkResponse deleteObjects(Collection keys) throws JAXRException {
throw new UnsupportedCapabilityException();
}
- Organization createOrganization(BusinessInfo info) throws JAXRException
- {
+ Organization createOrganization(BusinessInfo info) throws JAXRException {
String key = info.getBusinessKey();
Vector names = info.getNameVector();
Vector descriptions = info.getDescriptionVector();
Vector serviceInfos = info.getServiceInfos().getServiceInfoVector();
OrganizationImpl org = new OrganizationImpl(this);
org.setKey(createKey(key));
- if (names != null && !names.isEmpty())
- {
+ if (names != null && !names.isEmpty()) {
org.setName(createInternationalString(((Name)
names.get(0)).getValue()));
}
- if (descriptions != null && !descriptions.isEmpty())
- {
+ if (descriptions != null && !descriptions.isEmpty()) {
org.setDescription(createInternationalString(((Description)
descriptions.get(0)).getValue()));
}
- if (serviceInfos != null && !serviceInfos.isEmpty())
- {
+ if (serviceInfos != null && !serviceInfos.isEmpty()) {
List services = new ArrayList(serviceInfos.size());
- for (int i = 0; i < serviceInfos.size(); i++)
- {
+ for (int i = 0; i < serviceInfos.size(); i++) {
ServiceInfo serviceInfo = (ServiceInfo)
serviceInfos.elementAt(i);
services.add(createService(serviceInfo));
}
@@ -469,19 +474,16 @@
return org;
}
- Organization createOrganization(BusinessDetail detail) throws JAXRException
- {
+ Organization createOrganization(BusinessDetail detail) throws
JAXRException {
return ScoutUddiJaxrHelper.getOrganization(detail, this);
}
- Service createService(ServiceInfo info) throws JAXRException
- {
+ Service createService(ServiceInfo info) throws JAXRException {
String key = info.getServiceKey();
Vector names = info.getNameVector();
ServiceImpl service = new ServiceImpl(this);
service.setKey(createKey(key));
- if (!names.isEmpty())
- {
+ if (!names.isEmpty()) {
service.setName(createInternationalString(((Name)
names.get(0)).getValue()));
}
return service;
Modified:
webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/LifeCycleManagerTest.java
URL:
http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/LifeCycleManagerTest.java?view=diff&r1=153501&r2=153502
==============================================================================
---
webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/LifeCycleManagerTest.java
(original)
+++
webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/registry/LifeCycleManagerTest.java
Sat Feb 12 05:24:35 2005
@@ -41,6 +41,8 @@
import javax.xml.registry.JAXRException;
import javax.xml.registry.LifeCycleManager;
import javax.xml.registry.UnsupportedCapabilityException;
+import javax.xml.registry.BulkResponse;
+import javax.xml.registry.RegistryService;
import javax.xml.registry.infomodel.Classification;
import javax.xml.registry.infomodel.ClassificationScheme;
import javax.xml.registry.infomodel.Concept;
@@ -54,9 +56,10 @@
import javax.xml.registry.infomodel.PersonName;
import javax.xml.registry.infomodel.ServiceBinding;
import java.util.ArrayList;
+import java.util.Collection;
/**
- *
+ *
* @version $Rev$ $Date$ $Author$
*/
public class LifeCycleManagerTest extends TestCase {
@@ -238,8 +241,22 @@
}
}
+ protected class ConcreteLifeCycleManager extends LifeCycleManagerImpl {
+
+ public ConcreteLifeCycleManager(RegistryService rs) {
+ super(rs);
+ }
+
+ public BulkResponse saveObjects(Collection objects) throws
JAXRException {
+ return new BulkResponseImpl();
+ }
+
+ public BulkResponse deleteObjects(Collection keys, String objectType)
throws JAXRException {
+ return new BulkResponseImpl();
+ }
+ }
protected void setUp() throws Exception {
super.setUp();
- manager = new LifeCycleManagerImpl(new RegistryServiceImpl(null, null,
-1));
+ manager = new ConcreteLifeCycleManager(new RegistryServiceImpl(null,
null, -1));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]