[CONF] Apache Camel Shiro Security

2014-03-07 Thread Colm O hEigeartaigh (Confluence)














  


Colm O hEigeartaigh edited the page:
 


Shiro Security   






...



 Wiki Markup




 {div:class=confluenceTableSmall}
|| Name || Default Value || Type || Description ||
| {{iniResourcePath or ini}} | {{none}} | Resource String or Ini Object | A mandatory Resource String for the iniResourcePath or an instance of an Ini object must be passed to the security policy. Resources can be acquired from the file system, classpath, or URLs when prefixed with file:, classpath:, or url: respectively. For e.g classpath:shiro.ini |
| {{passPhrase}} | {{An AES 128 based key}} | byte[] | A passPhrase to decrypt ShiroSecurityToken(s) sent along with Message Exchanges |
| {{alwaysReauthenticate}} | {{true}} | boolean | Setting to ensure re-authentication on every individual request. If set to false, the user is authenticated and locked such than only requests from the same user going forward are authenticated. |
| {{permissionsList}} | {{none}} | ListPermission | A List of permissions required in order for an authenticated user to be authorized to perform further action i.e continue further on the route. If no Permissions list or Roles List (see below) is provided to the ShiroSecurityPolicy object, then authorization is deemed as not required. Note that the default is that authorization is granted if any of the Permission Objects in the list are applicable. |
| {{rolesList}} | {{none}} | ListString | *Camel 2.13:* A List of roles required in order for an authenticated user to be authorized to perform further action i.e continue further on the route. If no roles list or permissions list (see above) is provided to the ShiroSecurityPolicy object, then authorization is deemed as not required. Note that the default is that authorization is granted if any of the roles in the list are applicable. |
| {{cipherService}} | {{AES}} | org.apache.shiro.crypto.CipherService | Shiro ships with AES  Blowfish based CipherServices. You may use one these or pass in your own Cipher implementation |
| {{base64}} | {{false}} | {{boolean}} | *Camel 2.12:* To use base64 encoding for the security token header, which allows transferring the header over [JMS] etc. This option must also be set on {{ShiroSecurityTokenInjector}} as well. |
| {{allPermissionsRequired}} | {{false}} | {{boolean}} | *Camel 2.13:* The default is that authorization is granted if any of the Permission Objects in the permissionsList parameter are applicable. Set this to true to require all of the Permissions to be met. |
| {{allRolesRequired}} | {{false}} | {{boolean}} | *Camel 2.13:* The default is that authorization is granted if any of the roles in the rolesList parameter are applicable. Set this to true to require all of the roles to be met. |
{div} 



Applying Shiro Authentication on a Camel Route
...






 View 

svn commit: r900433 - in /websites/production/camel/content: cache/main.pageCache shiro-security.html

2014-03-07 Thread buildbot
Author: buildbot
Date: Fri Mar  7 11:19:41 2014
New Revision: 900433

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/shiro-security.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/shiro-security.html
==
--- websites/production/camel/content/shiro-security.html (original)
+++ websites/production/camel/content/shiro-security.html Fri Mar  7 11:19:41 
2014
@@ -130,7 +130,7 @@ sec-level1 = zone1:readonly:*
 new ShiroSecurityPolicy(iniResourcePath, passPhrase, true, 
permissionsList);
 ]]/script
 /div/divh3 
id=ShiroSecurity-ShiroSecurityPolicyOptionsShiroSecurityPolicy 
Options/h3div class=confluenceTableSmall
-table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceThp Name /p/thth colspan=1 rowspan=1 
class=confluenceThp Default Value /p/thth colspan=1 rowspan=1 
class=confluenceThp Type /p/thth colspan=1 rowspan=1 
class=confluenceThp Description /p/th/trtrtd colspan=1 
rowspan=1 class=confluenceTdp codeiniResourcePath or ini/code 
/p/tdtd colspan=1 rowspan=1 class=confluenceTdp codenone/code 
/p/tdtd colspan=1 rowspan=1 class=confluenceTdp Resource String 
or Ini Object /p/tdtd colspan=1 rowspan=1 class=confluenceTdp A 
mandatory Resource String for the iniResourcePath or an instance of an Ini 
object must be passed to the security policy. Resources can be acquired from 
the file system, classpath, or URLs when prefixed with file:, classpath:, or 
url: respectively. For e.g classpath:shiro.ini /p/td/trtrtd 
colspan=1 rowspan=1 class=conf
 luenceTdp codepassPhrase/code /p/tdtd colspan=1 rowspan=1 
