Skip to content

Commit

Permalink
Updated jsdocs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Smolgovsky committed Mar 15, 2016
1 parent 5c6322e commit 087ffc3
Show file tree
Hide file tree
Showing 13 changed files with 469 additions and 427 deletions.
46 changes: 40 additions & 6 deletions javascript/jsdoc/AmqpUniversalClient.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h1 class="page-title">Source: AmqpUniversalClient.js</h1>
* Provides communication services with AMQP server. Created within amqpClientFunction constructor.
* @class
*/
var AmqpClient = {};
var AmqpClient = {subscriptions:[]};
var errorFunction=null;
var amqpClient=null;

Expand Down Expand Up @@ -117,7 +117,9 @@ <h1 class="page-title">Source: AmqpUniversalClient.js</h1>
clientId:null,
messageIdCounter:0,
user:user,
closed:null,
messageReceivedFunc:messageReceivedFunc,
subscribed:false,
init:function(subscribedCallback){
this.queueName="client" + Math.floor(Math.random() * 1000000);
this.clientId=appId;
Expand All @@ -129,6 +131,8 @@ <h1 class="page-title">Source: AmqpUniversalClient.js</h1>
logInformation("INFO", "OPEN: Consume Channel");
this.consumeChannel = amqpClient.openChannel(function(){that.consumeChannelOpenHandler(that)});
$.when(this.publishChannelOpened, this.consumeChannelOpened).done(function(){
that.closed=$.Deferred();
that.subscribed=true;
subscribedCallback(that);
});

Expand Down Expand Up @@ -239,18 +243,40 @@ <h1 class="page-title">Source: AmqpUniversalClient.js</h1>
props.setUserId(this.user);
logInformation("sent","Sending message to "+this.topicPub+": "+ msg, "sent");
this.publishChannel.publishBasic({body: body, properties: props, exchange: this.topicPub, routingKey: routingKey});
},
disconnect:function(){
if (!this.subscribed){
this.closed.resolve();
}
else{
this.subscribed=false;
var config = {
replyCode: 0,
replyText: '',
classId: 0,
methodId: 0
};
this.consumeChannel.deleteQueue({queue:this.queueName, ifEmpty: false}, function(){
this.consumeChannel.closeChannel(config, function(){
this.publishChannel.closeChannel(config, function(){
this.closed.resolve();
});
});
});
}
}
};
return SubscriptionObject;

}

