Author: kstam
Date: Sun Oct 20 18:18:31 2013
New Revision: 1533937

URL: http://svn.apache.org/r1533937
Log:
JUDDI-621 run jUDDI in embedded mode

Added:
    juddi/trunk/juddi-examples/hello-world-embedded/
    juddi/trunk/juddi-examples/hello-world-embedded/README.txt
    juddi/trunk/juddi-examples/hello-world-embedded/pom.xml
    juddi/trunk/juddi-examples/hello-world-embedded/src/
    juddi/trunk/juddi-examples/hello-world-embedded/src/main/
    juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/
    juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/
    juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/
    
juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/juddi/
    
juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/juddi/example/
    
juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/juddi/example/helloworld/
    
juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java
    juddi/trunk/juddi-examples/hello-world-embedded/src/main/resources/
    juddi/trunk/juddi-examples/hello-world-embedded/src/main/resources/META-INF/
    
juddi/trunk/juddi-examples/hello-world-embedded/src/main/resources/META-INF/hello-world-uddi.xml
Modified:
    
juddi/trunk/juddi-examples/hello-world/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java
    juddi/trunk/juddi-examples/pom.xml

Added: juddi/trunk/juddi-examples/hello-world-embedded/README.txt
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/hello-world-embedded/README.txt?rev=1533937&view=auto
==============================================================================
--- juddi/trunk/juddi-examples/hello-world-embedded/README.txt (added)
+++ juddi/trunk/juddi-examples/hello-world-embedded/README.txt Sun Oct 20 
18:18:31 2013
@@ -0,0 +1,16 @@
+This example is a command line demonstration of how to interact with JUDDI.
+
+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 the auth token:
+
+     AUTHTOKEN = authtoken:8aa26a8a-461b-485f-904b-4be4fd5fab76
+  
+You will need an auth token to on subsequent UDDI calls. The token
+can be used until you call discard. The server can be configured to 
+timeout tokens after a certain age, or when not used for a certain
+number of minutes.

Added: juddi/trunk/juddi-examples/hello-world-embedded/pom.xml
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/hello-world-embedded/pom.xml?rev=1533937&view=auto
==============================================================================
--- juddi/trunk/juddi-examples/hello-world-embedded/pom.xml (added)
+++ juddi/trunk/juddi-examples/hello-world-embedded/pom.xml Sun Oct 20 18:18:31 
2013
@@ -0,0 +1,71 @@
+<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.2.0-SNAPSHOT</version>
+               <relativePath>../pom.xml</relativePath>
+       </parent>
+       <artifactId>hello-world-embedded</artifactId>
+       <name>jUDDI Example Hello World</name>
+       <description>Demonstrates the steps taken to publish a service using 
the jUDDI API directly</description>
+
+
+       <dependencies>
+               <dependency>
+                       <groupId>org.apache.juddi</groupId>
+                       <artifactId>uddi-ws</artifactId>
+                       <version>3.2.0-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.juddi</groupId>
+                       <artifactId>juddi-client</artifactId>
+                       <version>3.2.0-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.helloworld.HelloWorld</mainClass>
+                                                               </configuration>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+                               </plugins>
+                       </build>
+               </profile>
+       </profiles>
+
+</project>
+

Added: 
juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java?rev=1533937&view=auto
==============================================================================
--- 
juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java
 (added)
