[SAGA-RG] saga-ogf SVN commit 1285: /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/

ceriel at cs.vu.nl ceriel at cs.vu.nl
Wed Sep 22 10:28:28 CDT 2010


User: svn_ceriel
Date: 2010/09/22 10:28 AM

Modified:
 /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/error/
  package.html
 /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/namespace/
  NSDirectory.java, NSEntry.java, NSFactory.java
 /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/session/
  Session.java, SessionFactory.java
 /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/task/
  TaskContainer.java

Log:
 A couple of modifications to make the Java language bindings more conforming
 to the latest Saga specs:
 - fixed signature of task_container.remove() (does not return anything now);
 - various namespaces constructors now take READ as default flag;
 - added the various versions of get_mtime();
 - fixed signature of session constructors: no longer throws NotImplemented.

File Changes:

Directory: /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/error/
============================================================================================

File [modified]: package.html
Delta lines: +6 -0
===================================================================
--- trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/error/package.html	2010-09-01 15:06:46 UTC (rev 1284)
+++ trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/error/package.html	2010-09-22 15:28:13 UTC (rev 1285)
@@ -52,6 +52,12 @@
 </p>
 
 <p>
+The IncorrectType exception as described in the language-independent
+SAGA specification does not exist in the Java Language Bindings for SAGA,
+as Java has a ClassCastException for that purpose.
+</p>
+
+<p>
 A simple mechanism exists for storing and examining exceptions that may be thrown
 by adaptors in adaptor-based Saga implementations. In such implementations, the
 top-level exception (the one highest up in the Saga exception hierarchy) is not

Directory: /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/namespace/
================================================================================================

File [modified]: NSDirectory.java
Delta lines: +64 -0
===================================================================
--- trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/namespace/NSDirectory.java	2010-09-01 15:06:46 UTC (rev 1284)
+++ trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/namespace/NSDirectory.java	2010-09-22 15:28:13 UTC (rev 1285)
@@ -392,6 +392,54 @@
             NoSuccessException;
 
     /**
+     * Returns the time of the last modification in seconds since epoch
+     * (01.01.1970) of the specified name.
+     * 
+     * @param name
+     *      the name of which the last modification time must be returned.
+     * @return
+     *      the last modification time.
+     * @exception NotImplementedException
+     *      is thrown if the implementation does not provide an
+     *      implementation of this method.
+     * @exception PermissionDeniedException
+     *      is thrown when the method failed because the identity used did
+     *      not have sufficient permissions to perform the operation
+     *      successfully.
+     * @exception AuthorizationFailedException
+     *      is thrown when none of the available contexts of the
+     *      used session could be used for successful authorization.
+     *      This error indicates that the resource could not be accessed
+     *      at all, and not that an operation was not available due to
+     *      restricted permissions.
+     * @exception AuthenticationFailedException
+     *      is thrown when operation failed because none of the available
+     *      session contexts could successfully be used for authentication.
+     * @exception TimeoutException
+     *      is thrown when a remote operation did not complete successfully
+     *      because the network communication or the remote service timed
+     *      out.
+     * @exception BadParameterException
+     *      is thrown when the specified URL contains an invalid entry name.
+     * @exception IncorrectStateException
+     *      is thrown when the NSDirectory is already closed.
+     * @exception IncorrectURLException
+     *      is thrown when an implementation cannot handle the specified
+     *      protocol, or that access to the specified entity via the
+     *      given protocol is impossible.
+     * @exception DoesNotExistException
+     *      is thrown if the specified name does not exist.
+     * @exception NoSuccessException
+     *      is thrown when the operation was not successfully performed,
+     *      and none of the other exceptions apply.
+     */
+    public long getMTime(URL name) throws NotImplementedException,
+            IncorrectURLException, DoesNotExistException, AuthenticationFailedException,
+            AuthorizationFailedException, PermissionDeniedException,
+            BadParameterException, IncorrectStateException, TimeoutException,
+            NoSuccessException;
+ 
+    /**
      * Tests the name for being a directory.
      * 
      * @param name
@@ -2367,6 +2415,22 @@
      */
     public Task<NSDirectory, Boolean> isLink(TaskMode mode, URL name)
             throws NotImplementedException;