class=confluenceTdp codeAn AES 128 based key/code /p/tdtd 
colspan=1 rowspan=1 class=confluenceTdp byte[] /p/tdtd 
colspan=1 rowspan=1 class=confluenceTdp A passPhrase to decrypt 
ShiroSecurityToken(s) sent along with Message Exchanges /p/td/trtrtd 
colspan=1 rowspan=1 class=confluenceTdp 
codealwaysReauthenticate/code /p/tdtd colspan=1 rowspan=1 
class=confluenceTdp codetrue/code /p/tdtd colspan=1 rowspan=1 
class=confluenceTdp boolean /p/tdtd colspan=1 rowspan=1 
class=confluenceTdp Setting to ensure re-authentication on every 
individual request. If set to false, the user is authenticated and locked such 
than only requests from the same user going forward are authenticated. 
/p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp 
codepermissionsList/code /p/tdtd colspan=1 rowspan=1 cla
 ss=confluenceTdp codenone/code /p/tdtd colspan=1 rowspan=1 
class=confluenceTdp Listlt;Permissiongt; /p/tdtd colspan=1 
rowspan=1 class=confluenceTdp A List of permissions required in order 
for an authenticated user to be authorized to perform further action i.e 
continue further on the route. If no Permissions list is provided to the 
ShiroSecurityPolicy object, then authorization is deemed as not required. Note 
that the default is that authorization is granted if any of the Permission 
Objects in the list are applicable. /p/td/trtrtd colspan=1 
rowspan=1 class=confluenceTdp codecipherService/code /p/tdtd 
colspan=1 rowspan=1 class=confluenceTdp codeAES/code /p/tdtd 
colspan=1 rowspan=1 class=confluenceTdp 
org.apache.shiro.crypto.CipherService /p/tdtd colspan=1 rowspan=1 
class=confluenceTdp Shiro ships with AES amp; Blowfish based 
CipherServices. You may use one these or pass in your
  own Cipher implementation /p/td/trtrtd colspan=1 rowspan=1 
class=confluenceTdp codebase64/code /p/tdtd colspan=1 
rowspan=1 class=confluenceTdp codefalse/code /p/tdtd 
colspan=1 rowspan=1 class=confluenceTdp codeboolean/code 
/p/tdtd colspan=1 rowspan=1 class=confluenceTdp strongCamel 
2.12:/strong To use base64 encoding for the security token header, which 
allows transferring the header over a shape=rect href=jms.html 
title=JMSJMS/a etc. This option must also be set on 
codeShiroSecurityTokenInjector/code as well. /p/td/trtrtd 
colspan=1 rowspan=1 class=confluenceTdp 
codeallPermissionsRequired/code /p/tdtd colspan=1 rowspan=1 
class=confluenceTdp codefalse/code /p/tdtd colspan=1 
rowspan=1 class=confluenceTdp codeboolean/code /p/tdtd 
colspan=1 rowspan=1 class=confluenceTdp strongCamel 2.13:/strong 
The default is that authoriz
 ation is granted if any of the Permission Objects in the permissionsList 
parameter are applicable. Set this to true to require all of the Permissions to 
be met. /p/td/tr/tbody/table
+table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceThp Name /p/thth colspan=1 rowspan=1 
class=confluenceThp Default Value /p/thth colspan=1 rowspan=1 
class=confluenceThp Type /p/thth colspan=1 rowspan=1 
class=confluenceThp Description /p/th/trtrtd colspan=1 
rowspan=1 class=confluenceTdp codeiniResourcePath or ini/code 

[CONF] Apache Camel Aggregator2

2014-03-07 Thread Confluence














  


Jan Matrne bearbeitete die Seite:
 


Aggregator2   




 Kommentar: code style of example 


...



 Codeblock




 //simply combines Exchange String body values using '+' as a delimiter