+++ 
juddi/trunk/juddi-examples/hello-world-embedded/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java
 Sun Oct 20 18:18:31 2013
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2001-2010 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.juddi.example.helloworld;
+
+import org.uddi.api_v3.*;
+import org.apache.juddi.v3.client.config.UDDIClient;
+import org.apache.juddi.v3.client.config.UDDIClientContainer;
+import org.apache.juddi.v3.client.transport.Transport;
+import org.uddi.v3_service.UDDISecurityPortType;
+
+public class HelloWorld {
+       private static UDDISecurityPortType security = null;
+
+       public HelloWorld() {
+        try {
+               // create a client and read the config in the archive; 
+               // you can use your config file name
+               UDDIClient uddiClient = new 
UDDIClient("META-INF/hello-world-uddi.xml");
+               // a UddiClient 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 = uddiClient.getTransport("default");
+               // Now you create a reference to the UDDI API
+                       security = transport.getUDDISecurityService();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }       
+       }
+
+       public void getAuthToken() {
+               GetAuthToken getAuthToken = new GetAuthToken();
+               getAuthToken.setUserID("root");
+               getAuthToken.setCred("");
+               try {
+                       AuthToken authToken = 
security.getAuthToken(getAuthToken);
+                       System.out.println ("AUTHTOKEN = " 
+                               + authToken.getAuthInfo());
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }               
+
+       public static void main (String args[]) {
+               HelloWorld hw = new HelloWorld();
+               hw.getAuthToken();      
+       }
+}

Added: 
juddi/trunk/juddi-examples/hello-world-embedded/src/main/resources/META-INF/hello-world-uddi.xml
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/hello-world-embedded/src/main/resources/META-INF/hello-world-uddi.xml?rev=1533937&view=auto
==============================================================================
--- 
juddi/trunk/juddi-examples/hello-world-embedded/src/main/resources/META-INF/hello-world-uddi.xml
 (added)
+++ 
juddi/trunk/juddi-examples/hello-world-embedded/src/main/resources/META-INF/hello-world-uddi.xml
 Sun Oct 20 18:18:31 2013
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<uddi xmlns="urn:juddi-apache-org:v3_client" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+    <reloadDelay>5000</reloadDelay>
+    <client name="example-client">
+               <nodes>
+                       <node>
+                           <!-- required 'default' node -->
+                               <name>default</name> 
+                <properties>
+                    <property name="serverName" value="localhost"/>
+                    <property name="serverPort" value="8080"/>
+                                       <!-- for UDDI nodes that use HTTP u/p, 
using the following 
+                                       <property name="basicAuthUsername" 
value="root" />
+                                       <property name="basicAuthPassword" 
value="password" />
+                                       <property 
name="basicAuthPasswordIsEncrypted" value="false" />
+                                       <property 
name="basicAuthPasswordCryptoProvider" 
value="org.apache.juddi.v3.client.crypto.AES128Cryptor (an example)" />-->
+                </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?wsdl</custodyTransferUrl>
+                               
<inquiryUrl>http://${serverName}:${serverPort}/juddiv3/services/inquiry?wsdl</inquiryUrl>
+                       
<publishUrl>http://${serverName}:${serverPort}/juddiv3/services/publish?wsdl</publishUrl>
+                       
<securityUrl>http://${serverName}:${serverPort}/juddiv3/services/security?wsdl</securityUrl>
+                               
<subscriptionUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription?wsdl</subscriptionUrl>
+                               
<subscriptionListenerUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription-listener?wsdl</subscriptionListenerUrl>
+                               
<juddiApiUrl>http://${serverName}:${serverPort}/juddiv3/services/juddi-api</juddiApiUrl>
+                       </node>
+               </nodes>
+               <signature>
+                       <!-- signing stuff -->
+                       <signingKeyStorePath>keystore.jks</signingKeyStorePath>
+                       <signingKeyStoreType>JKS</signingKeyStoreType>
+                       <signingKeyStoreFilePassword 
+                               isPasswordEncrypted="false" 
+                               
cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</signingKeyStoreFilePassword>
+                       <signingKeyPassword
+                               isPasswordEncrypted="false" 
+                               
cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</signingKeyPassword>
+                       <signingKeyAlias>my special key</signingKeyAlias>
+                       
<canonicalizationMethod>http://www.w3.org/2001/10/xml-exc-c14n#</canonicalizationMethod>
+                       <signatureMethod>RSA_SHA1</signatureMethod>
+                       
<XML_DIGSIG_NS>http://www.w3.org/2000/09/xmldsig#</XML_DIGSIG_NS>
+                       <!-- validation stuff -->
+                       <trustStorePath>truststore.jks</trustStorePath>
+                       <trustStoreType>JKS</trustStoreType>
+                       <trustStorePassword
+                               isPasswordEncrypted="false" 
+                               
cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</trustStorePassword>
+                       
+                       <checkTimestamps>true</checkTimestamps>
+                       <checkTrust>true</checkTrust>
+                       <checkRevocationCRL>true</checkRevocationCRL>
+               </signature>
+               <subscriptionCallbacks>
+                       <keyDomain>uddi:somebusiness</keyDomain>
+                       <listenUrl>http://MyHostname:4444/callback</listenUrl>
+                       
<autoRegisterBindingTemplate>false</autoRegisterBindingTemplate>
+                       
<autoRegisterBusinessServiceKey>uddi:somebusiness:someservicekey</autoRegisterBusinessServiceKey>
+                       <signatureBehavior>DoNothing</signatureBehavior>
+                       <!--valid values are 
AbortIfSigned,Sign,DoNothing,SignOnlyIfParentIsntSigned, default is DoNothing-->
+               </subscriptionCallbacks>
+               <XtoWsdl>
+                       <IgnoreSSLErrors>false</IgnoreSSLErrors>
+               </XtoWsdl>
+       </client>
+</uddi>

Modified: 
juddi/trunk/juddi-examples/hello-world/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/hello-world/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java?rev=1533937&r1=1533936&r2=1533937&view=diff
==============================================================================
--- 
juddi/trunk/juddi-examples/hello-world/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java
 (original)
+++ 
juddi/trunk/juddi-examples/hello-world/src/main/java/org/apache/juddi/example/helloworld/HelloWorld.java
 Sun Oct 20 18:18:31 2013
@@ -18,7 +18,6 @@ package org.apache.juddi.example.hellowo
 
 import org.uddi.api_v3.*;
 import org.apache.juddi.v3.client.config.UDDIClient;
-import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.uddi.v3_service.UDDISecurityPortType;
 

Modified: juddi/trunk/juddi-examples/pom.xml
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/pom.xml?rev=1533937&r1=1533936&r2=1533937&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/pom.xml (original)
+++ juddi/trunk/juddi-examples/pom.xml Sun Oct 20 18:18:31 2013
@@ -29,6 +29,7 @@
     <modules>
        <module>create-partition</module>
        <module>hello-world</module>
+       <module>hello-world-embedded</module>
        <module>simple-browse</module>
        <module>simple-publish</module>
        <module>uddi-annotations</module>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to