juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svi...@apache.org
Subject cvs commit: ws-juddi/samples/delete_publisher DeletePublisherSample.java build.xml juddi.properties log4j.properties
Date Tue, 11 Nov 2003 14:13:51 GMT
sviens      2003/11/11 06:13:51

  Added:       samples/delete_publisher DeletePublisherSample.java
                        build.xml juddi.properties log4j.properties
  Log:
  Moved from jUDDI CVS at SourceForge
  
  Revision  Changes    Path
  1.1                  ws-juddi/samples/delete_publisher/DeletePublisherSample.java
  
  Index: DeletePublisherSample.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "jUDDI" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import org.apache.juddi.client.*;
  import org.apache.juddi.datatype.*;
  import org.apache.juddi.datatype.publisher.Publisher;
  import org.apache.juddi.datatype.publisher.PublisherID;
  import org.apache.juddi.datatype.business.*;
  import org.apache.juddi.datatype.request.*;
  import org.apache.juddi.datatype.response.*;
  import org.apache.juddi.error.*;
  import org.apache.juddi.registry.*;
  
  import java.util.Vector;
  import java.io.File;
  
  /**
   * @author Steve Viens (sviens@apache.org)
   */
  public class DeletePublisherSample
  {
    public static void main(String[] args)
    {
      RegistryProxy proxy = new RegistryProxy();
  
      try
      {
  
        // execute a GetAuthToken request
        AuthToken token = proxy.get_authToken("juddi", "password");
        AuthInfo authInfo = token.getAuthInfo();
  
        // create a publisher with administrative privileges
        Publisher publisher = new Publisher("BlueNoteIdentifier", "Blue Note", true);
        publisher.setEnabled(true);
        // create a publisher to remove
        Publisher perisher = new Publisher("removeMe", "Remove Me", false);
        // put the Publisher objects into a Vector
        Vector vector = new Vector(2);
        vector.add(publisher);
        vector.add(perisher);
  
        // make the request
        PublisherDetail detail = proxy.save_publisher(authInfo, vector);
  
        System.out.println("publishers saved = " + detail.getPublisherVector().size());
  
        // get an authToken using the publisher with administrative privileges
        token = proxy.get_authToken("BlueNoteIdentifier", "password");
        authInfo = token.getAuthInfo();
  
        // create a vector of strings containing the
        String publisherID = "removeMe";
        vector = new Vector(1);
        vector.add(publisherID);
        proxy.delete_publisher(authInfo, vector);
      }
      catch(Exception ex)
      {
        ex.printStackTrace();
      }
    }
  }
  
  
  1.1                  ws-juddi/samples/delete_publisher/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- ===================================================================
  
  Jakarta Ant build script for jUDDI samples
  
  
  Prerequisites:
  
     jakarta-ant 1.4 from http://jakarta.apache.org
  
     Note: It is strongly recommended that you add the Ant
     'bin' directory and the Java 2 SDK 'bin' directory to
     your PATH environment variable.
  
  
  Most Useful Targets:
  
   - compile   compiles the sample classes
   - run       runs the sample
   - clean     removes artifacts created during compile or run
  
  
  Authors:
  
   Steve Viens <sviens@attbi.com>
  
  
  Copyright:
  
    Copyright 2002 (c) Steve Viens
  
     $Id: build.xml,v 1.1 2003/11/11 14:13:51 sviens Exp $
  
  ==================================================================== -->
  <project default="run" basedir=".">
    <target name="init">
      <property name="debug" value="on"/>
      <property name="deprecation" value="on"/>
      <property name="optimize" value="off"/>
      <property name="lib.dir" value="${basedir}/../../lib"/>
      <property name="build.dir" value="${basedir}/../../build"/>
      <path id="project.classpath">
        <pathelement location="."/>
        <pathelement location="${build.dir}/juddi.jar"/>
        <fileset dir="${lib.dir}">
          <include name="*.jar"/>
        </fileset>
      </path>
    </target>
    <!-- =================================================================== -->
    <!-- Compiles the Java source                                            -->
    <!-- =================================================================== -->
    <target name="compile" depends="init">
      <javac destdir="." debug="${debug}" deprecation="${deprecation}" optimize="${optimize}">
        <classpath refid="project.classpath"/>
        <src path="."/>
      </javac>
    </target>
    <!-- =================================================================== -->
    <!-- Executes the save_business sample                                   -->
    <!-- =================================================================== -->
    <target name="run" depends="compile">
      <java classname="DeletePublisherSample" fork="yes">
        <classpath refid="project.classpath"/>
      </java>
    </target>
    <!-- =================================================================== -->
    <!-- Cleans everything                                                   -->
    <!-- =================================================================== -->
    <target name="clean" depends="init">
      <delete verbose="false">
        <fileset dir="." includes="**/*.class"/>
      </delete>
    </target>
  </project>
  
  
  1.1                  ws-juddi/samples/delete_publisher/juddi.properties
  
  Index: juddi.properties
  ===================================================================
  juddi.userID = sviens
  juddi.password = password
  juddi.adminURL = http://localhost:8080/juddi/admin
  juddi.inquiryURL = http://localhost:8080/juddi/inquiry
  juddi.publishURL = http://localhost:8080/juddi/publish
  juddi.securityProvider = com.sun.net.ssl.internal.ssl.Provider
  juddi.protocolHandler = com.sun.net.ssl.internal.www.protocol
  
  
  1.1                  ws-juddi/samples/delete_publisher/log4j.properties
  
  Index: log4j.properties
  ===================================================================
  # Uncomment to have log4j be verbose while parsing this file
  #log4j.debug
  
  # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
  log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
  log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
  log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
  log4j.appender.CONSOLE.Threshold=INFO
  
  # LOGFILE is set to be a RollingFileAppender appender using a TTCCLayout.
  log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
  log4j.appender.LOGFILE.layout=org.apache.log4j.TTCCLayout
  log4j.appender.LOGFILE.layout.ContextPrinting=true
  log4j.appender.LOGFILE.layout.DateFormat=ISO8601
  log4j.appender.LOGFILE.MaxFileSize=10MB
  log4j.appender.LOGFILE.MaxBackupIndex=3
  log4j.appender.LOGFILE.File=juddi.log
  
  # Set root category priority to DEBUG and its appender to LOGFILE.
  #log4j.rootCategory=DEBUG, CONSOLE
  log4j.rootCategory=DEBUG, LOGFILE
  
  

Mime
View raw message