ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r122895 - in webservices/scout/trunk/modules: jaxr-api scout scout/src/java/org/apache/ws/scout/registry scout/src/java/org/apache/ws/scout/registry/infomodel scout/src/test/org/apache/ws/scout
Date Mon, 20 Dec 2004 22:54:05 GMT
Author: anil
Date: Mon Dec 20 14:54:04 2004
New Revision: 122895

URL: http://svn.apache.org/viewcvs?view=rev&rev=122895
Log:
Updated Scout Code

Modified:
   webservices/scout/trunk/modules/jaxr-api/jaxr-api.iml
   webservices/scout/trunk/modules/jaxr-api/project.xml
   webservices/scout/trunk/modules/scout/project.xml
   webservices/scout/trunk/modules/scout/scout.iml
   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/BusinessQueryManagerImpl.java
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/ConnectionImpl.java
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/LifeCycleManagerImpl.java
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ConceptImpl.java
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/EmailAddressImpl.java
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ExternalIdentifierImpl.java
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PostalAddressImpl.java
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java
   webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java

Modified: webservices/scout/trunk/modules/jaxr-api/jaxr-api.iml
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/jaxr-api/jaxr-api.iml?view=diff&rev=122895&p1=webservices/scout/trunk/modules/jaxr-api/jaxr-api.iml&r1=122894&p2=webservices/scout/trunk/modules/jaxr-api/jaxr-api.iml&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/jaxr-api/jaxr-api.iml	(original)
+++ webservices/scout/trunk/modules/jaxr-api/jaxr-api.iml	Mon Dec 20 14:54:04 2004
@@ -2,7 +2,7 @@
 <module version="4" relativePaths="true" type="JAVA_MODULE">
   <component name="ModuleRootManager" />
   <component name="NewModuleRootManager">
-    <output url="file://$MODULE_DIR$/target-classes" />
+    <output url="file://$MODULE_DIR$/target/classes" />
     <exclude-output />
     <exclude-exploded />
     <content url="file://$MODULE_DIR$">
@@ -10,6 +10,24 @@
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/sun-javamail/jars/activation-.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/axis/jars/axis-1.2-RC1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
 </module>

Modified: webservices/scout/trunk/modules/jaxr-api/project.xml
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/jaxr-api/project.xml?view=diff&rev=122895&p1=webservices/scout/trunk/modules/jaxr-api/project.xml&r1=122894&p2=webservices/scout/trunk/modules/jaxr-api/project.xml&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/jaxr-api/project.xml	(original)
+++ webservices/scout/trunk/modules/jaxr-api/project.xml	Mon Dec 20 14:54:04 2004
@@ -24,10 +24,16 @@
     <name>JAXR API Classes</name>
 
     <dependencies>
-        <dependency>
+<!--        <dependency>
             <groupId>geronimo-spec</groupId>
             <artifactId>geronimo-spec-activation</artifactId>
             <version>1.0.2-SNAPSHOT</version>
         </dependency>
+-->
+        <dependency>
+            <groupId>sun-javamail</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
     </dependencies>
-</project>
\ No newline at end of file
+
+</project>

Modified: webservices/scout/trunk/modules/scout/project.xml
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/project.xml?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/project.xml&r1=122894&p2=webservices/scout/trunk/modules/scout/project.xml&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/project.xml	(original)
+++ webservices/scout/trunk/modules/scout/project.xml	Mon Dec 20 14:54:04 2004
@@ -31,7 +31,7 @@
         </dependency>
 
         <!-- external JARs -->
-        <dependency>
+<!--        <dependency>
             <groupId>geronimo-spec</groupId>
             <artifactId>geronimo-spec-activation</artifactId>
             <version>1.0.2-SNAPSHOT</version>
@@ -41,6 +41,11 @@
             <artifactId>geronimo-spec-activation</artifactId>
             <version>1.0.2-SNAPSHOT</version>
         </dependency>
+-->
+        <dependency>
+            <groupId>sun-javamail</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
         <dependency>
             <groupId>juddi</groupId>
             <artifactId>juddi</artifactId>
@@ -72,4 +77,4 @@
             <version>1.2-RC1</version>
         </dependency>
     </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: webservices/scout/trunk/modules/scout/scout.iml
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/scout.iml?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/scout.iml&r1=122894&p2=webservices/scout/trunk/modules/scout/scout.iml&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/scout.iml	(original)
+++ webservices/scout/trunk/modules/scout/scout.iml	Mon Dec 20 14:54:04 2004
@@ -5,13 +5,104 @@
     <output url="file://$MODULE_DIR$/target/classes" />
     <exclude-output />
     <exclude-exploded />
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="false" />
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/scout/jars/jaxr-api-1.0-SNAPSHOT.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/sun-javamail/jars/activation-.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../apache-ant-1.6.2/lib/ant-junit.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../apache-ant-1.6.2/lib/junit.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="jaxr-api" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/commons-logging/jars/commons-logging-SNAPSHOT.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/axis/jars/axis-jaxrpc-1.2-RC1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/axis/jars/axis-saaj-1.2-RC1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/axis/jars/axis-wsdl4j-1.2-RC1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/commons-discovery/jars/commons-discovery-SNAPSHOT.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="juddi" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.maven/repository/axis/jars/axis-1.2-RC1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
 </module>

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&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java&r2=122895
==============================================================================
--- 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	Mon Dec 20 14:54:04 2004
@@ -16,20 +16,31 @@
  */
 package org.apache.ws.scout.registry;
 
