16 Jan, 2015

4 commits

  • The `Entity.isEmpty()` method relied on `InputStream.available()` returning
    something different of `0` (zero) to detect if the entity was empty or not.
    This technic is not reliable enough since the javadoc clearly states that
    this return the number of bytes that can be read **without blocking**, that
    means that the result of this method depends on the network (and to some
    extension to the web container), not entirely on the message.
    
    The idea here is to now check if the wrapped stream is the `EMPTY_STREAM` instance
    to detect if the entity is empty or not.
    This is better than the old solution because we don't rely anymore on an external
    `InputStream` implementation, but that will not detect a user provided stream with
    no data inside. This is why `isEmpty()` has been renamed to `mayContainData()`.
    There is also a new `setEmpty()` method to mark the entity as empty (simply assign
    `EMPTY_STREAM` to the wrapped stram field).
    
    git-svn-id: https://svn.forgerock.org/openig/trunk@833 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    guillaume.sauthier
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@832 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    laurent.vaills
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@831 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    laurent.vaills
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@830 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    laurent.vaills
     

15 Jan, 2015

4 commits


14 Jan, 2015

1 commit


13 Jan, 2015

5 commits


17 Dec, 2014

3 commits

  • Thanks, Guillaume.
    
    git-svn-id: https://svn.forgerock.org/openig/trunk@815 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    mark
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@814 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    mark
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@813 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    mark
     

12 Dec, 2014

1 commit


10 Dec, 2014

1 commit


08 Dec, 2014

1 commit


05 Dec, 2014

7 commits


04 Dec, 2014

3 commits


03 Dec, 2014

3 commits


02 Dec, 2014

7 commits

  • Reviewed onscreen by Jean-Charles.
    
    git-svn-id: https://svn.forgerock.org/openig/trunk@776 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    mark
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@775 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    guillaume.sauthier
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@774 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    guillaume.sauthier
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@773 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    guillaume.sauthier
     
  • `HeapImpl.addDefaultDeclaration()` is now the way to add default object declarations in the heap.
    
    Default declarations are only included if no user-provided overriding declaration is
    found (only works for heap declarations, not for named inline declaration).
    
    git-svn-id: https://svn.forgerock.org/openig/trunk@772 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    guillaume.sauthier
     
  • `ConsoleLogSink` is now rendering each `LogEntry` on 2 lines with a line separator
    between entries, the objective being to improve console log readability. The first line
    is the header line and display the timestamp of the event (in the current system Locale),
    the entry's `LogLevel` and ends with the `Name` (leaf part) of the heap object that is
    the source of the log statement.
    
    ```
    MON DEC 01 20:39:16 CET 2014 (INFO) _Router
    Added route 'oauth2-resources.json' defined in file '/Users/guillaume/tmp/demo/config/routes/oauth2-resources.json'
    ------------------------------
    ```
    
    Notice that a special treatment is done when logging a `Throwable`: a condensed stack
    trace is printed on the console and if (and only if) the `LogSink` has been assigned
    a `DEBUG` or `TRACE` level, the full stack trace is printed (independently of the
    entry's level).
    
    ```
    MON DEC 01 15:28:10 CET 2014 (DEBUG) ResourceServer
    Initial token resolution has failed
    [     OAuth2TokenException] > Initial token resolution has failed
    [     OAuth2TokenException] > Authorization Server returned an error
                                  (error: bad_request, description: Could not read token in CTS)
    
    org.forgerock.openig.filter.oauth2.OAuth2TokenException: Initial token resolution has failed
      at org.forgerock.openig.filter.oauth2.cache.CachingAccessTokenResolver.resolve(CachingAccessTokenResolver.java:62)
    ... 33 more
    ------------------------------
    ```
    
    A new `stream` property has been added to `ConsoleLogSink` to let the user choose
    which PrintStream to use for printing messages:
     * `ERR`: Use System.err (default value, keep compatibility)
     * `OUT`: Use System.out
     * `AUTO`: Select System.out for `TRACE` to `INFO` messages, switching to System.err
       for `WARNING` and `ERROR`.
    
    `FileLogSink` implements a machine parseable `LogEntry` rendering: each entry is on
    one line and includes:
     * timestamp of the event (in the current system Locale), always have the same length
     * the entry's `LogLevel`, always 1 word, uppercase
     * the `Name` (leaf part) of the heap object that is the source of the log statement.
     * a `---` separator that segregates the beginning of the line (log statement's context)
       from the entry's message (the rest of the line)
    
    Notice that in the case of `Throwable` printing, the full stack trace is printed as commented lines.
    
    ```
    MON DEC 01 17:46:21 CET 2014 DEBUG ResourceServer --- Initial token resolution has failed
     # org.forgerock.openig.filter.oauth2.OAuth2TokenException: Initial token resolution has failed
     # 	at org.forgerock.openig.filter.oauth2.cache.CachingAccessTokenResolver.resolve(CachingAccessTokenResolver.java:62)
     # 	at org.forgerock.openig.filter.oauth2.OAuth2ResourceServerFilter.filter(OAuth2ResourceServerFilter.java:205)
     # 	at org.forgerock.openig.decoration.capture.CaptureFilter.filter(CaptureFilter.java:62)
    ```
    
    git-svn-id: https://svn.forgerock.org/openig/trunk@771 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    guillaume.sauthier
     
  • git-svn-id: https://svn.forgerock.org/openig/trunk@770 dbb9e58e-28e6-4ce0-90e8-f11d9605b710
    mark