summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/src/AddServiceObjectNode.java1
-rw-r--r--java/src/BlobWriter.java32
-rw-r--r--java/src/ClassNameGenerator.java1
-rw-r--r--java/src/ClassReader.java1
-rw-r--r--java/src/Makefile3
-rw-r--r--java/src/ParseNode.java1
-rw-r--r--java/src/RemoveNode.java1
-rw-r--r--java/src/ServiceConfig.java1
-rw-r--r--java/src/ServiceLoader.java1
-rw-r--r--java/src/ServiceObjectRecord.java3
-rw-r--r--java/src/ServiceRecord.java2
-rw-r--r--java/src/ServiceRepository.java3
-rw-r--r--java/src/Svc_Conf.y2
-rw-r--r--java/src/TimerQueue.java12
-rw-r--r--java/src/Yylex.java1
-rw-r--r--java/src/Yylex.lex1
-rw-r--r--java/src/parser.java4
-rw-r--r--java/src/sym.java2
18 files changed, 46 insertions, 26 deletions
diff --git a/java/src/AddServiceObjectNode.java b/java/src/AddServiceObjectNode.java
index 86d1d2e66fd..93d791942ae 100644
--- a/java/src/AddServiceObjectNode.java
+++ b/java/src/AddServiceObjectNode.java
@@ -1,7 +1,6 @@
package JACE.ServiceConfigurator;
import java.io.*;
-import JACE.ServiceConfigurator.*;
import JACE.OS.*;
import java_cup.runtime.*;
diff --git a/java/src/BlobWriter.java b/java/src/BlobWriter.java
index 4c4d5d1d31b..4c419a15c1f 100644
--- a/java/src/BlobWriter.java
+++ b/java/src/BlobWriter.java
@@ -31,6 +31,23 @@ public class BlobWriter extends BlobHandler
this.returnCode_ = -1;
}
+ /*******************************
+ * This constructor should be used when using the basic HTTP 1.1
+ * authentication scheme
+ *******************************/
+ public BlobWriter (MessageBlock mb,
+ int length,
+ int offset,
+ String filename,
+ String authentication)
+ {
+ super (length, offset, filename);
+ this.mb_ = mb;
+ this.returnCode_ = -1;
+ this.authentication_ = authentication;
+ }
+
+
public int open (Object obj)
{
if (this.sendRequest () != 0)
@@ -88,8 +105,16 @@ public class BlobWriter extends BlobHandler
filename = "/" + this.filename_;
// Create the header, store the actual length in mesglen
- String mesg = this.requestPrefix_ + " " + filename + " " + this.requestSuffix_ + " " + this.length_ + "\n\n";
- System.out.print (mesg);
+ String mesg = this.requestPrefix_ + " " + filename + " " + this.requestSuffix_;
+
+ if (this.authentication_ != null) {
+ mesg += "Authorization: Basic " + JACE.Connection.HTTPHelper.EncodeBase64(this.authentication_) + '\n';
+
+ System.err.println("Real password: " + this.authentication_);
+ }
+ mesg += "Content-length: " + this.length_ + "\n\n";
+
+ ACE.DEBUG("Sending header: " + mesg);
try
{
@@ -181,11 +206,12 @@ public class BlobWriter extends BlobHandler
return this.returnCode_;
}
+ protected String authentication_ = null;
protected String protocol_ = "http://";
protected int bytesWritten_ = 0;
protected MessageBlock mb_ = null;
protected String requestPrefix_ = "PUT";
- protected String requestSuffix_ = "HTTP/1.0\nContent-length:";
+ protected String requestSuffix_ = "HTTP/1.0\n";
protected String replyPrefix_ = "HTTP/1.0";
protected int returnCode_;
}
diff --git a/java/src/ClassNameGenerator.java b/java/src/ClassNameGenerator.java
index 8c08b33c09c..0be175c5275 100644
--- a/java/src/ClassNameGenerator.java
+++ b/java/src/ClassNameGenerator.java
@@ -17,7 +17,6 @@
package JACE.ServiceConfigurator;
import java.io.*;
-import java.lang.*;
import java.util.*;
import JACE.OS.*;
diff --git a/java/src/ClassReader.java b/java/src/ClassReader.java
index deddf32eac2..4faf2da257d 100644
--- a/java/src/ClassReader.java
+++ b/java/src/ClassReader.java
@@ -16,7 +16,6 @@ package JACE.ServiceConfigurator;
import JACE.OS.*;
import java.io.*;
-import java.lang.*;
import java.util.*;
/**
diff --git a/java/src/Makefile b/java/src/Makefile
index 272f4bb4b3b..2ca55c03c9c 100644
--- a/java/src/Makefile
+++ b/java/src/Makefile
@@ -88,7 +88,8 @@ pkg_connection = \
Blob \
BlobHandler \
BlobReader \
- BlobWriter
+ BlobWriter \
+ HTTPHelper
connection: os socksap svcconfig $(addsuffix .java,$(pkg_connection))
$(COMPILE.java)
diff --git a/java/src/ParseNode.java b/java/src/ParseNode.java
index b6d2d4957ed..6a4db754227 100644
--- a/java/src/ParseNode.java
+++ b/java/src/ParseNode.java
@@ -16,7 +16,6 @@
package JACE.ServiceConfigurator;
import java.io.*;
-import JACE.ServiceConfigurator.*;
import JACE.OS.*;
import java_cup.runtime.*;
diff --git a/java/src/RemoveNode.java b/java/src/RemoveNode.java
index d93a0911054..43744394a7b 100644
--- a/java/src/RemoveNode.java
+++ b/java/src/RemoveNode.java
@@ -17,7 +17,6 @@
package JACE.ServiceConfigurator;
import java.io.*;
-import JACE.ServiceConfigurator.*;
import JACE.OS.*;
import java_cup.runtime.*;
diff --git a/java/src/ServiceConfig.java b/java/src/ServiceConfig.java
index 69fc8cf566e..11504527bdd 100644
--- a/java/src/ServiceConfig.java
+++ b/java/src/ServiceConfig.java
@@ -22,7 +22,6 @@ package JACE.ServiceConfigurator;
import java.io.*;
import java.util.*;
import java.net.*;
-import java.lang.*;
import JACE.OS.*;
import JACE.Misc.*;
diff --git a/java/src/ServiceLoader.java b/java/src/ServiceLoader.java
index c9b201c72a8..427428c5ae2 100644
--- a/java/src/ServiceLoader.java
+++ b/java/src/ServiceLoader.java
@@ -16,7 +16,6 @@ package JACE.ServiceConfigurator;
import java.io.*;
import java.util.*;
import java.net.*;
-import java.lang.*;
import JACE.OS.*;
import JACE.Misc.*;
diff --git a/java/src/ServiceObjectRecord.java b/java/src/ServiceObjectRecord.java
index b92a72173cb..282d4360fbf 100644
--- a/java/src/ServiceObjectRecord.java
+++ b/java/src/ServiceObjectRecord.java
@@ -18,9 +18,6 @@
*************************************************/
package JACE.ServiceConfigurator;
-import java.lang.*;
-import JACE.ServiceConfigurator.*;
-
public class ServiceObjectRecord extends ServiceRecord
{
public ServiceObjectRecord (Object so, String name)
diff --git a/java/src/ServiceRecord.java b/java/src/ServiceRecord.java
index 6c598aa732f..cb06dafa7fc 100644
--- a/java/src/ServiceRecord.java
+++ b/java/src/ServiceRecord.java
@@ -27,9 +27,7 @@
package JACE.ServiceConfigurator;
import java.io.*;
-import java.lang.*;
import java.lang.reflect.*;
-import JACE.ServiceConfigurator.*;
import JACE.OS.*;
public class ServiceRecord
diff --git a/java/src/ServiceRepository.java b/java/src/ServiceRepository.java
index 8845fb52d0a..29c90a77313 100644
--- a/java/src/ServiceRepository.java
+++ b/java/src/ServiceRepository.java
@@ -20,8 +20,7 @@ package JACE.ServiceConfigurator;
import java.io.*;
import java.util.*;
-import JACE.ServiceConfigurator.*;
-
+
public class ServiceRepository
{
/**
diff --git a/java/src/Svc_Conf.y b/java/src/Svc_Conf.y
index 1079779eb31..a11a18f9af0 100644
--- a/java/src/Svc_Conf.y
+++ b/java/src/Svc_Conf.y
@@ -1,9 +1,7 @@
package JACE.ServiceConfigurator;
import java.io.*;
-import java.lang.*;
import java_cup.runtime.*;
-import JACE.ServiceConfigurator.*;
import JACE.OS.*;
parser code {:
diff --git a/java/src/TimerQueue.java b/java/src/TimerQueue.java
index 74bac5ec398..e3aa30d9472 100644
--- a/java/src/TimerQueue.java
+++ b/java/src/TimerQueue.java
@@ -14,6 +14,8 @@ package JACE.Reactor;
import java.util.*;
import JACE.ASX.*;
+import JACE.OS.*;
+
class TimerNode
{
public TimerNode (EventHandler handler,
@@ -224,8 +226,13 @@ public class TimerQueue implements Runnable
TimeValue timeout,
TimeValue interval)
{
+
// Increment the sequence number (it will wrap around).
this.timerId_++;
+
+ ACE.DEBUG("scheduleTimer (" + this.timerId_ + "): " + timeout + ", " + interval);
+
+
TimeValue futureTime = TimeValue.plus (timeout, TimeValue.getTimeOfDay ());
TimerNode node = new TimerNode (handler,
arg,
@@ -360,6 +367,8 @@ public class TimerQueue implements Runnable
this.reschedule (expired);
}
+ ACE.DEBUG("handleTimeout " + expired.timerId_);
+
// Perform the callback.
result = handler.handleTimeout (currentTime, arg);
@@ -372,6 +381,9 @@ public class TimerQueue implements Runnable
// position in the queue.
private void reschedule (TimerNode expired)
{
+ ACE.DEBUG("reschedule " + expired.timerId_ + " for " + expired.timerValue_);
+ // *** Shouldn't it use interval here?
+
if (this.isEmpty () ||
expired.timerValue_.lessThan (this.earliestTime ()))
{
diff --git a/java/src/Yylex.java b/java/src/Yylex.java
index a23a48efe88..50e9d1173d3 100644
--- a/java/src/Yylex.java
+++ b/java/src/Yylex.java
@@ -1,5 +1,4 @@
package JACE.ServiceConfigurator;
-import java.lang.*;
import java.io.*;
import JACE.OS.*;
import java_cup.runtime.*;
diff --git a/java/src/Yylex.lex b/java/src/Yylex.lex
index e40a69f73f7..fc41453fbad 100644
--- a/java/src/Yylex.lex
+++ b/java/src/Yylex.lex
@@ -1,6 +1,5 @@
package JACE.ServiceConfigurator;
-import java.lang.*;
import java.io.*;
import JACE.OS.*;
import java_cup.runtime.*;
diff --git a/java/src/parser.java b/java/src/parser.java
index 214b2abef6b..54c17d9dca3 100644
--- a/java/src/parser.java
+++ b/java/src/parser.java
@@ -1,15 +1,13 @@
//----------------------------------------------------
// The following code was generated by CUP v0.9e
-// Sun Nov 09 13:56:12 CST 1997
+// Thu Dec 18 19:14:44 CST 1997
//----------------------------------------------------
package JACE.ServiceConfigurator;
import java.io.*;
-import java.lang.*;
import java_cup.runtime.*;
-import JACE.ServiceConfigurator.*;
import JACE.OS.*;
public class parser extends java_cup.runtime.lr_parser {
diff --git a/java/src/sym.java b/java/src/sym.java
index aeaadf19354..de90912c10a 100644
--- a/java/src/sym.java
+++ b/java/src/sym.java
@@ -1,7 +1,7 @@
//----------------------------------------------------
// The following code was generated by CUP v0.9e
-// Sun Nov 09 13:56:12 CST 1997
+// Thu Dec 18 19:14:43 CST 1997
//----------------------------------------------------
package JACE.ServiceConfigurator;