+    
+    /**
+     * Creates a task that determines the last modification time of
+     * the specified name.
+     * 
+     * @param mode
+     *            the task mode.
+     * @param name
+     *            of which the last modification time must be determined.
+     * @return the task.
+     * @exception NotImplementedException
+     *                is thrown when the task version of this method is not
+     *                implemented.
+     */
+    public Task<NSDirectory, Long> getMTime(TaskMode mode, URL name)
+            throws NotImplementedException;
 
     /**
      * Creates a task that returns the URL representing the link target.

File [modified]: NSEntry.java
Delta lines: +50 -0
===================================================================
--- trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/namespace/NSEntry.java	2010-09-01 15:06:46 UTC (rev 1284)
+++ trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/namespace/NSEntry.java	2010-09-22 15:28:13 UTC (rev 1285)
@@ -234,6 +234,43 @@
             TimeoutException, NoSuccessException;
 
     /**
+     * Returns the time of the last modification in seconds since epoch
+     * (01.01.1970).
+     * 
+     * @return
+     *      the last modification time.
+     * @exception NotImplementedException
+     *      is thrown if the implementation does not provide an
+     *      implementation of this method.
+     * @exception PermissionDeniedException
+     *      is thrown when the method failed because the identity used did
+     *      not have sufficient permissions to perform the operation
+     *      successfully.
+     * @exception AuthorizationFailedException
+     *      is thrown when none of the available contexts of the
+     *      used session could be used for successful authorization.
+     *      This error indicates that the resource could not be accessed
+     *      at all, and not that an operation was not available due to
+     *      restricted permissions.
+     * @exception AuthenticationFailedException
+     *      is thrown when operation failed because none of the available
+     *      session contexts could successfully be used for authentication.
+     * @exception TimeoutException
+     *      is thrown when a remote operation did not complete successfully
+     *      because the network communication or the remote service timed
+     *      out.
+     * @exception IncorrectStateException
+     *      is thrown when the NSEntry is already closed.
+     * @exception NoSuccessException
+     *      is thrown when the operation was not successfully performed,
+     *      and none of the other exceptions apply.
+     */
+    public long getMTime() throws NotImplementedException,
+            AuthenticationFailedException, AuthorizationFailedException,
+            PermissionDeniedException, IncorrectStateException,
+            TimeoutException, NoSuccessException;
+
+    /**
      * Copies this entry to another part of the namespace.
      * 
      * @param target
@@ -787,6 +824,19 @@
             throws NotImplementedException;
 
     /**
+     * Creates a task that returns the last modification time of this entry.
+     * 
+     * @param mode
+     *            the task mode.
+     * @return the task.
+     * @exception NotImplementedException
+     *                is thrown when the task version of this method is not
+     *                implemented.
+     */
+    public Task<NSEntry, Long> getMTime(TaskMode mode)
+            throws NotImplementedException;
+
+    /**
      * Creates a task that tests this entry for being a directory.
      * 
      * @param mode

File [modified]: NSFactory.java
Delta lines: +12 -12
===================================================================
--- trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/namespace/NSFactory.java	2010-09-01 15:06:46 UTC (rev 1284)
+++ trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/namespace/NSFactory.java	2010-09-22 15:28:13 UTC (rev 1285)
@@ -218,7 +218,7 @@
             DoesNotExistException, AlreadyExistsException, TimeoutException,
             NoSuccessException {
         initializeFactory();
-        return factory.doCreateNSEntry(session, name, Flags.NONE.getValue());
+        return factory.doCreateNSEntry(session, name, Flags.READ.getValue());
     }
 
     /**
@@ -328,7 +328,7 @@
             NoSuccessException {
         Session session = SessionFactory.createSession();
         initializeFactory();
-        return factory.doCreateNSEntry(session, name, Flags.NONE.getValue());
+        return factory.doCreateNSEntry(session, name, Flags.READ.getValue());
     }
 
     /**
@@ -441,7 +441,7 @@
             NoSuccessException {
         initializeFactory();
         return factory
-                .doCreateNSDirectory(session, name, Flags.NONE.getValue());
+                .doCreateNSDirectory(session, name, Flags.READ.getValue());
     }
 
     /**
@@ -552,7 +552,7 @@
         Session session = SessionFactory.createSession();
         initializeFactory();
         return factory
-                .doCreateNSDirectory(session, name, Flags.NONE.getValue());
+                .doCreateNSDirectory(session, name, Flags.READ.getValue());
     }
 
     /**
@@ -600,8 +600,8 @@
             Session session, URL name) throws NotImplementedException,
             NoSuccessException {
         initializeFactory();
-        return factory.doCreateNSEntry(mode, session, name, Flags.NONE
-                .getValue());
+        return factory.doCreateNSEntry(mode, session, name,
+                Flags.READ.getValue());
     }
 
     /**
@@ -648,8 +648,8 @@
             throws NotImplementedException, NoSuccessException {
         Session session = SessionFactory.createSession();
         initializeFactory();
-        return factory.doCreateNSEntry(mode, session, name, Flags.NONE
-                .getValue());
+        return factory.doCreateNSEntry(mode, session, name,
+                Flags.READ.getValue());
     }
 
     /**
@@ -698,8 +698,8 @@
             Session session, URL name) throws NotImplementedException,
             NoSuccessException {
         initializeFactory();
-        return factory.doCreateNSDirectory(mode, session, name, Flags.NONE
-                .getValue());
+        return factory.doCreateNSDirectory(mode, session, name,
+                Flags.READ.getValue());
     }
 
     /**
@@ -749,7 +749,7 @@
             URL name) throws NotImplementedException, NoSuccessException {
         Session session = SessionFactory.createSession();
         initializeFactory();
-        return factory.doCreateNSDirectory(mode, session, name, Flags.NONE
-                .getValue());
+        return factory.doCreateNSDirectory(mode, session, name,
+                Flags.READ.getValue());
     }
 }

Directory: /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/session/
==============================================================================================

File [modified]: Session.java
Delta lines: +8 -1
===================================================================
--- trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/session/Session.java	2010-09-01 15:06:46 UTC (rev 1284)
+++ trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/session/Session.java	2010-09-22 15:28:13 UTC (rev 1285)
@@ -16,6 +16,12 @@
      * 
      * @param context
      *      the context to be added.
+     * @exception NoSuccessException
+     *      is thrown when the implementation is not able to initialize
+     *      the context, and cannot use the context as-is.
+     * @exception TimeoutException
+     *      is thrown if the context initialization implies a remote operation,
+     *      and that operation times out.
      */
     public void addContext(Context context) throws NoSuccessException, TimeoutException;
 