-import javax.xml.registry.BulkResponse;
-import javax.xml.registry.BusinessLifeCycleManager;
-import javax.xml.registry.InvalidRequestException;
-import javax.xml.registry.JAXRException;
-import javax.xml.registry.RegistryService;
-import javax.xml.registry.infomodel.Association;
-import java.util.Collection;
+import org.apache.juddi.IRegistry;
+import org.apache.juddi.datatype.business.*;
+import org.apache.juddi.datatype.service.*;
+import org.apache.juddi.datatype.*;
+import org.apache.juddi.datatype.PersonName;
+import org.apache.juddi.datatype.request.AuthInfo;
+import org.apache.juddi.datatype.response.BusinessDetail;
+import org.apache.juddi.datatype.response.AuthToken;
+import org.apache.ws.scout.registry.infomodel.InternationalStringImpl;
+import org.apache.ws.scout.registry.infomodel.KeyImpl;
+
+import javax.xml.registry.*;
+import javax.xml.registry.infomodel.*;
+import javax.xml.registry.infomodel.RegistryObject;
+import java.util.*;
+import java.net.PasswordAuthentication;
 
 /**
  * Implements JAXR BusinessLifeCycleManager Interface.
  * For futher details, look into the JAXR API Javadoc.
  * @author Anil Saldhana  <anil@apache.org>
  */