class StringAggregationStrategy implements AggregationStrategy {

public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
if (oldExchange == null) {
return newExchange;
}

String oldBody = oldExchange.getIn().getBody(String.class);
String newBody = newExchange.getIn().getBody(String.class);
oldExchange.getIn().setBody(oldBody + + + newBody);
return oldExchange;
}
}

//simply combines Exchange body values into an ArrayListObject
class ArrayListAggregationStrategy implements AggregationStrategy {

public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
		Object newBody = newExchange.getIn().getBody();
		ArrayListObject list = null;
if (oldExchange == null) {
			list = new ArrayListObject();
			list.add(newBody);
			newExchange.getIn().setBody(list);
			return newExchange;
} else {
	list = oldExchange.getIn().getBody(ArrayList.class);
			list.add(newBody);
			return oldExchange;
		}
}
}
 



About completion
When aggregation Exchanges at some point you need to indicate that the aggregated exchanges is complete, so they can be send out of the aggregator. Camel allows you to indicate completion in various ways as follows:
...






 Online anzeigen   Gefllt mir   nderungen anzeigen  
 berwachung des Bereichs beenden   Benachrichtigungen verwalten  


 


 


  Diese Nachricht wurde von Atlassian Confluence 5.0.3, der Kollaborationssoftware fr Teams, gesendet  






[CONF] Apache Camel Aggregator2

2014-03-07 Thread Confluence














  


Jan Matrne bearbeitete die Seite:
 


Aggregator2   




 Kommentar: typo 


...

there must be a public method to use
the method must not be void
the method can be static or non-static
the method must have 2 or more parameters
the parameters is paired so the first 50% is applied to the oldExchnage oldExchange and the reminder 50% is for the newExchange 
.. meaning that there must be an equal number of parameters, eg 2, 4, 6 etc.

...






 Online anzeigen   Gefllt mir   nderungen anzeigen  
 berwachung des Bereichs beenden   Benachrichtigungen verwalten  


 


 


  Diese Nachricht wurde von Atlassian Confluence 5.0.3, der Kollaborationssoftware fr Teams, gesendet  






[CONF] Apache Camel File2

2014-03-07 Thread Henryk Konsek (Confluence)














  


Henryk Konsek edited the page:
 


File2   




 Comment: Added temporary directory example. 


...
Using a single route, it is possible to write a file to any number of subdirectories. If you have a route setup as such:



 Code Block








language
xml


 




   route
from uri=bean:myBean/
to uri=file:/rootDirectory/
  /route
 



...
This allows you to have a single route to write files to multiple destinations.
 Writing file through the temporary directory relative to the final destination 
 Sometime you need to temporarily write the files to some directory relative to the destination directory. Such situation usually happens when some external process with limited filtering capabilities is reading from the directory you are writing to. In the example below files will be written to the /var/myapp/filesInProgress directory and after data transfer is done, they will be atomically moved to the/var/myapp/finalDirectory directory. 



 Code Block








language
java

  

svn commit: r900457 - in /websites/production/camel/content: aggregator2.html cache/main.pageCache file2.html

2014-03-07 Thread buildbot
Author: buildbot
Date: Fri Mar  7 14:19:23 2014
New Revision: 900457

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/aggregator2.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/file2.html

Modified: websites/production/camel/content/aggregator2.html
==
--- websites/production/camel/content/aggregator2.html (original)
+++ websites/production/camel/content/aggregator2.html Fri Mar  7 14:19:23 2014
@@ -110,18 +110,18 @@ class StringAggregationStrategy implemen
 class ArrayListAggregationStrategy implements AggregationStrategy {
 
 public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-   Object newBody = newExchange.getIn().getBody();
-   ArrayListlt;Objectgt; list = null;
+   Object newBody = newExchange.getIn().getBody();
+   ArrayListlt;Objectgt; list = null;
 if (oldExchange == null) {
-   list = new ArrayListlt;Objectgt;();
-   list.add(newBody);
-   newExchange.getIn().setBody(list);
-   return newExchange;
+   list = new ArrayListlt;Objectgt;();
+   list.add(newBody);
+   newExchange.getIn().setBody(list);
+   return newExchange;
 } else {
list = oldExchange.getIn().getBody(ArrayList.class);
-   list.add(newBody);
-   return oldExchange;
-   }
+   list.add(newBody);
+   return oldExchange;
+   }
 }
 }
 ]]/script
