From: cvs@openprivacy.orgCVS update: sierra/src/java/org/openprivacy/sierra/client
Date: Wednesday January 10, 19101 @ 19:33
Author: burton
CVSWEB Options: -------------------
Main CVSWeb: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi
View this module: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/client
-----------------------------------
Update of /usr/local/cvsroot/sierra/src/java/org/openprivacy/sierra/client
In directory openprivacy.org:/tmp/cvs-serv22890/src/java/org/openprivacy/sierra/client
Modified Files:
GetReputation.java PutReputation.java
Log Message:
...
*****************************************************************
File: sierra/src/java/org/openprivacy/sierra/client/GetReputation.java
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/client/GetReputation.java?annotate=1.2
CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/client/GetReputation.java?rev=1.2&content-type=text/x-cvsweb-markup
CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/client/GetReputation.java.diff?r1=1.2&r2=1.1
-----------------------------------
Index: sierra/src/java/org/openprivacy/sierra/client/GetReputation.java
diff -u sierra/src/java/org/openprivacy/sierra/client/GetReputation.java:1.1 sierra/src/java/org/openprivacy/sierra/client/GetReputation.java:1.2
--- sierra/src/java/org/openprivacy/sierra/client/GetReputation.java:1.1 Tue Jan 9 18:52:08 2001
+++ sierra/src/java/org/openprivacy/sierra/client/GetReputation.java Wed Jan 10 19:33:57 2001
@@ -24,6 +24,7 @@
//sierra stuf
import org.openprivacy.sierra.*;
+import org.openprivacy.sierra.util.*;
//soap stuff
import org.apache.soap.util.xml.*;
@@ -56,7 +57,7 @@
*
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: GetReputation.java,v 1.1 2001/01/10 02:52:08 burton Exp $
+ * @version $Id: GetReputation.java,v 1.2 2001/01/11 03:33:57 burton Exp $
*/
public GetReputation( String rpcRouter,
String reference ) throws Exception {
@@ -93,13 +94,7 @@
// Check the response.
if ( resp.generatedFault() ) {
-
- Fault fault = resp.getFault();
-
- System.err.println("Generated fault: ");
- System.err.println (" Fault Code = " + fault.getFaultCode());
- System.err.println (" Fault String = " + fault.getFaultString());
-
+ throw new SOAPFaultException( resp.getFault() );
} else {
Parameter ret = resp.getReturnValue();
@@ -115,7 +110,7 @@
* Get the reputation returned from the GetReputation object.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: GetReputation.java,v 1.1 2001/01/10 02:52:08 burton Exp $
+ * @version $Id: GetReputation.java,v 1.2 2001/01/11 03:33:57 burton Exp $
*/
public Reputation getReputation() {
return this.reputation;
@@ -125,14 +120,14 @@
* main()
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: GetReputation.java,v 1.1 2001/01/10 02:52:08 burton Exp $
+ * @version $Id: GetReputation.java,v 1.2 2001/01/11 03:33:57 burton Exp $
*/
public static void main( String[] args ) {
//parse command line options to figure out rpcRouter and the reputation object.
//
- if ( args.length != 5 ) {
+ if ( args.length != 3 ) {
showSyntax();
return;
}
@@ -152,7 +147,36 @@
try {
- new GetReputation( rpcRouter, reference );
+ GetReputation gr = new GetReputation( rpcRouter, reference );
+
+ Reputation rep = gr.getReputation();
+
+ System.out.println( "URI(reference): " + rep.getReference() );
+
+ //output values.
+
+
+ Value[] values = rep.getValues();
+
+ if ( values.length == 0 ) {
+
+ System.err.println( "NO VALUES FOUND!" );
+
+ } else {
+
+ //output header
+ System.out.println("\tNAME\t\t\tDATA\b");
+
+
+ for (int i = 0; i < values.length; ++i ) {
+
+ System.out.println( "\t" + values[i].getName() +
+ "\t\t\t" + values[i].getData() );
+
+ }
+
+ }
+
} catch ( Throwable t ) {
t.printStackTrace();
}
@@ -163,7 +187,7 @@
* Show the user how to work the system.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: GetReputation.java,v 1.1 2001/01/10 02:52:08 burton Exp $
+ * @version $Id: GetReputation.java,v 1.2 2001/01/11 03:33:57 burton Exp $
*/
public static void showSyntax() {
*****************************************************************
File: sierra/src/java/org/openprivacy/sierra/client/PutReputation.java
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/client/PutReputation.java?annotate=1.3
CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/client/PutReputation.java?rev=1.3&content-type=text/x-cvsweb-markup
CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/sierra/src/java/org/openprivacy/sierra/client/PutReputation.java.diff?r1=1.3&r2=1.2
-----------------------------------
Index: sierra/src/java/org/openprivacy/sierra/client/PutReputation.java
diff -u sierra/src/java/org/openprivacy/sierra/client/PutReputation.java:1.2 sierra/src/java/org/openprivacy/sierra/client/PutReputation.java:1.3
--- sierra/src/java/org/openprivacy/sierra/client/PutReputation.java:1.2 Tue Jan 9 18:51:47 2001
+++ sierra/src/java/org/openprivacy/sierra/client/PutReputation.java Wed Jan 10 19:33:57 2001
@@ -24,6 +24,7 @@
//sierra stuf
import org.openprivacy.sierra.*;
+import org.openprivacy.sierra.util.*;
//soap stuff
import org.apache.soap.util.xml.*;
@@ -54,7 +55,7 @@
*
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: PutReputation.java,v 1.2 2001/01/10 02:51:47 burton Exp $
+ * @version $Id: PutReputation.java,v 1.3 2001/01/11 03:33:57 burton Exp $
*/
public PutReputation( String rpcRouter,
Reputation reputation ) throws Exception {
@@ -86,6 +87,11 @@
call.setParams(params);
Response resp = call.invoke( new URL( rpcRouter ), "" );
+
+ if ( resp.generatedFault() ) {
+ throw new SOAPFaultException( resp.getFault() );
+ }
+
}
@@ -94,7 +100,7 @@
* main()
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: PutReputation.java,v 1.2 2001/01/10 02:51:47 burton Exp $
+ * @version $Id: PutReputation.java,v 1.3 2001/01/11 03:33:57 burton Exp $
*/
public static void main( String[] args ) {
@@ -123,10 +129,12 @@
String data = null;
+ //FIXME: this won't work for reputations with multiple values.
+
if ( args[3].equals( "--value" ) ) {
String value = args[4];
- int split = value.indexOf( "=");
+ int split = value.indexOf( "=" );
if ( split == -1 ) {
showSyntax();
@@ -147,6 +155,9 @@
try {
new PutReputation( rpcRouter, rep );
+
+ System.out.println( "SUCCESS" );
+
} catch ( Throwable t ) {
t.printStackTrace();
}
@@ -157,7 +168,7 @@
* Show the user how to work the system.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: PutReputation.java,v 1.2 2001/01/10 02:51:47 burton Exp $
+ * @version $Id: PutReputation.java,v 1.3 2001/01/11 03:33:57 burton Exp $
*/
public static void showSyntax() {
This archive was generated by hypermail 2b30 : Mon Jan 22 2001 - 15:52:14 PST