Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5322 - in branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage: . exist

Subject: perfsonar development work

List archive

perfsonar: r5322 - in branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage: . exist


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5322 - in branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage: . exist
  • Date: Thu, 22 Oct 2009 07:08:20 -0400

Author: trzaszcz
Date: 2009-10-22 07:08:20 -0400 (Thu, 22 Oct 2009)
New Revision: 5322

Modified:

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAO.java

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
Log:
refactorization

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAO.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAO.java
2009-10-22 10:03:14 UTC (rev 5321)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAO.java
2009-10-22 11:08:20 UTC (rev 5322)
@@ -75,23 +75,6 @@
public void setControlParameter(String metadataId, String parameter,
String value) throws PerfSONARException;

/**
- * Returns control parameter from LSStore-control
- * @param metadataId
- * @param parameter
- * @return parameter value as String. If not present, null value will be
returned.
- * @throws PerfSONARException
- */
- public String getControlParameter(String metadataId, String parameter)
throws PerfSONARException;
-
- /**
- * Removes control parameter from LSStore-control
- * @param metadataId
- * @param parameter
- * @throws PerfSONARException
- */
- public void removeControlParameter(String metadataId, String
parameter) throws PerfSONARException;
-
- /**
* Perform XQuery operation
* @param xquery
* @return

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
2009-10-22 10:03:14 UTC (rev 5321)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
2009-10-22 11:08:20 UTC (rev 5322)
@@ -42,6 +42,7 @@

// --------------------------------------------------------- Public
methods

+ @Override
public void putLookupInfo(Metadata m, Data[] d) throws
PerfSONARException {

if (m == null) {
@@ -103,7 +104,7 @@
getDataStorage().performXQuery(query, getDataCollection(),
getDataCredential());
}
-
+ @Override
public int removeLookupInfo(String metadataId) throws
PerfSONARException {

String xquery = XQUERY_DECLARE_NAMESPACES + UPDATE_FOR
@@ -119,7 +120,7 @@
return -1; // if error

}
-
+ @Override
public int cleanupLookupInfo(long timestamp, long defaultInterval)
throws PerfSONARException {

@@ -163,7 +164,8 @@

return res.getTextResults().length;
}
-
+
+ @Override
public void setControlParameter(String metadataId, String parameter,
String value) throws PerfSONARException {

@@ -211,45 +213,7 @@
getDataCredential());

} // set parameter
-
- public void removeControlParameter(String metadataId, String
parameter)
- throws PerfSONARException {
- String xquery = DECLARE_NMWG_NAMESPACE
- +
-
- "let $paramName := '"
- + parameter
- + "'\n"
- + "let $metadataId := '"
- + metadataId
- + "'\n"
- +
-
- "let $metadata :=
/nmwg:store[@type='"
- + LS_STORE_CONTROL_COLLECTION_TYPE
- +
"']/nmwg:metadata[@id=$metadataId]\n"
- + "let $parameters := \n"
- + " $metadata/nmwg:parameters\n"
- + "let $parameter := \n"
- + "
$parameters/nmwg:parameter[@name=$paramName]\n"
- +
-
- "let $o := \n"
- + " if (count($parameter) > 0) \n"
- + " then if ((count($parameters/child::*)
- count($parameter)) = 0)\n"
- + " then if
(count($metadata/child::*) = 1) \n"
- + " then $metadata\n"
- + " else $parameters\n"
- + " else $parameter\n" + " else
()\n" +
-
- "for $i in $o return update delete $i\n";
-
- // remove
- getDataStorage().performXQuery(xquery, getDataCollection(),
- getDataCredential());
-
- }
-
+
protected String getRemoveLookupInfoXQueryPart(String metadataId) {
return
// a set of ()



  • perfsonar: r5322 - in branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage: . exist, svnlog, 10/22/2009

Archive powered by MHonArc 2.6.16.

Top of Page