var createConnectionObject=function(amqpClient, user){
var createConnectionObject=function(connection, amqpClient, user){
/**
* Contains infomration about established connection.
* @class
*/
var ConnectionObject = {
connection:connection,
user:user,
amqpClient:amqpClient,
/**
Expand All @@ -264,7 +290,9 @@ <h1 class="page-title">Source: AmqpUniversalClient.js</h1>
subscribe:function(topicPub, topicSub, messageReceivedFunc, noLocal, subscribedCallbackFunction){
logInformation("INFO","CONNECTED!!!");
var subscription=createSubscriptionObject(this.amqpClient, topicPub, topicSub, noLocal, messageReceivedFunc, this.user);
var that=this;
subscription.init(function(subscription){
that.connection.subscriptions.push(subscription);
subscribedCallbackFunction(subscription);
});
}
Expand Down Expand Up @@ -301,8 +329,9 @@ <h1 class="page-title">Source: AmqpUniversalClient.js</h1>
credentials: credentials
};
try{
var that=this;
amqpClient.connect(options, function(){
var connection=createConnectionObject(amqpClient,connectionInfo.username);
var connection=createConnectionObject(that, amqpClient,connectionInfo.username);
connectedFunctionHandle(connection);
});
}
Expand All @@ -314,8 +343,13 @@ <h1 class="page-title">Source: AmqpUniversalClient.js</h1>
/**
* Disconnects from Kaazing WebSocket AMQP Gateway
*/
AmqpClient.disconnect=function(){
amqpClient.disconnect();
AmqpClient.close=function(){
for(var i=0;i&lt;this.subscriptions.length;i++){
this.subscriptions[i].disconnect();
}
$.when.apply($,this.subscriptions).then(function() {
amqpClient.disconnect();
});
}

return AmqpClient;
Expand All @@ -336,7 +370,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="amqpClien
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Mar 10 2016 14:40:22 GMT-0800 (PST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon Mar 14 2016 22:05:49 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
36 changes: 22 additions & 14 deletions javascript/jsdoc/JMSUniversalClient.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h1 class="page-title">Source: JMSUniversalClient.js</h1>
noLocal:noLocal,
messagesToSend:[],
inSend:false,
subscribed:false,
subscribed:true,
closed:$.Deferred(),
sendMessageOverTheWire:function(){
var msg = this.messagesToSend.pop();
Expand Down Expand Up @@ -119,17 +119,16 @@ <h1 class="page-title">Source: JMSUniversalClient.js</h1>
/**
* Closes the subscrpiption and releases all the resources.
*/
close:function(){
if (this.subscribed){
disconnect:function(){
if (!this.subscribed){
this.closed.resolve();
}
else{
this.producer.close(function(){
this.consumer.close(function(){
this.subscribed=false;
this.closed.resolve();
});
})
this.producer.close();
this.consumer.close(function(){
this.subscribed=false;
this.closed.resolve();
});
}
}
};
Expand All @@ -155,6 +154,13 @@ <h1 class="page-title">Source: JMSUniversalClient.js</h1>
* @param subscribedCallbackFunction {function} callback function if a format function(SubcriptionObject) to be called when SubsriptionObject is created.
*/
subscribe:function(topicPub, topicSub, messageReceivedFunc, noLocal, subscribedCallbackFunction){
if (!topicPub.startsWith("/topic/")){
topicPub="/topic/"+topicPub;
}
if (!topicSub.startsWith("/topic/")){
topicSub="/topic/"+topicSub;
}

var pubDest = this.session.createTopic(topicPub);
var producer = this.session.createProducer(pubDest);
logInformation("INFO","Producer for "+topicPub+" is ready! AppID=" + appId);
Expand Down Expand Up @@ -244,14 +250,16 @@ <h1 class="page-title">Source: JMSUniversalClient.js</h1>
/**
* Disconnects from Kaazing WebSocket JMS Gateway, closes all the subscription and releases all the resources.
*/
JMSClient.disconnect=function(){
JMSClient.close=function(){
for(var i=0;i&lt;this.subscriptions.length;i++){
this.subscriptions[i].close();
this.subscriptions[i].disconnect();
}
$.when.apply($,this.subscriptions).then(function() {
session.close(function () {
connection.close(function () {
connection.stop(function(){
session.close(function () {
connection.close(function () {

});
});
});
});
Expand All @@ -275,7 +283,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="amqpClien
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Mar 10 2016 14:40:22 GMT-0800 (PST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon Mar 14 2016 22:05:49 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
6 changes: 3 additions & 3 deletions javascript/jsdoc/JavascriptUniversalClient.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ <h1 class="page-title">Source: JavascriptUniversalClient.js</h1>
/**
* Disconnects from Kaazing WebSocket Gateway
*/
JavascriptUniversalClient.disconnect=function(){
client.disconnect();
JavascriptUniversalClient.close=function(){
client.close();
}

return JavascriptUniversalClient;
Expand All @@ -136,7 +136,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="amqpClien
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Mar 10 2016 14:40:22 GMT-0800 (PST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon Mar 14 2016 22:05:49 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
6 changes: 3 additions & 3 deletions javascript/jsdoc/JavascriptUniversalClientNPM.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ <h1 class="page-title">Source: JavascriptUniversalClientNPM.js</h1>
/**
* Disconnects from Kaazing WebSocket Gateway
*/
JavascriptUniversalClient.disconnect=function(){
client.disconnect();
JavascriptUniversalClient.close=function(){
client.close();
}

return JavascriptUniversalClient;
Expand All @@ -139,7 +139,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="amqpClien
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Mar 10 2016 14:40:22 GMT-0800 (PST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon Mar 14 2016 22:05:49 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit 087ffc3

Please sign in to comment.