Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) new soap function to get the current queue status *) new junit testclass to test soap statusService *) refactoring of admin service (usage of constants instead of strings) *) libraries upgraded to newer version + adding missing dependency

theli3e0516446b66
diff --git a/libx/activation.jar b/libx/activation.jar
index a53ee0da5..fbc5bf958 100644
Binary files a/libx/activation.jar and b/libx/activation.jar differ
diff --git a/libx/gnumail.jar b/libx/gnumail.jar
index 725fd5852..33802c45c 100644
Binary files a/libx/gnumail.jar and b/libx/gnumail.jar differ
diff --git a/libx/inetlib.jar b/libx/inetlib.jar
new file mode 100644
index 000000000..3c16bcc7e
Binary files /dev/null and b/libx/inetlib.jar differ
diff --git a/source/de/anomic/soap/services/AdminService.java b/source/de/anomic/soap/services/AdminService.java
index 3adf43dd9..59b35c40e 100644
--- a/source/de/anomic/soap/services/AdminService.java
+++ b/source/de/anomic/soap/services/AdminService.java
@@ -63,7 +63,34 @@ import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacySeed;
public class AdminService extends AbstractService {
-
+
+ /* =====================================================================
+ * Used Plasmaswitchboard config properties
+ * ===================================================================== */
+ private static final String _10_HTTPD = "10_httpd";
+ private static final String _62_REMOTETRIGGEREDCRAWL_BUSYSLEEP = "62_remotetriggeredcrawl_busysleep";
+ private static final String _62_REMOTETRIGGEREDCRAWL = "62_remotetriggeredcrawl";
+ private static final String PORT = "port";
+ private static final String PEER_NAME = "peerName";
+ private static final String RESTART = "restart";
+ private static final String REMOTE_PROXY_USE = "remoteProxyUse";
+ private static final String REMOTE_PROXY_USE4SSL = "remoteProxyUse4SSL";
+ private static final String REMOTE_PROXY_USE4YACY = "remoteProxyUse4Yacy";
+ private static final String REMOTE_PROXY_NO_PROXY = "remoteProxyNoProxy";
+ private static final String REMOTE_PROXY_PWD = "remoteProxyPwd";
+ private static final String REMOTE_PROXY_USER = "remoteProxyUser";
+ private static final String REMOTE_PROXY_PORT = "remoteProxyPort";
+ private static final String REMOTE_PROXY_HOST = "remoteProxyHost";
+ private static final String CRAWL_RESPONSE = "crawlResponse";
+ private static final String INDEX_RECEIVE_BLOCK_BLACKLIST = "indexReceiveBlockBlacklist";
+ private static final String ALLOW_RECEIVE_INDEX = "allowReceiveIndex";
+ private static final String ALLOW_DISTRIBUTE_INDEX_WHILE_CRAWLING = "allowDistributeIndexWhileCrawling";
+ private static final String ALLOW_DISTRIBUTE_INDEX = "allowDistributeIndex";
+
+
+ /* =====================================================================
+ * Used XML Templates
+ * ===================================================================== */
private static final String TEMPLATE_CONFIG_XML = "xml/config_p.xml";
private static final String TEMPLATE_VERSION_XML = "xml/version.xml";
@@ -224,7 +251,7 @@ public class AdminService extends AbstractService {
extractMessageContext(true);
// get the previous name
- String prevName = this.switchboard.getConfig("peerName", "");
+ String prevName = this.switchboard.getConfig(PEER_NAME, "");
if (prevName.equals("newName")) return;
// take a look if there is already an other peer with this name
@@ -244,7 +271,7 @@ public class AdminService extends AbstractService {
}
// use the new name
- this.switchboard.setConfig("peerName", newName);
+ this.switchboard.setConfig(PEER_NAME, newName);
}
/**
@@ -263,14 +290,14 @@ public class AdminService extends AbstractService {
extractMessageContext(true);
// get the old value
- int oldPort = (int) this.switchboard.getConfigLong("port", 8080);
+ int oldPort = (int) this.switchboard.getConfigLong(PORT, 8080);
if (oldPort == newPort) return;
// getting the server thread
- serverCore theServerCore = (serverCore) this.switchboard.getThread("10_httpd");
+ serverCore theServerCore = (serverCore) this.switchboard.getThread(_10_HTTPD);
// store the new value
- this.switchboard.setConfig("port", newPort);
+ this.switchboard.setConfig(PORT, newPort);
// restart the port listener
// TODO: check if the port is free
@@ -287,15 +314,15 @@ public class AdminService extends AbstractService {
extractMessageContext(true);
// check for errors
- String proxyHost = this.switchboard.getConfig("remoteProxyHost", "");
+ String proxyHost = this.switchboard.getConfig(REMOTE_PROXY_HOST, "");
if (proxyHost.length() == 0) throw new AxisFault("Remote proxy hostname is not configured");
- String proxyPort = this.switchboard.getConfig("remoteProxyPort", "");
+ String proxyPort = this.switchboard.getConfig(REMOTE_PROXY_PORT, "");
if (proxyPort.length() == 0) throw new AxisFault("Remote proxy port is not configured");
// store the new state
plasmaSwitchboard sb = (plasmaSwitchboard) this.switchboard;
- sb.setConfig("remoteProxyUse",Boolean.toString(enableProxy));
+ sb.setConfig(REMOTE_PROXY_USE,Boolean.toString(enableProxy));
sb.remoteProxyConfig = httpRemoteProxyConfig.init(sb);
}
@@ -330,25 +357,25 @@ public class AdminService extends AbstractService {
extractMessageContext(true);
if (proxyHost != null)
- this.switchboard.setConfig("remoteProxyHost", proxyHost);
+ this.switchboard.setConfig(REMOTE_PROXY_HOST, proxyHost);
if (proxyPort != null)
- this.switchboard.setConfig("remoteProxyPort", proxyPort.toString());
+ this.switchboard.setConfig(REMOTE_PROXY_PORT, proxyPort.toString());
if (proxyUserName != null)
- this.switchboard.setConfig("remoteProxyUser", proxyUserName);
+ this.switchboard.setConfig(REMOTE_PROXY_USER, proxyUserName);
if (proxyPwd != null)
- this.switchboard.setConfig("remoteProxyPwd", proxyPwd);
+ this.switchboard.setConfig(REMOTE_PROXY_PWD, proxyPwd);
if (noProxyList != null)
- this.switchboard.setConfig("remoteProxyNoProxy", noProxyList);
+ this.switchboard.setConfig(REMOTE_PROXY_NO_PROXY, noProxyList);
if (useProxy4YaCy != null)
- this.switchboard.setConfig("remoteProxyUse4Yacy", useProxy4YaCy.toString());
+ this.switchboard.setConfig(REMOTE_PROXY_USE4YACY, useProxy4YaCy.toString());
if (useProxy4SSL != null)
- this.switchboard.setConfig("remoteProxyUse4SSL", useProxy4SSL.toString());
+ this.switchboard.setConfig(REMOTE_PROXY_USE4SSL, useProxy4SSL.toString());
// enable remote proxy usage
if (enableRemoteProxy != null) this.enableRemoteProxy(enableRemoteProxy.booleanValue());
@@ -362,7 +389,7 @@ public class AdminService extends AbstractService {
// extracting the message context
extractMessageContext(true);
- this.switchboard.setConfig("restart", "false");
+ this.switchboard.setConfig(RESTART, "false");
// Terminate the peer in 3 seconds (this gives us enough time to finish the request
((plasmaSwitchboard)this.switchboard).terminate(3000);
@@ -399,18 +426,18 @@ public class AdminService extends AbstractService {
}
// get the server thread
- serverThread rct = this.switchboard.getThread("62_remotetriggeredcrawl");
+ serverThread rct = this.switchboard.getThread(_62_REMOTETRIGGEREDCRAWL);
// set the new sleep time
if (rct != null) rct.setBusySleep(newBusySleep);
// store it
- this.switchboard.setConfig("62_remotetriggeredcrawl_busysleep", Long.toString(newBusySleep));
+ this.switchboard.setConfig(_62_REMOTETRIGGEREDCRAWL_BUSYSLEEP, Long.toString(newBusySleep));
}
// if set enable/disable remote triggered crawls
if (enableRemoteTriggeredCrawls != null) {
- this.switchboard.setConfig("crawlResponse", enableRemoteTriggeredCrawls.toString());
+ this.switchboard.setConfig(CRAWL_RESPONSE, enableRemoteTriggeredCrawls.toString());
}
}
@@ -425,22 +452,22 @@ public class AdminService extends AbstractService {
// index Distribution on/off
if (indexDistribution != null) {
- this.switchboard.setConfig("allowDistributeIndex", indexDistribution.toString());
+ this.switchboard.setConfig(ALLOW_DISTRIBUTE_INDEX, indexDistribution.toString());
}
// Index Distribution while crawling
if (indexDistributeWhileCrawling != null) {
- this.switchboard.setConfig("allowDistributeIndexWhileCrawling", indexDistributeWhileCrawling.toString());
+ this.switchboard.setConfig(ALLOW_DISTRIBUTE_INDEX_WHILE_CRAWLING, indexDistributeWhileCrawling.toString());
}
// Index Receive
if (indexReceive != null) {
- this.switchboard.setConfig("allowReceiveIndex", indexReceive.toString());
+ this.switchboard.setConfig(ALLOW_RECEIVE_INDEX, indexReceive.toString());
}
// block URLs received by DHT by blocklist
if (indexReceiveBlockBlacklist != null) {
- this.switchboard.setConfig("indexReceiveBlockBlacklist", indexReceiveBlockBlacklist.toString());
+ this.switchboard.setConfig(INDEX_RECEIVE_BLOCK_BLACKLIST, indexReceiveBlockBlacklist.toString());
}
}
@@ -453,20 +480,20 @@ public class AdminService extends AbstractService {
Document xmlDoc = createNewXMLDocument("transferProperties");
Element xmlRoot = xmlDoc.getDocumentElement();
- xmlElement = xmlDoc.createElement("allowDistributeIndex");
- xmlElement.appendChild(xmlDoc.createTextNode(Boolean.toString(this.switchboard.getConfigBool("allowDistributeIndex",true))));
+ xmlElement = xmlDoc.createElement(ALLOW_DISTRIBUTE_INDEX);
+ xmlElement.appendChild(xmlDoc.createTextNode(Boolean.toString(this.switchboard.getConfigBool(ALLOW_DISTRIBUTE_INDEX,true))));
xmlRoot.appendChild(xmlElement);
- xmlElement = xmlDoc.createElement("allowDistributeIndexWhileCrawling");
- xmlElement.appendChild(xmlDoc.createTextNode(Boolean.toString(this.switchboard.getConfigBool("allowDistributeIndexWhileCrawling",true))));
+ xmlElement = xmlDoc.createElement(ALLOW_DISTRIBUTE_INDEX_WHILE_CRAWLING);
+ xmlElement.appendChild(xmlDoc.createTextNode(Boolean.toString(this.switchboard.getConfigBool(ALLOW_DISTRIBUTE_INDEX_WHILE_CRAWLING,true))));
xmlRoot.appendChild(xmlElement);
- xmlElement = xmlDoc.createElement("allowReceiveIndex");
- xmlElement.appendChild(xmlDoc.createTextNode(Boolean.toString(this.switchboard.getConfigBool("allowReceiveIndex",true))));
+ xmlElement = xmlDoc.createElement(ALLOW_RECEIVE_INDEX);
+ xmlElement.appendChild(xmlDoc.createTextNode(Boolean.toString(this.switchboard.getConfigBool(ALLOW_RECEIVE_INDEX,true))));
xmlRoot.appendChild(xmlElement);
- xmlElement = xmlDoc.createElement("indexReceiveBlockBlacklist");
- xmlElement.appendChild(xmlDoc.createTextNode(Boolean.toString(this.switchboard.getConfigBool("indexReceiveBlockBlacklist",true))));
+ xmlElement = xmlDoc.createElement(INDEX_RECEIVE_BLOCK_BLACKLIST);
+ xmlElement.appendChild(xmlDoc.createTextNode(Boolean.toString(this.switchboard.getConfigBool(INDEX_RECEIVE_BLOCK_BLACKLIST,true))));
xmlRoot.appendChild(xmlElement);
return xmlDoc;
diff --git a/source/de/anomic/soap/services/StatusService.java b/source/de/anomic/soap/services/StatusService.java
index 3c1d77761..c1f435e2a 100644
--- a/source/de/anomic/soap/services/StatusService.java
+++ b/source/de/anomic/soap/services/StatusService.java
@@ -53,10 +53,15 @@ import de.anomic.soap.AbstractService;
public class StatusService extends AbstractService {
+ /* =====================================================================
+ * Used XML Templates
+ * ===================================================================== */
/**
* Constant: template for the network status page
*/
private static final String TEMPLATE_NETWORK_XML = "Network.xml";
+ private static final String TEMPLATE_QUEUES_XML = "xml/queues_p.xml";
+
/**
* Service used to query the network properties
@@ -76,4 +81,49 @@ public class StatusService extends AbstractService {
throw new AxisFault(e.getMessage());
}
}
+
+
+ /**
+ * Returns the current status of the following queues
+ * <ul>
+ * <li>Indexing Queue</li>
+ * <li>Loader Queue</li>
+ * <li>Local Crawling Queue </li>
+ * <li>Remote Triggered Crawling Queue</li>
+ * </ul>
+ * @param localqueueCount the amount of items that should be returned. If this is <code>null</code> 10 items will be returned
+ * @param loaderqueueCount the amount of items that should be returned. This parameter will be ignored at the moment
+ * @param localcrawlerqueueCount the amount of items that should be returned. This parameter will be ignored at the moment
+ * @param remotecrawlerqueueCount the amount of items that should be returned. This parameter will be ignored at the moment
+ * @return a XML document containing the status information. For the detailed format, take a look into the template file
+ * <code>htroot/xml/queues_p.xml</code>
+ *
+ * @throws AxisFault if authentication failed
+ * @throws Exception on other unexpected errors
+ *
+ * @since 2835
+ */
+ public Document getQueueStatus(
+ Integer localqueueCount,
+ Integer loaderqueueCount,
+ Integer localcrawlerqueueCount,
+ Integer remotecrawlerqueueCount
+ ) throws Exception {
+ // extracting the message context
+ extractMessageContext(true);
+
+ // passing parameters to servlet
+ serverObjects input = new serverObjects();
+ if (localqueueCount != null) input.put("num",localqueueCount.toString());
+ //if (loaderqueueCount != null) input.put("num",loaderqueueCount.toString());
+ //if (localcrawlerqueueCount != null) input.put("num",localcrawlerqueueCount.toString());
+ //if (remotecrawlerqueueCount != null) input.put("num",remotecrawlerqueueCount.toString());
+
+
+ // generating the template containing the network status information
+ byte[] result = writeTemplate(TEMPLATE_QUEUES_XML, input);
+
+ // sending back the result to the client
+ return this.convertContentToXML(result);
+ }
}
diff --git a/source/de/anomic/soap/services/admin.wsdl b/source/de/anomic/soap/services/admin.wsdl
index 605a053d7..1310f1f3f 100644
--- a/source/de/anomic/soap/services/admin.wsdl
+++ b/source/de/anomic/soap/services/admin.wsdl
@@ -5,151 +5,173 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:message>
<wsdl:message name="shutdownPeerResponse">
</wsdl:message>
+ <wsdl:message name="createNewXMLDocumentRequest">
+ <wsdl:part name="rootElementName" type="soapenc:string"/>
+ </wsdl:message>
<wsdl:message name="enableRemoteProxyRequest">
+
<wsdl:part name="enableProxy" type="xsd:boolean"/>
</wsdl:message>
<wsdl:message name="setPeerNameRequest">
-
<wsdl:part name="newName" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="getConfigPropertyRequest">
<wsdl:part name="key" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="getTransferPropertiesRequest">
+
</wsdl:message>
<wsdl:message name="setRemoteProxyResponse">
</wsdl:message>
-
<wsdl:message name="getConfigPropertyListRequest">
</wsdl:message>
<wsdl:message name="enableRemoteProxyResponse">
</wsdl:message>
<wsdl:message name="getConfigPropertiesResponse">
<wsdl:part name="getConfigPropertiesReturn" type="impl:ArrayOf_soapenc_string"/>
+
+ </wsdl:message>
+ <wsdl:message name="createNewXMLDocumentResponse">
+ <wsdl:part name="createNewXMLDocumentReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="getConfigPropertiesRequest">
<wsdl:part name="keys" type="impl:ArrayOf_soapenc_string"/>
-
</wsdl:message>
<wsdl:message name="getVersionRequest">
</wsdl:message>
+
<wsdl:message name="setPeerPortResponse">
</wsdl:message>
<wsdl:message name="setTransferPropertiesRequest">
<wsdl:part name="indexDistribution" type="soapenc:boolean"/>
<wsdl:part name="indexDistributeWhileCrawling" type="soapenc:boolean"/>
<wsdl:part name="indexReceive" type="soapenc:boolean"/>
-
<wsdl:part name="indexReceiveBlockBlacklist" type="soapenc:boolean"/>
</wsdl:message>
<wsdl:message name="getConfigPropertyListResponse">
+
<wsdl:part name="getConfigPropertyListReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="setPeerPortRequest">
<wsdl:part name="newPort" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="getTransferPropertiesResponse">
-
<wsdl:part name="getTransferPropertiesReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="getConfigPropertyResponse">
+
<wsdl:part name="getConfigPropertyReturn" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="setPropertiesRequest">
<wsdl:part name="keys" type="impl:ArrayOf_soapenc_string"/>
<wsdl:part name="values" type="impl:ArrayOf_soapenc_string"/>
</wsdl:message>
-
<wsdl:message name="setRemoteProxyRequest">
<wsdl:part name="enableRemoteProxy" type="soapenc:boolean"/>
<wsdl:part name="proxyHost" type="soapenc:string"/>
+
<wsdl:part name="proxyPort" type="soapenc:int"/>
<wsdl:part name="proxyUserName" type="soapenc:string"/>
<wsdl:part name="proxyPwd" type="soapenc:string"/>
<wsdl:part name="noProxyList" type="soapenc:string"/>
<wsdl:part name="useProxy4YaCy" type="soapenc:boolean"/>
<wsdl:part name="useProxy4SSL" type="soapenc:boolean"/>
-
</wsdl:message>
<wsdl:message name="setConfigPropertyResponse">
</wsdl:message>
+
+ <wsdl:message name="setDistributedCrawlingRequest">
+ <wsdl:part name="enableRemoteTriggeredCrawls" type="soapenc:boolean"/>
+ <wsdl:part name="maximumAllowedPPM" type="soapenc:int"/>
+ </wsdl:message>
<wsdl:message name="getVersionResponse">
<wsdl:part name="getVersionReturn" type="apachesoap:Document"/>
</wsdl:message>
<wsdl:message name="setPropertiesResponse">
</wsdl:message>
- <wsdl:message name="setPeerNameResponse">
+ <wsdl:message name="setPeerNameResponse">
</wsdl:message>
<wsdl:message name="setConfigPropertyRequest">
<wsdl:part name="key" type="soapenc:string"/>
<wsdl:part name="value" type="soapenc:string"/>
</wsdl:message>
+ <wsdl:message name="setDistributedCrawlingResponse">
+ </wsdl:message>
<wsdl:message name="shutdownPeerRequest">
+
</wsdl:message>
<wsdl:portType name="AdminService">
<wsdl:operation name="setProperties" parameterOrder="keys values">
-
<wsdl:input message="impl:setPropertiesRequest" name="setPropertiesRequest"/>
<wsdl:output message="impl:setPropertiesResponse" name="setPropertiesResponse"/>
</wsdl:operation>
<wsdl:operation name="getVersion">
<wsdl:input message="impl:getVersionRequest" name="getVersionRequest"/>
<wsdl:output message="impl:getVersionResponse" name="getVersionResponse"/>
+
</wsdl:operation>
<wsdl:operation name="setConfigProperty" parameterOrder="key value">
<wsdl:input message="impl:setConfigPropertyRequest" name="setConfigPropertyRequest"/>
-
<wsdl:output message="impl:setConfigPropertyResponse" name="setConfigPropertyResponse"/>
</wsdl:operation>
<wsdl:operation name="getConfigProperty" parameterOrder="key">
<wsdl:input message="impl:getConfigPropertyRequest" name="getConfigPropertyRequest"/>
<wsdl:output message="impl:getConfigPropertyResponse" name="getConfigPropertyResponse"/>
</wsdl:operation>
+
<wsdl:operation name="getConfigProperties" parameterOrder="keys">
<wsdl:input message="impl:getConfigPropertiesRequest" name="getConfigPropertiesRequest"/>
<wsdl:output message="impl:getConfigPropertiesResponse" name="getConfigPropertiesResponse"/>
-
</wsdl:operation>
<wsdl:operation name="getConfigPropertyList">
<wsdl:input message="impl:getConfigPropertyListRequest" name="getConfigPropertyListRequest"/>
<wsdl:output message="impl:getConfigPropertyListResponse" name="getConfigPropertyListResponse"/>
</wsdl:operation>
<wsdl:operation name="setPeerName" parameterOrder="newName">
+
<wsdl:input message="impl:setPeerNameRequest" name="setPeerNameRequest"/>
<wsdl:output message="impl:setPeerNameResponse" name="setPeerNameResponse"/>
</wsdl:operation>
-
<wsdl:operation name="setPeerPort" parameterOrder="newPort">
<wsdl:input message="impl:setPeerPortRequest" name="setPeerPortRequest"/>
<wsdl:output message="impl:setPeerPortResponse" name="setPeerPortResponse"/>
</wsdl:operation>
<wsdl:operation name="enableRemoteProxy" parameterOrder="enableProxy">
<wsdl:input message="impl:enableRemoteProxyRequest" name="enableRemoteProxyRequest"/>
+
<wsdl:output message="impl:enableRemoteProxyResponse" name="enableRemoteProxyResponse"/>
</wsdl:operation>
<wsdl:operation name="setRemoteProxy" parameterOrder="enableRemoteProxy proxyHost proxyPort proxyUserName proxyPwd noProxyList useProxy4YaCy useProxy4SSL">
-
<wsdl:input message="impl:setRemoteProxyRequest" name="setRemoteProxyRequest"/>
<wsdl:output message="impl:setRemoteProxyResponse" name="setRemoteProxyResponse"/>
</wsdl:operation>
<wsdl:operation name="shutdownPeer">
<wsdl:input message="impl:shutdownPeerRequest" name="shutdownPeerRequest"/>
<wsdl:output message="impl:shutdownPeerResponse" name="shutdownPeerResponse"/>
+
+ </wsdl:operation>
+ <wsdl:operation name="setDistributedCrawling" parameterOrder="enableRemoteTriggeredCrawls maximumAllowedPPM">
+ <wsdl:input message="impl:setDistributedCrawlingRequest" name="setDistributedCrawlingRequest"/>
+ <wsdl:output message="impl:setDistributedCrawlingResponse" name="setDistributedCrawlingResponse"/>
</wsdl:operation>
<wsdl:operation name="setTransferProperties" parameterOrder="indexDistribution indexDistributeWhileCrawling indexReceive indexReceiveBlockBlacklist">
<wsdl:input message="impl:setTransferPropertiesRequest" name="setTransferPropertiesRequest"/>
-
<wsdl:output message="impl:setTransferPropertiesResponse" name="setTransferPropertiesResponse"/>
</wsdl:operation>
+
<wsdl:operation name="getTransferProperties">
<wsdl:input message="impl:getTransferPropertiesRequest" name="getTransferPropertiesRequest"/>
<wsdl:output message="impl:getTransferPropertiesResponse" name="getTransferPropertiesResponse"/>
</wsdl:operation>
+ <wsdl:operation name="createNewXMLDocument" parameterOrder="rootElementName">
+ <wsdl:input message="impl:createNewXMLDocumentRequest" name="createNewXMLDocumentRequest"/>
+ <wsdl:output message="impl:createNewXMLDocumentResponse" name="createNewXMLDocumentResponse"/>
+ </wsdl:operation>
</wsdl:portType>
+
<wsdl:binding name="adminSoapBinding" type="impl:AdminService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-
<wsdl:operation name="setProperties">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="setPropertiesRequest">
@@ -157,9 +179,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="setPropertiesResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="getVersion">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getVersionRequest">
@@ -167,9 +189,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="getVersionResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="setConfigProperty">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="setConfigPropertyRequest">
@@ -177,9 +199,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="setConfigPropertyResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="getConfigProperty">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getConfigPropertyRequest">
@@ -187,9 +209,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="getConfigPropertyResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="getConfigProperties">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getConfigPropertiesRequest">
@@ -197,9 +219,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="getConfigPropertiesResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="getConfigPropertyList">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getConfigPropertyListRequest">
@@ -207,9 +229,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="getConfigPropertyListResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="setPeerName">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="setPeerNameRequest">
@@ -217,9 +239,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="setPeerNameResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="setPeerPort">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="setPeerPortRequest">
@@ -227,9 +249,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="setPeerPortResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="enableRemoteProxy">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="enableRemoteProxyRequest">
@@ -237,9 +259,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="enableRemoteProxyResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="setRemoteProxy">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="setRemoteProxyRequest">
@@ -247,9 +269,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="setRemoteProxyResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="shutdownPeer">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="shutdownPeerRequest">
@@ -257,9 +279,19 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="shutdownPeerResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="setDistributedCrawling">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="setDistributedCrawlingRequest">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="setDistributedCrawlingResponse">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
<wsdl:operation name="setTransferProperties">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="setTransferPropertiesRequest">
@@ -267,9 +299,9 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="setTransferPropertiesResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
-
<wsdl:operation name="getTransferProperties">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getTransferPropertiesRequest">
@@ -277,9 +309,19 @@ Built on Nov 16, 2004 (12:19:44 EST)--><wsdl:types><schema targetNamespace="http
</wsdl:input>
<wsdl:output name="getTransferPropertiesResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="createNewXMLDocument">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="createNewXMLDocumentRequest">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.anomic.de" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="createNewXMLDocumentResponse">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/admin" use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
</wsdl:binding>
<wsdl:service name="AdminServiceService">
<wsdl:port binding="impl:adminSoapBinding" name="admin">
diff --git a/source/de/anomic/soap/services/status.wsdl b/source/de/anomic/soap/services/status.wsdl
index a9337dc56..29f1ed443 100644
--- a/source/de/anomic/soap/services/status.wsdl
+++ b/source/de/anomic/soap/services/status.wsdl
@@ -1,8 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://yacy:8080/soap/status" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://yacy:8080/soap/status" xmlns:intf="http://yacy:8080/soap/status" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><!--WSDL created by Apache Axis version: 1.2RC2
Built on Nov 16, 2004 (12:19:44 EST)-->
+ <wsdl:message name="getQueueStatusResponse">
+ <wsdl:part name="getQueueStatusReturn" type="apachesoap:Document"/>
+ </wsdl:message>
+ <wsdl:message name="createNewXMLDocumentResponse">
+ <wsdl:part name="createNewXMLDocumentReturn" type="apachesoap:Document"/>
+ </wsdl:message>
+ <wsdl:message name="createNewXMLDocumentRequest">
+ <wsdl:part name="rootElementName" type="soapenc:string"/>
+
+ </wsdl:message>
+ <wsdl:message name="getQueueStatusRequest">
+ <wsdl:part name="localqueueCount" type="soapenc:int"/>
+ <wsdl:part name="loaderqueueCount" type="soapenc:int"/>
+ <wsdl:part name="localcrawlerqueueCount" type="soapenc:int"/>
+ <wsdl:part name="remotecrawlerqueueCount" type="soapenc:int"/>
+ </wsdl:message>
<wsdl:message name="networkResponse">
<wsdl:part name="networkReturn" type="apachesoap:Document"/>
+
</wsdl:message>
<wsdl:message name="networkRequest">
</wsdl:message>
@@ -11,8 +28,18 @@ Built on Nov 16, 2004 (12:19:44 EST)-->
<wsdl:input message="impl:networkRequest" name="networkRequest"/>
<wsdl:output message="impl:networkResponse" name="networkResponse"/>
</wsdl:operation>
+ <wsdl:operation name="getQueueStatus" parameterOrder="localqueueCount loaderqueueCount localcrawlerqueueCount remotecrawlerqueueCount">
+
+ <wsdl:input message="impl:getQueueStatusRequest" name="getQueueStatusRequest"/>
+ <wsdl:output message="impl:getQueueStatusResponse" name="getQueueStatusResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="createNewXMLDocument" parameterOrder="rootElementName">
+ <wsdl:input message="impl:createNewXMLDocumentRequest" name="createNewXMLDocumentRequest"/>
+ <wsdl:output message="impl:createNewXMLDocumentResponse" name="createNewXMLDocumentResponse"/>
+ </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="statusSoapBinding" type="impl:StatusService">
+
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="network">
<wsdlsoap:operation soapAction=""/>
@@ -22,6 +49,27 @@ Built on Nov 16, 2004 (12:19:44 EST)-->
<wsdl:output name="networkResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/status" use="encoded"/>
</wsdl:output>
+
+ </wsdl:operation>
+ <wsdl:operation name="getQueueStatus">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="getQueueStatusRequest">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.soap.anomic.de" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="getQueueStatusResponse">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/status" use="encoded"/>
+ </wsdl:output>
+
+ </wsdl:operation>
+ <wsdl:operation name="createNewXMLDocument">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="createNewXMLDocumentRequest">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.anomic.de" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="createNewXMLDocumentResponse">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://yacy:8080/soap/status" use="encoded"/>
+ </wsdl:output>
+
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="StatusServiceService">
diff --git a/test/de/anomic/soap/services/StatusServiceTest.java b/test/de/anomic/soap/services/StatusServiceTest.java
new file mode 100644
index 000000000..2b78399fe
--- /dev/null
+++ b/test/de/anomic/soap/services/StatusServiceTest.java
@@ -0,0 +1,70 @@
+package de.anomic.soap.services;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.rmi.RemoteException;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.apache.axis.client.Stub;
+import org.apache.axis.utils.XMLUtils;
+import org.w3c.dom.Document;
+
+import yacy.soap.status.StatusService;
+import yacy.soap.status.StatusServiceServiceLocator;
+
+public class StatusServiceTest extends TestCase {
+ private static String authString;
+ private static String peerPort;
+ private static StatusService service;
+
+
+ protected void setUp() throws Exception {
+ if (peerPort == null) this.loadConfigProperties();
+ super.setUp();
+ }
+
+ private void loadConfigProperties() throws Exception {
+ BufferedInputStream fileInput = null;
+ try {
+ File configFile = new File("DATA/SETTINGS/httpProxy.conf");
+ System.out.println("Reading config file: " + configFile.getAbsoluteFile().toString());
+ fileInput = new BufferedInputStream(new FileInputStream(configFile));
+
+ // load property list
+ Properties peerProperties = new Properties();
+ peerProperties.load(fileInput);
+ fileInput.close();
+
+ // getting admin account auth string
+ authString = peerProperties.getProperty("adminAccountBase64MD5");
+ if (authString == null) throw new Exception("Unable to find authentication information.");
+
+ peerPort = peerProperties.getProperty("port");
+ if (authString == null) throw new Exception("Unable to find peer port information.");
+
+ // construct Soap object
+ StatusServiceServiceLocator locator = new StatusServiceServiceLocator();
+ locator.setstatusEndpointAddress("http://localhost:" + peerPort + "/soap/status");
+
+ service = locator.getstatus();
+ ((Stub)service).setHeader("http://http.anomic.de/header","Authorization",authString);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (fileInput != null) try { fileInput.close(); } catch (Exception e){/* ignore this */}
+ }
+ }
+
+ public void testNetwork() throws RemoteException {
+ Document xml = service.network();
+ System.out.println(XMLUtils.DocumentToString(xml));
+ }
+
+ public void testGetQueueStatus() throws RemoteException {
+ Document xml = service.getQueueStatus(null,null,null,null);
+ System.out.println(XMLUtils.DocumentToString(xml));
+ }
+}