juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r1452620 - in /juddi/trunk/juddi-examples: ./ create-partition/ create-partition/src/main/java/org/apache/juddi/example/partition/ create-partition/src/main/resources/META-INF/ create-partition/target/ create-partition/target/classes/ creat...
Date Tue, 05 Mar 2013 01:28:29 GMT
Author: kstam
Date: Tue Mar  5 01:28:28 2013
New Revision: 1452620

URL: http://svn.apache.org/r1452620
Log:
JUDDI-555 adding additional examples

applying patch by Alex O'Ree

Added:
    juddi/trunk/juddi-examples/create-partition/src/main/resources/META-INF/partition-uddi.xml
      - copied unchanged from r1452616, juddi/trunk/juddi-examples/create-partition/src/main/resources/META-INF/uddi.xml
    juddi/trunk/juddi-examples/create-partition/target/
    juddi/trunk/juddi-examples/create-partition/target/classes/
    juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/
    juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/MANIFEST.MF
    juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/
    juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/
    juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/
    juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.properties
    juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.xml
    juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/partition-uddi.xml
    juddi/trunk/juddi-examples/create-partition/target/classes/org/
    juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/
    juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/
    juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/
    juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/
    juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/SimpleCreateTmodelPartition$AuthStyle.class
  (with props)
    juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.class
  (with props)
    juddi/trunk/juddi-examples/create-partition/target/test-classes/
Removed:
    juddi/trunk/juddi-examples/create-partition/src/main/resources/META-INF/uddi.xml
Modified:
    juddi/trunk/juddi-examples/create-partition/   (props changed)
    juddi/trunk/juddi-examples/create-partition/README.txt
    juddi/trunk/juddi-examples/create-partition/src/main/java/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.java
    juddi/trunk/juddi-examples/pom.xml

Propchange: juddi/trunk/juddi-examples/create-partition/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Mar  5 01:28:28 2013
@@ -0,0 +1,3 @@
+.settings
+.classpath
+.project

Modified: juddi/trunk/juddi-examples/create-partition/README.txt
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/create-partition/README.txt?rev=1452620&r1=1452619&r2=1452620&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/create-partition/README.txt (original)
+++ juddi/trunk/juddi-examples/create-partition/README.txt Tue Mar  5 01:28:28 2013
@@ -1,18 +1,15 @@
-This example contains one class: the SimplePublish.java. When
-executed it will obtain an AuthToken and use it to publish
-a Publisher, a Business and a Service. 
-
-The easiest way to run execute the main of this class in from
-your IDE. If your IDE has maven integration it should set up
-the project class path for you, and you can simple run it from 
-there.
-
-You should see the following output being written to the console:
-
-root AUTHTOKEN = authtoken:0494e382-1ad3-4c52-8806-ae70a0ed37ad
-myPub AUTHTOKEN = authtoken:bf973e5f-7361-4c57-92f7-7b499b886b6d
-myBusiness key:  uddi:juddi.apache.org:6f3e4e62-e483-48ff-a1b3-6855310505c6
-myService key:  uddi:juddi.apache.org:549a9580-cd7b-4969-9b77-527ab9f8f261
+This example creates a new UDDI partition. 
 
-However since the keys are being generated in this case your keys will differ.
+1. Start the jUDDI-server (juddi-tomcat or juddi-bundle)
+
+2. Check the settings of the META-INF/uddi.xml, to make sure the serverName and serverPort
are set correctly.
+
+3. mvn -Pdemo test
+
+Should print:
+
+root AUTHTOKEN = authtoken:a1b910fb-618e-4e46-a06e-29451265862c
+Creation of Partition Success!
+Creation of tModel Department Success!
+Creation of tModel Auth Mode Success!
 

Modified: juddi/trunk/juddi-examples/create-partition/src/main/java/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/create-partition/src/main/java/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.java?rev=1452620&r1=1452619&r2=1452620&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/create-partition/src/main/java/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.java
(original)
+++ juddi/trunk/juddi-examples/create-partition/src/main/java/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.java
Tue Mar  5 01:28:28 2013
@@ -14,10 +14,11 @@
  * limitations under the License.
  *
  */
-package org.apache.juddi.example.browse;
+package org.apache.juddi.example.partition;
 
 import java.util.Properties;
-import org.apache.juddi.ClassUtil;
+
+import org.apache.juddi.v3.client.config.UDDIClerkManager;
 import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.uddi.api_v3.AuthToken;