@@ -353,7 +353,7 @@ public final class MyListOfNumbersStrate
 pYou can use POJOs as AggregationStrategy with 
the other a shape=rect href=eip.htmlEIP/as that supports aggregation, 
such as a shape=rect href=splitter.htmlSplitter/a, a shape=rect 
href=recipient-list.htmlRecipient List/a, etc./p
 /div
 /div
-pTo use the codeAggregationStrategy/code you had to implement the 
codeorg.apache.camel.processor.aggregate.AggregationStrategy/code 
interface, which means your logic would be tied to the Camel API. From 
strongCamel 2.12/strong onwards you can use a POJO for the logic and let 
Camel adapt to your POJO. To use a POJO a convention must be followed:/pul 
class=alternatelithere must be a public method to use/lilithe method 
must not be void/lilithe method can be static or non-static/lilithe 
method must have 2 or more parameters/lilithe parameters is paired so the 
first 50% is applied to the codeoldExchnage/code and the reminder 50% is 
for the codenewExchange/code/lili.. meaning that there must be an equal 
number of parameters, eg 2, 4, 6 etc./li/ulpThe paired methods is 
expected to be ordered as follows:/pul class=alternatelithe first 
parameter is the message body/lilithe 2nd parameter is a Map of the 
headers/lilithe 3r
 d parameter is a Map of the Exchange properties/li/ulpThis convention is 
best explained with some examples./ppIn the method below, we have only 2 
parameters, so the 1st parameter is the body of the codeoldExchange/code, 
and the 2nd is paired to the body of the codenewExchange/code:/pdiv 
class=code panel pdl style=border-width: 1px;div class=codeContent 
panelContent pdl
+pTo use the codeAggregationStrategy/code you had to implement the 
codeorg.apache.camel.processor.aggregate.AggregationStrategy/code 
interface, which means your logic would be tied to the Camel API. From 
strongCamel 2.12/strong onwards you can use a POJO for the logic and let 
Camel adapt to your POJO. To use a POJO a convention must be followed:/pul 
class=alternatelithere must be a public method to use/lilithe method 
must not be void/lilithe method can be static or non-static/lilithe 
method must have 2 or more parameters/lilithe parameters is paired so the 
first 50% is applied to the codeoldExchange/code and the reminder 50% is 
for the codenewExchange/code/lili.. meaning that there must be an equal 
number of parameters, eg 2, 4, 6 etc./li/ulpThe paired methods is 
expected to be ordered as follows:/pul class=alternatelithe first 
parameter is the message body/lilithe 2nd parameter is a Map of the 
headers/lilithe 3r
 d parameter is a Map of the Exchange properties/li/ulpThis convention is 
best explained with some examples./ppIn the method below, we have only 2 
parameters, so the 1st parameter is the body of the codeoldExchange/code, 
and the 2nd is paired to the body of the codenewExchange/code:/pdiv 
class=code panel pdl style=border-width: 1px;div class=codeContent 
panelContent pdl
 script class=theme: Default; brush: java; gutter: false 
