Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6096 - in trunk/psBase3/perfsonar-base-annotations/src: . main main/java main/java/net main/java/net/geant main/java/net/geant/perfsonar main/java/net/geant/perfsonar/annotations main/java/net/geant/perfsonar/annotations/selftest

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r6096 - in trunk/psBase3/perfsonar-base-annotations/src: . main main/java main/java/net main/java/net/geant main/java/net/geant/perfsonar main/java/net/geant/perfsonar/annotations main/java/net/geant/perfsonar/annotations/selftest


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6096 - in trunk/psBase3/perfsonar-base-annotations/src: . main main/java main/java/net main/java/net/geant main/java/net/geant/perfsonar main/java/net/geant/perfsonar/annotations main/java/net/geant/perfsonar/annotations/selftest
  • Date: Wed, 9 Jan 2013 23:20:01 +0000 (GMT)

Author: psnc.pietrzak
Date: 2013-01-09 23:20:01 +0000 (Wed, 09 Jan 2013)
New Revision: 6096

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/
trunk/psBase3/perfsonar-base-annotations/src/main/java/
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/MetadataKey.java

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/Namespace.java

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/Request.java

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/SetupData.java

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/XPath.java

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/package-info.java

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/SelfTest.java

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/SelfTestData.java

trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/package-info.java
Log:
Moved perfSONAR Base3 related projects.

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/MetadataKey.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/MetadataKey.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/MetadataKey.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,17 @@
+package net.geant.perfsonar.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a method that processes MetadataKey requests.
+ *
+ * @author <a
href="mailto:">Blazej
Pietrzak</a>
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.SOURCE)
+public @interface MetadataKey {
+
+}

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/Namespace.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/Namespace.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/Namespace.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,18 @@
+package net.geant.perfsonar.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Namespace with prefix and url provided as a value.
+ *
+ * @author <a
href="mailto:">Blazej
Pietrzak</a>
+ */
+@Target({ElementType.FIELD,
ElementType.TYPE})
+@Retention(RetentionPolicy.SOURCE)
+public @interface Namespace {
+ String prefix() default "";
+ String value();
+}

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/Request.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/Request.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/Request.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,38 @@
+package net.geant.perfsonar.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Object model is deserialized from the xml stream with the help of request
+ * annotations. Request annotations are applied to types and fields. In this
+ * annotation one provides the XPath expression to the field or class
instance
+ * together with required namespaces.
+ *
+ * In the following example object of the class Person is deserialized from
the
+ * stream when it is a MetadataKey request. Please note that the XPath
+ * expression within the class does not contain the whole path but is
relative.
+ *
+ * <code><br/>
+ *
{@literal
+ *
%Request(xpath=%XPath("/message/[%type='MetadataKeyRequest']/metadata",<br/>
+ *
namespaces=%Namespace("http://ggf.org/ns/nmwg/base/2.0/";)))<br/>
+ * public class Person {<br/>
+ * %Request(xpath=%XPath("/eventType"))<br/>
+ * private String name;<br/>
+ * ...<br/>
+ * } }<br/>
+ * </code>
+ *
+ * @author <a
href="mailto:">Blazej
Pietrzak</a>
+ *
+ */
+@Target({
ElementType.FIELD, ElementType.TYPE })
+@Retention(RetentionPolicy.SOURCE)
+public @interface Request {
+ XPath xpath();
+
+ Namespace[] namespaces();
+}

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/SetupData.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/SetupData.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/SetupData.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,18 @@
+package net.geant.perfsonar.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * Annotates a method that processes SetupData requests.
+ *
+ * @author <a
href="">Blazej
Pietrzak</a>
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.SOURCE)
+public @interface SetupData {
+
+}

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/XPath.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/XPath.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/XPath.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,18 @@
+package net.geant.perfsonar.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Describes the simplified XPath expression.
+ *
+ * @author <a
href="mailto:">Blazej
Pietrzak</a>
+ *
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.SOURCE)
+public @interface XPath {
+ String value();
+}

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/package-info.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/package-info.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/package-info.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,5 @@
+/**
+ * This package contains annotations used for deserialization
+ * of the object model and for MetadataKey, SetupData messages.
+ */
+package net.geant.perfsonar.annotations;
\ No newline at end of file

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/SelfTest.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/SelfTest.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/SelfTest.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,68 @@
+package net.geant.perfsonar.annotations.selftest;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates methods that process Self Test requests.
+ * Self test is described with the unique name, success message, and failure
message.
+ * Success message is used in the response when the test passed, while
failure is
+ * used for latter case. Name and success message are explictly declared as
annotation
+ * properties, while the failure message is taken from the exception's
message.
+ *
+ * For instance a method that checks whether database is running could look
like
+ * the following snippet:
+ * <code>
+ * %SelfTest(name="database", successMessage = "Database is present.")<br/>
+ * public List<Dictionary> listDictionaries() {<br/>
+ * return Dictionary.listDictionaries(factory);<br/>
+ * }<br/>
+ * </code>
+ *
+ * The database test is identified with the unique name "database". When it
passes
+ * "Database is present" message is provided in the response. When it fails
+ * exception's message will be returned in the response.
+ *
+ * Self test methods may be optionally parameterized. It is necessary
+ * when the number of tests depends on dynamic behavior of the system e.g.
+ * the result of the query, or service configuration.
+ * Parameterized self-tests are methods with argument as a parameter.
+ * There must be self-test-data method present that provides parameter
values.
+ * It must be of type java.util.List<T>, where T is the type of the argument.
+ *
+ * perfSONAR base provides two builtin properties:
+ * ${index} - unique identifier of the self-test run (integer from 0..*)
+ * ${arg} - argument of the parameterized self-test
+ *
+ * The following example shows the parameterized self test.
+ * There is a parameter of Dictionary type as the test parameter.
+ * <code><br/>
+ * %SelfTest(</br>
+ * name="translation${index}",<br/>
+ * successMessage = "${arg} dictionary works correctly.")<br/>
+ * public void checkTranslation(Dictionary dictionary) throws Exception
{<br/>
+ * if (!dictionary.translate(word,
factory).equals(translated))<br/>
+ * throw new Exception("Invalid translation.");<br/>
+ * }<br/>
+ * <br/>
+ * %SelfTestData<br/>
+ * public List<Dictionary> listDictionaries() {<br/>
+ * return Dictionary.listDictionaries(factory);<br/>
+ * }<br/>
+ * </code>
+ *
+ * The method listDictionaries provides test data for checkTranslation
method.
+ * checkTranslation method accepts the arguments of type Dictionary, so
listDictionaries
+ * must return the type java.util.List<Dictionary>.
+ *
+ * @author <a
href="mailto:">Blazej
Pietrzak</a>
+ *
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.SOURCE)
+public @interface SelfTest {
+ String name();
+ String successMessage();
+}

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/SelfTestData.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/SelfTestData.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/SelfTestData.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,24 @@
+package net.geant.perfsonar.annotations.selftest;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotated a method as a self test data provider.
+ *
+ * Self test methods may be optionally parameterized. It is necessary
+ * when the number of tests depends on dynamic behavior of the system e.g.
+ * the result of the query, or service configuration.
+ * Parameterized self-tests are methods with argument as a parameter.
+ * There must be self-test-data method present that provides parameter
values.
+ * It must be of type java.util.List<T>, where T is the type of the self
test argument.
+ *
+ * @author <a
href="mailto:">Blazej
Pietrzak</a>
+ *
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.SOURCE)
+public @interface SelfTestData {
+}

Added:
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/package-info.java
===================================================================
---
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/package-info.java
(rev 0)
+++
trunk/psBase3/perfsonar-base-annotations/src/main/java/net/geant/perfsonar/annotations/selftest/package-info.java
2013-01-09 23:20:01 UTC (rev 6096)
@@ -0,0 +1,4 @@
+/**
+ * This package contains annotations used for selftest messaging
functionality.
+ */
+package net.geant.perfsonar.annotations.selftest;
\ No newline at end of file



  • [pS-dev] [GEANT/SA2/ps-java-services] r6096 - in trunk/psBase3/perfsonar-base-annotations/src: . main main/java main/java/net main/java/net/geant main/java/net/geant/perfsonar main/java/net/geant/perfsonar/annotations main/java/net/geant/perfsonar/annotations/selftest, svn-noreply, 01/09/2013

Archive powered by MHonArc 2.6.16.

Top of Page