@@ -42,7 +43,6 @@ import org.uddi.v3_service.UDDISecurityP
 public class SimpleCreateTmodelPartition {
 
     private static UDDISecurityPortType security = null;
-    private static UDDIInquiryPortType inquiry = null;
     private static UDDIPublicationPortType publish = null;
 
     /**
@@ -50,17 +50,19 @@ public class SimpleCreateTmodelPartition
      */
     public SimpleCreateTmodelPartition() {
         try {
-            String clazz = UDDIClientContainer.getUDDIClerkManager(null).
-                    getClientConfig().getUDDINode("default").getProxyTransport();
-            Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
-            if (transportClass != null) {
-                Transport transport = (Transport) transportClass.
-                        getConstructor(String.class).newInstance("default");
-
-                security = transport.getUDDISecurityService();
-                inquiry = transport.getUDDIInquiryService();
-                publish = transport.getUDDIPublishService();
-            }
+	    	// create a manager and read the config in the archive; 
+	    	// you can use your config file name
+	    	UDDIClerkManager clerkManager = new UDDIClerkManager("META-INF/partition-uddi.xml");
+	    	// register the clerkManager with the client side container
+	    	UDDIClientContainer.addClerkManager(clerkManager);
+	    	// a ClerkManager can be a client to multiple UDDI nodes, so 
+	    	// supply the nodeName (defined in your uddi.xml.
+	    	// The transport can be WS, inVM, RMI etc which is defined in the uddi.xml
+	    	Transport transport = clerkManager.getTransport("default");
+	    	// Now you create a reference to the UDDI API
+	
+	        security = transport.getUDDISecurityService();
+	        publish = transport.getUDDIPublishService();
         } catch (Exception e) {
             e.printStackTrace();
         }

Added: juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/MANIFEST.MF?rev=1452620&view=auto
==============================================================================
--- juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/MANIFEST.MF (added)
+++ juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/MANIFEST.MF Tue Mar
 5 01:28:28 2013
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Built-By: kstam
+Build-Jdk: 1.6.0_41
+Specification-Title: jUDDI Example Create Partition
+Specification-Version: 3.1.5-SNAPSHOT
+Specification-Vendor: The Apache Software Foundation
+Implementation-Title: jUDDI Example Create Partition
+Implementation-Version: 3.1.5-SNAPSHOT
+Implementation-Vendor-Id: org.apache.juddi.example
+Implementation-Vendor: The Apache Software Foundation
+Created-By: Maven Integration for Eclipse
+

Added: juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.properties
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.properties?rev=1452620&view=auto
==============================================================================
--- juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.properties
(added)
+++ juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.properties
Tue Mar  5 01:28:28 2013
@@ -0,0 +1,7 @@
+#Generated by Maven Integration for Eclipse
+#Mon Mar 04 20:27:27 EST 2013
+version=3.1.5-SNAPSHOT
+groupId=org.apache.juddi.example
+m2e.projectName=org.apache.juddi.example.create-partition-3.1.5-SNAPSHOT
+m2e.projectLocation=/Users/kstam/osc/apache/dev/juddi-patch/juddi-examples/create-partition
+artifactId=create-partition

Added: juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.xml
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.xml?rev=1452620&view=auto
==============================================================================
--- juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.xml
(added)
+++ juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/maven/org.apache.juddi.example/create-partition/pom.xml
Tue Mar  5 01:28:28 2013
@@ -0,0 +1,72 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.juddi.example</groupId>
+		<artifactId>juddi-examples</artifactId>
+		<version>3.1.5-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<artifactId>create-partition</artifactId>
+	<name>jUDDI Example Create Partition</name>
+	<description>Demonstrates the steps taken create a UDDI partition</description>
+
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.juddi</groupId>
+			<artifactId>uddi-ws</artifactId>
+			<version>3.1.5-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.juddi</groupId>
+			<artifactId>juddi-client</artifactId>
+			<version>3.1.5-SNAPSHOT</version>
+		</dependency>
+	</dependencies>
+
+	<profiles>
+		<profile>
+			<id>default</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-surefire-plugin</artifactId>
+						<configuration>
+							<skip>true</skip>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		<profile>
+			<id>demo</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+						<version>1.1.1</version>
+						<executions>
+							<execution>
+								<phase>test</phase>
+								<goals>
+									<goal>java</goal>
+								</goals>
+								<configuration>
+									<mainClass>org.apache.juddi.example.partition.SimpleCreateTmodelPartition</mainClass>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+
+</project>
+

Added: juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/partition-uddi.xml
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/partition-uddi.xml?rev=1452620&view=auto
==============================================================================
--- juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/partition-uddi.xml
(added)
+++ juddi/trunk/juddi-examples/create-partition/target/classes/META-INF/partition-uddi.xml
Tue Mar  5 01:28:28 2013
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<uddi>
+    <reloadDelay>5000</reloadDelay>
+    <manager name="example-manager">
+		<nodes>
+			<node>
+			    <!-- required 'default' node -->
+				<name>default</name> 
+                <properties>
+                    <property name="serverName" value="localhost"/>
+                    <property name="serverPort" value="8080"/>
+                </properties>
+				<description>Main jUDDI node</description>
+				<!-- JAX-WS Transport -->
+				<proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport>
+				<custodyTransferUrl>http://${serverName}:${serverPort}/juddiv3/services/custody-transfer</custodyTransferUrl>
+				<inquiryUrl>http://${serverName}:${serverPort}/juddiv3/services/inquiry</inquiryUrl>
+		        <publishUrl>http://${serverName}:${serverPort}/juddiv3/services/publish</publishUrl>
+		        <securityUrl>http://${serverName}:${serverPort}/juddiv3/services/security</securityUrl>
+				<subscriptionUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription</subscriptionUrl>
+				<subscriptionListenerUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription-listener</subscriptionListenerUrl>
+				<juddiApiUrl>http://${serverName}:${serverPort}/juddiv3/services/juddi-api</juddiApiUrl>
+			</node>
+		</nodes>
+	</manager>
+</uddi>

Added: juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/SimpleCreateTmodelPartition$AuthStyle.class
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/SimpleCreateTmodelPartition%24AuthStyle.class?rev=1452620&view=auto
==============================================================================
Binary file - no diff available.

Propchange: juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/SimpleCreateTmodelPartition$AuthStyle.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.class
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.class?rev=1452620&view=auto
==============================================================================
Binary file - no diff available.

Propchange: juddi/trunk/juddi-examples/create-partition/target/classes/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: juddi/trunk/juddi-examples/pom.xml
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/pom.xml?rev=1452620&r1=1452619&r2=1452620&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/pom.xml (original)
+++ juddi/trunk/juddi-examples/pom.xml Tue Mar  5 01:28:28 2013
@@ -27,6 +27,7 @@
       <maven>3.0.3</maven>
     </prerequisites>
     <modules>
+       <module>create-partition</module>
        <module>hello-world</module>
        <module>simple-browse</module>
        <module>simple-publish</module>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message