-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README.md #102
base: master
Are you sure you want to change the base?
Update README.md #102
Changes from all commits
1392886
0185e0f
23bd0a5
0370316
d8e0a5f
c2653ea
8076d3c
4cc35d2
b952f52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -693,18 +693,16 @@ public QueueModel create() throws IOException { | |
* Creates a queue for specified queue client. | ||
* If queue exists, it will be updated. | ||
* @param subscribersList The subscribers list. | ||
* @param alertsList The alerts list. | ||
* @param pushType The push type - multicast or unicast. | ||
* @param errorQueue The name of the error queue to use (can be null) | ||
* @param retries The retries. | ||
* @param retriesDelay The retries delay. | ||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
public QueueModel create(ArrayList<Subscriber> subscribersList, ArrayList<Alert> alertsList, String pushType, String errorQueue, int retries, int retriesDelay) throws IOException { | ||
public QueueModel create(ArrayList<Subscriber> subscribersList, String pushType, String errorQueue, int retries, int retriesDelay) throws IOException { | ||
QueueModel model = new QueueModel(); | ||
model.setPushInfo(new QueuePushModel(subscribersList, retries, retriesDelay, errorQueue)); | ||
model.setAlerts(alertsList); | ||
model.setType(pushType); | ||
return create(model); | ||
} | ||
|
@@ -713,15 +711,14 @@ public QueueModel create(ArrayList<Subscriber> subscribersList, ArrayList<Alert> | |
* Creates a queue for specified queue client. | ||
* If queue exists, it will be updated. | ||
* @param subscribersList The subscribers list. | ||
* @param alertsList The alerts list. | ||
* @param pushType The push type - multicast or unicast. | ||
* @param retries The retries. | ||
* @param retriesDelay The retries delay. | ||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
public QueueModel create(ArrayList<Subscriber> subscribersList, ArrayList<Alert> alertsList, String pushType, int retries, int retriesDelay) throws IOException { | ||
return create(subscribersList, alertsList, pushType, "", retries, retriesDelay); | ||
public QueueModel create(ArrayList<Subscriber> subscribersList, String pushType, int retries, int retriesDelay) throws IOException { | ||
return create(subscribersList, pushType, "", retries, retriesDelay); | ||
} | ||
|
||
/** | ||
|
@@ -744,34 +741,31 @@ public QueueModel create(QueueModel model) throws IOException { | |
/** | ||
* Update queue. If there is no queue, an EmptyQueueException is thrown. | ||
* @param subscribersList The subscribers list. | ||
* @param alertsList The alerts list. | ||
* @param pushType The push type - multicast or unicast. | ||
* @param errorQueue The name of the error queue to use (can be null) | ||
* @param retries The retries. | ||
* @param retriesDelay The retries delay. | ||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
public QueueModel updateQueue(ArrayList<Subscriber> subscribersList, ArrayList<Alert> alertsList, String pushType, String errorQueue, int retries, int retriesDelay) throws IOException { | ||
public QueueModel updateQueue(ArrayList<Subscriber> subscribersList, String pushType, String errorQueue, int retries, int retriesDelay) throws IOException { | ||
QueueModel model = new QueueModel(); | ||
model.setPushInfo(new QueuePushModel(subscribersList, retries, retriesDelay, errorQueue)); | ||
model.setAlerts(alertsList); | ||
model.setType(pushType); | ||
return update(model); | ||
} | ||
|
||
/** | ||
* Update queue. If there is no queue, an EmptyQueueException is thrown. | ||
* @param subscribersList The subscribers list. | ||
* @param alertsList The alerts list. | ||
* @param pushType The push type - multicast or unicast. | ||
* @param retries The retries. | ||
* @param retriesDelay The retries delay. | ||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
public QueueModel updateQueue(ArrayList<Subscriber> subscribersList, ArrayList<Alert> alertsList, String pushType, int retries, int retriesDelay) throws IOException { | ||
return updateQueue(subscribersList, alertsList, pushType, "", retries,retriesDelay); | ||
public QueueModel updateQueue(ArrayList<Subscriber> subscribersList, String pushType, int retries, int retriesDelay) throws IOException { | ||
return updateQueue(subscribersList, pushType, "", retries,retriesDelay); | ||
} | ||
|
||
public QueueModel update(QueueModel model) throws IOException { | ||
|
@@ -785,59 +779,23 @@ public QueueModel update(QueueModel model) throws IOException { | |
} | ||
|
||
/** | ||
* Add alerts to a queue. If there is no queue, an EmptyQueueException is thrown. | ||
* @param alerts The array list of alerts. | ||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
public QueueModel addAlertsToQueue(ArrayList<Alert> alerts) throws IOException { | ||
return this.updateAlerts(alerts); | ||
} | ||
|
||
/** | ||
* Replace current queue alerts with a given list of alerts. If there is no queue, an EmptyQueueException is thrown. | ||
* @param alerts The array list of alerts. | ||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
public QueueModel updateAlertsToQueue(ArrayList<Alert> alerts) throws IOException { | ||
return this.updateAlerts(alerts); | ||
} | ||
|
||
/** | ||
* Replace current queue alerts with a given list of alerts. If there is no queue, an EmptyQueueException is thrown. | ||
* @param alerts The array list of alerts. | ||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
public QueueModel updateAlerts(ArrayList<Alert> alerts) throws IOException { | ||
QueueModel payload = new QueueModel(alerts); | ||
return this.update(payload); | ||
} | ||
|
||
/** | ||
* Delete alerts from a queue. If there is no queue, an EmptyQueueException is thrown. | ||
* @param alert_ids The array list of alert ids. | ||
|
||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lines that should be deleted There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't find these. Did you delete it already? |
||
public void deleteAlertsFromQueue(ArrayList<Alert> alert_ids) throws IOException { | ||
String url = "queues/" + name + "/alerts"; | ||
Alerts alert = new Alerts(alert_ids); | ||
String jsonMessages = gson.toJson(alert); | ||
IronReader reader = client.delete(url, jsonMessages); | ||
reader.close(); | ||
} | ||
|
||
/** | ||
* Delete alert from a queue by alert id. If there is no queue, an EmptyQueueException is thrown. | ||
* @param alert_id The alert id. | ||
* @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. | ||
* @throws java.io.IOException If there is an error accessing the IronMQ server. | ||
*/ | ||
public void deleteAlertFromQueueById(String alert_id) throws IOException { | ||
String url = "queues/" + name + "/alerts/" + alert_id; | ||
IronReader reader = client.delete(url); | ||
reader.close(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -656,23 +656,7 @@ public void testUpdateQueuePushParameters() throws IOException { | |
Assert.assertEquals(url, info.getPushInfo().getSubscribers().get(0).getUrl()); | ||
} | ||
|
||
/** | ||
* This test shows how to update alerts of a queue | ||
* Expected that: | ||
* - new alert will be available after update | ||
* @throws IOException | ||
*/ | ||
@Test | ||
public void testUpdateQueueAlerts() throws IOException { | ||
queue.create(); | ||
ArrayList<Alert> alerts = new ArrayList<Alert>(); | ||
alerts.add(new Alert(Alert.typeProgressive, Alert.directionAscending, 5, "some_q")); | ||
QueueModel info = queue.updateAlerts(alerts); | ||
|
||
Assert.assertEquals(5, info.getAlerts().get(0).getTrigger()); | ||
Assert.assertEquals(Alert.directionAscending, info.getAlerts().get(0).getDirection()); | ||
Assert.assertEquals(Alert.typeProgressive, info.getAlerts().get(0).getType()); | ||
Assert.assertEquals("some_q", info.getAlerts().get(0).getQueue()); | ||
sameQueue.getInfoAboutQueue(); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ayodejiola If you delete the whole method - you should delete all the headers and lines. In this case you should delete all the lines between 659 and 677 |
||
/** | ||
|
@@ -691,11 +675,11 @@ public void testDeleteQueue() throws IOException, InterruptedException { | |
|
||
sameQueue.getInfoAboutQueue(); | ||
} | ||
|
||
/** | ||
* This test shows how to add subscribers to a queue. | ||
* @throws IOException | ||
*/ | ||
|
||
@Test | ||
public void testAddSubscribers() throws IOException { | ||
QueueModel payload = new QueueModel(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lines that should be deleted as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't find these. Did you delete it already?