-public class BusinessLifeCycleManagerImpl extends LifeCycleManagerImpl implements BusinessLifeCycleManager {
+public class BusinessLifeCycleManagerImpl extends LifeCycleManagerImpl
+implements BusinessLifeCycleManager {
+
     public BusinessLifeCycleManagerImpl(RegistryService registry) {
         super(registry);
     }
@@ -71,7 +82,54 @@
     }
 
     public BulkResponse saveOrganizations(Collection organizationKeys) throws JAXRException {
-        return null;
+        IRegistry ireg = null;
+        if(registry != null ) ireg = registry.getRegistry();
+        //Now we need to convert the collection into a vector for juddi
+        BulkResponseImpl bulk = new BulkResponseImpl();
+        Vector entityvect = new Vector();
+
+        Collection coll = new ArrayList();
+        Collection exceptions = new ArrayList();
+
+         try{
+             ConnectionImpl connection = registry.getConnection();
+             Set creds = connection.getCredentials();
+             Iterator it  = creds.iterator();
+             String username="",pwd="";
+             while(it.hasNext())
+             {
+                 PasswordAuthentication pass = (PasswordAuthentication)it.next();
+                 username = pass.getUserName();
+                 pwd = new String(pass.getPassword());
+             }
+             AuthToken token = null;
+             try{
+                 token = ireg.getAuthToken(username,pwd);
+             }catch(Exception e)
+             {
+                 throw new JAXRException(e);
+             }
+             Iterator iter = organizationKeys.iterator();
+             while( iter.hasNext()){
+                 BusinessEntity en =
+                   getBusinessEntityFromJAXROrg( (Organization)iter.next());
+                 entityvect.add(en);
+             }
+             System.out.println( "Method:save_business: ENlength="+entityvect.size() );
+             // Save business
+             BusinessDetail bd = ireg.saveBusiness(token.getAuthInfo(),   entityvect);
+
+             entityvect = bd.getBusinessEntityVector(); System.out.println( "After Saving Business. Obtained vector size:"+                 entityvect.size());
+             for( int i = 0 ; entityvect != null && i < entityvect.size(); i++){                 BusinessEntity entity = (BusinessEntity)entityvect.elementAt(i);
+                 coll.add( new KeyImpl(entity.getBusinessKey() ));
+             }
+
+             bulk.setCollection( coll );
+             bulk.setExceptions( exceptions);
+          }catch(  Exception tran){
+                 throw new JAXRException( "Apache JAXR Impl:",tran);
+             }
+          return bulk;
     }
 
     public BulkResponse saveServiceBindings(Collection bindingKeys) throws JAXRException {
@@ -87,4 +145,174 @@
 
     public void unConfirmAssociation(Association assoc) throws JAXRException, InvalidRequestException {
     }
+
+    //Private methods
+    private  BusinessEntity getBusinessEntityFromJAXROrg( Organization org )
+    throws JAXRException {
+        BusinessEntity biz = new BusinessEntity();
+        BusinessServices bss = new BusinessServices();
+        Contacts cts = new Contacts();
+        Vector bvect =  new Vector();
+        Vector cvect = new Vector();
+
+        try{
+            //Lets get the Organization attributes at the top level
+            String language = Locale.getDefault().getLanguage();
+
+            biz.addName(new Name(org.getName().getValue() , language));
+            biz.addDescription(new Description(org.getDescription().getValue()));
+
+            Collection s = org.getServices();
+            System.out.println( "?Org has services="+s.isEmpty());
+            Iterator iter = s.iterator();
+            while( iter.hasNext()){
+                BusinessService bs =
+                  getBusinessServiceFromJAXRService( (Service)iter.next());
+                bvect.add(bs);
+            }
+
+            Collection users = org.getUsers();
+            System.out.println( "?Org has users="+users.isEmpty());
+            Iterator it  = users.iterator();
+            while( it.hasNext()){
+                Contact ct =
+                  getContactFromJAXRUser( (User)it.next());
+                cvect.add(ct);
+            }
+
+            bss.setBusinessServiceVector( bvect );
+            cts.setContactVector( cvect );
+            biz.setContacts( cts );
+
+            biz.setBusinessServices( bss );
+        }catch(Exception ud){
+                throw new JAXRException( "Apache JAXR Impl:", ud);
+        }
+        return biz;
+    }
+
+     /**
+     * Convert JAXR User Object to UDDI  Contact
+     */
+    private Contact getContactFromJAXRUser( User user)
+    throws JAXRException {
+         Contact ct = new Contact();
+         Vector addvect = new Vector();
+         Vector phonevect = new Vector();
+         Vector emailvect = new Vector();
+         try{
+             ct.setPersonName( new PersonName(user.getPersonName().getFullName()) );
+             //Postal Address
+             Collection postc = user.getPostalAddresses();
+             Iterator iterator  = postc.iterator();
+              while( iterator.hasNext()){
+                  PostalAddress post = (PostalAddress)iterator.next();
+                  addvect.add( getAddress( post) );
+              }
+             //Phone Numbers
+             Collection ph = user.getTelephoneNumbers(null);
+             Iterator it  = ph.iterator();
+              while( it.hasNext()){
+                 TelephoneNumber t = (TelephoneNumber)it .next();
+                 Phone phone = new Phone();
+                 String str =  t.getNumber();
+                 System.out.println( "Telephone="+str );
+                 phone.setValue(str);
+                // phone.setText( str );
+                 phonevect.add(phone);
+             }
+
+             //Email Addresses
+             Collection ec = user.getEmailAddresses();
+             Iterator iter = ec.iterator();
+             while( iter.hasNext()){
+                 EmailAddress ea = (EmailAddress)iter.next();
+                 Email email = new Email();
+                 email.setValue(ea.getAddress());
+                 //email.setText( ea.getAddress() );
+                 email.setUseType(ea.getType());
+                 emailvect.add(email);
+             }
+             ct.setAddressVector( addvect );
+             ct.setPhoneVector( phonevect );
+             ct.setEmailVector( emailvect );
+              }catch(Exception ud){
+                throw new JAXRException( "Apache JAXR Impl:", ud);
+        }
+        return ct;
+    }
+
+     /**
+     * Get UDDI Address given JAXR Postal Address
+     */
+    private Address getAddress( PostalAddress post)
+    throws JAXRException {
+        Address address = new Address();
+
+        Vector addvect  = new Vector();
+
+        String stnum = post.getStreetNumber();
+        String st  = post.getStreet();
+        String city = post.getCity();
+        String country = post.getCountry();
+        String code = post.getPostalCode();
+        String state = post.getStateOrProvince();
+
+        AddressLine stnumAL = new AddressLine();
+        stnumAL.setKeyName( "STREET_NUMBER");
+        stnumAL.setKeyValue(stnum );
+
+        AddressLine stAL = new AddressLine();
+        stAL.setKeyName( "STREET");
+        stAL.setKeyValue(st );
+
+        AddressLine cityAL = new AddressLine();
+        cityAL.setKeyName( "CITY");
+        cityAL.setKeyValue(city );
+
+        AddressLine countryAL = new AddressLine();
+        countryAL.setKeyName( "COUNTRY");
+        countryAL.setKeyValue(country );
+
+        AddressLine codeAL = new AddressLine();
+        codeAL.setKeyName( "POSTALCODE");
+        codeAL.setKeyValue(code );
+
+        AddressLine stateAL = new AddressLine();
+        stateAL.setKeyName( "STATE");
+        stateAL.setKeyValue(state );
+
+        //Add the AddressLine to vector
+        addvect.add(stnumAL);
+        addvect.add(stAL);
+        addvect.add(cityAL);
+        addvect.add(countryAL);
+        addvect.add(codeAL);
+        addvect.add(stateAL);
+
+        address.setAddressLineVector( addvect );
+
+        return address;
+    }
+
+    private   BusinessService getBusinessServiceFromJAXRService( Service serve )
+    throws JAXRException {
+        BusinessService bs = new BusinessService();
+        try{
+            InternationalStringImpl iname = (InternationalStringImpl)((RegistryObject) serve).getName();
+            String name = iname.getValue();
+            //bs.setDefaultNameString( name, Locale.getDefault().getLanguage());
+            bs.addName(new Name(name, Locale.getDefault().getLanguage()));
+            /**
+            bs.setBusinessKey( ((RegistryObject) serve).getKey().getId() );
+            **/
+
+            bs.addDescription(new Description(((RegistryObject) serve).getDescription().getValue()));
+            System.out.println( "BusinessService="+bs.toString());
+        }catch(Exception ud){
+                throw new JAXRException( "Apache JAXR Impl:", ud);
+        }
+        return bs;
+    }
+
 }

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java	(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java	Mon Dec 20 14:54:04 2004
@@ -64,8 +64,14 @@
             Vector nameVector = mapNamePatterns(namePatterns);
             BusinessList result = registry.findBusiness(nameVector, null, null, null, null, juddiFindQualifiers, registryService.getMaxRows());
             Vector v = result.getBusinessInfos().getBusinessInfoVector();
-            Collection orgs = new ArrayList(v.size());
-            for (int i = 0; i < v.size(); i++) {
+            Collection orgs = null;
+            int len = 0;
+            if( v!= null )
+            {
+                len = v.size();
+                orgs = new ArrayList(len);
+            }
+            for (int i = 0; i < len; i++) {
                 BusinessInfo info = (BusinessInfo) v.elementAt(i);
                 orgs.add(registryService.getLifeCycleManagerImpl().createOrganization(info));
             }

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/ConnectionImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/ConnectionImpl.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/ConnectionImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/ConnectionImpl.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/ConnectionImpl.java	(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/ConnectionImpl.java	Mon Dec 20 14:54:04 2004
@@ -47,7 +47,9 @@
     }
 
     public RegistryService getRegistryService() throws JAXRException {
-        return new RegistryServiceImpl(registry, postalScheme, maxRows);
+        RegistryServiceImpl reg = new RegistryServiceImpl(registry, postalScheme, maxRows);
+        reg.setConnection(this);
+        return reg;
     }
 
     public void close() {

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&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/LifeCycleManagerImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/LifeCycleManagerImpl.java&r2=122895
==============================================================================
--- 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	Mon Dec 20 14:54:04 2004
@@ -20,21 +20,7 @@
 import org.apache.juddi.datatype.Name;
 import org.apache.juddi.datatype.response.BusinessInfo;
 import org.apache.juddi.datatype.response.ServiceInfo;
-import org.apache.ws.scout.registry.infomodel.ClassificationImpl;
-import org.apache.ws.scout.registry.infomodel.ClassificationSchemeImpl;
-import org.apache.ws.scout.registry.infomodel.ConceptImpl;
-import org.apache.ws.scout.registry.infomodel.EmailAddressImpl;
-import org.apache.ws.scout.registry.infomodel.ExternalIdentifierImpl;
-import org.apache.ws.scout.registry.infomodel.ExternalLinkImpl;
-import org.apache.ws.scout.registry.infomodel.InternationalStringImpl;
-import org.apache.ws.scout.registry.infomodel.KeyImpl;
-import org.apache.ws.scout.registry.infomodel.LocalizedStringImpl;
-import org.apache.ws.scout.registry.infomodel.OrganizationImpl;
-import org.apache.ws.scout.registry.infomodel.PostalAddressImpl;
-import org.apache.ws.scout.registry.infomodel.RegistryEntryImpl;
-import org.apache.ws.scout.registry.infomodel.ServiceImpl;
-import org.apache.ws.scout.registry.infomodel.TelephoneNumberImpl;
-import org.apache.ws.scout.registry.infomodel.UserImpl;
+import org.apache.ws.scout.registry.infomodel.*;
 
 import javax.activation.DataHandler;
 import javax.xml.registry.BulkResponse;
@@ -70,216 +56,331 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Vector;
+import java.rmi.registry.Registry;
 
 /**
  * Implements JAXR LifeCycleManager Interface
  * For futher details, look into the JAXR API Javadoc.
+ *
  * @author Anil Saldhana  <anil@apache.org>
  */
-public class LifeCycleManagerImpl implements LifeCycleManager {
-    private final RegistryService registry;
+public class LifeCycleManagerImpl implements LifeCycleManager
+{
+    protected final RegistryServiceImpl registry;
 
-    public LifeCycleManagerImpl(RegistryService registry) {
-        this.registry = 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))
+        {
             throw new UnsupportedCapabilityException();
-        } 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)) {
-            throw new UnsupportedCapabilityException();
-        } else if (LifeCycleManager.POSTAL_ADDRESS.equals(interfaceName)) {
+        } else if (LifeCycleManager.PERSON_NAME.equals(interfaceName))
+        {
+            return new PersonNameImpl();
+        } 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))
+        {
             return new RegistryEntryImpl(this);
-        } 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)) {
-            throw new UnsupportedCapabilityException();
-        } else if (LifeCycleManager.SLOT.equals(interfaceName)) {
+        } else if (LifeCycleManager.SERVICE_BINDING.equals(interfaceName))
+        {
             throw new UnsupportedCapabilityException();
-        } else if (LifeCycleManager.SPECIFICATION_LINK.equals(interfaceName)) {
-            throw new UnsupportedCapabilityException();
-        } else if (LifeCycleManager.TELEPHONE_NUMBER.equals(interfaceName)) {
+        } else if (LifeCycleManager.SLOT.equals(interfaceName))
+        {
+            return new SlotImpl(this);
+        } else if (LifeCycleManager.SPECIFICATION_LINK.equals(interfaceName))
+        {
+            return new SpecificationLinkImpl(this);
+        } 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 {
-        return null;
+    public Association createAssociation(RegistryObject targetObject, Concept associationType) throws JAXRException
+    {
+        return (Association) this.createObject(LifeCycleManager.ASSOCIATION);
     }
 
-    public Classification createClassification(Concept concept) throws JAXRException, InvalidRequestException {
-        return null;
+    public Classification createClassification(Concept concept) throws JAXRException, InvalidRequestException
+    {
+        return (Classification) this.createObject(LifeCycleManager.CLASSIFICATION);
     }
 
-    public Classification createClassification(ClassificationScheme scheme, InternationalString name, String value) throws JAXRException {
-        return null;
+    public Classification createClassification(ClassificationScheme scheme,
+                                               InternationalString name,
+                                               String value) throws JAXRException
+    {
+        Classification cl = (Classification) this.createObject(LifeCycleManager.CLASSIFICATION);
+        cl.setClassificationScheme(scheme);
+        cl.setName(name);
+        cl.setValue(value);
+        return cl;
     }
 
-    public Classification createClassification(ClassificationScheme scheme, String name, String value) throws JAXRException {
-        return null;
+    public Classification createClassification(ClassificationScheme scheme,
+                                               String name, String value)
+    throws JAXRException
+    {
+        return createClassification(scheme, this.createInternationalString(name), value);
     }
 
-    public ClassificationScheme createClassificationScheme(Concept concept) throws JAXRException, InvalidRequestException {
-        return null;
+    public ClassificationScheme createClassificationScheme(Concept concept) throws JAXRException, InvalidRequestException
+    {
+        ClassificationScheme cs = new ClassificationSchemeImpl(this);
+        cs.addChildConcept(concept);
+        return cs;
     }
 
-    public ClassificationScheme createClassificationScheme(InternationalString name, InternationalString description) throws JAXRException, InvalidRequestException {
-        return null;
+    public ClassificationScheme createClassificationScheme(InternationalString name,
+                                                           InternationalString des)
+    throws JAXRException, InvalidRequestException
+    {
+        ClassificationScheme cs = new ClassificationSchemeImpl(this);
+        cs.setName(name);
+        cs.setDescription(des);
+        return cs;
     }
 
-    public ClassificationScheme createClassificationScheme(String name, String description) throws JAXRException, InvalidRequestException {
-        return null;
+    public ClassificationScheme createClassificationScheme(String name, String desc )
+    throws JAXRException, InvalidRequestException
+    {
+        return createClassificationScheme(this.createInternationalString(name),
+                this.createInternationalString(desc));
     }
 
-    public Concept createConcept(RegistryObject parent, InternationalString name, String value) throws JAXRException {
-        return null;
+    public Concept createConcept(RegistryObject parent, InternationalString name, String value)
+    throws JAXRException
+    {
+        ConceptImpl concept = new ConceptImpl(this);
+        concept.setParent(parent);
+        concept.setName(name);
+        concept.setValue(value);
+        return concept;
     }
 
-    public Concept createConcept(RegistryObject parent, String name, String value) throws JAXRException {
-        return null;
+    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 {
-        return null;
+    public EmailAddress createEmailAddress(String address) throws JAXRException
+    {
+        return new EmailAddressImpl(address);
     }
 
-    public EmailAddress createEmailAddress(String address, String type) throws JAXRException {
-        return null;
+    public EmailAddress createEmailAddress(String address, String type) throws JAXRException
+    {
+        return new EmailAddressImpl(address,type);
     }
 
-    public ExternalIdentifier createExternalIdentifier(ClassificationScheme identificationScheme, InternationalString name, String value) throws JAXRException {
-        return null;
+    public ExternalIdentifier createExternalIdentifier(ClassificationScheme ids,
+                                                       InternationalString name,
+                                                       String value) throws JAXRException
+    {
+        return new ExternalIdentifierImpl(this,ids,name,value);
     }
 
-    public ExternalIdentifier createExternalIdentifier(ClassificationScheme identificationScheme, String name, String value) throws JAXRException {
-        return null;
+    public ExternalIdentifier createExternalIdentifier(ClassificationScheme ids,
+                                                       String name, String value) throws JAXRException
+    {
+        return createExternalIdentifier(ids,this.createInternationalString(name),value);
     }
 
-    public ExternalLink createExternalLink(String externalURI, InternationalString description) throws JAXRException {
+    public ExternalLink createExternalLink(String externalURI, InternationalString description) throws JAXRException
+    {
         return null;
     }
 
-    public ExternalLink createExternalLink(String externalURI, String description) throws JAXRException {
-        return null;
+    public ExternalLink createExternalLink(String uri, String desc ) throws JAXRException
+    {
+        ExternalLink ext = new ExternalLinkImpl(this);
+        ext.setExternalURI(uri);
+        ext.setDescription(this.createInternationalString(desc));
+        return ext;
     }
 
-    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 {
-        return null;
+    public Organization createOrganization(InternationalString name) throws JAXRException
+    {
+        return (Organization) this.createObject(LifeCycleManager.ORGANIZATION);
     }
 
-    public Organization createOrganization(String name) throws JAXRException {
-        return null;
+    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 {
-        return null;
+    public PersonName createPersonName(String fullName) throws JAXRException
+    {
+        return (PersonName) this.createObject(LifeCycleManager.PERSON_NAME);
     }
 
-    public PostalAddress createPostalAddress(String streetNumber, String street, String city, String stateOrProvince, String country, String postalCode, String type) throws JAXRException {
-        return null;
+    public PostalAddress createPostalAddress(String streetNumber,
+                                             String street,
+                                             String city,
+                                             String stateOrProvince,
+                                             String country,
+                                             String postalCode, String type) throws JAXRException
+    {
+        PostalAddress post = new PostalAddressImpl();
+        post.setStreetNumber(streetNumber);
+        post.setStreet(street);
+        post.setCity(city);
+        post.setStateOrProvince(stateOrProvince);
+        post.setCountry(country);
+        post.setPostalCode(postalCode);
+        post.setType(type);
+        return post;
     }
 
-    public Service createService(InternationalString name) throws JAXRException {
-        return null;
+    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 {
-        return null;
+    public Service createService(String name) throws JAXRException
+    {
+        return createService(this.createInternationalString(name));
     }
 
-    public ServiceBinding createServiceBinding() throws JAXRException {
-        return null;
+    public ServiceBinding createServiceBinding() throws JAXRException
+    {
+        return (ServiceBinding) this.createObject(LifeCycleManager.SERVICE_BINDING);
     }
 
-    public Slot createSlot(String name, String value, String slotType) throws JAXRException {
-        return null;
+    public Slot createSlot(String name, String value, String slotType) throws JAXRException
+    {
+        return (Slot) this.createObject(LifeCycleManager.SLOT);
     }
 
-    public Slot createSlot(String name, Collection values, String slotType) throws JAXRException {
-        return null;
+    public Slot createSlot(String name, Collection values, String slotType) throws JAXRException
+    {
+        Slot slot = (Slot) this.createObject(LifeCycleManager.SLOT);
+        slot.setName(name);
+        slot.setValues(values);
+        slot.setSlotType(slotType);
+        return slot;
     }
 
-    public SpecificationLink createSpecificationLink() throws JAXRException {
-        return null;
+    public SpecificationLink createSpecificationLink() throws JAXRException
+    {
+        return (SpecificationLink) this.createObject(LifeCycleManager.SPECIFICATION_LINK);
     }
 
-    public TelephoneNumber createTelephoneNumber() throws JAXRException {
-        return null;
+    public TelephoneNumber createTelephoneNumber() throws JAXRException
+    {
+        return (TelephoneNumber) this.createObject(LifeCycleManager.TELEPHONE_NUMBER);
     }
 
-    public User createUser() throws JAXRException {
-        return null;
+    public User createUser() throws JAXRException
+    {
+        return (User) this.createObject(LifeCycleManager.USER);
     }
 
-    public BulkResponse deleteObjects(Collection keys, String objectType) throws JAXRException {
+    public BulkResponse deleteObjects(Collection keys, String objectType) throws JAXRException
+    {
         return null;
     }
 
-    public BulkResponse saveObjects(Collection objects) throws JAXRException {
+    public BulkResponse saveObjects(Collection objects) throws JAXRException
+    {
         return null;
     }
 
@@ -292,50 +393,62 @@
      * @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));
             }
@@ -344,12 +457,14 @@
         return org;
     }
 
-    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/java/org/apache/ws/scout/registry/RegistryServiceImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java	(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java	Mon Dec 20 14:54:04 2004
@@ -46,6 +46,9 @@
     private final ClassificationSchemeImpl postalScheme;
     private final int maxRows;
 
+
+    private  ConnectionImpl connection;
+
     public RegistryServiceImpl(RegistryProxy registry, String postalScheme, int maxRows) {
         this.registry = registry;
         this.maxRows = maxRows;
@@ -96,6 +99,17 @@
     }
 
     public String makeRegistrySpecificRequest(String s) throws JAXRException {
-        return null;
+        throw new UnsupportedCapabilityException();
     }
+
+    public ConnectionImpl getConnection()
+    {
+            return connection;
+    }
+
+    public void setConnection(ConnectionImpl connection)
+    {
+            this.connection = connection;
+    }
+
 }

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ConceptImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ConceptImpl.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ConceptImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ConceptImpl.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ConceptImpl.java	(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ConceptImpl.java	Mon Dec 20 14:54:04 2004
@@ -96,4 +96,24 @@
     public void setValue(String str) {
         value = str;
     }
+
+    public void setParent(RegistryObject parent)
+    {
+        this.parent = parent;
+    }
+
+    public void setParentconcept(Concept parentconcept)
+    {
+        this.parentconcept = parentconcept;
+    }
+
+    public void setScheme(ClassificationSchemeImpl scheme)
+    {
+        this.scheme = scheme;
+    }
+
+    public void setChildconcepts(Collection childconcepts)
+    {
+        this.childconcepts = childconcepts;
+    }
 }

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/EmailAddressImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/EmailAddressImpl.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/EmailAddressImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/EmailAddressImpl.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/EmailAddressImpl.java	(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/EmailAddressImpl.java	Mon Dec 20 14:54:04 2004
@@ -33,6 +33,17 @@
     public EmailAddressImpl() {
     }
 
+    public EmailAddressImpl(String email)
+    {
+        this.email = email;
+    }
+
+    public EmailAddressImpl(String email, String type)
+    {
+        this.email = email;
+        this.type = type;
+    }
+
     public String getAddress() throws JAXRException {
         return email;
     }

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ExternalIdentifierImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ExternalIdentifierImpl.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ExternalIdentifierImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ExternalIdentifierImpl.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ExternalIdentifierImpl.java	(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/ExternalIdentifierImpl.java	Mon Dec 20 14:54:04 2004
@@ -20,6 +20,7 @@
 import javax.xml.registry.LifeCycleManager;
 import javax.xml.registry.infomodel.ClassificationScheme;
 import javax.xml.registry.infomodel.RegistryObject;
+import javax.xml.registry.infomodel.InternationalString;
 
 /**
  * Implements JAXR Interface.
@@ -39,6 +40,16 @@
      */
     public ExternalIdentifierImpl(LifeCycleManager lifeCycleManager) {
         super(lifeCycleManager);
+    }
+
+    public ExternalIdentifierImpl(LifeCycleManager lifeCycleManager,
+                                  ClassificationScheme identity,
+                                  InternationalString name,
+                                  String value )
+    {
+        super(lifeCycleManager,name);
+        this.identity = identity;
+        this.value = value;
     }
 
     public ClassificationScheme getIdentificationScheme()

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PostalAddressImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PostalAddressImpl.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PostalAddressImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PostalAddressImpl.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PostalAddressImpl.java	(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/PostalAddressImpl.java	Mon Dec 20 14:54:04 2004
@@ -44,6 +44,10 @@
         this.postalScheme = postalScheme;
     }
 
+    public PostalAddressImpl()
+    {
+    }
+
     public String getCity() {
         return city;
     }

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java	(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/infomodel/RegistryObjectImpl.java	Mon Dec 20 14:54:04 2004
@@ -57,6 +57,10 @@
     public RegistryObjectImpl(LifeCycleManager lifeCycleManager) {
         this.lifeCycleManager = lifeCycleManager;
     }
+    public RegistryObjectImpl(LifeCycleManager lifeCycleManager,InternationalString n) {
+        this.lifeCycleManager = lifeCycleManager;
+        name = n;
+    }
 
     public Key getKey() {
         return key;

Modified: webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java?view=diff&rev=122895&p1=webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java&r1=122894&p2=webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java&r2=122895
==============================================================================
--- webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java	(original)
+++ webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java	Mon Dec 20 14:54:04 2004
@@ -38,8 +38,15 @@
 import java.util.Iterator;
 import java.util.Properties;
 
-public class JAXRQueryTest extends TestCase {
-    public void testQuery() throws Exception {
+/**
+ * Testcase for JaxrQuery
+ * @author <mailto:dims@yahoo.com>Davanum Srinivas
+ * @author <mailto:anil@apache.org>Anil Saldhana
+ */
+public class JAXRQueryTest extends TestCase
+{
+    public void testQuery() throws Exception
+    {
         String queryString = "IBM";
         Connection connection = null;
 
@@ -47,98 +54,145 @@
         // To query, you need only the query URL
         Properties props = new Properties();
         props.setProperty("javax.xml.registry.queryManagerURL",
-                "http://uddi.microsoft.com:80/inquire");
+                //        "http://uddi.microsoft.com:80/inquire");
+                "http://localhost:8080/juddi/inquiry");
         props.setProperty("javax.xml.registry.factoryClass",
                 "org.apache.ws.scout.registry.ConnectionFactoryImpl");
 
-        // Create the connection, passing it the configuration properties
-        ConnectionFactory factory = ConnectionFactory.newInstance();
-        factory.setProperties(props);
-        connection = factory.createConnection();
-
-        // Get registry service and business query manager
-        RegistryService rs = connection.getRegistryService();
-        BusinessQueryManager bqm = rs.getBusinessQueryManager();
-        System.out.println("We have the Business Query Manager");
-
-        // Define find qualifiers and name patterns
-        Collection findQualifiers = new ArrayList();
-        findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
-        Collection namePatterns = new ArrayList();
-        namePatterns.add("%" + queryString + "%");
-
-        // Find based upon qualifier type and values
-        System.out.println("\n-- searching the registry --\n");
-        BulkResponse response =
-                bqm.findOrganizations(findQualifiers,
-                        namePatterns,
-                        null,
-                        null,
-                        null,
-                        null);
-
-        // check how many organisation we have matched
-        Collection orgs = response.getCollection();
-        System.out.println("\n-- Matched " + orgs.size() + " organisations --\n");
-
-        // then step through them
-        for (Iterator orgIter = orgs.iterator(); orgIter.hasNext();) {
-            Organization org = (Organization) orgIter.next();
-            System.out.println("Org name: " + getName(org));
-            System.out.println("Org description: " + getDescription(org));
-            System.out.println("Org key id: " + getKey(org));
-
-            // Display primary contact information
-            User pc = org.getPrimaryContact();
-            if (pc != null) {
-                PersonName pcName = pc.getPersonName();
-                System.out.println(" Contact name: " + pcName.getFullName());
-                Collection phNums = pc.getTelephoneNumbers(pc.getType());
-                for (Iterator phIter = phNums.iterator(); phIter.hasNext();) {
-                    TelephoneNumber num = (TelephoneNumber) phIter.next();
-                    System.out.println("  Phone number: " + num.getNumber());
-                }
-                Collection eAddrs = pc.getEmailAddresses();
-                for (Iterator eaIter = eAddrs.iterator(); eaIter.hasNext();) {
-                    System.out.println("  Email Address: " + (EmailAddress) eaIter.next());
+        try
+        {
+            // Create the connection, passing it the configuration properties
+            ConnectionFactory factory = ConnectionFactory.newInstance();
+            factory.setProperties(props);
+            connection = factory.createConnection();
+        } catch (JAXRException e)
+        {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+
+        try
+        {
+            // Get registry service and business query manager
+            RegistryService rs = connection.getRegistryService();
+            BusinessQueryManager bqm = rs.getBusinessQueryManager();
+            System.out.println("We have the Business Query Manager");
+
+            // Define find qualifiers and name patterns
+            Collection findQualifiers = new ArrayList();
+            findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
+            Collection namePatterns = new ArrayList();
+            namePatterns.add("%" + queryString + "%");
+
+            // Find based upon qualifier type and values
+            System.out.println("\n-- searching the registry --\n");
+            BulkResponse response =
+                    bqm.findOrganizations(findQualifiers,
+                            namePatterns,
+                            null,
+                            null,
+                            null,
+                            null);
+
+            // check how many organisation we have matched
+            Collection orgs = response.getCollection();
+            if (orgs == null)
+            {
+                System.out.println("\n-- Matched 0 orgs");
+
+            } else
+            {
+                System.out.println("\n-- Matched " + orgs.size() + " organisations --\n");
+
+                // then step through them
+                for (Iterator orgIter = orgs.iterator(); orgIter.hasNext();)
+                {
+                    Organization org = (Organization) orgIter.next();
+                    System.out.println("Org name: " + getName(org));
+                    System.out.println("Org description: " + getDescription(org));
+                    System.out.println("Org key id: " + getKey(org));
+
+                    printUser(org);
+
+                    printServices(org);
+                    // Print spacer between organizations
+                    System.out.println(" --- ");
                 }
+            }//end else
+        } catch (JAXRException e)
+        {
+            e.printStackTrace();
+        } finally
+        {
+            connection.close();
+        }
+
+    }
+
+    private static void printServices(Organization org)
+            throws JAXRException
+    {
+        // Display service and binding information
+        Collection services = org.getServices();
+        for (Iterator svcIter = services.iterator(); svcIter.hasNext();)
+        {
+            Service svc = (Service) svcIter.next();
+            System.out.println(" Service name: " + getName(svc));
+            System.out.println(" Service description: " + getDescription(svc));
+            Collection serviceBindings = svc.getServiceBindings();
+            for (Iterator sbIter = serviceBindings.iterator(); sbIter.hasNext();)
+            {
+                ServiceBinding sb = (ServiceBinding) sbIter.next();
+                System.out.println("  Binding Description: " + getDescription(sb));
+                System.out.println("  Access URI: " + sb.getAccessURI());
             }
+        }
+    }
 
-            // Display service and binding information
-            Collection services = org.getServices();
-            for (Iterator svcIter = services.iterator(); svcIter.hasNext();) {
-                Service svc = (Service) svcIter.next();
-                System.out.println(" Service name: " + getName(svc));
-                System.out.println(" Service description: " + getDescription(svc));
-                Collection serviceBindings = svc.getServiceBindings();
-                for (Iterator sbIter = serviceBindings.iterator(); sbIter.hasNext();) {
-                    ServiceBinding sb = (ServiceBinding) sbIter.next();
-                    System.out.println("  Binding Description: " + getDescription(sb));
-                    System.out.println("  Access URI: " + sb.getAccessURI());
-                }
+    private static void printUser(Organization org)
+    throws JAXRException
+    {
+        // Display primary contact information
+        User pc = org.getPrimaryContact();
+        if (pc != null)
+        {
+            PersonName pcName = pc.getPersonName();
+            System.out.println(" Contact name: " + pcName.getFullName());
+            Collection phNums = pc.getTelephoneNumbers(pc.getType());
+            for (Iterator phIter = phNums.iterator(); phIter.hasNext();)
+            {
+                TelephoneNumber num = (TelephoneNumber) phIter.next();
+                System.out.println("  Phone number: " + num.getNumber());
+            }
+            Collection eAddrs = pc.getEmailAddresses();
+            for (Iterator eaIter = eAddrs.iterator(); eaIter.hasNext();)
+            {
+                System.out.println("  Email Address: " + (EmailAddress) eaIter.next());
             }
-            // Print spacer between organizations
-            System.out.println(" --- ");
         }
-        connection.close();
     }
 
-    private static String getName(RegistryObject ro) throws JAXRException {
-        if (ro != null && ro.getName() != null) {
+    private static String getName(RegistryObject ro) throws JAXRException
+    {
+        if (ro != null && ro.getName() != null)
+        {
             return ro.getName().getValue();
         }
         return "";
     }
 
-    private static String getDescription(RegistryObject ro) throws JAXRException {
-        if (ro != null && ro.getDescription() != null) {
+    private static String getDescription(RegistryObject ro) throws JAXRException
+    {
+        if (ro != null && ro.getDescription() != null)
+        {
             return ro.getDescription().getValue();
         }
         return "";
     }
 
-    private static String getKey(RegistryObject ro) throws JAXRException {
-        if (ro != null && ro.getKey() != null) {
+    private static String getKey(RegistryObject ro) throws JAXRException
+    {
+        if (ro != null && ro.getKey() != null)
+        {
             return ro.getKey().getId();
         }
         return "";

---------------------------------------------------------------------
To unsubscribe, e-mail: scout-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: scout-dev-help@ws.apache.org


Mime
View raw message