Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2747 - in branches/new-structure/trunk: geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType perfsonar_base/src/main/java/org/perfsonar/service/base/messages

Subject: perfsonar development work

List archive

perfsonar: r2747 - in branches/new-structure/trunk: geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType perfsonar_base/src/main/java/org/perfsonar/service/base/messages


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2747 - in branches/new-structure/trunk: geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType perfsonar_base/src/main/java/org/perfsonar/service/base/messages
  • Date: Wed, 29 Aug 2007 10:23:59 -0400

Author: mac
Date: 2007-08-29 10:23:59 -0400 (Wed, 29 Aug 2007)
New Revision: 2747

Modified:

branches/new-structure/trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType/LSAction.java

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LSRegisterRequest.java
Log:
small changes
removed temporary debuging information from LSRegisterRequest
and throwing an exception if more than one metadata is to be registered in LS.

Modified:
branches/new-structure/trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType/LSAction.java
===================================================================
---
branches/new-structure/trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType/LSAction.java
2007-08-29 13:41:08 UTC (rev 2746)
+++
branches/new-structure/trunk/geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType/LSAction.java
2007-08-29 14:23:59 UTC (rev 2747)
@@ -80,17 +80,22 @@
* @return Metadata
*/
protected Metadata getMetadataFromRequest(
- Message request) {
+ Message request) throws PerfSONARException {

//Get Metadata

Metadata requestMetadata[] = request.getMetadataArray();
- if(requestMetadata.length > 0){
+
+ if (requestMetadata.length == 0) {
+ return null;
+ } if (requestMetadata.length == 1) {
return requestMetadata[0];
+ } else {
+ throw new PerfSONARException(
+ "error.ls.registration.too_many_metadata",
+ "At this stage Lookup Service doesn't support"+
+ "multiple metadata blocks. Try to merge them to a single
one");
}
- else{
- return null;
- }
}



Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LSRegisterRequest.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LSRegisterRequest.java
2007-08-29 13:41:08 UTC (rev 2746)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/LSRegisterRequest.java
2007-08-29 14:23:59 UTC (rev 2747)
@@ -9,6 +9,7 @@
import java.util.HashMap;
import java.util.Map;
import org.ggf.ns.nmwg.base.v2_0.Data;
+import org.ggf.ns.nmwg.base.v2_0.Element;
import org.ggf.ns.nmwg.base.v2_0.Message;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
import org.omg.CORBA.SystemException;
@@ -39,8 +40,6 @@
public LSRegisterRequest() throws PerfSONARException {

super();
- System.out.println(" -------- NEW ----------");
-
logger.debug("LSRegisterRequest: MessageHandler created");
setType(ActionType.LS_REGISTER);

@@ -65,12 +64,10 @@
dataChains.put(metaref, new Message());
Message m = dataChains.get(metaref);
m.setData(data);
- System.out.println("## data ["+data.getId()+"] ->
["+metaref+"]");
+ //System.out.println("## data ["+data.getId()+"] ->
["+metaref+"]");

}

-
-
//for each data elements set find chaining
for (Map.Entry<String, Message> e : dataChains.entrySet()) {

@@ -82,7 +79,7 @@
//get reference to metadata
String metadataIdRef = e.getKey();

- System.out.println("## metadata chain for
["+metadataIdRef+"]");
+ //System.out.println("## metadata chain for
["+metadataIdRef+"]");

//find metadata chaining
Map<String,Metadata> metadatas = new
HashMap<String,Metadata>();
@@ -99,18 +96,16 @@
//add to result set
messagesList.add(message);

- //temp
- System.out.println(" --
["+message.getMetadataArray().length+"] metadatas");
- System.out.println(" --
["+message.getDataArray().length+"] datas");
- try {
-
System.out.println("--------------------------------------\n"+
- XMLUtils.serializeXML(message)+
- "--------------------------------------\n");
- } catch (PerfSONARException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- //temp
+// System.out.println(" --
["+message.getMetadataArray().length+"] metadatas");
+// System.out.println(" --
["+message.getDataArray().length+"] datas");
+// try {
+//
System.out.println("--------------------------------------\n"+
+// XMLUtils.serializeXML(message)+
+// "--------------------------------------\n");
+// } catch (PerfSONARException e1) {
+// // TODO Auto-generated catch block
+// e1.printStackTrace();
+// }

} catch (NoSuchMetadataException e1) {
logger.error("LSRegisterRequest: no such metadata, cannot
find chain!");
@@ -121,6 +116,6 @@
return messagesList;

}
+

-
}



  • perfsonar: r2747 - in branches/new-structure/trunk: geant2_java-xml-ls/src/main/java/org/perfsonar/service/lookupService/xmlType perfsonar_base/src/main/java/org/perfsonar/service/base/messages, svnlog, 08/29/2007

Archive powered by MHonArc 2.6.16.

Top of Page