type=syntaxhighlighter![CDATA[public String append(String existing, String 
next) {
   return existing + next;
 }

Modified: websites/production/camel/content/cache/main.pageCache

[CONF] Apache Camel Camel 2.9.1 Release

2014-03-07 Thread Christian Mueller (Confluence)














  


Christian Mueller edited the page:
 


Camel 2.9.1 Release   






...




 Description 
 Download Link 
 PGP Signature file of download 


 Windows Distribution 
  apache-camel-2.9.1.zip  
  apache-camel-2.9.1.zip.asc  


 Unix/Linux/Cygwin Distribution 
  apache-camel-2.9.1.tar.gz  
  apache-camel-2.9.1.tar.gz.asc  







 Info








title
The above URLs use redirection


 




 The above URLs use the Apache Mirror system to redirect you to a suitable mirror for your download. Some users have experienced issues with some versions of browsers (e.g. some Safari browsers). If the download doesn't seem to work for you from the above URL then try using FireFox  



...




 

svn commit: r900462 - in /websites/production/camel/content: cache/main.pageCache camel-291-release.html

2014-03-07 Thread buildbot
Author: buildbot
Date: Fri Mar  7 15:19:30 2014
New Revision: 900462

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/camel-291-release.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/camel-291-release.html
==
--- websites/production/camel/content/camel-291-release.html (original)
+++ websites/production/camel/content/camel-291-release.html Fri Mar  7 
15:19:30 2014
@@ -86,80 +86,25 @@
tbody
 tr
 td valign=top width=100%
-div class=wiki-content maincontenth1 
id=Camel2.9.1Release-Camel2.9.1releaseCamel 2.9.1 release/h1
-
-div style=padding-right:20px;float:left;margin-left:-20px;
-pspan class=image-wrap style=img 
src=http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; 
style=border: 0px solid black/span/p/div
-div style=min-height:200px/div
-
-h2 id=Camel2.9.1Release-NewandNoteworthyNew and Noteworthy/h2
-
-pWelcome to the 2.9.1 release which is mainly a bug fix release with 109 
issues resolved. /p
-
-pFor more details see the a shape=rect class=external-link 
href=https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311211amp;version=12319191;JIRA
 tickets/a/p
-
-h2 id=Camel2.9.1Release-KnownIssuesKnown Issues/h2
-
-ulliSee a shape=rect href=camel-290-release.htmlCamel 2.9.0 
Release/a/li/ul
-
-
-h2 id=Camel2.9.1Release-ImportantchangestoconsiderwhenupgradingImportant 
changes to consider when upgrading/h2
-
-ulliSee a shape=rect href=camel-290-release.htmlCamel 2.9.0 
Release/a/li/ul
-
-
-h2 id=Camel2.9.1Release-NoticeNotice/h2
-
-ulliSee a shape=rect href=camel-290-release.htmlCamel 2.9.0 
Release/a/li/ul
-
-
-h2 id=Camel2.9.1Release-GettingtheDistributionsGetting the 
Distributions/h2
-
-h3 id=Camel2.9.1Release-BinaryDistributionsBinary Distributions/h3
-
-div class=table-wraptable class=confluenceTabletbodytrth 
colspan=1 rowspan=1 class=confluenceThp Description /p/thth 
colspan=1 rowspan=1 class=confluenceThp Download Link /p/thth 
colspan=1 rowspan=1 class=confluenceThp PGP Signature file of download 
/p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdp Windows 
Distribution /p/tdtd colspan=1 rowspan=1 class=confluenceTdp a 
shape=rect class=external-link 
href=http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.9.1/apache-camel-2.9.1.zip;apache-camel-2.9.1.zip/a
 /p/tdtd colspan=1 rowspan=1 class=confluenceTdp a shape=rect 
class=external-link 
href=http://www.apache.org/dist/camel/apache-camel/2.9.1/apache-camel-2.9.1.zip.asc;apache-camel-2.9.1.zip.asc/a
 /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp 
Unix/Linux/Cygwin Distribution /p/tdtd colspan=1 rowspan=1 
class=confluenceTdp a sh
 ape=rect class=external-link 
href=http://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.9.1/apache-camel-2.9.1.tar.gz;apache-camel-2.9.1.tar.gz/a
 /p/tdtd colspan=1 rowspan=1 class=confluenceTdp a shape=rect 
class=external-link 
href=http://www.apache.org/dist/camel/apache-camel/2.9.1/apache-camel-2.9.1.tar.gz.asc;apache-camel-2.9.1.tar.gz.asc/a
 /p/td/tr/tbody/table/div
-
-div class=aui-message hint shadowed information-macro
+div class=wiki-content maincontenth1 
id=Camel2.9.1Release-Camel2.9.1releaseCamel 2.9.1 release/h1div 
style=padding-right:20px;float:left;margin-left:-20px;
+pspan class=image-wrap style=img 
src=http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; 
style=border: 0px solid black/span/p/divdiv 
style=min-height:200px/divh2 id=Camel2.9.1Release-NewandNoteworthyNew 
and Noteworthy/h2pWelcome to the 2.9.1 release which is mainly a bug fix 
release with 109 issues resolved./ppFor more details see the a 
shape=rect class=external-link 
href=https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311211amp;version=12319191;JIRA
 tickets/a/ph2 id=Camel2.9.1Release-KnownIssuesKnown 
Issues/h2ulliSee a shape=rect href=camel-290-release.htmlCamel 
2.9.0 Release/a/li/ulh2 
id=Camel2.9.1Release-ImportantchangestoconsiderwhenupgradingImportant 
changes to consider when upgrading/h2ulliSee a shape=rect 
href=camel-290-release.htmlCamel 2.9.0 Release/a/li/ulh2 
id=Camel2.9.1Release-NoticeNotice/h2ulliSee a shape=rect 
href=camel-290-releas
 e.htmlCamel 2.9.0 Release/a/li/ulh2 
id=Camel2.9.1Release-GettingtheDistributionsGetting the 
Distributions/h2h3 id=Camel2.9.1Release-BinaryDistributionsBinary 
Distributions/h3div class=table-wraptable 
class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceThpDescription/p/thth colspan=1 rowspan=1 
class=confluenceThpDownload Link/p/thth colspan=1 rowspan=1 
class=confluenceThpPGP Signature file of download/p/th/trtrtd 
colspan=1 rowspan=1 class=confluenceTdpWindows 
Distribution/p/tdtd colspan=1 

git commit: CAMEL-7279 - Yammer now uses bearer token for auth

2014-03-07 Thread janstey
Repository: camel
Updated Branches:
  refs/heads/master 1b0f11626 - 263b56814


CAMEL-7279 - Yammer now uses bearer token for auth


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/263b5681
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/263b5681
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/263b5681

Branch: refs/heads/master
Commit: 263b568146ee94b3bf781ba77bd6415514bc452f
Parents: 1b0f116
Author: Jonathan Anstey jans...@gmail.com
Authored: Fri Mar 7 13:13:18 2014 -0330
Committer: Jonathan Anstey jans...@gmail.com
Committed: Fri Mar 7 13:14:52 2014 -0330

--
 .../component/yammer/ScribeApiRequestor.java  | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/263b5681/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
--
diff --git 
a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
 
b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
index 6d2ac99..7bdf605 100644
--- 
a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
+++ 
b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
@@ -20,9 +20,12 @@ import org.scribe.model.OAuthConstants;
 import org.scribe.model.OAuthRequest;
 import org.scribe.model.Response;
 import org.scribe.model.Verb;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ScribeApiRequestor implements ApiRequestor {
 
+private static final Logger LOG = 
LoggerFactory.getLogger(ScribeApiRequestor.class);
 String apiUrl;
 String apiAccessToken;   
 
@@ -32,8 +35,21 @@ public class ScribeApiRequestor implements ApiRequestor {
 }
 
 private String send(Verb verb, String params) throws Exception {
-OAuthRequest request = new OAuthRequest(verb, apiUrl + ((params != 
null) ? params : ));
+String url = apiUrl + ((params != null) ? params : );
+
+OAuthRequest request = new OAuthRequest(verb, url);
 request.addQuerystringParameter(OAuthConstants.ACCESS_TOKEN, 
apiAccessToken);
+
+// For more details on the “Bearer” token refer to 
http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-23
+StringBuilder sb = new StringBuilder();
+sb.append(Bearer );
+sb.append(apiAccessToken);
+request.addHeader(Authorization,  sb.toString());
+
+if (LOG.isDebugEnabled()) {
+LOG.debug(Yammer request url: %s, request.getCompleteUrl());
+}
+
 Response response = request.send();
 if (response.isSuccessful()) {
 return response.getBody();



git commit: CAMEL-7279 - Yammer now uses bearer token for auth

2014-03-07 Thread janstey
Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x 9e71d8ace - 496026d68


CAMEL-7279 - Yammer now uses bearer token for auth


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/496026d6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/496026d6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/496026d6

Branch: refs/heads/camel-2.12.x
Commit: 496026d688bd2efff6437fee480f615f494459eb
Parents: 9e71d8a
Author: Jonathan Anstey jans...@gmail.com
Authored: Fri Mar 7 13:13:18 2014 -0330
Committer: Jonathan Anstey jans...@gmail.com
Committed: Fri Mar 7 13:15:06 2014 -0330

--
 .../component/yammer/ScribeApiRequestor.java  | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/496026d6/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
--
diff --git 
a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
 
b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
index 6d2ac99..7bdf605 100644
--- 
a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
+++ 
b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
@@ -20,9 +20,12 @@ import org.scribe.model.OAuthConstants;
 import org.scribe.model.OAuthRequest;
 import org.scribe.model.Response;
 import org.scribe.model.Verb;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ScribeApiRequestor implements ApiRequestor {
 
+private static final Logger LOG = 
LoggerFactory.getLogger(ScribeApiRequestor.class);
 String apiUrl;
 String apiAccessToken;   
 
@@ -32,8 +35,21 @@ public class ScribeApiRequestor implements ApiRequestor {
 }
 
 private String send(Verb verb, String params) throws Exception {
-OAuthRequest request = new OAuthRequest(verb, apiUrl + ((params != 
null) ? params : ));
+String url = apiUrl + ((params != null) ? params : );
+
+OAuthRequest request = new OAuthRequest(verb, url);
 request.addQuerystringParameter(OAuthConstants.ACCESS_TOKEN, 
apiAccessToken);
+
+// For more details on the “Bearer” token refer to 
http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-23
+StringBuilder sb = new StringBuilder();
+sb.append(Bearer );
+sb.append(apiAccessToken);
+request.addHeader(Authorization,  sb.toString());
+
+if (LOG.isDebugEnabled()) {
+LOG.debug(Yammer request url: %s, request.getCompleteUrl());
+}
+
 Response response = request.send();
 if (response.isSuccessful()) {
 return response.getBody();



[2/2] git commit: Fix log format error

2014-03-07 Thread janstey
Fix log format error


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/335e6f72
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/335e6f72
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/335e6f72

Branch: refs/heads/master
Commit: 335e6f725685f18a811060711bc17d4bc6adf0c8
Parents: 263b568
Author: Jonathan Anstey jans...@gmail.com
Authored: Fri Mar 7 13:18:45 2014 -0330
Committer: Jonathan Anstey jans...@gmail.com
Committed: Fri Mar 7 13:19:04 2014 -0330

--
 .../java/org/apache/camel/component/yammer/ScribeApiRequestor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/335e6f72/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
--
diff --git 
a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
 
b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
index 7bdf605..027cf9d 100644
--- 
a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
+++ 
b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
@@ -47,7 +47,7 @@ public class ScribeApiRequestor implements ApiRequestor {
 request.addHeader(Authorization,  sb.toString());
 
 if (LOG.isDebugEnabled()) {
-LOG.debug(Yammer request url: %s, request.getCompleteUrl());
+LOG.debug(Yammer request url: {}, request.getCompleteUrl());
 }
 
 Response response = request.send();



[1/2] git commit: Fix log format error

2014-03-07 Thread janstey
Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x 496026d68 - c3668a305
  refs/heads/master 263b56814 - 335e6f725


Fix log format error


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c3668a30
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c3668a30
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c3668a30

Branch: refs/heads/camel-2.12.x
Commit: c3668a305a013566bff0ebe7c4833025dc67dd34
Parents: 496026d
Author: Jonathan Anstey jans...@gmail.com
Authored: Fri Mar 7 13:18:45 2014 -0330
Committer: Jonathan Anstey jans...@gmail.com
Committed: Fri Mar 7 13:18:45 2014 -0330

--
 .../java/org/apache/camel/component/yammer/ScribeApiRequestor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c3668a30/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
--
diff --git 
a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
 
b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
index 7bdf605..027cf9d 100644
--- 
a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
+++ 
b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/ScribeApiRequestor.java
@@ -47,7 +47,7 @@ public class ScribeApiRequestor implements ApiRequestor {
 request.addHeader(Authorization,  sb.toString());
 
 if (LOG.isDebugEnabled()) {
-LOG.debug(Yammer request url: %s, request.getCompleteUrl());
+LOG.debug(Yammer request url: {}, request.getCompleteUrl());
 }
 
 Response response = request.send();