@@ -32,7 +38,8 @@
 
     /**
      * Retrieves all contexts attached to the session. An empty array is
-     * returned if no context is attached.
+     * returned if no context is attached. The contexts in the returned list
+     * are deep copies of the session's context.
      * 
      * @return
      *      a list of contexts.

File [modified]: SessionFactory.java
Delta lines: +3 -11
===================================================================
--- trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/session/SessionFactory.java	2010-09-01 15:06:46 UTC (rev 1284)
+++ trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/session/SessionFactory.java	2010-09-22 15:28:13 UTC (rev 1285)
@@ -2,7 +2,6 @@
 
 import org.ogf.saga.bootstrap.ImplementationBootstrapLoader;
 import org.ogf.saga.error.NoSuccessException;
-import org.ogf.saga.error.NotImplementedException;
 
 /**
  * Factory for creating sessions.
@@ -27,7 +26,7 @@
      * @return the session.
      */
     protected abstract Session doCreateSession(boolean defaults)
-            throws NotImplementedException, NoSuccessException;
+            throws NoSuccessException;
 
     /**
      * Creates a session.
@@ -38,15 +37,12 @@
      *      reflected in the default session.
      * @return
      *      the session.
-     * @exception NotImplementedException
-     *      is thrown if the implementation does not provide an
-     *      implementation of this method.
      * @exception NoSuccessException
      *      is thrown if the implementation cannot create valid
      *      default values based on the available information.
      */
     public static Session createSession(boolean defaults)
-            throws NotImplementedException, NoSuccessException {
+            throws NoSuccessException {
         initFactory();
         return factory.doCreateSession(defaults);
     }
@@ -57,15 +53,11 @@
      * 
      * @return
      *      the session.
-     * @exception NotImplementedException
-     *      is thrown if the implementation does not provide an
-     *      implementation of this method.
      * @exception NoSuccessException
      *      is thrown if the implementation cannot create valid
      *      default values based on the available information.
      */
-    public static Session createSession() throws NotImplementedException,
-            NoSuccessException {
+    public static Session createSession() throws NoSuccessException {
         return createSession(true);
     }
 }

Directory: /trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/task/
===========================================================================================

File [modified]: TaskContainer.java
Delta lines: +1 -3
===================================================================
--- trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/task/TaskContainer.java	2010-09-01 15:06:46 UTC (rev 1284)
+++ trunk/documents/saga-core-binding-java/implementation/VU/src/org/ogf/saga/task/TaskContainer.java	2010-09-22 15:28:13 UTC (rev 1285)
@@ -53,8 +53,6 @@
      * 
      * @param task
      *      the task to be removed.
-     * @return
-     *      the task.
      * @exception NotImplementedException
      *      is thrown if the implementation does not provide an
      *      implementation of this method.
@@ -68,7 +66,7 @@
      *      is thrown when the operation was not successfully performed,
      *      and none of the other exceptions apply.
      */
-    public Task<?,?> remove(Task<?,?> task) throws NotImplementedException,
+    public void remove(Task<?,?> task) throws NotImplementedException,
             DoesNotExistException, TimeoutException, NoSuccessException;
 
     /**



More information about the saga-rg mailing list