repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
janScheible/rising-empire | src/main/java/com/scheible/risingempire/game/common/Game.java | // Path: src/main/java/com/scheible/risingempire/game/common/command/Command.java
// public abstract class Command {
//
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/View.java
// public class View {
//
// private final List<Player> players;
// private final List<Star> stars;
// private final List<Fleet> fleets;
//
// private final List<Event> events;
//
// public View(String nation, List<Player> players, List<Star> stars, List<Fleet> fleets, List<Event> events) {
// this.players = players;
// this.stars = stars;
// this.fleets = fleets;
//
// this.events = events;
// }
//
// public List<Player> getPlayers() {
// return players;
// }
//
// public List<Star> getStars() {
// return stars;
// }
//
// public List<Fleet> getFleets() {
// return fleets;
// }
//
// public List<Event> getEvents() {
// return events;
// }
// }
| import com.scheible.risingempire.game.common.command.Command;
import com.scheible.risingempire.game.common.view.View;
import java.util.List;
import java.util.Map; | package com.scheible.risingempire.game.common;
/**
*
* @author sj
*/
public interface Game {
void register(Player player);
void addAi(Player player);
List<Player> getPlayers();
boolean isAi(Player player);
boolean process(Player player, List<Command> commands);
| // Path: src/main/java/com/scheible/risingempire/game/common/command/Command.java
// public abstract class Command {
//
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/View.java
// public class View {
//
// private final List<Player> players;
// private final List<Star> stars;
// private final List<Fleet> fleets;
//
// private final List<Event> events;
//
// public View(String nation, List<Player> players, List<Star> stars, List<Fleet> fleets, List<Event> events) {
// this.players = players;
// this.stars = stars;
// this.fleets = fleets;
//
// this.events = events;
// }
//
// public List<Player> getPlayers() {
// return players;
// }
//
// public List<Star> getStars() {
// return stars;
// }
//
// public List<Fleet> getFleets() {
// return fleets;
// }
//
// public List<Event> getEvents() {
// return events;
// }
// }
// Path: src/main/java/com/scheible/risingempire/game/common/Game.java
import com.scheible.risingempire.game.common.command.Command;
import com.scheible.risingempire.game.common.view.View;
import java.util.List;
import java.util.Map;
package com.scheible.risingempire.game.common;
/**
*
* @author sj
*/
public interface Game {
void register(Player player);
void addAi(Player player);
List<Player> getPlayers();
boolean isAi(Player player);
boolean process(Player player, List<Command> commands);
| Map<Player, View> getViews(); |
janScheible/rising-empire | src/main/java/com/scheible/risingempire/game/core/event/RandomMessageEvent.java | // Path: src/main/java/com/scheible/risingempire/game/core/Leader.java
// public class Leader {
//
// private final String name;
// private final String nation;
// private final String homeStar;
//
// public Leader(String name, String nation, String homeStar) {
// this.name = name;
// this.nation = nation;
// this.homeStar = homeStar;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// public String getHomeStar() {
// return homeStar;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(name, nation);
// }
//
// @Override
// public boolean equals(Object obj) {
// if (obj == this) {
// return true;
// } else if (obj instanceof Leader) {
// Leader other = (Leader) obj;
// return Objects.equals(name, other.name) && Objects.equals(nation, other.nation);
// } else {
// return false;
// }
// }
// }
| import com.scheible.risingempire.game.core.Leader; | package com.scheible.risingempire.game.core.event;
/**
*
* @author sj
*/
public class RandomMessageEvent extends Event {
private final String message;
| // Path: src/main/java/com/scheible/risingempire/game/core/Leader.java
// public class Leader {
//
// private final String name;
// private final String nation;
// private final String homeStar;
//
// public Leader(String name, String nation, String homeStar) {
// this.name = name;
// this.nation = nation;
// this.homeStar = homeStar;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// public String getHomeStar() {
// return homeStar;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(name, nation);
// }
//
// @Override
// public boolean equals(Object obj) {
// if (obj == this) {
// return true;
// } else if (obj instanceof Leader) {
// Leader other = (Leader) obj;
// return Objects.equals(name, other.name) && Objects.equals(nation, other.nation);
// } else {
// return false;
// }
// }
// }
// Path: src/main/java/com/scheible/risingempire/game/core/event/RandomMessageEvent.java
import com.scheible.risingempire.game.core.Leader;
package com.scheible.risingempire.game.core.event;
/**
*
* @author sj
*/
public class RandomMessageEvent extends Event {
private final String message;
| public RandomMessageEvent(Leader leader, String message) { |
janScheible/rising-empire | src/main/java/com/scheible/risingempire/game/common/view/View.java | // Path: src/main/java/com/scheible/risingempire/game/common/Player.java
// public class Player {
//
// public static class Prototype {
//
// private final String name;
// private final String nation;
// private final String homeStar;
//
// public Prototype(String name, String nation, String homeStar) {
// this.name = name;
// this.nation = nation;
// this.homeStar = homeStar;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// public String getHomeStar() {
// return homeStar;
// }
// }
//
// private final String name;
// private final String nation;
//
// public Player(String name, String nation) {
// this.name = name;
// this.nation = nation;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(name, nation);
// }
//
// @Override
// public boolean equals(Object obj) {
// if (obj == this) {
// return true;
// } else if (obj instanceof Player) {
// Player other = (Player) obj;
// return Objects.equals(name, other.name) && Objects.equals(nation, other.nation);
// } else {
// return false;
// }
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/event/Event.java
// public abstract class Event {
//
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/fleet/Fleet.java
// public class Fleet {
//
// private final int id;
// private final String nation;
//
// private final String star;
//
// private final Integer x;
// private final Integer y;
//
// private final boolean dispatchable;
//
//
// private Fleet(int id, int x, int y, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = null;
// this.x = x;
// this.y = y;
//
// this.dispatchable = dispatchable;
// }
//
// private Fleet(int id, String star, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = star;
// this.x = null;
// this.y = null;
//
// this.dispatchable = dispatchable;
// }
//
// public static Fleet createOrbitingFleet(int id, String star, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, star, nation, dispatchable);
// return fleet;
// }
//
// public static Fleet createTravelingFleet(int id, int x, int y, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, x, y, nation, dispatchable);
// return fleet;
// }
//
// public int getId() {
// return id;
// }
//
// public String getStar() {
// return star;
// }
//
// public String getNation() {
// return nation;
// }
//
// public boolean isDispatchable() {
// return dispatchable;
// }
//
// public Integer getX() {
// return x;
// }
//
// public Integer getY() {
// return y;
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/star/Star.java
// public class Star {
//
// private final String name;
// private final int x;
// private final int y;
//
// private final String nation;
// private final Integer population;
//
// private Star(String name, int x, int y, String nation, Integer population) {
// this.name = name;
// this.x = x;
// this.y = y;
// this.nation = nation;
// this.population = population;
// }
//
// public static Star createAnonymousStar(String name, int x, int y) {
// Star star = new Star(name, x, y, null, null);
// return star;
// }
//
// public static Star createAlienStar(String name, int x, int y, String nation) {
// Star star = new Star(name, x, y, nation, null);
// return star;
// }
//
// public static Star createOwnedStar(String name, int x, int y, String nation, int population) {
// Star star = new Star(name, x, y, nation, population);
// return star;
// }
//
// public String getName() {
// return name;
// }
//
// public int getX() {
// return x;
// }
//
// public int getY() {
// return y;
// }
//
// public String getNation() {
// return nation;
// }
//
// public Integer getPopulation() {
// return population;
// }
// }
| import com.scheible.risingempire.game.common.Player;
import com.scheible.risingempire.game.common.event.Event;
import com.scheible.risingempire.game.common.view.fleet.Fleet;
import com.scheible.risingempire.game.common.view.star.Star;
import java.util.List; | package com.scheible.risingempire.game.common.view;
/**
*
* @author sj
*/
public class View {
private final List<Player> players; | // Path: src/main/java/com/scheible/risingempire/game/common/Player.java
// public class Player {
//
// public static class Prototype {
//
// private final String name;
// private final String nation;
// private final String homeStar;
//
// public Prototype(String name, String nation, String homeStar) {
// this.name = name;
// this.nation = nation;
// this.homeStar = homeStar;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// public String getHomeStar() {
// return homeStar;
// }
// }
//
// private final String name;
// private final String nation;
//
// public Player(String name, String nation) {
// this.name = name;
// this.nation = nation;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(name, nation);
// }
//
// @Override
// public boolean equals(Object obj) {
// if (obj == this) {
// return true;
// } else if (obj instanceof Player) {
// Player other = (Player) obj;
// return Objects.equals(name, other.name) && Objects.equals(nation, other.nation);
// } else {
// return false;
// }
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/event/Event.java
// public abstract class Event {
//
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/fleet/Fleet.java
// public class Fleet {
//
// private final int id;
// private final String nation;
//
// private final String star;
//
// private final Integer x;
// private final Integer y;
//
// private final boolean dispatchable;
//
//
// private Fleet(int id, int x, int y, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = null;
// this.x = x;
// this.y = y;
//
// this.dispatchable = dispatchable;
// }
//
// private Fleet(int id, String star, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = star;
// this.x = null;
// this.y = null;
//
// this.dispatchable = dispatchable;
// }
//
// public static Fleet createOrbitingFleet(int id, String star, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, star, nation, dispatchable);
// return fleet;
// }
//
// public static Fleet createTravelingFleet(int id, int x, int y, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, x, y, nation, dispatchable);
// return fleet;
// }
//
// public int getId() {
// return id;
// }
//
// public String getStar() {
// return star;
// }
//
// public String getNation() {
// return nation;
// }
//
// public boolean isDispatchable() {
// return dispatchable;
// }
//
// public Integer getX() {
// return x;
// }
//
// public Integer getY() {
// return y;
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/star/Star.java
// public class Star {
//
// private final String name;
// private final int x;
// private final int y;
//
// private final String nation;
// private final Integer population;
//
// private Star(String name, int x, int y, String nation, Integer population) {
// this.name = name;
// this.x = x;
// this.y = y;
// this.nation = nation;
// this.population = population;
// }
//
// public static Star createAnonymousStar(String name, int x, int y) {
// Star star = new Star(name, x, y, null, null);
// return star;
// }
//
// public static Star createAlienStar(String name, int x, int y, String nation) {
// Star star = new Star(name, x, y, nation, null);
// return star;
// }
//
// public static Star createOwnedStar(String name, int x, int y, String nation, int population) {
// Star star = new Star(name, x, y, nation, population);
// return star;
// }
//
// public String getName() {
// return name;
// }
//
// public int getX() {
// return x;
// }
//
// public int getY() {
// return y;
// }
//
// public String getNation() {
// return nation;
// }
//
// public Integer getPopulation() {
// return population;
// }
// }
// Path: src/main/java/com/scheible/risingempire/game/common/view/View.java
import com.scheible.risingempire.game.common.Player;
import com.scheible.risingempire.game.common.event.Event;
import com.scheible.risingempire.game.common.view.fleet.Fleet;
import com.scheible.risingempire.game.common.view.star.Star;
import java.util.List;
package com.scheible.risingempire.game.common.view;
/**
*
* @author sj
*/
public class View {
private final List<Player> players; | private final List<Star> stars; |
janScheible/rising-empire | src/main/java/com/scheible/risingempire/game/common/view/View.java | // Path: src/main/java/com/scheible/risingempire/game/common/Player.java
// public class Player {
//
// public static class Prototype {
//
// private final String name;
// private final String nation;
// private final String homeStar;
//
// public Prototype(String name, String nation, String homeStar) {
// this.name = name;
// this.nation = nation;
// this.homeStar = homeStar;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// public String getHomeStar() {
// return homeStar;
// }
// }
//
// private final String name;
// private final String nation;
//
// public Player(String name, String nation) {
// this.name = name;
// this.nation = nation;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(name, nation);
// }
//
// @Override
// public boolean equals(Object obj) {
// if (obj == this) {
// return true;
// } else if (obj instanceof Player) {
// Player other = (Player) obj;
// return Objects.equals(name, other.name) && Objects.equals(nation, other.nation);
// } else {
// return false;
// }
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/event/Event.java
// public abstract class Event {
//
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/fleet/Fleet.java
// public class Fleet {
//
// private final int id;
// private final String nation;
//
// private final String star;
//
// private final Integer x;
// private final Integer y;
//
// private final boolean dispatchable;
//
//
// private Fleet(int id, int x, int y, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = null;
// this.x = x;
// this.y = y;
//
// this.dispatchable = dispatchable;
// }
//
// private Fleet(int id, String star, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = star;
// this.x = null;
// this.y = null;
//
// this.dispatchable = dispatchable;
// }
//
// public static Fleet createOrbitingFleet(int id, String star, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, star, nation, dispatchable);
// return fleet;
// }
//
// public static Fleet createTravelingFleet(int id, int x, int y, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, x, y, nation, dispatchable);
// return fleet;
// }
//
// public int getId() {
// return id;
// }
//
// public String getStar() {
// return star;
// }
//
// public String getNation() {
// return nation;
// }
//
// public boolean isDispatchable() {
// return dispatchable;
// }
//
// public Integer getX() {
// return x;
// }
//
// public Integer getY() {
// return y;
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/star/Star.java
// public class Star {
//
// private final String name;
// private final int x;
// private final int y;
//
// private final String nation;
// private final Integer population;
//
// private Star(String name, int x, int y, String nation, Integer population) {
// this.name = name;
// this.x = x;
// this.y = y;
// this.nation = nation;
// this.population = population;
// }
//
// public static Star createAnonymousStar(String name, int x, int y) {
// Star star = new Star(name, x, y, null, null);
// return star;
// }
//
// public static Star createAlienStar(String name, int x, int y, String nation) {
// Star star = new Star(name, x, y, nation, null);
// return star;
// }
//
// public static Star createOwnedStar(String name, int x, int y, String nation, int population) {
// Star star = new Star(name, x, y, nation, population);
// return star;
// }
//
// public String getName() {
// return name;
// }
//
// public int getX() {
// return x;
// }
//
// public int getY() {
// return y;
// }
//
// public String getNation() {
// return nation;
// }
//
// public Integer getPopulation() {
// return population;
// }
// }
| import com.scheible.risingempire.game.common.Player;
import com.scheible.risingempire.game.common.event.Event;
import com.scheible.risingempire.game.common.view.fleet.Fleet;
import com.scheible.risingempire.game.common.view.star.Star;
import java.util.List; | package com.scheible.risingempire.game.common.view;
/**
*
* @author sj
*/
public class View {
private final List<Player> players;
private final List<Star> stars; | // Path: src/main/java/com/scheible/risingempire/game/common/Player.java
// public class Player {
//
// public static class Prototype {
//
// private final String name;
// private final String nation;
// private final String homeStar;
//
// public Prototype(String name, String nation, String homeStar) {
// this.name = name;
// this.nation = nation;
// this.homeStar = homeStar;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// public String getHomeStar() {
// return homeStar;
// }
// }
//
// private final String name;
// private final String nation;
//
// public Player(String name, String nation) {
// this.name = name;
// this.nation = nation;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(name, nation);
// }
//
// @Override
// public boolean equals(Object obj) {
// if (obj == this) {
// return true;
// } else if (obj instanceof Player) {
// Player other = (Player) obj;
// return Objects.equals(name, other.name) && Objects.equals(nation, other.nation);
// } else {
// return false;
// }
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/event/Event.java
// public abstract class Event {
//
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/fleet/Fleet.java
// public class Fleet {
//
// private final int id;
// private final String nation;
//
// private final String star;
//
// private final Integer x;
// private final Integer y;
//
// private final boolean dispatchable;
//
//
// private Fleet(int id, int x, int y, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = null;
// this.x = x;
// this.y = y;
//
// this.dispatchable = dispatchable;
// }
//
// private Fleet(int id, String star, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = star;
// this.x = null;
// this.y = null;
//
// this.dispatchable = dispatchable;
// }
//
// public static Fleet createOrbitingFleet(int id, String star, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, star, nation, dispatchable);
// return fleet;
// }
//
// public static Fleet createTravelingFleet(int id, int x, int y, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, x, y, nation, dispatchable);
// return fleet;
// }
//
// public int getId() {
// return id;
// }
//
// public String getStar() {
// return star;
// }
//
// public String getNation() {
// return nation;
// }
//
// public boolean isDispatchable() {
// return dispatchable;
// }
//
// public Integer getX() {
// return x;
// }
//
// public Integer getY() {
// return y;
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/star/Star.java
// public class Star {
//
// private final String name;
// private final int x;
// private final int y;
//
// private final String nation;
// private final Integer population;
//
// private Star(String name, int x, int y, String nation, Integer population) {
// this.name = name;
// this.x = x;
// this.y = y;
// this.nation = nation;
// this.population = population;
// }
//
// public static Star createAnonymousStar(String name, int x, int y) {
// Star star = new Star(name, x, y, null, null);
// return star;
// }
//
// public static Star createAlienStar(String name, int x, int y, String nation) {
// Star star = new Star(name, x, y, nation, null);
// return star;
// }
//
// public static Star createOwnedStar(String name, int x, int y, String nation, int population) {
// Star star = new Star(name, x, y, nation, population);
// return star;
// }
//
// public String getName() {
// return name;
// }
//
// public int getX() {
// return x;
// }
//
// public int getY() {
// return y;
// }
//
// public String getNation() {
// return nation;
// }
//
// public Integer getPopulation() {
// return population;
// }
// }
// Path: src/main/java/com/scheible/risingempire/game/common/view/View.java
import com.scheible.risingempire.game.common.Player;
import com.scheible.risingempire.game.common.event.Event;
import com.scheible.risingempire.game.common.view.fleet.Fleet;
import com.scheible.risingempire.game.common.view.star.Star;
import java.util.List;
package com.scheible.risingempire.game.common.view;
/**
*
* @author sj
*/
public class View {
private final List<Player> players;
private final List<Star> stars; | private final List<Fleet> fleets; |
janScheible/rising-empire | src/main/java/com/scheible/risingempire/game/common/view/View.java | // Path: src/main/java/com/scheible/risingempire/game/common/Player.java
// public class Player {
//
// public static class Prototype {
//
// private final String name;
// private final String nation;
// private final String homeStar;
//
// public Prototype(String name, String nation, String homeStar) {
// this.name = name;
// this.nation = nation;
// this.homeStar = homeStar;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// public String getHomeStar() {
// return homeStar;
// }
// }
//
// private final String name;
// private final String nation;
//
// public Player(String name, String nation) {
// this.name = name;
// this.nation = nation;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(name, nation);
// }
//
// @Override
// public boolean equals(Object obj) {
// if (obj == this) {
// return true;
// } else if (obj instanceof Player) {
// Player other = (Player) obj;
// return Objects.equals(name, other.name) && Objects.equals(nation, other.nation);
// } else {
// return false;
// }
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/event/Event.java
// public abstract class Event {
//
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/fleet/Fleet.java
// public class Fleet {
//
// private final int id;
// private final String nation;
//
// private final String star;
//
// private final Integer x;
// private final Integer y;
//
// private final boolean dispatchable;
//
//
// private Fleet(int id, int x, int y, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = null;
// this.x = x;
// this.y = y;
//
// this.dispatchable = dispatchable;
// }
//
// private Fleet(int id, String star, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = star;
// this.x = null;
// this.y = null;
//
// this.dispatchable = dispatchable;
// }
//
// public static Fleet createOrbitingFleet(int id, String star, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, star, nation, dispatchable);
// return fleet;
// }
//
// public static Fleet createTravelingFleet(int id, int x, int y, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, x, y, nation, dispatchable);
// return fleet;
// }
//
// public int getId() {
// return id;
// }
//
// public String getStar() {
// return star;
// }
//
// public String getNation() {
// return nation;
// }
//
// public boolean isDispatchable() {
// return dispatchable;
// }
//
// public Integer getX() {
// return x;
// }
//
// public Integer getY() {
// return y;
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/star/Star.java
// public class Star {
//
// private final String name;
// private final int x;
// private final int y;
//
// private final String nation;
// private final Integer population;
//
// private Star(String name, int x, int y, String nation, Integer population) {
// this.name = name;
// this.x = x;
// this.y = y;
// this.nation = nation;
// this.population = population;
// }
//
// public static Star createAnonymousStar(String name, int x, int y) {
// Star star = new Star(name, x, y, null, null);
// return star;
// }
//
// public static Star createAlienStar(String name, int x, int y, String nation) {
// Star star = new Star(name, x, y, nation, null);
// return star;
// }
//
// public static Star createOwnedStar(String name, int x, int y, String nation, int population) {
// Star star = new Star(name, x, y, nation, population);
// return star;
// }
//
// public String getName() {
// return name;
// }
//
// public int getX() {
// return x;
// }
//
// public int getY() {
// return y;
// }
//
// public String getNation() {
// return nation;
// }
//
// public Integer getPopulation() {
// return population;
// }
// }
| import com.scheible.risingempire.game.common.Player;
import com.scheible.risingempire.game.common.event.Event;
import com.scheible.risingempire.game.common.view.fleet.Fleet;
import com.scheible.risingempire.game.common.view.star.Star;
import java.util.List; | package com.scheible.risingempire.game.common.view;
/**
*
* @author sj
*/
public class View {
private final List<Player> players;
private final List<Star> stars;
private final List<Fleet> fleets;
| // Path: src/main/java/com/scheible/risingempire/game/common/Player.java
// public class Player {
//
// public static class Prototype {
//
// private final String name;
// private final String nation;
// private final String homeStar;
//
// public Prototype(String name, String nation, String homeStar) {
// this.name = name;
// this.nation = nation;
// this.homeStar = homeStar;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// public String getHomeStar() {
// return homeStar;
// }
// }
//
// private final String name;
// private final String nation;
//
// public Player(String name, String nation) {
// this.name = name;
// this.nation = nation;
// }
//
// public String getName() {
// return name;
// }
//
// public String getNation() {
// return nation;
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(name, nation);
// }
//
// @Override
// public boolean equals(Object obj) {
// if (obj == this) {
// return true;
// } else if (obj instanceof Player) {
// Player other = (Player) obj;
// return Objects.equals(name, other.name) && Objects.equals(nation, other.nation);
// } else {
// return false;
// }
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/event/Event.java
// public abstract class Event {
//
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/fleet/Fleet.java
// public class Fleet {
//
// private final int id;
// private final String nation;
//
// private final String star;
//
// private final Integer x;
// private final Integer y;
//
// private final boolean dispatchable;
//
//
// private Fleet(int id, int x, int y, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = null;
// this.x = x;
// this.y = y;
//
// this.dispatchable = dispatchable;
// }
//
// private Fleet(int id, String star, String nation, boolean dispatchable) {
// this.id = id;
// this.nation = nation;
//
// this.star = star;
// this.x = null;
// this.y = null;
//
// this.dispatchable = dispatchable;
// }
//
// public static Fleet createOrbitingFleet(int id, String star, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, star, nation, dispatchable);
// return fleet;
// }
//
// public static Fleet createTravelingFleet(int id, int x, int y, String nation, boolean dispatchable) {
// Fleet fleet = new Fleet(id, x, y, nation, dispatchable);
// return fleet;
// }
//
// public int getId() {
// return id;
// }
//
// public String getStar() {
// return star;
// }
//
// public String getNation() {
// return nation;
// }
//
// public boolean isDispatchable() {
// return dispatchable;
// }
//
// public Integer getX() {
// return x;
// }
//
// public Integer getY() {
// return y;
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/game/common/view/star/Star.java
// public class Star {
//
// private final String name;
// private final int x;
// private final int y;
//
// private final String nation;
// private final Integer population;
//
// private Star(String name, int x, int y, String nation, Integer population) {
// this.name = name;
// this.x = x;
// this.y = y;
// this.nation = nation;
// this.population = population;
// }
//
// public static Star createAnonymousStar(String name, int x, int y) {
// Star star = new Star(name, x, y, null, null);
// return star;
// }
//
// public static Star createAlienStar(String name, int x, int y, String nation) {
// Star star = new Star(name, x, y, nation, null);
// return star;
// }
//
// public static Star createOwnedStar(String name, int x, int y, String nation, int population) {
// Star star = new Star(name, x, y, nation, population);
// return star;
// }
//
// public String getName() {
// return name;
// }
//
// public int getX() {
// return x;
// }
//
// public int getY() {
// return y;
// }
//
// public String getNation() {
// return nation;
// }
//
// public Integer getPopulation() {
// return population;
// }
// }
// Path: src/main/java/com/scheible/risingempire/game/common/view/View.java
import com.scheible.risingempire.game.common.Player;
import com.scheible.risingempire.game.common.event.Event;
import com.scheible.risingempire.game.common.view.fleet.Fleet;
import com.scheible.risingempire.game.common.view.star.Star;
import java.util.List;
package com.scheible.risingempire.game.common.view;
/**
*
* @author sj
*/
public class View {
private final List<Player> players;
private final List<Star> stars;
private final List<Fleet> fleets;
| private final List<Event> events; |
janScheible/rising-empire | src/main/java/com/scheible/risingempire/web/config/websocket/WebSocketConfig.java | // Path: src/main/java/com/scheible/risingempire/web/config/web/JsonConfig.java
// @Component
// public class JsonConfig {
//
// @Autowired
// ObjectMapper objectMapper;
//
// public MessageConverter configure() {
// DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
// resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
// MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
//
// // NOTE Includes Java type informations (only for the deserialization process, objectMapper.enableDefaultTyping() would do it for both ways).
// // https://github.com/FasterXML/jackson-databind/issues/352
// TypeResolverBuilder<?> typer = new ObjectMapper.DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE);
// // we'll always use full class name, when using defaulting
// typer = typer.init(JsonTypeInfo.Id.CLASS, null);
// typer = typer.inclusion(JsonTypeInfo.As.WRAPPER_ARRAY);
// objectMapper.setConfig(objectMapper.getDeserializationConfig().with(typer));
//
// // NOTE Operate on a field basis.
// objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
// objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
//
// converter.setObjectMapper(objectMapper);
// converter.setContentTypeResolver(resolver);
//
// return converter;
// }
// }
| import com.scheible.risingempire.web.config.web.JsonConfig;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.converter.MessageConverter;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.session.ExpiringSession;
import org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; | package com.scheible.risingempire.web.config.websocket;
/**
*
* @author sj
*/
@Configuration
@EnableScheduling
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfigurer<ExpiringSession> {
@Autowired | // Path: src/main/java/com/scheible/risingempire/web/config/web/JsonConfig.java
// @Component
// public class JsonConfig {
//
// @Autowired
// ObjectMapper objectMapper;
//
// public MessageConverter configure() {
// DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
// resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
// MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
//
// // NOTE Includes Java type informations (only for the deserialization process, objectMapper.enableDefaultTyping() would do it for both ways).
// // https://github.com/FasterXML/jackson-databind/issues/352
// TypeResolverBuilder<?> typer = new ObjectMapper.DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE);
// // we'll always use full class name, when using defaulting
// typer = typer.init(JsonTypeInfo.Id.CLASS, null);
// typer = typer.inclusion(JsonTypeInfo.As.WRAPPER_ARRAY);
// objectMapper.setConfig(objectMapper.getDeserializationConfig().with(typer));
//
// // NOTE Operate on a field basis.
// objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
// objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
//
// converter.setObjectMapper(objectMapper);
// converter.setContentTypeResolver(resolver);
//
// return converter;
// }
// }
// Path: src/main/java/com/scheible/risingempire/web/config/websocket/WebSocketConfig.java
import com.scheible.risingempire.web.config.web.JsonConfig;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.converter.MessageConverter;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.session.ExpiringSession;
import org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
package com.scheible.risingempire.web.config.websocket;
/**
*
* @author sj
*/
@Configuration
@EnableScheduling
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfigurer<ExpiringSession> {
@Autowired | JsonConfig jsonConfig; |
janScheible/rising-empire | src/main/java/com/scheible/risingempire/web/join/JoinController.java | // Path: src/main/java/com/scheible/risingempire/web/join/message/server/PlayerEntry.java
// public class PlayerEntry {
//
// public enum State {
// ACTIVE, DETACHED, AI, NON_PARTICIPATING;
// }
//
// private final String leaderName;
// private final String nation;
// private final String username;
// private final State state;
// private final String color;
//
// private PlayerEntry(String leaderName, String nation, State state, Color color) {
// this.leaderName = leaderName;
// this.nation = nation;
// this.username = PlayerHelper.generateUsername(leaderName, nation);
// this.state = state;
// this.color = new BrowserColor(color).getHex();
// }
//
// public static PlayerEntry create(String username, PlayerEntry.State state) {
// Player player = resolvePlayer(username);
// return create(player.getName(), player.getNation(), state);
// }
//
// public static PlayerEntry create(String leaderName, String nation, PlayerEntry.State state) {
// return new PlayerEntry(leaderName, nation, state,
// AvailablePlayer.find(leaderName, nation).getColor());
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/web/security/ConnectedPlayer.java
// public final class ConnectedPlayer implements UserDetails {
//
// public final static PasswordEncoder PASSWORD_ENCODER = NoOpPasswordEncoder.getInstance();
// public final static String DEFAULT_PASSWORD = "yyy";
//
// private final String username;
//
// /* package */ ConnectedPlayer(String username) {
// this.username = username;
// }
//
// @Override
// public Collection<? extends GrantedAuthority> getAuthorities() {
// return AuthorityUtils.createAuthorityList("ROLE_USER");
// }
//
// @Override
// public String getUsername() {
// return username;
// }
//
// @Override
// public boolean isAccountNonExpired() {
// return true;
// }
//
// @Override
// public boolean isAccountNonLocked() {
// return true;
// }
//
// @Override
// public boolean isCredentialsNonExpired() {
// return true;
// }
//
// @Override
// public boolean isEnabled() {
// return true;
// }
//
// @Override
// public String getPassword() {
// return DEFAULT_PASSWORD;
// }
// }
| import com.scheible.risingempire.web.join.message.server.PlayerEntry;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.scheible.risingempire.web.security.ConnectedPlayer;
import java.security.Principal;
import org.springframework.context.ApplicationListener;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.socket.messaging.AbstractSubProtocolEvent;
import org.springframework.web.socket.messaging.SessionConnectEvent;
import org.springframework.web.socket.messaging.SessionDisconnectEvent; | package com.scheible.risingempire.web.join;
/**
*
* @author sj
*/
@Controller
public class JoinController implements ApplicationListener<AbstractSubProtocolEvent> {
@Autowired
SimpMessagingTemplate messagingTemplate;
@Autowired
PlayerManager playerManager;
@RequestMapping("/join.html")
public String join(Map<String, Object> model) { | // Path: src/main/java/com/scheible/risingempire/web/join/message/server/PlayerEntry.java
// public class PlayerEntry {
//
// public enum State {
// ACTIVE, DETACHED, AI, NON_PARTICIPATING;
// }
//
// private final String leaderName;
// private final String nation;
// private final String username;
// private final State state;
// private final String color;
//
// private PlayerEntry(String leaderName, String nation, State state, Color color) {
// this.leaderName = leaderName;
// this.nation = nation;
// this.username = PlayerHelper.generateUsername(leaderName, nation);
// this.state = state;
// this.color = new BrowserColor(color).getHex();
// }
//
// public static PlayerEntry create(String username, PlayerEntry.State state) {
// Player player = resolvePlayer(username);
// return create(player.getName(), player.getNation(), state);
// }
//
// public static PlayerEntry create(String leaderName, String nation, PlayerEntry.State state) {
// return new PlayerEntry(leaderName, nation, state,
// AvailablePlayer.find(leaderName, nation).getColor());
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/web/security/ConnectedPlayer.java
// public final class ConnectedPlayer implements UserDetails {
//
// public final static PasswordEncoder PASSWORD_ENCODER = NoOpPasswordEncoder.getInstance();
// public final static String DEFAULT_PASSWORD = "yyy";
//
// private final String username;
//
// /* package */ ConnectedPlayer(String username) {
// this.username = username;
// }
//
// @Override
// public Collection<? extends GrantedAuthority> getAuthorities() {
// return AuthorityUtils.createAuthorityList("ROLE_USER");
// }
//
// @Override
// public String getUsername() {
// return username;
// }
//
// @Override
// public boolean isAccountNonExpired() {
// return true;
// }
//
// @Override
// public boolean isAccountNonLocked() {
// return true;
// }
//
// @Override
// public boolean isCredentialsNonExpired() {
// return true;
// }
//
// @Override
// public boolean isEnabled() {
// return true;
// }
//
// @Override
// public String getPassword() {
// return DEFAULT_PASSWORD;
// }
// }
// Path: src/main/java/com/scheible/risingempire/web/join/JoinController.java
import com.scheible.risingempire.web.join.message.server.PlayerEntry;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.scheible.risingempire.web.security.ConnectedPlayer;
import java.security.Principal;
import org.springframework.context.ApplicationListener;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.socket.messaging.AbstractSubProtocolEvent;
import org.springframework.web.socket.messaging.SessionConnectEvent;
import org.springframework.web.socket.messaging.SessionDisconnectEvent;
package com.scheible.risingempire.web.join;
/**
*
* @author sj
*/
@Controller
public class JoinController implements ApplicationListener<AbstractSubProtocolEvent> {
@Autowired
SimpMessagingTemplate messagingTemplate;
@Autowired
PlayerManager playerManager;
@RequestMapping("/join.html")
public String join(Map<String, Object> model) { | model.put("defaultPassword", ConnectedPlayer.DEFAULT_PASSWORD); |
janScheible/rising-empire | src/main/java/com/scheible/risingempire/web/join/JoinController.java | // Path: src/main/java/com/scheible/risingempire/web/join/message/server/PlayerEntry.java
// public class PlayerEntry {
//
// public enum State {
// ACTIVE, DETACHED, AI, NON_PARTICIPATING;
// }
//
// private final String leaderName;
// private final String nation;
// private final String username;
// private final State state;
// private final String color;
//
// private PlayerEntry(String leaderName, String nation, State state, Color color) {
// this.leaderName = leaderName;
// this.nation = nation;
// this.username = PlayerHelper.generateUsername(leaderName, nation);
// this.state = state;
// this.color = new BrowserColor(color).getHex();
// }
//
// public static PlayerEntry create(String username, PlayerEntry.State state) {
// Player player = resolvePlayer(username);
// return create(player.getName(), player.getNation(), state);
// }
//
// public static PlayerEntry create(String leaderName, String nation, PlayerEntry.State state) {
// return new PlayerEntry(leaderName, nation, state,
// AvailablePlayer.find(leaderName, nation).getColor());
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/web/security/ConnectedPlayer.java
// public final class ConnectedPlayer implements UserDetails {
//
// public final static PasswordEncoder PASSWORD_ENCODER = NoOpPasswordEncoder.getInstance();
// public final static String DEFAULT_PASSWORD = "yyy";
//
// private final String username;
//
// /* package */ ConnectedPlayer(String username) {
// this.username = username;
// }
//
// @Override
// public Collection<? extends GrantedAuthority> getAuthorities() {
// return AuthorityUtils.createAuthorityList("ROLE_USER");
// }
//
// @Override
// public String getUsername() {
// return username;
// }
//
// @Override
// public boolean isAccountNonExpired() {
// return true;
// }
//
// @Override
// public boolean isAccountNonLocked() {
// return true;
// }
//
// @Override
// public boolean isCredentialsNonExpired() {
// return true;
// }
//
// @Override
// public boolean isEnabled() {
// return true;
// }
//
// @Override
// public String getPassword() {
// return DEFAULT_PASSWORD;
// }
// }
| import com.scheible.risingempire.web.join.message.server.PlayerEntry;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.scheible.risingempire.web.security.ConnectedPlayer;
import java.security.Principal;
import org.springframework.context.ApplicationListener;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.socket.messaging.AbstractSubProtocolEvent;
import org.springframework.web.socket.messaging.SessionConnectEvent;
import org.springframework.web.socket.messaging.SessionDisconnectEvent; | package com.scheible.risingempire.web.join;
/**
*
* @author sj
*/
@Controller
public class JoinController implements ApplicationListener<AbstractSubProtocolEvent> {
@Autowired
SimpMessagingTemplate messagingTemplate;
@Autowired
PlayerManager playerManager;
@RequestMapping("/join.html")
public String join(Map<String, Object> model) {
model.put("defaultPassword", ConnectedPlayer.DEFAULT_PASSWORD);
return "join";
}
@RequestMapping("/players") | // Path: src/main/java/com/scheible/risingempire/web/join/message/server/PlayerEntry.java
// public class PlayerEntry {
//
// public enum State {
// ACTIVE, DETACHED, AI, NON_PARTICIPATING;
// }
//
// private final String leaderName;
// private final String nation;
// private final String username;
// private final State state;
// private final String color;
//
// private PlayerEntry(String leaderName, String nation, State state, Color color) {
// this.leaderName = leaderName;
// this.nation = nation;
// this.username = PlayerHelper.generateUsername(leaderName, nation);
// this.state = state;
// this.color = new BrowserColor(color).getHex();
// }
//
// public static PlayerEntry create(String username, PlayerEntry.State state) {
// Player player = resolvePlayer(username);
// return create(player.getName(), player.getNation(), state);
// }
//
// public static PlayerEntry create(String leaderName, String nation, PlayerEntry.State state) {
// return new PlayerEntry(leaderName, nation, state,
// AvailablePlayer.find(leaderName, nation).getColor());
// }
// }
//
// Path: src/main/java/com/scheible/risingempire/web/security/ConnectedPlayer.java
// public final class ConnectedPlayer implements UserDetails {
//
// public final static PasswordEncoder PASSWORD_ENCODER = NoOpPasswordEncoder.getInstance();
// public final static String DEFAULT_PASSWORD = "yyy";
//
// private final String username;
//
// /* package */ ConnectedPlayer(String username) {
// this.username = username;
// }
//
// @Override
// public Collection<? extends GrantedAuthority> getAuthorities() {
// return AuthorityUtils.createAuthorityList("ROLE_USER");
// }
//
// @Override
// public String getUsername() {
// return username;
// }
//
// @Override
// public boolean isAccountNonExpired() {
// return true;
// }
//
// @Override
// public boolean isAccountNonLocked() {
// return true;
// }
//
// @Override
// public boolean isCredentialsNonExpired() {
// return true;
// }
//
// @Override
// public boolean isEnabled() {
// return true;
// }
//
// @Override
// public String getPassword() {
// return DEFAULT_PASSWORD;
// }
// }
// Path: src/main/java/com/scheible/risingempire/web/join/JoinController.java
import com.scheible.risingempire.web.join.message.server.PlayerEntry;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.scheible.risingempire.web.security.ConnectedPlayer;
import java.security.Principal;
import org.springframework.context.ApplicationListener;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.socket.messaging.AbstractSubProtocolEvent;
import org.springframework.web.socket.messaging.SessionConnectEvent;
import org.springframework.web.socket.messaging.SessionDisconnectEvent;
package com.scheible.risingempire.web.join;
/**
*
* @author sj
*/
@Controller
public class JoinController implements ApplicationListener<AbstractSubProtocolEvent> {
@Autowired
SimpMessagingTemplate messagingTemplate;
@Autowired
PlayerManager playerManager;
@RequestMapping("/join.html")
public String join(Map<String, Object> model) {
model.put("defaultPassword", ConnectedPlayer.DEFAULT_PASSWORD);
return "join";
}
@RequestMapping("/players") | public @ResponseBody List<PlayerEntry> players() { |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/SyncNoodleOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
| import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Synchronously submits {@link NoodleOrder} orders to a {@link NoodleBar}.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class SyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
| // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/SyncNoodleOrderGenerator.java
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Synchronously submits {@link NoodleOrder} orders to a {@link NoodleBar}.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class SyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
| private static NoodleBar noodleBar; |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/SyncNoodleOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
| import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Synchronously submits {@link NoodleOrder} orders to a {@link NoodleBar}.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class SyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
| // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/SyncNoodleOrderGenerator.java
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Synchronously submits {@link NoodleOrder} orders to a {@link NoodleBar}.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class SyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
| private static NoodleOrderThroughputMonitor noodleOrderThroughputMonitor; |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/SyncNoodleOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
| import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Synchronously submits {@link NoodleOrder} orders to a {@link NoodleBar}.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class SyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
private static NoodleOrderThroughputMonitor noodleOrderThroughputMonitor;
public static void main(String[] args) {
System.out.println("Initializing Dependencies...");
initializeDependencies();
long startTime = System.currentTimeMillis();
System.out.println("Sending orders into the Noodle Bar...");
sendSomeOrders();
long stopTime = System.currentTimeMillis();
long timeTaken = stopTime - startTime;
System.out.println("Simple timer calculated at end " + timeTaken + " milliseconds for " + NUMBER_OF_ORDERS
+ " orders");
System.out.println("The Noodle Bar is actually processing "
+ noodleOrderThroughputMonitor.getAverageThroughput()
+ " orders per second according to continuous Esper Monitoring");
System.exit(0);
}
private static void sendSomeOrders() { | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/SyncNoodleOrderGenerator.java
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Synchronously submits {@link NoodleOrder} orders to a {@link NoodleBar}.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class SyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
private static NoodleOrderThroughputMonitor noodleOrderThroughputMonitor;
public static void main(String[] args) {
System.out.println("Initializing Dependencies...");
initializeDependencies();
long startTime = System.currentTimeMillis();
System.out.println("Sending orders into the Noodle Bar...");
sendSomeOrders();
long stopTime = System.currentTimeMillis();
long timeTaken = stopTime - startTime;
System.out.println("Simple timer calculated at end " + timeTaken + " milliseconds for " + NUMBER_OF_ORDERS
+ " orders");
System.out.println("The Noodle Bar is actually processing "
+ noodleOrderThroughputMonitor.getAverageThroughput()
+ " orders per second according to continuous Esper Monitoring");
System.exit(0);
}
private static void sendSomeOrders() { | NoodleOrder[] orders = new NoodleOrder[NUMBER_OF_ORDERS]; |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/SyncNoodleOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
| import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Synchronously submits {@link NoodleOrder} orders to a {@link NoodleBar}.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class SyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
private static NoodleOrderThroughputMonitor noodleOrderThroughputMonitor;
public static void main(String[] args) {
System.out.println("Initializing Dependencies...");
initializeDependencies();
long startTime = System.currentTimeMillis();
System.out.println("Sending orders into the Noodle Bar...");
sendSomeOrders();
long stopTime = System.currentTimeMillis();
long timeTaken = stopTime - startTime;
System.out.println("Simple timer calculated at end " + timeTaken + " milliseconds for " + NUMBER_OF_ORDERS
+ " orders");
System.out.println("The Noodle Bar is actually processing "
+ noodleOrderThroughputMonitor.getAverageThroughput()
+ " orders per second according to continuous Esper Monitoring");
System.exit(0);
}
private static void sendSomeOrders() {
NoodleOrder[] orders = new NoodleOrder[NUMBER_OF_ORDERS];
// Create and send events
for (int x = 0; x < NUMBER_OF_ORDERS; x++) {
orders[x] = new NoodleOrder();
noodleBar.placeOrder(orders[x]);
}
for (NoodleOrder order : orders) { | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/SyncNoodleOrderGenerator.java
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Synchronously submits {@link NoodleOrder} orders to a {@link NoodleBar}.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class SyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
private static NoodleOrderThroughputMonitor noodleOrderThroughputMonitor;
public static void main(String[] args) {
System.out.println("Initializing Dependencies...");
initializeDependencies();
long startTime = System.currentTimeMillis();
System.out.println("Sending orders into the Noodle Bar...");
sendSomeOrders();
long stopTime = System.currentTimeMillis();
long timeTaken = stopTime - startTime;
System.out.println("Simple timer calculated at end " + timeTaken + " milliseconds for " + NUMBER_OF_ORDERS
+ " orders");
System.out.println("The Noodle Bar is actually processing "
+ noodleOrderThroughputMonitor.getAverageThroughput()
+ " orders per second according to continuous Esper Monitoring");
System.exit(0);
}
private static void sendSomeOrders() {
NoodleOrder[] orders = new NoodleOrder[NUMBER_OF_ORDERS];
// Create and send events
for (int x = 0; x < NUMBER_OF_ORDERS; x++) {
orders[x] = new NoodleOrder();
noodleBar.placeOrder(orders[x]);
}
for (NoodleOrder order : orders) { | if (order.getStatus() == OrderStatus.COMPLETE) { |
opencredo/opencredo-esper | esper-template/src/test/java/org/opencredo/esper/TestEsperStatement.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import static org.junit.Assert.assertEquals;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.opencredo.esper.sample.SampleEvent;
import com.espertech.esper.client.EventBean; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
public class TestEsperStatement {
private EsperTemplate template;
private EsperStatement statement;
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-template/src/test/java/org/opencredo/esper/TestEsperStatement.java
import static org.junit.Assert.assertEquals;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.opencredo.esper.sample.SampleEvent;
import com.espertech.esper.client.EventBean;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
public class TestEsperStatement {
private EsperTemplate template;
private EsperStatement statement;
| private ParameterizedEsperRowMapper<SampleEvent> rowMapper; |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPostReceiveOnlyWithDefaultWireTapPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPostReceiveOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel outgoingChannel;
@Autowired
@Qualifier("incomingDomainEvents")
QueueChannel incomingChannel;
@Autowired | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPostReceiveOnlyWithDefaultWireTapPassingDomainObjectTest.java
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPostReceiveOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel outgoingChannel;
@Autowired
@Qualifier("incomingDomainEvents")
QueueChannel incomingChannel;
@Autowired | CallRecordingListener listener; |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPostReceiveOnlyWithDefaultWireTapPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPostReceiveOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel outgoingChannel;
@Autowired
@Qualifier("incomingDomainEvents")
QueueChannel incomingChannel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPostReceiveOnlyWithDefaultWireTapPassingDomainObjectTest.java
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPostReceiveOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel outgoingChannel;
@Autowired
@Qualifier("incomingDomainEvents")
QueueChannel incomingChannel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| outgoingChannel.send(new GenericMessage<SampleEvent>(new SampleEvent())); |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/AsyncNoodleOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
| import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Asynchronously submits a number of orders to a {@link NoodleBar}
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class AsyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
| // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/AsyncNoodleOrderGenerator.java
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Asynchronously submits a number of orders to a {@link NoodleBar}
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class AsyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
| private static NoodleBar noodleBar; |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/AsyncNoodleOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
| import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Asynchronously submits a number of orders to a {@link NoodleBar}
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class AsyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
| // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/AsyncNoodleOrderGenerator.java
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Asynchronously submits a number of orders to a {@link NoodleBar}
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class AsyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
| private static NoodleOrderThroughputMonitor noodleOrderThroughputMonitor; |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/AsyncNoodleOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
| import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Asynchronously submits a number of orders to a {@link NoodleBar}
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class AsyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
private static NoodleOrderThroughputMonitor noodleOrderThroughputMonitor;
public static void main(String[] args) {
System.out.println("Initializing Dependencies...");
initializeDependencies();
long startTime = System.currentTimeMillis();
System.out.println("Sending orders into the Noodle Bar...");
sendSomeOrders();
long stopTime = System.currentTimeMillis();
long timeTaken = stopTime - startTime;
System.out.println("Simple timer calculated at end " + timeTaken + " milliseconds for " + NUMBER_OF_ORDERS
+ " orders");
System.out.println("The Noodle Bar is actually accepting "
+ noodleOrderThroughputMonitor.getAverageThroughput()
+ " orders per second according to continuous Esper Monitoring");
System.exit(0);
}
private static void sendSomeOrders() { | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/AsyncNoodleOrderGenerator.java
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Asynchronously submits a number of orders to a {@link NoodleBar}
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class AsyncNoodleOrderGenerator {
private static final int NUMBER_OF_ORDERS = 1000;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
private static final String NOODLE_ORDER_THROUGHPUT_MONITOR_BEAN_NAME = "noodleOrderThroughputMonitor";
private static NoodleBar noodleBar;
private static NoodleOrderThroughputMonitor noodleOrderThroughputMonitor;
public static void main(String[] args) {
System.out.println("Initializing Dependencies...");
initializeDependencies();
long startTime = System.currentTimeMillis();
System.out.println("Sending orders into the Noodle Bar...");
sendSomeOrders();
long stopTime = System.currentTimeMillis();
long timeTaken = stopTime - startTime;
System.out.println("Simple timer calculated at end " + timeTaken + " milliseconds for " + NUMBER_OF_ORDERS
+ " orders");
System.out.println("The Noodle Bar is actually accepting "
+ noodleOrderThroughputMonitor.getAverageThroughput()
+ " orders per second according to continuous Esper Monitoring");
System.exit(0);
}
private static void sendSomeOrders() { | NoodleOrder[] orders = new NoodleOrder[NUMBER_OF_ORDERS]; |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/AsyncNoodleOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
| import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; |
System.out.println("Simple timer calculated at end " + timeTaken + " milliseconds for " + NUMBER_OF_ORDERS
+ " orders");
System.out.println("The Noodle Bar is actually accepting "
+ noodleOrderThroughputMonitor.getAverageThroughput()
+ " orders per second according to continuous Esper Monitoring");
System.exit(0);
}
private static void sendSomeOrders() {
NoodleOrder[] orders = new NoodleOrder[NUMBER_OF_ORDERS];
// Create and send events
for (int x = 0; x < NUMBER_OF_ORDERS; x++) {
orders[x] = new NoodleOrder();
noodleBar.placeOrder(orders[x]);
// Sleep a little bit between orders
try {
Thread.sleep(5l);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
boolean processing = true;
while (processing) {
processing = false;
for (NoodleOrder order : orders) { | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/OrderStatus.java
// public enum OrderStatus {
// NEW, RECEIVED, REJECTED, BEING_COOKED, COMPLETE
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/throughput/NoodleOrderThroughputMonitor.java
// public class NoodleOrderThroughputMonitor implements ThroughputMonitor {
// private long averageThroughput = 0l;
//
// public synchronized void receiveCurrentThroughput(long ordersProcessedPerDuration) {
// this.averageThroughput = ordersProcessedPerDuration;
// }
//
// public synchronized long getAverageThroughput() {
// return averageThroughput;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/AsyncNoodleOrderGenerator.java
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.opencredo.esper.samples.noodlebar.domain.OrderStatus;
import org.opencredo.esper.samples.noodlebar.domain.throughput.NoodleOrderThroughputMonitor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
System.out.println("Simple timer calculated at end " + timeTaken + " milliseconds for " + NUMBER_OF_ORDERS
+ " orders");
System.out.println("The Noodle Bar is actually accepting "
+ noodleOrderThroughputMonitor.getAverageThroughput()
+ " orders per second according to continuous Esper Monitoring");
System.exit(0);
}
private static void sendSomeOrders() {
NoodleOrder[] orders = new NoodleOrder[NUMBER_OF_ORDERS];
// Create and send events
for (int x = 0; x < NUMBER_OF_ORDERS; x++) {
orders[x] = new NoodleOrder();
noodleBar.placeOrder(orders[x]);
// Sleep a little bit between orders
try {
Thread.sleep(5l);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
boolean processing = true;
while (processing) {
processing = false;
for (NoodleOrder order : orders) { | if (order.getStatus() == OrderStatus.COMPLETE) { |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapInterceptingChannelPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapInterceptingChannelPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapInterceptingChannelPassingDomainObjectTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapInterceptingChannelPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | CallRecordingListener listener; |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapInterceptingChannelPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapInterceptingChannelPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapInterceptingChannelPassingDomainObjectTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapInterceptingChannelPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| channel.send(new GenericMessage<SampleEvent>(new SampleEvent()), 500l); |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPreReceiveOnlyWithDefaultWireTapPassingContextTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPreReceiveOnlyWithDefaultWireTapPassingContextTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel outgoingChannel;
@Autowired
@Qualifier("incomingDomainEvents")
QueueChannel incomingChannel;
@Autowired | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPreReceiveOnlyWithDefaultWireTapPassingContextTest.java
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPreReceiveOnlyWithDefaultWireTapPassingContextTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel outgoingChannel;
@Autowired
@Qualifier("incomingDomainEvents")
QueueChannel incomingChannel;
@Autowired | CallRecordingListener listener; |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPreReceiveOnlyWithDefaultWireTapPassingContextTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPreReceiveOnlyWithDefaultWireTapPassingContextTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel outgoingChannel;
@Autowired
@Qualifier("incomingDomainEvents")
QueueChannel incomingChannel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPreReceiveOnlyWithDefaultWireTapPassingContextTest.java
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPreReceiveOnlyWithDefaultWireTapPassingContextTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel outgoingChannel;
@Autowired
@Qualifier("incomingDomainEvents")
QueueChannel incomingChannel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| outgoingChannel.send(new GenericMessage<SampleEvent>(new SampleEvent())); |
opencredo/opencredo-esper | esper-template/src/test/java/org/opencredo/esper/TestEsperTemplate.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import static org.junit.Assert.assertEquals;
import com.espertech.esper.client.EPStatementState;
import org.junit.Before;
import org.junit.Test;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
/**
* A unit test for the {@link EsperTemplate}.
*
* @author Russ Miles (russ.miles@opencredo.com)
* @author Aleksa Vukotic (aleksa.vukotic@opencredo.com)
*
*/
public class TestEsperTemplate {
private EsperTemplate template;
@Before
public void setupStatementUnderTest() {
this.template = new EsperTemplate();
}
@Test(expected = InvalidEsperConfigurationException.class)
public void testExceptionRaisedWhenTemplateNotInitialized() { | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-template/src/test/java/org/opencredo/esper/TestEsperTemplate.java
import static org.junit.Assert.assertEquals;
import com.espertech.esper.client.EPStatementState;
import org.junit.Before;
import org.junit.Test;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
/**
* A unit test for the {@link EsperTemplate}.
*
* @author Russ Miles (russ.miles@opencredo.com)
* @author Aleksa Vukotic (aleksa.vukotic@opencredo.com)
*
*/
public class TestEsperTemplate {
private EsperTemplate template;
@Before
public void setupStatementUnderTest() {
this.template = new EsperTemplate();
}
@Test(expected = InvalidEsperConfigurationException.class)
public void testExceptionRaisedWhenTemplateNotInitialized() { | template.sendEvent(new SampleEvent()); |
opencredo/opencredo-esper | esper-template/src/test/java/org/opencredo/esper/TestEsperTemplate.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import static org.junit.Assert.assertEquals;
import com.espertech.esper.client.EPStatementState;
import org.junit.Before;
import org.junit.Test;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
/**
* A unit test for the {@link EsperTemplate}.
*
* @author Russ Miles (russ.miles@opencredo.com)
* @author Aleksa Vukotic (aleksa.vukotic@opencredo.com)
*
*/
public class TestEsperTemplate {
private EsperTemplate template;
@Before
public void setupStatementUnderTest() {
this.template = new EsperTemplate();
}
@Test(expected = InvalidEsperConfigurationException.class)
public void testExceptionRaisedWhenTemplateNotInitialized() {
template.sendEvent(new SampleEvent());
}
@Test
public void testEventWithNoStatements() {
setupTemplateAndSendSampleEvent();
}
private void setupTemplateAndSendSampleEvent() {
template.setName("testTemplate");
template.initialize();
template.sendEvent(new SampleEvent());
}
@Test
public void testEventWithOneStatementNoListener() {
EsperStatement statement = addTestStatement();
template.addStatement(statement);
setupTemplateAndSendSampleEvent();
}
@Test
public void testEventWithOneStatementWithOneListener() {
EsperStatement statement = addTestStatement();
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-template/src/test/java/org/opencredo/esper/TestEsperTemplate.java
import static org.junit.Assert.assertEquals;
import com.espertech.esper.client.EPStatementState;
import org.junit.Before;
import org.junit.Test;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
/**
* A unit test for the {@link EsperTemplate}.
*
* @author Russ Miles (russ.miles@opencredo.com)
* @author Aleksa Vukotic (aleksa.vukotic@opencredo.com)
*
*/
public class TestEsperTemplate {
private EsperTemplate template;
@Before
public void setupStatementUnderTest() {
this.template = new EsperTemplate();
}
@Test(expected = InvalidEsperConfigurationException.class)
public void testExceptionRaisedWhenTemplateNotInitialized() {
template.sendEvent(new SampleEvent());
}
@Test
public void testEventWithNoStatements() {
setupTemplateAndSendSampleEvent();
}
private void setupTemplateAndSendSampleEvent() {
template.setName("testTemplate");
template.initialize();
template.sendEvent(new SampleEvent());
}
@Test
public void testEventWithOneStatementNoListener() {
EsperStatement statement = addTestStatement();
template.addStatement(statement);
setupTemplateAndSendSampleEvent();
}
@Test
public void testEventWithOneStatementWithOneListener() {
EsperStatement statement = addTestStatement();
| CallRecordingListener listener = this.addListenerToStatement(statement); |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPostSendOnlyWithDefaultWireTapPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPostSendOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPostSendOnlyWithDefaultWireTapPassingDomainObjectTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPostSendOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | CallRecordingListener listener; |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPostSendOnlyWithDefaultWireTapPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPostSendOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPostSendOnlyWithDefaultWireTapPassingDomainObjectTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPostSendOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| channel.send(new GenericMessage<SampleEvent>(new SampleEvent()), 500l); |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/DirectNoodleBarOrderGenerator.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
| import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.springframework.context.ApplicationContext; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Submits orders to a noodle bar with no additional esper-related
* configuration. This is to demonstrates the starting point before OpenCredo
* Esper can be applied transparently to expose temporal information about the
* underlying Spring Integration infrastructure.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class DirectNoodleBarOrderGenerator {
private static NoodleBar noodleBar;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
public static void main(String[] args) {
initializeDependencies();
| // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleBar.java
// public interface NoodleBar {
//
// /**
// * Places a noodle order.
// *
// * @param order
// * the new noodle order being placed.
// */
// public void placeOrder(NoodleOrder order);
//
// }
//
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/main/DirectNoodleBarOrderGenerator.java
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.opencredo.esper.samples.noodlebar.domain.NoodleBar;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
import org.springframework.context.ApplicationContext;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.main;
/**
* Submits orders to a noodle bar with no additional esper-related
* configuration. This is to demonstrates the starting point before OpenCredo
* Esper can be applied transparently to expose temporal information about the
* underlying Spring Integration infrastructure.
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class DirectNoodleBarOrderGenerator {
private static NoodleBar noodleBar;
private static final String NOODLE_BAR_BEAN_NAME = "noodleBar";
public static void main(String[] args) {
initializeDependencies();
| NoodleOrder order = new NoodleOrder(); |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapInterceptingChannelPassingContextTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapInterceptingChannelPassingContextTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapInterceptingChannelPassingContextTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapInterceptingChannelPassingContextTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | CallRecordingListener listener; |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapInterceptingChannelPassingContextTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapInterceptingChannelPassingContextTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapInterceptingChannelPassingContextTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapInterceptingChannelPassingContextTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| channel.send(new GenericMessage<SampleEvent>(new SampleEvent()), 500l); |
opencredo/opencredo-esper | esper-template/src/test/java/org/opencredo/esper/NonSpringBeanLifecycleEsperTemplateTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
//
// Path: esper-template/src/main/java/org/opencredo/esper/spring/EsperTemplateBean.java
// public class EsperTemplateBean extends EsperTemplate implements BeanNameAware, InitializingBean, DisposableBean {
// private final static Logger LOG = LoggerFactory.getLogger(EsperTemplateBean.class);
//
// public void setBeanName(String name) {
// super.setName(name);
// LOG.debug("Set esper template bean name to " + name);
// }
//
// public void afterPropertiesSet() {
// LOG.debug("Initializing the esper template bean");
// super.initialize();
// LOG.debug("Completed initializing the esper template bean");
// }
//
// public void destroy() {
// LOG.debug("Destroying the esper template bean");
// super.cleanup();
// LOG.debug("Finished destroying the esper template bean");
// }
// }
| import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.opencredo.esper.spring.EsperTemplateBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
/**
* Tests the {@link EsperTemplate} without it being the
* {@link EsperTemplateBean}, so without the close integration with Spring
* itself and its bean lifecycle hooks.
*
* @author Russ Miles (russell.miles@opencredo.com)
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class NonSpringBeanLifecycleEsperTemplateTest {
@Autowired
EsperTemplate template;
@Autowired | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
//
// Path: esper-template/src/main/java/org/opencredo/esper/spring/EsperTemplateBean.java
// public class EsperTemplateBean extends EsperTemplate implements BeanNameAware, InitializingBean, DisposableBean {
// private final static Logger LOG = LoggerFactory.getLogger(EsperTemplateBean.class);
//
// public void setBeanName(String name) {
// super.setName(name);
// LOG.debug("Set esper template bean name to " + name);
// }
//
// public void afterPropertiesSet() {
// LOG.debug("Initializing the esper template bean");
// super.initialize();
// LOG.debug("Completed initializing the esper template bean");
// }
//
// public void destroy() {
// LOG.debug("Destroying the esper template bean");
// super.cleanup();
// LOG.debug("Finished destroying the esper template bean");
// }
// }
// Path: esper-template/src/test/java/org/opencredo/esper/NonSpringBeanLifecycleEsperTemplateTest.java
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.opencredo.esper.spring.EsperTemplateBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
/**
* Tests the {@link EsperTemplate} without it being the
* {@link EsperTemplateBean}, so without the close integration with Spring
* itself and its bean lifecycle hooks.
*
* @author Russ Miles (russell.miles@opencredo.com)
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class NonSpringBeanLifecycleEsperTemplateTest {
@Autowired
EsperTemplate template;
@Autowired | CallRecordingListener listener; |
opencredo/opencredo-esper | esper-template/src/test/java/org/opencredo/esper/NonSpringBeanLifecycleEsperTemplateTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
//
// Path: esper-template/src/main/java/org/opencredo/esper/spring/EsperTemplateBean.java
// public class EsperTemplateBean extends EsperTemplate implements BeanNameAware, InitializingBean, DisposableBean {
// private final static Logger LOG = LoggerFactory.getLogger(EsperTemplateBean.class);
//
// public void setBeanName(String name) {
// super.setName(name);
// LOG.debug("Set esper template bean name to " + name);
// }
//
// public void afterPropertiesSet() {
// LOG.debug("Initializing the esper template bean");
// super.initialize();
// LOG.debug("Completed initializing the esper template bean");
// }
//
// public void destroy() {
// LOG.debug("Destroying the esper template bean");
// super.cleanup();
// LOG.debug("Finished destroying the esper template bean");
// }
// }
| import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.opencredo.esper.spring.EsperTemplateBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
/**
* Tests the {@link EsperTemplate} without it being the
* {@link EsperTemplateBean}, so without the close integration with Spring
* itself and its bean lifecycle hooks.
*
* @author Russ Miles (russell.miles@opencredo.com)
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class NonSpringBeanLifecycleEsperTemplateTest {
@Autowired
EsperTemplate template;
@Autowired
CallRecordingListener listener;
@Test
public void testSendSampleEvent() { | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
//
// Path: esper-template/src/main/java/org/opencredo/esper/spring/EsperTemplateBean.java
// public class EsperTemplateBean extends EsperTemplate implements BeanNameAware, InitializingBean, DisposableBean {
// private final static Logger LOG = LoggerFactory.getLogger(EsperTemplateBean.class);
//
// public void setBeanName(String name) {
// super.setName(name);
// LOG.debug("Set esper template bean name to " + name);
// }
//
// public void afterPropertiesSet() {
// LOG.debug("Initializing the esper template bean");
// super.initialize();
// LOG.debug("Completed initializing the esper template bean");
// }
//
// public void destroy() {
// LOG.debug("Destroying the esper template bean");
// super.cleanup();
// LOG.debug("Finished destroying the esper template bean");
// }
// }
// Path: esper-template/src/test/java/org/opencredo/esper/NonSpringBeanLifecycleEsperTemplateTest.java
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.opencredo.esper.spring.EsperTemplateBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper;
/**
* Tests the {@link EsperTemplate} without it being the
* {@link EsperTemplateBean}, so without the close integration with Spring
* itself and its bean lifecycle hooks.
*
* @author Russ Miles (russell.miles@opencredo.com)
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class NonSpringBeanLifecycleEsperTemplateTest {
@Autowired
EsperTemplate template;
@Autowired
CallRecordingListener listener;
@Test
public void testSendSampleEvent() { | template.sendEvent(new SampleEvent()); |
opencredo/opencredo-esper | esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/yummy/YummyNoodleBar.java | // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
| import static org.opencredo.esper.samples.noodlebar.domain.OrderStatus.BEING_COOKED;
import static org.opencredo.esper.samples.noodlebar.domain.OrderStatus.COMPLETE;
import static org.opencredo.esper.samples.noodlebar.domain.OrderStatus.RECEIVED;
import static org.opencredo.esper.samples.noodlebar.domain.OrderStatus.REJECTED;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.domain.yummy;
/**
* A simple service that pretends to execute an order.
*
* For the real thing, visit http://www.yummynoodlebar.co.uk/
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class YummyNoodleBar implements YNoodleBar {
private long cookDuration;
public void setCookDuration(long cookDuration) {
this.cookDuration = cookDuration;
}
| // Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/NoodleOrder.java
// public class NoodleOrder {
// private OrderStatus status = NEW;
//
// public synchronized void setStatus(OrderStatus status) {
// this.status = status;
// }
//
// public OrderStatus getStatus() {
// return this.status;
// }
// }
// Path: esper-samples/simple-esper-si-sample/src/main/java/org/opencredo/esper/samples/noodlebar/domain/yummy/YummyNoodleBar.java
import static org.opencredo.esper.samples.noodlebar.domain.OrderStatus.BEING_COOKED;
import static org.opencredo.esper.samples.noodlebar.domain.OrderStatus.COMPLETE;
import static org.opencredo.esper.samples.noodlebar.domain.OrderStatus.RECEIVED;
import static org.opencredo.esper.samples.noodlebar.domain.OrderStatus.REJECTED;
import org.opencredo.esper.samples.noodlebar.domain.NoodleOrder;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.samples.noodlebar.domain.yummy;
/**
* A simple service that pretends to execute an order.
*
* For the real thing, visit http://www.yummynoodlebar.co.uk/
*
* @author Russ Miles (russ.miles@opencredo.com)
*
*/
public class YummyNoodleBar implements YNoodleBar {
private long cookDuration;
public void setCookDuration(long cookDuration) {
this.cookDuration = cookDuration;
}
| public void cookNoodles(NoodleOrder order) { |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPreSendOnlyWithDefaultWireTapPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPreSendOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPreSendOnlyWithDefaultWireTapPassingDomainObjectTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPreSendOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | CallRecordingListener listener; |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPreSendOnlyWithDefaultWireTapPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPreSendOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsPreSendOnlyWithDefaultWireTapPassingDomainObjectTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsPreSendOnlyWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| channel.send(new GenericMessage<SampleEvent>(new SampleEvent()), 500l); |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsWithDefaultWireTapPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsWithDefaultWireTapPassingDomainObjectTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired | CallRecordingListener listener; |
opencredo/opencredo-esper | esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsWithDefaultWireTapPassingDomainObjectTest.java | // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration; | /*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| // Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/CallRecordingListener.java
// public class CallRecordingListener extends AbstractCallRecorder implements UpdateListener {
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.espertech.esper.client.UpdateListener#update(com.espertech.esper.
// * client.EventBean[], com.espertech.esper.client.EventBean[])
// */
// public void update(EventBean[] eventBeans, EventBean[] eventBeans1) {
// super.incrementCallCounter();
// }
//
// public void update(EventBean[] eventBeans) {
// super.incrementCallCounter();
// }
//
// /**
// * Method used when this class is being used as a subscriber as opposed to a
// * listener.
// *
// * @param event
// * The event detected
// */
// public void update(SampleEvent event) {
// super.incrementCallCounter();
// }
// }
//
// Path: esper-test-utils/src/main/java/org/opencredo/esper/sample/SampleEvent.java
// public class SampleEvent {
// private Status status = NEW;
//
// public synchronized void setStatus(Status status) {
// this.status = status;
// }
//
// public Status getStatus() {
// return this.status;
// }
// }
// Path: esper-si-support/src/test/java/org/opencredo/esper/integration/config/xml/WireTapChannelsWithDefaultWireTapPassingDomainObjectTest.java
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opencredo.esper.sample.CallRecordingListener;
import org.opencredo.esper.sample.SampleEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
/*
* OpenCredo-Esper - simplifies adopting Esper in Java applications.
* Copyright (C) 2010 OpenCredo Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.opencredo.esper.integration.config.xml;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WireTapChannelsWithDefaultWireTapPassingDomainObjectTest {
@Autowired
@Qualifier("outgoingDomainEvents")
MessageChannel channel;
@Autowired
CallRecordingListener listener;
@Test
public void sendADomainMessageAcrossChannelAndAssertThatListenerIsInvoked() {
| channel.send(new GenericMessage<SampleEvent>(new SampleEvent()), 500l); |
idega/se.agura.memorial | src/java/se/agura/memorial/search/business/SearchImplBrokerBean.java | // Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConn.java
// public interface GraveDatabaseConn extends IDOEntity {
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDatabaseName
// */
// public void setDatabaseName(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDatabaseName
// */
// public String getDatabaseName();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setAPIDBConnection
// */
// public void setAPIDBConnection(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getAPIDBConnection
// */
// public String getAPIDBConnection();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDescription
// */
// public void setDescription(String description);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDescription
// */
// public String getDescription();
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConnHome.java
// public interface GraveDatabaseConnHome extends IDOHome {
// public GraveDatabaseConn create() throws javax.ejb.CreateException;
//
// public GraveDatabaseConn findByPrimaryKey(Object pk)
// throws javax.ejb.FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAll
// */
// public Collection findAll() throws FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAllNameContaining
// */
// public Collection findAllNameContaining(String s) throws FinderException;
//
// }
| import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.FinderException;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.data.GraveDatabaseConn;
import se.agura.memorial.search.data.GraveDatabaseConnHome;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException; | package se.agura.memorial.search.business;
public class SearchImplBrokerBean extends IBOServiceBean implements SearchImplBroker{
private Map map = new HashMap();
public SearchImplBrokerBean() {
try {
Collection c = getAllDatabaseConnections();
for (Iterator iter = c.iterator(); iter.hasNext();) { | // Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConn.java
// public interface GraveDatabaseConn extends IDOEntity {
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDatabaseName
// */
// public void setDatabaseName(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDatabaseName
// */
// public String getDatabaseName();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setAPIDBConnection
// */
// public void setAPIDBConnection(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getAPIDBConnection
// */
// public String getAPIDBConnection();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDescription
// */
// public void setDescription(String description);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDescription
// */
// public String getDescription();
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConnHome.java
// public interface GraveDatabaseConnHome extends IDOHome {
// public GraveDatabaseConn create() throws javax.ejb.CreateException;
//
// public GraveDatabaseConn findByPrimaryKey(Object pk)
// throws javax.ejb.FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAll
// */
// public Collection findAll() throws FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAllNameContaining
// */
// public Collection findAllNameContaining(String s) throws FinderException;
//
// }
// Path: src/java/se/agura/memorial/search/business/SearchImplBrokerBean.java
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.FinderException;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.data.GraveDatabaseConn;
import se.agura.memorial.search.data.GraveDatabaseConnHome;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException;
package se.agura.memorial.search.business;
public class SearchImplBrokerBean extends IBOServiceBean implements SearchImplBroker{
private Map map = new HashMap();
public SearchImplBrokerBean() {
try {
Collection c = getAllDatabaseConnections();
for (Iterator iter = c.iterator(); iter.hasNext();) { | GraveDatabaseConn gdc = (GraveDatabaseConn) iter.next(); |
idega/se.agura.memorial | src/java/se/agura/memorial/search/business/SearchImplBrokerBean.java | // Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConn.java
// public interface GraveDatabaseConn extends IDOEntity {
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDatabaseName
// */
// public void setDatabaseName(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDatabaseName
// */
// public String getDatabaseName();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setAPIDBConnection
// */
// public void setAPIDBConnection(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getAPIDBConnection
// */
// public String getAPIDBConnection();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDescription
// */
// public void setDescription(String description);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDescription
// */
// public String getDescription();
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConnHome.java
// public interface GraveDatabaseConnHome extends IDOHome {
// public GraveDatabaseConn create() throws javax.ejb.CreateException;
//
// public GraveDatabaseConn findByPrimaryKey(Object pk)
// throws javax.ejb.FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAll
// */
// public Collection findAll() throws FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAllNameContaining
// */
// public Collection findAllNameContaining(String s) throws FinderException;
//
// }
| import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.FinderException;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.data.GraveDatabaseConn;
import se.agura.memorial.search.data.GraveDatabaseConnHome;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException; | package se.agura.memorial.search.business;
public class SearchImplBrokerBean extends IBOServiceBean implements SearchImplBroker{
private Map map = new HashMap();
public SearchImplBrokerBean() {
try {
Collection c = getAllDatabaseConnections();
for (Iterator iter = c.iterator(); iter.hasNext();) {
GraveDatabaseConn gdc = (GraveDatabaseConn) iter.next();
try {
Class implClass = Class.forName(gdc.getAPIDBConnection()); | // Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConn.java
// public interface GraveDatabaseConn extends IDOEntity {
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDatabaseName
// */
// public void setDatabaseName(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDatabaseName
// */
// public String getDatabaseName();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setAPIDBConnection
// */
// public void setAPIDBConnection(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getAPIDBConnection
// */
// public String getAPIDBConnection();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDescription
// */
// public void setDescription(String description);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDescription
// */
// public String getDescription();
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConnHome.java
// public interface GraveDatabaseConnHome extends IDOHome {
// public GraveDatabaseConn create() throws javax.ejb.CreateException;
//
// public GraveDatabaseConn findByPrimaryKey(Object pk)
// throws javax.ejb.FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAll
// */
// public Collection findAll() throws FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAllNameContaining
// */
// public Collection findAllNameContaining(String s) throws FinderException;
//
// }
// Path: src/java/se/agura/memorial/search/business/SearchImplBrokerBean.java
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.FinderException;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.data.GraveDatabaseConn;
import se.agura.memorial.search.data.GraveDatabaseConnHome;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException;
package se.agura.memorial.search.business;
public class SearchImplBrokerBean extends IBOServiceBean implements SearchImplBroker{
private Map map = new HashMap();
public SearchImplBrokerBean() {
try {
Collection c = getAllDatabaseConnections();
for (Iterator iter = c.iterator(); iter.hasNext();) {
GraveDatabaseConn gdc = (GraveDatabaseConn) iter.next();
try {
Class implClass = Class.forName(gdc.getAPIDBConnection()); | ObituarySearch os = (ObituarySearch) implClass.newInstance(); |
idega/se.agura.memorial | src/java/se/agura/memorial/search/business/SearchImplBrokerBean.java | // Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConn.java
// public interface GraveDatabaseConn extends IDOEntity {
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDatabaseName
// */
// public void setDatabaseName(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDatabaseName
// */
// public String getDatabaseName();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setAPIDBConnection
// */
// public void setAPIDBConnection(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getAPIDBConnection
// */
// public String getAPIDBConnection();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDescription
// */
// public void setDescription(String description);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDescription
// */
// public String getDescription();
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConnHome.java
// public interface GraveDatabaseConnHome extends IDOHome {
// public GraveDatabaseConn create() throws javax.ejb.CreateException;
//
// public GraveDatabaseConn findByPrimaryKey(Object pk)
// throws javax.ejb.FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAll
// */
// public Collection findAll() throws FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAllNameContaining
// */
// public Collection findAllNameContaining(String s) throws FinderException;
//
// }
| import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.FinderException;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.data.GraveDatabaseConn;
import se.agura.memorial.search.data.GraveDatabaseConnHome;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException; | package se.agura.memorial.search.business;
public class SearchImplBrokerBean extends IBOServiceBean implements SearchImplBroker{
private Map map = new HashMap();
public SearchImplBrokerBean() {
try {
Collection c = getAllDatabaseConnections();
for (Iterator iter = c.iterator(); iter.hasNext();) {
GraveDatabaseConn gdc = (GraveDatabaseConn) iter.next();
try {
Class implClass = Class.forName(gdc.getAPIDBConnection());
ObituarySearch os = (ObituarySearch) implClass.newInstance();
map.put(gdc.getPrimaryKey(), os);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
} catch (IDOLookupException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FinderException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public ObituarySearch getSearch(int databaseConnId) {
return (ObituarySearch) map.get(new Integer(databaseConnId));
}
private Collection getAllDatabaseConnections()throws FinderException,IDOLookupException { | // Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConn.java
// public interface GraveDatabaseConn extends IDOEntity {
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDatabaseName
// */
// public void setDatabaseName(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDatabaseName
// */
// public String getDatabaseName();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setAPIDBConnection
// */
// public void setAPIDBConnection(String name);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getAPIDBConnection
// */
// public String getAPIDBConnection();
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#setDescription
// */
// public void setDescription(String description);
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#getDescription
// */
// public String getDescription();
//
// }
//
// Path: src/java/se/agura/memorial/search/data/GraveDatabaseConnHome.java
// public interface GraveDatabaseConnHome extends IDOHome {
// public GraveDatabaseConn create() throws javax.ejb.CreateException;
//
// public GraveDatabaseConn findByPrimaryKey(Object pk)
// throws javax.ejb.FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAll
// */
// public Collection findAll() throws FinderException;
//
// /**
// * @see se.agura.memorial.search.data.GraveDatabaseConnBMPBean#ejbFindAllNameContaining
// */
// public Collection findAllNameContaining(String s) throws FinderException;
//
// }
// Path: src/java/se/agura/memorial/search/business/SearchImplBrokerBean.java
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.FinderException;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.data.GraveDatabaseConn;
import se.agura.memorial.search.data.GraveDatabaseConnHome;
import com.idega.business.IBOServiceBean;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException;
package se.agura.memorial.search.business;
public class SearchImplBrokerBean extends IBOServiceBean implements SearchImplBroker{
private Map map = new HashMap();
public SearchImplBrokerBean() {
try {
Collection c = getAllDatabaseConnections();
for (Iterator iter = c.iterator(); iter.hasNext();) {
GraveDatabaseConn gdc = (GraveDatabaseConn) iter.next();
try {
Class implClass = Class.forName(gdc.getAPIDBConnection());
ObituarySearch os = (ObituarySearch) implClass.newInstance();
map.put(gdc.getPrimaryKey(), os);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
} catch (IDOLookupException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FinderException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public ObituarySearch getSearch(int databaseConnId) {
return (ObituarySearch) map.get(new Integer(databaseConnId));
}
private Collection getAllDatabaseConnections()throws FinderException,IDOLookupException { | GraveDatabaseConnHome gdch = (GraveDatabaseConnHome) IDOLookup.getHome(GraveDatabaseConn.class); |
idega/se.agura.memorial | src/java/se/agura/memorial/search/presentation/GraveyardConverter.java | // Path: src/java/se/agura/memorial/search/api/Graveyard.java
// public class Graveyard {
// private int id;
//
// private String kGard; //
//
// private String Benamning; //
//
// private int distriktID;
//
// public Graveyard(int id, String kGard, String Benamning, int distriktID) {
// super();
//
// this.id = id;
// this.kGard = kGard;
// this.Benamning = Benamning;
// this.distriktID = distriktID;
// }
//
// public String getBenamning() {
// return Benamning;
// }
//
// public void setBenamning(String benamning) {
// Benamning = benamning;
// }
//
// public int getDistrikt_ID() {
// return distriktID;
// }
//
// public void setDistrikt_ID(int distrikt_ID) {
// this.distriktID = distrikt_ID;
// }
//
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
//
// public String getKGard() {
// return kGard;
// }
//
// public void setKGard(String gard) {
// kGard = gard;
// }
//
// public int hashCode() {
// String tempKGard = getKGard();
// if ( tempKGard == null) {
// return getId() + getDistrikt_ID();
// }
// return getId() + getDistrikt_ID() + tempKGard.hashCode();
// }
//
// public boolean equals(Object object) {
// if (this == object) {
// return true;
// }
// if (object == null) {
// return false;
// }
// if (getClass() != object.getClass()) {
// return false;
// }
// Graveyard graveyard = (Graveyard) object;
// String tempKGard = getKGard();
// String graveyardKGard = graveyard.getKGard();
// if (tempKGard == null && graveyardKGard == null) {
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID());
// }
// if (tempKGard == null || graveyardKGard == null) {
// return false;
// }
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID() && graveyardKGard.equals(tempKGard));
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchFormSessionBean.java
// public class SearchFormSessionBean extends IBOSessionBean implements SearchFormSession{
//
// private Integer databaseId = null;
//
// private String graveId = null;
//
//
// public SearchFormSessionBean(){}
//
//
//
// public String getGraveId() {
// return graveId;
// }
//
//
//
//
// public void setGraveId(String graveId) {
// this.graveId = graveId;
// }
//
//
//
//
// public Integer getDatabaseId() {
// return databaseId;
// }
//
// public void setDatabaseId(Integer databaseId) {
// this.databaseId = databaseId;
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchImplBroker.java
// public interface SearchImplBroker extends IBOService {
// /**
// * @see se.agura.memorial.search.business.SearchImplBrokerBean#getSearch
// */
// public ObituarySearch getSearch(int databaseConnId)
// throws java.rmi.RemoteException;
//
// }
| import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import se.agura.memorial.search.api.Graveyard;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.business.SearchFormSessionBean;
import se.agura.memorial.search.business.SearchImplBroker;
import com.idega.business.IBOLookup;
import com.idega.business.IBOLookupException;
import com.idega.presentation.IWContext; | package se.agura.memorial.search.presentation;
public class GraveyardConverter implements Converter {
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
throws ConverterException {
| // Path: src/java/se/agura/memorial/search/api/Graveyard.java
// public class Graveyard {
// private int id;
//
// private String kGard; //
//
// private String Benamning; //
//
// private int distriktID;
//
// public Graveyard(int id, String kGard, String Benamning, int distriktID) {
// super();
//
// this.id = id;
// this.kGard = kGard;
// this.Benamning = Benamning;
// this.distriktID = distriktID;
// }
//
// public String getBenamning() {
// return Benamning;
// }
//
// public void setBenamning(String benamning) {
// Benamning = benamning;
// }
//
// public int getDistrikt_ID() {
// return distriktID;
// }
//
// public void setDistrikt_ID(int distrikt_ID) {
// this.distriktID = distrikt_ID;
// }
//
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
//
// public String getKGard() {
// return kGard;
// }
//
// public void setKGard(String gard) {
// kGard = gard;
// }
//
// public int hashCode() {
// String tempKGard = getKGard();
// if ( tempKGard == null) {
// return getId() + getDistrikt_ID();
// }
// return getId() + getDistrikt_ID() + tempKGard.hashCode();
// }
//
// public boolean equals(Object object) {
// if (this == object) {
// return true;
// }
// if (object == null) {
// return false;
// }
// if (getClass() != object.getClass()) {
// return false;
// }
// Graveyard graveyard = (Graveyard) object;
// String tempKGard = getKGard();
// String graveyardKGard = graveyard.getKGard();
// if (tempKGard == null && graveyardKGard == null) {
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID());
// }
// if (tempKGard == null || graveyardKGard == null) {
// return false;
// }
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID() && graveyardKGard.equals(tempKGard));
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchFormSessionBean.java
// public class SearchFormSessionBean extends IBOSessionBean implements SearchFormSession{
//
// private Integer databaseId = null;
//
// private String graveId = null;
//
//
// public SearchFormSessionBean(){}
//
//
//
// public String getGraveId() {
// return graveId;
// }
//
//
//
//
// public void setGraveId(String graveId) {
// this.graveId = graveId;
// }
//
//
//
//
// public Integer getDatabaseId() {
// return databaseId;
// }
//
// public void setDatabaseId(Integer databaseId) {
// this.databaseId = databaseId;
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchImplBroker.java
// public interface SearchImplBroker extends IBOService {
// /**
// * @see se.agura.memorial.search.business.SearchImplBrokerBean#getSearch
// */
// public ObituarySearch getSearch(int databaseConnId)
// throws java.rmi.RemoteException;
//
// }
// Path: src/java/se/agura/memorial/search/presentation/GraveyardConverter.java
import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import se.agura.memorial.search.api.Graveyard;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.business.SearchFormSessionBean;
import se.agura.memorial.search.business.SearchImplBroker;
import com.idega.business.IBOLookup;
import com.idega.business.IBOLookupException;
import com.idega.presentation.IWContext;
package se.agura.memorial.search.presentation;
public class GraveyardConverter implements Converter {
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
throws ConverterException {
| Graveyard g = null; |
idega/se.agura.memorial | src/java/se/agura/memorial/search/presentation/GraveyardConverter.java | // Path: src/java/se/agura/memorial/search/api/Graveyard.java
// public class Graveyard {
// private int id;
//
// private String kGard; //
//
// private String Benamning; //
//
// private int distriktID;
//
// public Graveyard(int id, String kGard, String Benamning, int distriktID) {
// super();
//
// this.id = id;
// this.kGard = kGard;
// this.Benamning = Benamning;
// this.distriktID = distriktID;
// }
//
// public String getBenamning() {
// return Benamning;
// }
//
// public void setBenamning(String benamning) {
// Benamning = benamning;
// }
//
// public int getDistrikt_ID() {
// return distriktID;
// }
//
// public void setDistrikt_ID(int distrikt_ID) {
// this.distriktID = distrikt_ID;
// }
//
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
//
// public String getKGard() {
// return kGard;
// }
//
// public void setKGard(String gard) {
// kGard = gard;
// }
//
// public int hashCode() {
// String tempKGard = getKGard();
// if ( tempKGard == null) {
// return getId() + getDistrikt_ID();
// }
// return getId() + getDistrikt_ID() + tempKGard.hashCode();
// }
//
// public boolean equals(Object object) {
// if (this == object) {
// return true;
// }
// if (object == null) {
// return false;
// }
// if (getClass() != object.getClass()) {
// return false;
// }
// Graveyard graveyard = (Graveyard) object;
// String tempKGard = getKGard();
// String graveyardKGard = graveyard.getKGard();
// if (tempKGard == null && graveyardKGard == null) {
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID());
// }
// if (tempKGard == null || graveyardKGard == null) {
// return false;
// }
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID() && graveyardKGard.equals(tempKGard));
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchFormSessionBean.java
// public class SearchFormSessionBean extends IBOSessionBean implements SearchFormSession{
//
// private Integer databaseId = null;
//
// private String graveId = null;
//
//
// public SearchFormSessionBean(){}
//
//
//
// public String getGraveId() {
// return graveId;
// }
//
//
//
//
// public void setGraveId(String graveId) {
// this.graveId = graveId;
// }
//
//
//
//
// public Integer getDatabaseId() {
// return databaseId;
// }
//
// public void setDatabaseId(Integer databaseId) {
// this.databaseId = databaseId;
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchImplBroker.java
// public interface SearchImplBroker extends IBOService {
// /**
// * @see se.agura.memorial.search.business.SearchImplBrokerBean#getSearch
// */
// public ObituarySearch getSearch(int databaseConnId)
// throws java.rmi.RemoteException;
//
// }
| import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import se.agura.memorial.search.api.Graveyard;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.business.SearchFormSessionBean;
import se.agura.memorial.search.business.SearchImplBroker;
import com.idega.business.IBOLookup;
import com.idega.business.IBOLookupException;
import com.idega.presentation.IWContext; | package se.agura.memorial.search.presentation;
public class GraveyardConverter implements Converter {
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
throws ConverterException {
Graveyard g = null;
//g = (Graveyard) new SearchFormBackingBean.getGraveyards().get(arg2);
/*
1. get current data base implementation id (from session bean)
2. get database graveyards
3. find appropriate graveyard by Id
*/
//1.
FacesContext facesContext = FacesContext.getCurrentInstance();
IWContext iwc = IWContext.getIWContext(facesContext);
try { | // Path: src/java/se/agura/memorial/search/api/Graveyard.java
// public class Graveyard {
// private int id;
//
// private String kGard; //
//
// private String Benamning; //
//
// private int distriktID;
//
// public Graveyard(int id, String kGard, String Benamning, int distriktID) {
// super();
//
// this.id = id;
// this.kGard = kGard;
// this.Benamning = Benamning;
// this.distriktID = distriktID;
// }
//
// public String getBenamning() {
// return Benamning;
// }
//
// public void setBenamning(String benamning) {
// Benamning = benamning;
// }
//
// public int getDistrikt_ID() {
// return distriktID;
// }
//
// public void setDistrikt_ID(int distrikt_ID) {
// this.distriktID = distrikt_ID;
// }
//
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
//
// public String getKGard() {
// return kGard;
// }
//
// public void setKGard(String gard) {
// kGard = gard;
// }
//
// public int hashCode() {
// String tempKGard = getKGard();
// if ( tempKGard == null) {
// return getId() + getDistrikt_ID();
// }
// return getId() + getDistrikt_ID() + tempKGard.hashCode();
// }
//
// public boolean equals(Object object) {
// if (this == object) {
// return true;
// }
// if (object == null) {
// return false;
// }
// if (getClass() != object.getClass()) {
// return false;
// }
// Graveyard graveyard = (Graveyard) object;
// String tempKGard = getKGard();
// String graveyardKGard = graveyard.getKGard();
// if (tempKGard == null && graveyardKGard == null) {
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID());
// }
// if (tempKGard == null || graveyardKGard == null) {
// return false;
// }
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID() && graveyardKGard.equals(tempKGard));
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchFormSessionBean.java
// public class SearchFormSessionBean extends IBOSessionBean implements SearchFormSession{
//
// private Integer databaseId = null;
//
// private String graveId = null;
//
//
// public SearchFormSessionBean(){}
//
//
//
// public String getGraveId() {
// return graveId;
// }
//
//
//
//
// public void setGraveId(String graveId) {
// this.graveId = graveId;
// }
//
//
//
//
// public Integer getDatabaseId() {
// return databaseId;
// }
//
// public void setDatabaseId(Integer databaseId) {
// this.databaseId = databaseId;
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchImplBroker.java
// public interface SearchImplBroker extends IBOService {
// /**
// * @see se.agura.memorial.search.business.SearchImplBrokerBean#getSearch
// */
// public ObituarySearch getSearch(int databaseConnId)
// throws java.rmi.RemoteException;
//
// }
// Path: src/java/se/agura/memorial/search/presentation/GraveyardConverter.java
import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import se.agura.memorial.search.api.Graveyard;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.business.SearchFormSessionBean;
import se.agura.memorial.search.business.SearchImplBroker;
import com.idega.business.IBOLookup;
import com.idega.business.IBOLookupException;
import com.idega.presentation.IWContext;
package se.agura.memorial.search.presentation;
public class GraveyardConverter implements Converter {
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
throws ConverterException {
Graveyard g = null;
//g = (Graveyard) new SearchFormBackingBean.getGraveyards().get(arg2);
/*
1. get current data base implementation id (from session bean)
2. get database graveyards
3. find appropriate graveyard by Id
*/
//1.
FacesContext facesContext = FacesContext.getCurrentInstance();
IWContext iwc = IWContext.getIWContext(facesContext);
try { | SearchFormSessionBean sb = (SearchFormSessionBean) IBOLookup.getSessionInstance(iwc, SearchFormSessionBean.class); |
idega/se.agura.memorial | src/java/se/agura/memorial/search/presentation/GraveyardConverter.java | // Path: src/java/se/agura/memorial/search/api/Graveyard.java
// public class Graveyard {
// private int id;
//
// private String kGard; //
//
// private String Benamning; //
//
// private int distriktID;
//
// public Graveyard(int id, String kGard, String Benamning, int distriktID) {
// super();
//
// this.id = id;
// this.kGard = kGard;
// this.Benamning = Benamning;
// this.distriktID = distriktID;
// }
//
// public String getBenamning() {
// return Benamning;
// }
//
// public void setBenamning(String benamning) {
// Benamning = benamning;
// }
//
// public int getDistrikt_ID() {
// return distriktID;
// }
//
// public void setDistrikt_ID(int distrikt_ID) {
// this.distriktID = distrikt_ID;
// }
//
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
//
// public String getKGard() {
// return kGard;
// }
//
// public void setKGard(String gard) {
// kGard = gard;
// }
//
// public int hashCode() {
// String tempKGard = getKGard();
// if ( tempKGard == null) {
// return getId() + getDistrikt_ID();
// }
// return getId() + getDistrikt_ID() + tempKGard.hashCode();
// }
//
// public boolean equals(Object object) {
// if (this == object) {
// return true;
// }
// if (object == null) {
// return false;
// }
// if (getClass() != object.getClass()) {
// return false;
// }
// Graveyard graveyard = (Graveyard) object;
// String tempKGard = getKGard();
// String graveyardKGard = graveyard.getKGard();
// if (tempKGard == null && graveyardKGard == null) {
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID());
// }
// if (tempKGard == null || graveyardKGard == null) {
// return false;
// }
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID() && graveyardKGard.equals(tempKGard));
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchFormSessionBean.java
// public class SearchFormSessionBean extends IBOSessionBean implements SearchFormSession{
//
// private Integer databaseId = null;
//
// private String graveId = null;
//
//
// public SearchFormSessionBean(){}
//
//
//
// public String getGraveId() {
// return graveId;
// }
//
//
//
//
// public void setGraveId(String graveId) {
// this.graveId = graveId;
// }
//
//
//
//
// public Integer getDatabaseId() {
// return databaseId;
// }
//
// public void setDatabaseId(Integer databaseId) {
// this.databaseId = databaseId;
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchImplBroker.java
// public interface SearchImplBroker extends IBOService {
// /**
// * @see se.agura.memorial.search.business.SearchImplBrokerBean#getSearch
// */
// public ObituarySearch getSearch(int databaseConnId)
// throws java.rmi.RemoteException;
//
// }
| import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import se.agura.memorial.search.api.Graveyard;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.business.SearchFormSessionBean;
import se.agura.memorial.search.business.SearchImplBroker;
import com.idega.business.IBOLookup;
import com.idega.business.IBOLookupException;
import com.idega.presentation.IWContext; | package se.agura.memorial.search.presentation;
public class GraveyardConverter implements Converter {
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
throws ConverterException {
Graveyard g = null;
//g = (Graveyard) new SearchFormBackingBean.getGraveyards().get(arg2);
/*
1. get current data base implementation id (from session bean)
2. get database graveyards
3. find appropriate graveyard by Id
*/
//1.
FacesContext facesContext = FacesContext.getCurrentInstance();
IWContext iwc = IWContext.getIWContext(facesContext);
try {
SearchFormSessionBean sb = (SearchFormSessionBean) IBOLookup.getSessionInstance(iwc, SearchFormSessionBean.class);
//2.
try { | // Path: src/java/se/agura/memorial/search/api/Graveyard.java
// public class Graveyard {
// private int id;
//
// private String kGard; //
//
// private String Benamning; //
//
// private int distriktID;
//
// public Graveyard(int id, String kGard, String Benamning, int distriktID) {
// super();
//
// this.id = id;
// this.kGard = kGard;
// this.Benamning = Benamning;
// this.distriktID = distriktID;
// }
//
// public String getBenamning() {
// return Benamning;
// }
//
// public void setBenamning(String benamning) {
// Benamning = benamning;
// }
//
// public int getDistrikt_ID() {
// return distriktID;
// }
//
// public void setDistrikt_ID(int distrikt_ID) {
// this.distriktID = distrikt_ID;
// }
//
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
//
// public String getKGard() {
// return kGard;
// }
//
// public void setKGard(String gard) {
// kGard = gard;
// }
//
// public int hashCode() {
// String tempKGard = getKGard();
// if ( tempKGard == null) {
// return getId() + getDistrikt_ID();
// }
// return getId() + getDistrikt_ID() + tempKGard.hashCode();
// }
//
// public boolean equals(Object object) {
// if (this == object) {
// return true;
// }
// if (object == null) {
// return false;
// }
// if (getClass() != object.getClass()) {
// return false;
// }
// Graveyard graveyard = (Graveyard) object;
// String tempKGard = getKGard();
// String graveyardKGard = graveyard.getKGard();
// if (tempKGard == null && graveyardKGard == null) {
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID());
// }
// if (tempKGard == null || graveyardKGard == null) {
// return false;
// }
// return (graveyard.getId() == getId() && graveyard.getDistrikt_ID() == getDistrikt_ID() && graveyardKGard.equals(tempKGard));
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
// public interface ObituarySearch {
//
// public Collection findGraves (
// String firstName,
// String lastName,
// String personIdentifier,
// CustomMemorialDate dateOfBirthFrom,
// CustomMemorialDate dateOfBirthTo,
// CustomMemorialDate dateOfDeathFrom,
// CustomMemorialDate dateOfDeathTo,
// String hometown,
// String graveyard);
//
// public Collection getGraveyards();
//
// public Grave findGrave(String graveId);
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchFormSessionBean.java
// public class SearchFormSessionBean extends IBOSessionBean implements SearchFormSession{
//
// private Integer databaseId = null;
//
// private String graveId = null;
//
//
// public SearchFormSessionBean(){}
//
//
//
// public String getGraveId() {
// return graveId;
// }
//
//
//
//
// public void setGraveId(String graveId) {
// this.graveId = graveId;
// }
//
//
//
//
// public Integer getDatabaseId() {
// return databaseId;
// }
//
// public void setDatabaseId(Integer databaseId) {
// this.databaseId = databaseId;
// }
//
// }
//
// Path: src/java/se/agura/memorial/search/business/SearchImplBroker.java
// public interface SearchImplBroker extends IBOService {
// /**
// * @see se.agura.memorial.search.business.SearchImplBrokerBean#getSearch
// */
// public ObituarySearch getSearch(int databaseConnId)
// throws java.rmi.RemoteException;
//
// }
// Path: src/java/se/agura/memorial/search/presentation/GraveyardConverter.java
import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import se.agura.memorial.search.api.Graveyard;
import se.agura.memorial.search.api.ObituarySearch;
import se.agura.memorial.search.business.SearchFormSessionBean;
import se.agura.memorial.search.business.SearchImplBroker;
import com.idega.business.IBOLookup;
import com.idega.business.IBOLookupException;
import com.idega.presentation.IWContext;
package se.agura.memorial.search.presentation;
public class GraveyardConverter implements Converter {
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
throws ConverterException {
Graveyard g = null;
//g = (Graveyard) new SearchFormBackingBean.getGraveyards().get(arg2);
/*
1. get current data base implementation id (from session bean)
2. get database graveyards
3. find appropriate graveyard by Id
*/
//1.
FacesContext facesContext = FacesContext.getCurrentInstance();
IWContext iwc = IWContext.getIWContext(facesContext);
try {
SearchFormSessionBean sb = (SearchFormSessionBean) IBOLookup.getSessionInstance(iwc, SearchFormSessionBean.class);
//2.
try { | SearchImplBroker sib = (SearchImplBroker) IBOLookup.getServiceInstance(iwc, SearchImplBroker.class); |
idega/se.agura.memorial | src/java/se/agura/memorial/search/api/ObituarySearch.java | // Path: src/java/se/agura/memorial/search/api/Grave.java
// public class Grave {
//
// private String graveId;
// private String firstName;
// private String lastName;
// private CustomMemorialDate dateOfBirth;
// private CustomMemorialDate dateOfDeath;
// private CustomMemorialDate dateOfBurial;
// private String hometown;
//
// private GraveInformation graveInfo;
//
//
//
// public Grave(String graveId,
// String firstName,
// String lastName,
// CustomMemorialDate dateOfBirth,
// CustomMemorialDate dateOfDeath,
// CustomMemorialDate dateOfBurial,
// String hometown,
// GraveInformation graveInfo) {
// super();
//
// this.graveId = graveId;
// this.firstName = firstName;
// this.lastName = lastName;
// this.dateOfBirth = dateOfBirth;
// this.dateOfDeath = dateOfDeath;
// this.dateOfBurial = dateOfBurial;
// this.hometown = hometown;
// this.graveInfo = graveInfo;
//
// }
//
//
//
//
//
// public CustomMemorialDate getDateOfBirth() {
// return dateOfBirth;
// }
//
//
// public void setDateOfBirth(CustomMemorialDate dateOfBirth) {
// this.dateOfBirth = dateOfBirth;
// }
//
//
// public CustomMemorialDate getDateOfDeath() {
// return dateOfDeath;
// }
//
//
// public void setDateOfDeath(CustomMemorialDate dateOfDeath) {
// this.dateOfDeath = dateOfDeath;
// }
//
//
// public String getFirstName() {
// return firstName;
// }
//
//
// public void setFirstName(String firstName) {
// this.firstName = firstName;
// }
//
//
// public String getGraveId() {
// return graveId;
// }
//
//
// public void setGraveId(String graveId) {
// this.graveId = graveId;
// }
//
//
// public GraveInformation getGraveInfo() {
// return graveInfo;
// }
//
//
// public void setGraveInfo(GraveInformation graveInfo) {
// this.graveInfo = graveInfo;
// }
//
//
// public String getHometown() {
// return hometown;
// }
//
//
// public void setHometown(String hometown) {
// this.hometown = hometown;
// }
//
//
// public String getLastName() {
// return lastName;
// }
//
//
// public void setLastName(String lastName) {
// this.lastName = lastName;
// }
//
//
//
//
//
// public CustomMemorialDate getDateOfBurial() {
// return dateOfBurial;
// }
// public void setDateOfBurial(CustomMemorialDate dateOfBurial) {
// this.dateOfBurial = dateOfBurial;
// }
// }
| import se.agura.memorial.search.api.Grave;
import java.util.Collection; | package se.agura.memorial.search.api;
/**
*
Here we need interface for thee actual search classes, we could call
it ObituarySearch
It will need three methods to begin with at least
findGraves(String bean.firstName, String bean.lastName, Interval
bean.dateOfBirth, Interval bean.dayOfDeath, String bean.region, String
bean.graveyard) - For the search form
getGraveyards() - For the dropdown in the search form (or to load to
the local database once and from there to the dropdown)
findGrave(string identifier) - for the grave-details in the Obituary
part
findGraves could return list of Grave objects which is class you
could define in se.agura.memorial.search.business. The fields needed
would be: String identifier, String firstName, String lastName Date
dateOfBirth, Date dateOfDeath, Region region, GraveInformation info;
where GraveInformation would be similar class with the fields: String
graveNumber, String block, String department, String cemetery. Region
may not be necessary to begin with, I let you know. It would then be
Region with the fields: String name, String type where type can be
county, Commune, Parish.
*
*/
/**
* @author Igors
*
*/
public interface ObituarySearch {
public Collection findGraves (
String firstName,
String lastName,
String personIdentifier,
CustomMemorialDate dateOfBirthFrom,
CustomMemorialDate dateOfBirthTo,
CustomMemorialDate dateOfDeathFrom,
CustomMemorialDate dateOfDeathTo,
String hometown,
String graveyard);
public Collection getGraveyards();
| // Path: src/java/se/agura/memorial/search/api/Grave.java
// public class Grave {
//
// private String graveId;
// private String firstName;
// private String lastName;
// private CustomMemorialDate dateOfBirth;
// private CustomMemorialDate dateOfDeath;
// private CustomMemorialDate dateOfBurial;
// private String hometown;
//
// private GraveInformation graveInfo;
//
//
//
// public Grave(String graveId,
// String firstName,
// String lastName,
// CustomMemorialDate dateOfBirth,
// CustomMemorialDate dateOfDeath,
// CustomMemorialDate dateOfBurial,
// String hometown,
// GraveInformation graveInfo) {
// super();
//
// this.graveId = graveId;
// this.firstName = firstName;
// this.lastName = lastName;
// this.dateOfBirth = dateOfBirth;
// this.dateOfDeath = dateOfDeath;
// this.dateOfBurial = dateOfBurial;
// this.hometown = hometown;
// this.graveInfo = graveInfo;
//
// }
//
//
//
//
//
// public CustomMemorialDate getDateOfBirth() {
// return dateOfBirth;
// }
//
//
// public void setDateOfBirth(CustomMemorialDate dateOfBirth) {
// this.dateOfBirth = dateOfBirth;
// }
//
//
// public CustomMemorialDate getDateOfDeath() {
// return dateOfDeath;
// }
//
//
// public void setDateOfDeath(CustomMemorialDate dateOfDeath) {
// this.dateOfDeath = dateOfDeath;
// }
//
//
// public String getFirstName() {
// return firstName;
// }
//
//
// public void setFirstName(String firstName) {
// this.firstName = firstName;
// }
//
//
// public String getGraveId() {
// return graveId;
// }
//
//
// public void setGraveId(String graveId) {
// this.graveId = graveId;
// }
//
//
// public GraveInformation getGraveInfo() {
// return graveInfo;
// }
//
//
// public void setGraveInfo(GraveInformation graveInfo) {
// this.graveInfo = graveInfo;
// }
//
//
// public String getHometown() {
// return hometown;
// }
//
//
// public void setHometown(String hometown) {
// this.hometown = hometown;
// }
//
//
// public String getLastName() {
// return lastName;
// }
//
//
// public void setLastName(String lastName) {
// this.lastName = lastName;
// }
//
//
//
//
//
// public CustomMemorialDate getDateOfBurial() {
// return dateOfBurial;
// }
// public void setDateOfBurial(CustomMemorialDate dateOfBurial) {
// this.dateOfBurial = dateOfBurial;
// }
// }
// Path: src/java/se/agura/memorial/search/api/ObituarySearch.java
import se.agura.memorial.search.api.Grave;
import java.util.Collection;
package se.agura.memorial.search.api;
/**
*
Here we need interface for thee actual search classes, we could call
it ObituarySearch
It will need three methods to begin with at least
findGraves(String bean.firstName, String bean.lastName, Interval
bean.dateOfBirth, Interval bean.dayOfDeath, String bean.region, String
bean.graveyard) - For the search form
getGraveyards() - For the dropdown in the search form (or to load to
the local database once and from there to the dropdown)
findGrave(string identifier) - for the grave-details in the Obituary
part
findGraves could return list of Grave objects which is class you
could define in se.agura.memorial.search.business. The fields needed
would be: String identifier, String firstName, String lastName Date
dateOfBirth, Date dateOfDeath, Region region, GraveInformation info;
where GraveInformation would be similar class with the fields: String
graveNumber, String block, String department, String cemetery. Region
may not be necessary to begin with, I let you know. It would then be
Region with the fields: String name, String type where type can be
county, Commune, Parish.
*
*/
/**
* @author Igors
*
*/
public interface ObituarySearch {
public Collection findGraves (
String firstName,
String lastName,
String personIdentifier,
CustomMemorialDate dateOfBirthFrom,
CustomMemorialDate dateOfBirthTo,
CustomMemorialDate dateOfDeathFrom,
CustomMemorialDate dateOfDeathTo,
String hometown,
String graveyard);
public Collection getGraveyards();
| public Grave findGrave(String graveId); |
NeuroTechX/eeg-101 | EEG101/android/app/src/main/java/com/eeg_project/components/connector/ConnectorModule.java | // Path: EEG101/android/app/src/main/java/com/eeg_project/MainApplication.java
// public class MainApplication extends Application implements ReactApplication {
//
// // Global singleton Muse
// public static Muse connectedMuse;
//
// // Global singleton event emitter
// public static AppNativeEventEmitter eventEmitter;
//
// private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// @Override
// public boolean getUseDeveloperSupport() {
// return com.eeg_project.BuildConfig.DEBUG;
// }
//
// // All packages for native libraries must be added to the array returned by this method
// @Override
// protected List<ReactPackage> getPackages() {
// return Arrays.<ReactPackage>asList(
// new MainReactPackage(),
// new LottiePackage(),
// new RNI18nPackage(),
// new RCTTorchPackage(),
// new SvgPackage(),
// new EEGPackage()
// );
// }
// };
//
// @Override
// public ReactNativeHost getReactNativeHost() {
// return mReactNativeHost;
// }
//
// }
| import android.bluetooth.BluetoothAdapter;
import android.os.Handler;
import android.os.HandlerThread;
import com.choosemuse.libmuse.ConnectionState;
import com.choosemuse.libmuse.Muse;
import com.choosemuse.libmuse.MuseConnectionListener;
import com.choosemuse.libmuse.MuseConnectionPacket;
import com.choosemuse.libmuse.MuseListener;
import com.choosemuse.libmuse.MuseManagerAndroid;
import com.eeg_project.MainApplication;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import java.util.List; | package com.eeg_project.components.connector;
// Handles connecting to the Muse headband
public class ConnectorModule extends ReactContextBaseJavaModule {
// ----------------------------------------------------------
// Variables
private MuseManagerAndroid manager;
private ConnectionListener connectionListener;
private int museIndex = 0;
private List<Muse> availableMuses;
private Muse muse;
private boolean isBluetoothEnabled;
public Handler connectHandler;
public HandlerThread connectThread;
// grab reference to global singletons | // Path: EEG101/android/app/src/main/java/com/eeg_project/MainApplication.java
// public class MainApplication extends Application implements ReactApplication {
//
// // Global singleton Muse
// public static Muse connectedMuse;
//
// // Global singleton event emitter
// public static AppNativeEventEmitter eventEmitter;
//
// private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// @Override
// public boolean getUseDeveloperSupport() {
// return com.eeg_project.BuildConfig.DEBUG;
// }
//
// // All packages for native libraries must be added to the array returned by this method
// @Override
// protected List<ReactPackage> getPackages() {
// return Arrays.<ReactPackage>asList(
// new MainReactPackage(),
// new LottiePackage(),
// new RNI18nPackage(),
// new RCTTorchPackage(),
// new SvgPackage(),
// new EEGPackage()
// );
// }
// };
//
// @Override
// public ReactNativeHost getReactNativeHost() {
// return mReactNativeHost;
// }
//
// }
// Path: EEG101/android/app/src/main/java/com/eeg_project/components/connector/ConnectorModule.java
import android.bluetooth.BluetoothAdapter;
import android.os.Handler;
import android.os.HandlerThread;
import com.choosemuse.libmuse.ConnectionState;
import com.choosemuse.libmuse.Muse;
import com.choosemuse.libmuse.MuseConnectionListener;
import com.choosemuse.libmuse.MuseConnectionPacket;
import com.choosemuse.libmuse.MuseListener;
import com.choosemuse.libmuse.MuseManagerAndroid;
import com.eeg_project.MainApplication;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import java.util.List;
package com.eeg_project.components.connector;
// Handles connecting to the Muse headband
public class ConnectorModule extends ReactContextBaseJavaModule {
// ----------------------------------------------------------
// Variables
private MuseManagerAndroid manager;
private ConnectionListener connectionListener;
private int museIndex = 0;
private List<Muse> availableMuses;
private Muse muse;
private boolean isBluetoothEnabled;
public Handler connectHandler;
public HandlerThread connectThread;
// grab reference to global singletons | MainApplication appState; |
NeuroTechX/eeg-101 | EEG101/android/app/src/main/java/com/eeg_project/components/battery/BatteryModule.java | // Path: EEG101/android/app/src/main/java/com/eeg_project/MainApplication.java
// public class MainApplication extends Application implements ReactApplication {
//
// // Global singleton Muse
// public static Muse connectedMuse;
//
// // Global singleton event emitter
// public static AppNativeEventEmitter eventEmitter;
//
// private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// @Override
// public boolean getUseDeveloperSupport() {
// return com.eeg_project.BuildConfig.DEBUG;
// }
//
// // All packages for native libraries must be added to the array returned by this method
// @Override
// protected List<ReactPackage> getPackages() {
// return Arrays.<ReactPackage>asList(
// new MainReactPackage(),
// new LottiePackage(),
// new RNI18nPackage(),
// new RCTTorchPackage(),
// new SvgPackage(),
// new EEGPackage()
// );
// }
// };
//
// @Override
// public ReactNativeHost getReactNativeHost() {
// return mReactNativeHost;
// }
//
// }
| import android.util.Log;
import android.os.Handler;
import android.os.HandlerThread;
import com.choosemuse.libmuse.Battery;
import com.choosemuse.libmuse.Muse;
import com.choosemuse.libmuse.MuseArtifactPacket;
import com.choosemuse.libmuse.MuseDataListener;
import com.choosemuse.libmuse.MuseDataPacket;
import com.choosemuse.libmuse.MuseDataPacketType;
import com.eeg_project.MainApplication;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule; | package com.eeg_project.components.battery;
//Created by Vasyl 21/11/2018
public class BatteryModule extends ReactContextBaseJavaModule {
public DataListener batteryListener; | // Path: EEG101/android/app/src/main/java/com/eeg_project/MainApplication.java
// public class MainApplication extends Application implements ReactApplication {
//
// // Global singleton Muse
// public static Muse connectedMuse;
//
// // Global singleton event emitter
// public static AppNativeEventEmitter eventEmitter;
//
// private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// @Override
// public boolean getUseDeveloperSupport() {
// return com.eeg_project.BuildConfig.DEBUG;
// }
//
// // All packages for native libraries must be added to the array returned by this method
// @Override
// protected List<ReactPackage> getPackages() {
// return Arrays.<ReactPackage>asList(
// new MainReactPackage(),
// new LottiePackage(),
// new RNI18nPackage(),
// new RCTTorchPackage(),
// new SvgPackage(),
// new EEGPackage()
// );
// }
// };
//
// @Override
// public ReactNativeHost getReactNativeHost() {
// return mReactNativeHost;
// }
//
// }
// Path: EEG101/android/app/src/main/java/com/eeg_project/components/battery/BatteryModule.java
import android.util.Log;
import android.os.Handler;
import android.os.HandlerThread;
import com.choosemuse.libmuse.Battery;
import com.choosemuse.libmuse.Muse;
import com.choosemuse.libmuse.MuseArtifactPacket;
import com.choosemuse.libmuse.MuseDataListener;
import com.choosemuse.libmuse.MuseDataPacket;
import com.choosemuse.libmuse.MuseDataPacketType;
import com.eeg_project.MainApplication;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
package com.eeg_project.components.battery;
//Created by Vasyl 21/11/2018
public class BatteryModule extends ReactContextBaseJavaModule {
public DataListener batteryListener; | MainApplication appState; |
NeuroTechX/eeg-101 | EEG101/android/app/src/main/java/com/eeg_project/MainApplication.java | // Path: EEG101/android/app/src/main/java/com/eeg_project/components/emitter/AppNativeEventEmitter.java
// public class AppNativeEventEmitter extends ReactContextBaseJavaModule {
//
// // ----------------------------------------------------------
// // Variables
//
// // ---------------------------------------------------------
// // Constructor
//
// public AppNativeEventEmitter(ReactApplicationContext reactContext) {
// super(reactContext);
// }
//
// // ---------------------------------------------------------
// // React Native Module methods
//
// // Required by ReactContextBaseJavaModule
// @Override
// public String getName() {
// return "AppNativeEventEmitter";
// }
//
// // ---------------------------------------------------------
// // Public sendEvent Methods
//
// // Send events with int params (PREDICT_RESULT)
// public void sendEvent(String eventName, int result) {
// getReactApplicationContext()
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
// .emit(eventName, result);
// }
//
// // Send events with Map params (CONNECTION_CHANGED, NOISE)
// public void sendEvent(String eventName, @Nullable WritableMap params) {
// getReactApplicationContext()
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
// .emit(eventName, params);
// }
//
// // Send events with Array params (MUSE_LIST_CHANGED)
// public void sendEvent(String eventName, @Nullable WritableArray params) {
// getReactApplicationContext()
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
// .emit(eventName, params);
// }
// }
| import android.app.Application;
import com.choosemuse.libmuse.Muse;
import com.eeg_project.components.emitter.AppNativeEventEmitter;
import com.facebook.react.ReactApplication;
import com.airbnb.android.react.lottie.LottiePackage;
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import com.cubicphuse.RCTTorch.RCTTorchPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.horcrux.svg.SvgPackage;
import java.util.Arrays;
import java.util.List; | package com.eeg_project;
// Prevents react-native-svg issue #135
public class MainApplication extends Application implements ReactApplication {
// Global singleton Muse
public static Muse connectedMuse;
// Global singleton event emitter | // Path: EEG101/android/app/src/main/java/com/eeg_project/components/emitter/AppNativeEventEmitter.java
// public class AppNativeEventEmitter extends ReactContextBaseJavaModule {
//
// // ----------------------------------------------------------
// // Variables
//
// // ---------------------------------------------------------
// // Constructor
//
// public AppNativeEventEmitter(ReactApplicationContext reactContext) {
// super(reactContext);
// }
//
// // ---------------------------------------------------------
// // React Native Module methods
//
// // Required by ReactContextBaseJavaModule
// @Override
// public String getName() {
// return "AppNativeEventEmitter";
// }
//
// // ---------------------------------------------------------
// // Public sendEvent Methods
//
// // Send events with int params (PREDICT_RESULT)
// public void sendEvent(String eventName, int result) {
// getReactApplicationContext()
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
// .emit(eventName, result);
// }
//
// // Send events with Map params (CONNECTION_CHANGED, NOISE)
// public void sendEvent(String eventName, @Nullable WritableMap params) {
// getReactApplicationContext()
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
// .emit(eventName, params);
// }
//
// // Send events with Array params (MUSE_LIST_CHANGED)
// public void sendEvent(String eventName, @Nullable WritableArray params) {
// getReactApplicationContext()
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
// .emit(eventName, params);
// }
// }
// Path: EEG101/android/app/src/main/java/com/eeg_project/MainApplication.java
import android.app.Application;
import com.choosemuse.libmuse.Muse;
import com.eeg_project.components.emitter.AppNativeEventEmitter;
import com.facebook.react.ReactApplication;
import com.airbnb.android.react.lottie.LottiePackage;
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import com.cubicphuse.RCTTorch.RCTTorchPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.horcrux.svg.SvgPackage;
import java.util.Arrays;
import java.util.List;
package com.eeg_project;
// Prevents react-native-svg issue #135
public class MainApplication extends Application implements ReactApplication {
// Global singleton Muse
public static Muse connectedMuse;
// Global singleton event emitter | public static AppNativeEventEmitter eventEmitter; |
NeuroTechX/eeg-101 | EEG101/android/app/src/main/java/com/eeg_project/components/signal/NoiseDetector.java | // Path: EEG101/android/app/src/main/java/com/eeg_project/MainApplication.java
// public class MainApplication extends Application implements ReactApplication {
//
// // Global singleton Muse
// public static Muse connectedMuse;
//
// // Global singleton event emitter
// public static AppNativeEventEmitter eventEmitter;
//
// private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// @Override
// public boolean getUseDeveloperSupport() {
// return com.eeg_project.BuildConfig.DEBUG;
// }
//
// // All packages for native libraries must be added to the array returned by this method
// @Override
// protected List<ReactPackage> getPackages() {
// return Arrays.<ReactPackage>asList(
// new MainReactPackage(),
// new LottiePackage(),
// new RNI18nPackage(),
// new RCTTorchPackage(),
// new SvgPackage(),
// new EEGPackage()
// );
// }
// };
//
// @Override
// public ReactNativeHost getReactNativeHost() {
// return mReactNativeHost;
// }
//
// }
| import com.eeg_project.MainApplication;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.WritableMap;
import javax.annotation.Nullable; | package com.eeg_project.components.signal;
// This class implements a simple EEG noise detector based on
// variance thresholding of a short epoch.
public class NoiseDetector {
// ------------------------------------------------------------------------
// Variables
private double t;
private ReactApplicationContext reactContext;
private WritableMap noiseMap = Arguments.createMap();
// grab reference to global singletons | // Path: EEG101/android/app/src/main/java/com/eeg_project/MainApplication.java
// public class MainApplication extends Application implements ReactApplication {
//
// // Global singleton Muse
// public static Muse connectedMuse;
//
// // Global singleton event emitter
// public static AppNativeEventEmitter eventEmitter;
//
// private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// @Override
// public boolean getUseDeveloperSupport() {
// return com.eeg_project.BuildConfig.DEBUG;
// }
//
// // All packages for native libraries must be added to the array returned by this method
// @Override
// protected List<ReactPackage> getPackages() {
// return Arrays.<ReactPackage>asList(
// new MainReactPackage(),
// new LottiePackage(),
// new RNI18nPackage(),
// new RCTTorchPackage(),
// new SvgPackage(),
// new EEGPackage()
// );
// }
// };
//
// @Override
// public ReactNativeHost getReactNativeHost() {
// return mReactNativeHost;
// }
//
// }
// Path: EEG101/android/app/src/main/java/com/eeg_project/components/signal/NoiseDetector.java
import com.eeg_project.MainApplication;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.WritableMap;
import javax.annotation.Nullable;
package com.eeg_project.components.signal;
// This class implements a simple EEG noise detector based on
// variance thresholding of a short epoch.
public class NoiseDetector {
// ------------------------------------------------------------------------
// Variables
private double t;
private ReactApplicationContext reactContext;
private WritableMap noiseMap = Arguments.createMap();
// grab reference to global singletons | MainApplication appState; |
wkgcass/Style | src/main/java/net/cassite/style/ptr.java | // Path: src/main/java/net/cassite/style/reflect/Reflect.java
// public abstract class Reflect {
//
// private static PathMapper mapper = new PathMapper();
//
// protected Reflect() {
//
// }
//
// // ┌─────────────────────────────────┐
// // │...........reflection............│
// // └─────────────────────────────────┘
//
// /**
// * create a class supporter with given class
// *
// * @param cls the class object to be supported
// * @return Class supporter
// * @see ClassSup
// */
// public static <T> ClassSup<T> cls(Class<T> cls) {
// return mapper.get(cls.getName(), () -> new ClassSup<>(cls));
// }
//
// /**
// * create a class supporter with given class name
// *
// * @param clsName full name of the class to be supported
// * @return Class supporter
// * @see ClassSup
// */
// @SuppressWarnings("unchecked")
// public static <T> ClassSup<T> cls(String clsName) {
// try {
// return mapper.get(clsName, () -> (ClassSup<T>) cls(Class.forName(clsName)));
// } catch (Exception e) {
// throw $(e);
// }
// }
//
// /**
// * create a class supporter with given object
// *
// * @param obj instance of the class to be supported
// * @return Class supporter
// * @see ClassSup
// */
// @SuppressWarnings("unchecked")
// public static <T> ClassSup<T> cls(T obj) {
// return mapper.get(obj.getClass().getName(), () -> (ClassSup<T>) cls(obj.getClass()));
// }
//
// /**
// * generate proxy object with given InvocationHandler and the object to
// * do proxy
// *
// * @param handler InvocationHandler instance
// * @param toProxy the object to do proxy
// * @return proxy object generated with Proxy.newProxyInstance(...)
// * @see InvocationHandler
// * @see Proxy#newProxyInstance(ClassLoader, Class[], InvocationHandler)
// */
// @SuppressWarnings("unchecked")
// public static <T> T proxy(InvocationHandler handler, T toProxy) {
// return (T) Proxy.newProxyInstance(toProxy.getClass().getClassLoader(), toProxy.getClass().getInterfaces(), handler);
// }
//
// /**
// * generate proxy object with given ProxyHandler<br>
// * ProxyHandler is an abstract class with a constructor taking in the
// * object to do proxy<br>
// * see ProxyHandler or
// * <a href="https://github.com/wkgcass/Style/">tutorial</a> for more
// * info on how to use.
// *
// * @param proxyHandler proxy handler
// * @return proxy object generated with Proxy.newProxyInstance(...)
// * @see ProxyHandler
// * @see Proxy#newProxyInstance(ClassLoader, Class[], InvocationHandler)
// */
// @SuppressWarnings("unchecked")
// public static <P> P proxy(ProxyHandler<P> proxyHandler) {
// List<MethodSupport<?, ProxyHandler<P>>> methods = cls(proxyHandler).allMethods();
// P toProxy = proxyHandler.target;
//
// return (P) Proxy.newProxyInstance(toProxy.getClass().getClassLoader(), toProxy.getClass().getInterfaces(), (p, m, args) -> If((MethodSupport<Object, ProxyHandler<P>>) $(methods).forEach(e -> {
// if (e.name().equals(m.getName()) && e.argCount() == m.getParameterCount()
// && avoidNull($(m.getParameterTypes()).forEach((pt, i) -> {
// if (!pt.isAssignableFrom(e.argTypes()[$(i)]))
// return BreakWithResult(false);
// else
// return true;
// }), () -> true))
// return BreakWithResult(e);
// else
// return null;
// }), res -> (Object) res.invoke(proxyHandler, args)).Else(() -> m.invoke(toProxy, args)));
// }
//
// /**
// * Make an object which has interfaces to a read-only one.<br>
// * When an invocation comes, the InvocatinHandler will check the method.
// * <p>
// * <pre>
// * if methodName.contains elements in $.readOnlyToSearch
// * Check whether the method has ReadOnly annotation
// * if has
// * do invoking
// * else
// * throw an exception(ModifyReadOnlyException)
// * else
// * Check whether the method has Writable annotation
// * if has
// * throw an exception(ModifyReadOnlyException)
// * else
// * do invoking
// * </pre>
// *
// * @param toReadOnly the object to be readonly
// * @return read-only object(dynamic proxy supported)
// */
// public static <R> R readOnly(R toReadOnly) {
// return proxy((p, m, args) -> If((Method) $($.readOnlyToSearch).forEach(s -> {
// if (m.getName().contains(s))
// return BreakWithResult(m);
// else
// return null;
// }), rm -> {
// if (rm.isAnnotationPresent(ReadOnly.class))
// return m.invoke(toReadOnly, args);
// else
// throw new ModifyReadOnlyException(toReadOnly, m);
// }).Else(() -> {
// if (m.isAnnotationPresent(Writable.class))
// throw new ModifyReadOnlyException(toReadOnly, m);
// else
// return m.invoke(toReadOnly, args);
// }), toReadOnly);
// }
// }
| import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import net.cassite.style.reflect.Reflect; | package net.cassite.style;
/**
* A container of objects, usually used when accessing a non-final value from
* inner classes.
*
* @param <T> type of the object to contain
* @author wkgcass
*/
public class ptr<T> implements InvocationHandler {
/**
* contained object
*/
public T item;
public final T proxy;
ptr(T o) {
this.item = o;
if (o == null) {
proxy = null;
} else {
if (o.getClass().getInterfaces() != null && o.getClass().getInterfaces().length != 0) { | // Path: src/main/java/net/cassite/style/reflect/Reflect.java
// public abstract class Reflect {
//
// private static PathMapper mapper = new PathMapper();
//
// protected Reflect() {
//
// }
//
// // ┌─────────────────────────────────┐
// // │...........reflection............│
// // └─────────────────────────────────┘
//
// /**
// * create a class supporter with given class
// *
// * @param cls the class object to be supported
// * @return Class supporter
// * @see ClassSup
// */
// public static <T> ClassSup<T> cls(Class<T> cls) {
// return mapper.get(cls.getName(), () -> new ClassSup<>(cls));
// }
//
// /**
// * create a class supporter with given class name
// *
// * @param clsName full name of the class to be supported
// * @return Class supporter
// * @see ClassSup
// */
// @SuppressWarnings("unchecked")
// public static <T> ClassSup<T> cls(String clsName) {
// try {
// return mapper.get(clsName, () -> (ClassSup<T>) cls(Class.forName(clsName)));
// } catch (Exception e) {
// throw $(e);
// }
// }
//
// /**
// * create a class supporter with given object
// *
// * @param obj instance of the class to be supported
// * @return Class supporter
// * @see ClassSup
// */
// @SuppressWarnings("unchecked")
// public static <T> ClassSup<T> cls(T obj) {
// return mapper.get(obj.getClass().getName(), () -> (ClassSup<T>) cls(obj.getClass()));
// }
//
// /**
// * generate proxy object with given InvocationHandler and the object to
// * do proxy
// *
// * @param handler InvocationHandler instance
// * @param toProxy the object to do proxy
// * @return proxy object generated with Proxy.newProxyInstance(...)
// * @see InvocationHandler
// * @see Proxy#newProxyInstance(ClassLoader, Class[], InvocationHandler)
// */
// @SuppressWarnings("unchecked")
// public static <T> T proxy(InvocationHandler handler, T toProxy) {
// return (T) Proxy.newProxyInstance(toProxy.getClass().getClassLoader(), toProxy.getClass().getInterfaces(), handler);
// }
//
// /**
// * generate proxy object with given ProxyHandler<br>
// * ProxyHandler is an abstract class with a constructor taking in the
// * object to do proxy<br>
// * see ProxyHandler or
// * <a href="https://github.com/wkgcass/Style/">tutorial</a> for more
// * info on how to use.
// *
// * @param proxyHandler proxy handler
// * @return proxy object generated with Proxy.newProxyInstance(...)
// * @see ProxyHandler
// * @see Proxy#newProxyInstance(ClassLoader, Class[], InvocationHandler)
// */
// @SuppressWarnings("unchecked")
// public static <P> P proxy(ProxyHandler<P> proxyHandler) {
// List<MethodSupport<?, ProxyHandler<P>>> methods = cls(proxyHandler).allMethods();
// P toProxy = proxyHandler.target;
//
// return (P) Proxy.newProxyInstance(toProxy.getClass().getClassLoader(), toProxy.getClass().getInterfaces(), (p, m, args) -> If((MethodSupport<Object, ProxyHandler<P>>) $(methods).forEach(e -> {
// if (e.name().equals(m.getName()) && e.argCount() == m.getParameterCount()
// && avoidNull($(m.getParameterTypes()).forEach((pt, i) -> {
// if (!pt.isAssignableFrom(e.argTypes()[$(i)]))
// return BreakWithResult(false);
// else
// return true;
// }), () -> true))
// return BreakWithResult(e);
// else
// return null;
// }), res -> (Object) res.invoke(proxyHandler, args)).Else(() -> m.invoke(toProxy, args)));
// }
//
// /**
// * Make an object which has interfaces to a read-only one.<br>
// * When an invocation comes, the InvocatinHandler will check the method.
// * <p>
// * <pre>
// * if methodName.contains elements in $.readOnlyToSearch
// * Check whether the method has ReadOnly annotation
// * if has
// * do invoking
// * else
// * throw an exception(ModifyReadOnlyException)
// * else
// * Check whether the method has Writable annotation
// * if has
// * throw an exception(ModifyReadOnlyException)
// * else
// * do invoking
// * </pre>
// *
// * @param toReadOnly the object to be readonly
// * @return read-only object(dynamic proxy supported)
// */
// public static <R> R readOnly(R toReadOnly) {
// return proxy((p, m, args) -> If((Method) $($.readOnlyToSearch).forEach(s -> {
// if (m.getName().contains(s))
// return BreakWithResult(m);
// else
// return null;
// }), rm -> {
// if (rm.isAnnotationPresent(ReadOnly.class))
// return m.invoke(toReadOnly, args);
// else
// throw new ModifyReadOnlyException(toReadOnly, m);
// }).Else(() -> {
// if (m.isAnnotationPresent(Writable.class))
// throw new ModifyReadOnlyException(toReadOnly, m);
// else
// return m.invoke(toReadOnly, args);
// }), toReadOnly);
// }
// }
// Path: src/main/java/net/cassite/style/ptr.java
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import net.cassite.style.reflect.Reflect;
package net.cassite.style;
/**
* A container of objects, usually used when accessing a non-final value from
* inner classes.
*
* @param <T> type of the object to contain
* @author wkgcass
*/
public class ptr<T> implements InvocationHandler {
/**
* contained object
*/
public T item;
public final T proxy;
ptr(T o) {
this.item = o;
if (o == null) {
proxy = null;
} else {
if (o.getClass().getInterfaces() != null && o.getClass().getInterfaces().length != 0) { | proxy = Reflect.proxy(this, o); |
WinRoad-NET/wrdocletbase | src/main/java/net/winroad/wrdoclet/builder/SOAPDocBuilder.java | // Path: src/main/java/net/winroad/wrdoclet/data/APIParameter.java
// @Data
// public class APIParameter {
// private String name;
// private String description;
// private ParameterOccurs parameterOccurs;
// private ParameterLocation parameterLocation;
// private String type;
// private ModificationHistory history;
// private List<APIParameter> fields;
// private Example example;
// /**
// * whether it's type argument for parent (the parent is generic type).
// */
// private boolean isParentTypeArgument;
//
// /*
// * @return Whether this parameter has modification on specified version. If
// * no version specified, returns true.
// */
// public boolean isModifiedOnVersion(String version) {
// if (version == null || version.isEmpty()) {
// return true;
// }
// if (this.history != null && this.history.isModifiedOnVersion(version)) {
// return true;
// }
// if (this.fields != null) {
// for (APIParameter param : this.fields) {
// if (param.isModifiedOnVersion(version)) {
// return true;
// }
// }
// }
// return false;
// }
//
// public void appendField(APIParameter field) {
// if (this.fields == null) {
// this.fields = new LinkedList<APIParameter>();
// }
//
// this.fields.add(field);
// }
//
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/ParameterOccurs.java
// public enum ParameterOccurs {
// //It should be appeared each time.
// REQUIRED,
// //It may not be appeared.
// OPTIONAL,
// //It may not be appeared. But in some cases, depends on other field,
// //it will be appeared each time when other field equals to specified value.
// DEPENDS
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/ParameterType.java
// public enum ParameterType {
// Request,
// Response
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/RequestMapping.java
// @Data
// public class RequestMapping {
// private String url;
// private String methodType;
// private String tooltip;
// private String containerName;
// private String consumes;
// private String produces;
// private String headers;
// private String params;
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/WRDoc.java
// public class WRDoc {
// private Map<String, List<OpenAPI>> taggedOpenAPIs = new HashMap<String, List<OpenAPI>>();
//
// private List<AbstractDocBuilder> builders = new LinkedList<AbstractDocBuilder>();
//
// // The collection of tag name in this Doc.
// private Set<String> wrTags = new HashSet<String>();
//
// private Configuration configuration;
//
// private String docGeneratedDate;
//
// private Logger logger = LoggerFactory.getLogger(this.getClass());
//
// public Configuration getConfiguration() {
// return configuration;
// }
//
// public Set<String> getWRTags() {
// return this.wrTags;
// }
//
// public Map<String, List<OpenAPI>> getTaggedOpenAPIs() {
// return taggedOpenAPIs;
// }
//
// public String getDocGeneratedTime() {
// return this.docGeneratedDate;
// }
//
// public WRDoc(Configuration configuration) {
// this.configuration = configuration;
// Calendar c = Calendar.getInstance();
// DateFormat df = new SimpleDateFormat("yyyy.MM.dd HH:mm:ssz");
// this.docGeneratedDate = df.format(c.getTime());
// this.builders.add(new RESTDocBuilder(this));
// this.logger.debug("RESTDocBuilder loaded.");
// this.builders.add(new SOAPDocBuilder(this));
// this.logger.debug("SOAPDocBuilder loaded.");
// String dubboConfigPath = ((AbstractConfiguration) this.configuration).dubboconfigpath;
// this.builders.add(new DubboDocBuilder(this));
// this.logger.debug("DubboDocBuilder loaded with config path:" + dubboConfigPath);
// this.builders.add(new MQDocBuilder(this));
// this.logger.debug("MQDocBuilder loaded.");
// this.build();
// }
//
// private void build() {
// for (AbstractDocBuilder builder : this.builders) {
// builder.buildWRDoc();
// }
// }
// }
| import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import net.winroad.wrdoclet.data.APIParameter;
import net.winroad.wrdoclet.data.ParameterOccurs;
import net.winroad.wrdoclet.data.ParameterType;
import net.winroad.wrdoclet.data.RequestMapping;
import net.winroad.wrdoclet.data.WRDoc;
import com.sun.javadoc.AnnotationDesc;
import com.sun.javadoc.AnnotationDesc.ElementValuePair;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Parameter;
import com.sun.javadoc.Tag; | package net.winroad.wrdoclet.builder;
public class SOAPDocBuilder extends AbstractServiceDocBuilder {
public SOAPDocBuilder(WRDoc wrDoc) {
super(wrDoc);
}
@Override | // Path: src/main/java/net/winroad/wrdoclet/data/APIParameter.java
// @Data
// public class APIParameter {
// private String name;
// private String description;
// private ParameterOccurs parameterOccurs;
// private ParameterLocation parameterLocation;
// private String type;
// private ModificationHistory history;
// private List<APIParameter> fields;
// private Example example;
// /**
// * whether it's type argument for parent (the parent is generic type).
// */
// private boolean isParentTypeArgument;
//
// /*
// * @return Whether this parameter has modification on specified version. If
// * no version specified, returns true.
// */
// public boolean isModifiedOnVersion(String version) {
// if (version == null || version.isEmpty()) {
// return true;
// }
// if (this.history != null && this.history.isModifiedOnVersion(version)) {
// return true;
// }
// if (this.fields != null) {
// for (APIParameter param : this.fields) {
// if (param.isModifiedOnVersion(version)) {
// return true;
// }
// }
// }
// return false;
// }
//
// public void appendField(APIParameter field) {
// if (this.fields == null) {
// this.fields = new LinkedList<APIParameter>();
// }
//
// this.fields.add(field);
// }
//
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/ParameterOccurs.java
// public enum ParameterOccurs {
// //It should be appeared each time.
// REQUIRED,
// //It may not be appeared.
// OPTIONAL,
// //It may not be appeared. But in some cases, depends on other field,
// //it will be appeared each time when other field equals to specified value.
// DEPENDS
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/ParameterType.java
// public enum ParameterType {
// Request,
// Response
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/RequestMapping.java
// @Data
// public class RequestMapping {
// private String url;
// private String methodType;
// private String tooltip;
// private String containerName;
// private String consumes;
// private String produces;
// private String headers;
// private String params;
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/WRDoc.java
// public class WRDoc {
// private Map<String, List<OpenAPI>> taggedOpenAPIs = new HashMap<String, List<OpenAPI>>();
//
// private List<AbstractDocBuilder> builders = new LinkedList<AbstractDocBuilder>();
//
// // The collection of tag name in this Doc.
// private Set<String> wrTags = new HashSet<String>();
//
// private Configuration configuration;
//
// private String docGeneratedDate;
//
// private Logger logger = LoggerFactory.getLogger(this.getClass());
//
// public Configuration getConfiguration() {
// return configuration;
// }
//
// public Set<String> getWRTags() {
// return this.wrTags;
// }
//
// public Map<String, List<OpenAPI>> getTaggedOpenAPIs() {
// return taggedOpenAPIs;
// }
//
// public String getDocGeneratedTime() {
// return this.docGeneratedDate;
// }
//
// public WRDoc(Configuration configuration) {
// this.configuration = configuration;
// Calendar c = Calendar.getInstance();
// DateFormat df = new SimpleDateFormat("yyyy.MM.dd HH:mm:ssz");
// this.docGeneratedDate = df.format(c.getTime());
// this.builders.add(new RESTDocBuilder(this));
// this.logger.debug("RESTDocBuilder loaded.");
// this.builders.add(new SOAPDocBuilder(this));
// this.logger.debug("SOAPDocBuilder loaded.");
// String dubboConfigPath = ((AbstractConfiguration) this.configuration).dubboconfigpath;
// this.builders.add(new DubboDocBuilder(this));
// this.logger.debug("DubboDocBuilder loaded with config path:" + dubboConfigPath);
// this.builders.add(new MQDocBuilder(this));
// this.logger.debug("MQDocBuilder loaded.");
// this.build();
// }
//
// private void build() {
// for (AbstractDocBuilder builder : this.builders) {
// builder.buildWRDoc();
// }
// }
// }
// Path: src/main/java/net/winroad/wrdoclet/builder/SOAPDocBuilder.java
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import net.winroad.wrdoclet.data.APIParameter;
import net.winroad.wrdoclet.data.ParameterOccurs;
import net.winroad.wrdoclet.data.ParameterType;
import net.winroad.wrdoclet.data.RequestMapping;
import net.winroad.wrdoclet.data.WRDoc;
import com.sun.javadoc.AnnotationDesc;
import com.sun.javadoc.AnnotationDesc.ElementValuePair;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Parameter;
import com.sun.javadoc.Tag;
package net.winroad.wrdoclet.builder;
public class SOAPDocBuilder extends AbstractServiceDocBuilder {
public SOAPDocBuilder(WRDoc wrDoc) {
super(wrDoc);
}
@Override | protected RequestMapping parseRequestMapping(MethodDoc method) { |
WinRoad-NET/wrdocletbase | src/main/java/net/winroad/wrdoclet/builder/SOAPDocBuilder.java | // Path: src/main/java/net/winroad/wrdoclet/data/APIParameter.java
// @Data
// public class APIParameter {
// private String name;
// private String description;
// private ParameterOccurs parameterOccurs;
// private ParameterLocation parameterLocation;
// private String type;
// private ModificationHistory history;
// private List<APIParameter> fields;
// private Example example;
// /**
// * whether it's type argument for parent (the parent is generic type).
// */
// private boolean isParentTypeArgument;
//
// /*
// * @return Whether this parameter has modification on specified version. If
// * no version specified, returns true.
// */
// public boolean isModifiedOnVersion(String version) {
// if (version == null || version.isEmpty()) {
// return true;
// }
// if (this.history != null && this.history.isModifiedOnVersion(version)) {
// return true;
// }
// if (this.fields != null) {
// for (APIParameter param : this.fields) {
// if (param.isModifiedOnVersion(version)) {
// return true;
// }
// }
// }
// return false;
// }
//
// public void appendField(APIParameter field) {
// if (this.fields == null) {
// this.fields = new LinkedList<APIParameter>();
// }
//
// this.fields.add(field);
// }
//
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/ParameterOccurs.java
// public enum ParameterOccurs {
// //It should be appeared each time.
// REQUIRED,
// //It may not be appeared.
// OPTIONAL,
// //It may not be appeared. But in some cases, depends on other field,
// //it will be appeared each time when other field equals to specified value.
// DEPENDS
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/ParameterType.java
// public enum ParameterType {
// Request,
// Response
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/RequestMapping.java
// @Data
// public class RequestMapping {
// private String url;
// private String methodType;
// private String tooltip;
// private String containerName;
// private String consumes;
// private String produces;
// private String headers;
// private String params;
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/WRDoc.java
// public class WRDoc {
// private Map<String, List<OpenAPI>> taggedOpenAPIs = new HashMap<String, List<OpenAPI>>();
//
// private List<AbstractDocBuilder> builders = new LinkedList<AbstractDocBuilder>();
//
// // The collection of tag name in this Doc.
// private Set<String> wrTags = new HashSet<String>();
//
// private Configuration configuration;
//
// private String docGeneratedDate;
//
// private Logger logger = LoggerFactory.getLogger(this.getClass());
//
// public Configuration getConfiguration() {
// return configuration;
// }
//
// public Set<String> getWRTags() {
// return this.wrTags;
// }
//
// public Map<String, List<OpenAPI>> getTaggedOpenAPIs() {
// return taggedOpenAPIs;
// }
//
// public String getDocGeneratedTime() {
// return this.docGeneratedDate;
// }
//
// public WRDoc(Configuration configuration) {
// this.configuration = configuration;
// Calendar c = Calendar.getInstance();
// DateFormat df = new SimpleDateFormat("yyyy.MM.dd HH:mm:ssz");
// this.docGeneratedDate = df.format(c.getTime());
// this.builders.add(new RESTDocBuilder(this));
// this.logger.debug("RESTDocBuilder loaded.");
// this.builders.add(new SOAPDocBuilder(this));
// this.logger.debug("SOAPDocBuilder loaded.");
// String dubboConfigPath = ((AbstractConfiguration) this.configuration).dubboconfigpath;
// this.builders.add(new DubboDocBuilder(this));
// this.logger.debug("DubboDocBuilder loaded with config path:" + dubboConfigPath);
// this.builders.add(new MQDocBuilder(this));
// this.logger.debug("MQDocBuilder loaded.");
// this.build();
// }
//
// private void build() {
// for (AbstractDocBuilder builder : this.builders) {
// builder.buildWRDoc();
// }
// }
// }
| import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import net.winroad.wrdoclet.data.APIParameter;
import net.winroad.wrdoclet.data.ParameterOccurs;
import net.winroad.wrdoclet.data.ParameterType;
import net.winroad.wrdoclet.data.RequestMapping;
import net.winroad.wrdoclet.data.WRDoc;
import com.sun.javadoc.AnnotationDesc;
import com.sun.javadoc.AnnotationDesc.ElementValuePair;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Parameter;
import com.sun.javadoc.Tag; | }
}
}
}
mapping.setUrl(url);
mapping.setTooltip(method.containingClass().simpleTypeName());
mapping.setContainerName(method.containingClass().simpleTypeName());
return mapping;
}
@Override
protected APIParameter getOutputParam(MethodDoc method) {
APIParameter apiParameter = null;
if (method.returnType() != null) {
apiParameter = new APIParameter();
AnnotationDesc[] annotations = method.annotations();
boolean isResNameCustomized = false;
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].annotationType().name().equals("WebResult")) {
for (ElementValuePair p : annotations[i].elementValues()) {
if (p.element().name().equals("name")) {
apiParameter.setName(p.value().value().toString());
isResNameCustomized = true;
}
}
}
}
if (!isResNameCustomized) {
apiParameter.setName("return");
} | // Path: src/main/java/net/winroad/wrdoclet/data/APIParameter.java
// @Data
// public class APIParameter {
// private String name;
// private String description;
// private ParameterOccurs parameterOccurs;
// private ParameterLocation parameterLocation;
// private String type;
// private ModificationHistory history;
// private List<APIParameter> fields;
// private Example example;
// /**
// * whether it's type argument for parent (the parent is generic type).
// */
// private boolean isParentTypeArgument;
//
// /*
// * @return Whether this parameter has modification on specified version. If
// * no version specified, returns true.
// */
// public boolean isModifiedOnVersion(String version) {
// if (version == null || version.isEmpty()) {
// return true;
// }
// if (this.history != null && this.history.isModifiedOnVersion(version)) {
// return true;
// }
// if (this.fields != null) {
// for (APIParameter param : this.fields) {
// if (param.isModifiedOnVersion(version)) {
// return true;
// }
// }
// }
// return false;
// }
//
// public void appendField(APIParameter field) {
// if (this.fields == null) {
// this.fields = new LinkedList<APIParameter>();
// }
//
// this.fields.add(field);
// }
//
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/ParameterOccurs.java
// public enum ParameterOccurs {
// //It should be appeared each time.
// REQUIRED,
// //It may not be appeared.
// OPTIONAL,
// //It may not be appeared. But in some cases, depends on other field,
// //it will be appeared each time when other field equals to specified value.
// DEPENDS
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/ParameterType.java
// public enum ParameterType {
// Request,
// Response
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/RequestMapping.java
// @Data
// public class RequestMapping {
// private String url;
// private String methodType;
// private String tooltip;
// private String containerName;
// private String consumes;
// private String produces;
// private String headers;
// private String params;
// }
//
// Path: src/main/java/net/winroad/wrdoclet/data/WRDoc.java
// public class WRDoc {
// private Map<String, List<OpenAPI>> taggedOpenAPIs = new HashMap<String, List<OpenAPI>>();
//
// private List<AbstractDocBuilder> builders = new LinkedList<AbstractDocBuilder>();
//
// // The collection of tag name in this Doc.
// private Set<String> wrTags = new HashSet<String>();
//
// private Configuration configuration;
//
// private String docGeneratedDate;
//
// private Logger logger = LoggerFactory.getLogger(this.getClass());
//
// public Configuration getConfiguration() {
// return configuration;
// }
//
// public Set<String> getWRTags() {
// return this.wrTags;
// }
//
// public Map<String, List<OpenAPI>> getTaggedOpenAPIs() {
// return taggedOpenAPIs;
// }
//
// public String getDocGeneratedTime() {
// return this.docGeneratedDate;
// }
//
// public WRDoc(Configuration configuration) {
// this.configuration = configuration;
// Calendar c = Calendar.getInstance();
// DateFormat df = new SimpleDateFormat("yyyy.MM.dd HH:mm:ssz");
// this.docGeneratedDate = df.format(c.getTime());
// this.builders.add(new RESTDocBuilder(this));
// this.logger.debug("RESTDocBuilder loaded.");
// this.builders.add(new SOAPDocBuilder(this));
// this.logger.debug("SOAPDocBuilder loaded.");
// String dubboConfigPath = ((AbstractConfiguration) this.configuration).dubboconfigpath;
// this.builders.add(new DubboDocBuilder(this));
// this.logger.debug("DubboDocBuilder loaded with config path:" + dubboConfigPath);
// this.builders.add(new MQDocBuilder(this));
// this.logger.debug("MQDocBuilder loaded.");
// this.build();
// }
//
// private void build() {
// for (AbstractDocBuilder builder : this.builders) {
// builder.buildWRDoc();
// }
// }
// }
// Path: src/main/java/net/winroad/wrdoclet/builder/SOAPDocBuilder.java
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import net.winroad.wrdoclet.data.APIParameter;
import net.winroad.wrdoclet.data.ParameterOccurs;
import net.winroad.wrdoclet.data.ParameterType;
import net.winroad.wrdoclet.data.RequestMapping;
import net.winroad.wrdoclet.data.WRDoc;
import com.sun.javadoc.AnnotationDesc;
import com.sun.javadoc.AnnotationDesc.ElementValuePair;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Parameter;
import com.sun.javadoc.Tag;
}
}
}
}
mapping.setUrl(url);
mapping.setTooltip(method.containingClass().simpleTypeName());
mapping.setContainerName(method.containingClass().simpleTypeName());
return mapping;
}
@Override
protected APIParameter getOutputParam(MethodDoc method) {
APIParameter apiParameter = null;
if (method.returnType() != null) {
apiParameter = new APIParameter();
AnnotationDesc[] annotations = method.annotations();
boolean isResNameCustomized = false;
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].annotationType().name().equals("WebResult")) {
for (ElementValuePair p : annotations[i].elementValues()) {
if (p.element().name().equals("name")) {
apiParameter.setName(p.value().value().toString());
isResNameCustomized = true;
}
}
}
}
if (!isResNameCustomized) {
apiParameter.setName("return");
} | apiParameter.setParameterOccurs(ParameterOccurs.REQUIRED); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/NotePush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
| import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import lombok.Getter;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true) | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/NotePush.java
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import lombok.Getter;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true) | public class NotePush extends Push { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/NotePush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
| import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import lombok.Getter;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
public class NotePush extends Push {
private NotePush() { | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/NotePush.java
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import lombok.Getter;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
public class NotePush extends Push {
private NotePush() { | setType(PushType.NOTE); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListBlocksRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
| import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest; | package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListBlocksRequest extends ListItemsRequest {
public ListBlocksRequest() { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListBlocksRequest.java
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListBlocksRequest extends ListItemsRequest {
public ListBlocksRequest() { | super(Urls.BLOCKS); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/LinkPush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
| import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import lombok.Getter;
import lombok.ToString;
import lombok.experimental.Accessors; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Accessors(chain = true)
@Getter
@ToString(callSuper = true) | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/LinkPush.java
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import lombok.Getter;
import lombok.ToString;
import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Accessors(chain = true)
@Getter
@ToString(callSuper = true) | public class LinkPush extends Push { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/LinkPush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
| import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import lombok.Getter;
import lombok.ToString;
import lombok.experimental.Accessors; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Accessors(chain = true)
@Getter
@ToString(callSuper = true)
public class LinkPush extends Push {
private LinkPush() { | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/LinkPush.java
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import lombok.Getter;
import lombok.ToString;
import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Accessors(chain = true)
@Getter
@ToString(callSuper = true)
public class LinkPush extends Push {
private LinkPush() { | setType(PushType.LINK); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.DeleteRequest;
import com.github.sheigutn.pushbullet.http.Urls; | package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> {
public DeleteSpecificSubscriptionRequest(String channelIdentity) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificSubscriptionRequest.java
import com.github.sheigutn.pushbullet.http.DeleteRequest;
import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificSubscriptionRequest extends DeleteRequest<Void> {
public DeleteSpecificSubscriptionRequest(String channelIdentity) { | super(Urls.SUBSCRIPTIONS + "/" + channelIdentity); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateDeviceRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/device/Device.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class Device extends PushbulletObject implements Deletable, Pushable, SmsSendable {
//
// /**
// * The nickname of this device
// */
// private String nickname;
//
// /**
// * Whether the nickname of this device has been generated
// */
// @SerializedName("generated_nickname")
// private boolean nicknameGenerated;
//
// /**
// * The type of this device
// */
// private String type;
//
// /**
// * The kind of this device
// */
// private String kind;
//
// /**
// * The icon of this device
// */
// private String icon;
//
// /**
// * Whether it is possible to push to this device
// */
// private boolean pushable;
//
// /**
// * The push token for this device
// */
// @SerializedName("push_token")
// private String pushToken;
//
// /**
// * The app version of the pushbullet app on this device
// */
// @SerializedName("app_version")
// private int appVersion;
//
// /**
// * The fingerprint of this device
// */
// @SerializedName("fingerprint")
// private String fingerPrint;
//
// /**
// * The manufacturer of this device
// */
// private String manufacturer;
//
// /**
// * The model of this device
// */
// private String model;
//
// @SerializedName("has_sms")
// @Accessors(fluent = true)
// private boolean hasSms;
//
// public Push push(SendablePush push) {
// if(!isPushable()) return null;
// push = push.clone();
// push.setReceiver(ReceiverType.DEVICE, getIdentity());
// return sendPush(getPushbullet(), push);
// }
//
// /**
// * Sent a text to the clipboard of the other registered devices that have universal copy paste enabled
// * @param content The text to
// * @param toTypes The types of the devices that should receive the text, leave empty for all
// */
// public void sendToOtherClipboards(String content, String... toTypes) {
// ClipEphemeral push = new ClipEphemeral();
// push.setBody(content)
// .setSourceDeviceIdentity(getIdentity());
// getPushbullet().pushEphemeral(push, toTypes);
// }
//
// /**
// * Returns all pushes that this device has received
// * @return A list of pushes that this device has received
// */
// public List<Push> getReceivedPushes() {
// return getPushbullet().getAllPushes().stream().filter(push -> getIdentity().equals(push.getTargetDeviceIdentity())).collect(Collectors.toList());
// }
//
// /**
// * Returns the phonebook of this device
// * @return The phonebook of this device
// */
// public Phonebook getPhonebook() {
// Phonebook phonebook = getPushbullet().executeRequest(new ListPhonebookRequest(getIdentity()));
// phonebook.setDevice(this);
// return phonebook;
// }
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificDeviceRequest deleteSpecificDeviceRequest = new DeleteSpecificDeviceRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificDeviceRequest);
// setActive(false);
// }
//
// @Override
// public void sendSMS(String number, String body) {
// if(!isActive()) return;
// if(!hasSms()) return;
// SmsReplyEphemeral smsReplyEphemeralPush = new SmsReplyEphemeral();
// smsReplyEphemeralPush
// .setMessage(body)
// .setPackageName("com.pushbullet.android")
// .setPhoneNumber(number)
// .setTargetDeviceIdentity(getIdentity())
// .setSourceUserIdentity(getPushbullet().getCurrentUser().getIdentity());
// getPushbullet().pushEphemeral(smsReplyEphemeralPush);
// }
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.device.Device;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class CreateDeviceRequest extends PostRequest<Device> {
private String nickname;
private String type;
public CreateDeviceRequest(String nickname, String type) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/device/Device.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class Device extends PushbulletObject implements Deletable, Pushable, SmsSendable {
//
// /**
// * The nickname of this device
// */
// private String nickname;
//
// /**
// * Whether the nickname of this device has been generated
// */
// @SerializedName("generated_nickname")
// private boolean nicknameGenerated;
//
// /**
// * The type of this device
// */
// private String type;
//
// /**
// * The kind of this device
// */
// private String kind;
//
// /**
// * The icon of this device
// */
// private String icon;
//
// /**
// * Whether it is possible to push to this device
// */
// private boolean pushable;
//
// /**
// * The push token for this device
// */
// @SerializedName("push_token")
// private String pushToken;
//
// /**
// * The app version of the pushbullet app on this device
// */
// @SerializedName("app_version")
// private int appVersion;
//
// /**
// * The fingerprint of this device
// */
// @SerializedName("fingerprint")
// private String fingerPrint;
//
// /**
// * The manufacturer of this device
// */
// private String manufacturer;
//
// /**
// * The model of this device
// */
// private String model;
//
// @SerializedName("has_sms")
// @Accessors(fluent = true)
// private boolean hasSms;
//
// public Push push(SendablePush push) {
// if(!isPushable()) return null;
// push = push.clone();
// push.setReceiver(ReceiverType.DEVICE, getIdentity());
// return sendPush(getPushbullet(), push);
// }
//
// /**
// * Sent a text to the clipboard of the other registered devices that have universal copy paste enabled
// * @param content The text to
// * @param toTypes The types of the devices that should receive the text, leave empty for all
// */
// public void sendToOtherClipboards(String content, String... toTypes) {
// ClipEphemeral push = new ClipEphemeral();
// push.setBody(content)
// .setSourceDeviceIdentity(getIdentity());
// getPushbullet().pushEphemeral(push, toTypes);
// }
//
// /**
// * Returns all pushes that this device has received
// * @return A list of pushes that this device has received
// */
// public List<Push> getReceivedPushes() {
// return getPushbullet().getAllPushes().stream().filter(push -> getIdentity().equals(push.getTargetDeviceIdentity())).collect(Collectors.toList());
// }
//
// /**
// * Returns the phonebook of this device
// * @return The phonebook of this device
// */
// public Phonebook getPhonebook() {
// Phonebook phonebook = getPushbullet().executeRequest(new ListPhonebookRequest(getIdentity()));
// phonebook.setDevice(this);
// return phonebook;
// }
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificDeviceRequest deleteSpecificDeviceRequest = new DeleteSpecificDeviceRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificDeviceRequest);
// setActive(false);
// }
//
// @Override
// public void sendSMS(String number, String body) {
// if(!isActive()) return;
// if(!hasSms()) return;
// SmsReplyEphemeral smsReplyEphemeralPush = new SmsReplyEphemeral();
// smsReplyEphemeralPush
// .setMessage(body)
// .setPackageName("com.pushbullet.android")
// .setPhoneNumber(number)
// .setTargetDeviceIdentity(getIdentity())
// .setSourceUserIdentity(getPushbullet().getCurrentUser().getIdentity());
// getPushbullet().pushEphemeral(smsReplyEphemeralPush);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateDeviceRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.device.Device;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class CreateDeviceRequest extends PostRequest<Device> {
private String nickname;
private String type;
public CreateDeviceRequest(String nickname, String type) { | super(Urls.DEVICES); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListChannelsRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls; | package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListChannelsRequest extends ListItemsRequest {
public ListChannelsRequest() { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListChannelsRequest.java
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListChannelsRequest extends ListItemsRequest {
public ListChannelsRequest() { | super(Urls.CHANNELS); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.DeleteRequest;
import com.github.sheigutn.pushbullet.http.Urls; | package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificBlockRequest extends DeleteRequest<Void> {
public DeleteSpecificBlockRequest(String blockIdentity) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificBlockRequest.java
import com.github.sheigutn.pushbullet.http.DeleteRequest;
import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificBlockRequest extends DeleteRequest<Void> {
public DeleteSpecificBlockRequest(String blockIdentity) { | super(Urls.BLOCKS + "/" + blockIdentity); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListContactsRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls; | package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListContactsRequest extends ListItemsRequest {
public ListContactsRequest() { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListContactsRequest.java
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListContactsRequest extends ListItemsRequest {
public ListContactsRequest() { | super(Urls.CONTACTS); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificDeviceRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
| import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.http.DeleteRequest; | package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificDeviceRequest extends DeleteRequest<Void> {
public DeleteSpecificDeviceRequest(String deviceIdentity) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificDeviceRequest.java
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.http.DeleteRequest;
package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificDeviceRequest extends DeleteRequest<Void> {
public DeleteSpecificDeviceRequest(String deviceIdentity) { | super(Urls.DEVICES + "/" + deviceIdentity); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/RequestFileUploadRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java
// @Getter
// public class UploadFile {
//
// /**
// * The mime type of this file
// */
// @SerializedName("file_type")
// private String fileType;
//
// /**
// * The name of this file
// */
// @SerializedName("file_name")
// private String fileName;
//
// /**
// * The url to this file
// */
// @SerializedName("file_url")
// private String fileUrl;
//
// /**
// * The upload url that this file should be uploaded to
// */
// @SerializedName("upload_url")
// private String uploadUrl;
//
// /**
// * The data for the upload to AWS
// */
// private AwsAuthData data;
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.file.UploadFile;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.SneakyThrows;
import org.apache.http.client.methods.HttpPost;
import javax.activation.MimetypesFileTypeMap;
import java.io.File; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class RequestFileUploadRequest extends PostRequest<UploadFile> {
@SerializedName("file_name")
private String fileName;
@SerializedName("file_type")
private String fileType;
public RequestFileUploadRequest(File file) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java
// @Getter
// public class UploadFile {
//
// /**
// * The mime type of this file
// */
// @SerializedName("file_type")
// private String fileType;
//
// /**
// * The name of this file
// */
// @SerializedName("file_name")
// private String fileName;
//
// /**
// * The url to this file
// */
// @SerializedName("file_url")
// private String fileUrl;
//
// /**
// * The upload url that this file should be uploaded to
// */
// @SerializedName("upload_url")
// private String uploadUrl;
//
// /**
// * The data for the upload to AWS
// */
// private AwsAuthData data;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/RequestFileUploadRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.file.UploadFile;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.SneakyThrows;
import org.apache.http.client.methods.HttpPost;
import javax.activation.MimetypesFileTypeMap;
import java.io.File;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class RequestFileUploadRequest extends PostRequest<UploadFile> {
@SerializedName("file_name")
private String fileName;
@SerializedName("file_type")
private String fileType;
public RequestFileUploadRequest(File file) { | super(Urls.UPLOAD_REQUEST); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
| import com.github.sheigutn.pushbullet.items.push.PushType;
import com.google.gson.annotations.SerializedName;
import lombok.*;
import lombok.experimental.Accessors; | package com.github.sheigutn.pushbullet.items.push.sendable;
@Accessors(chain = true)
@Data
public abstract class SendablePush implements Cloneable {
| // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sendable/SendablePush.java
import com.github.sheigutn.pushbullet.items.push.PushType;
import com.google.gson.annotations.SerializedName;
import lombok.*;
import lombok.experimental.Accessors;
package com.github.sheigutn.pushbullet.items.push.sendable;
@Accessors(chain = true)
@Data
public abstract class SendablePush implements Cloneable {
| private final PushType type; |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// @Data
// public class SubscribeToChannelRequest extends PostRequest<Subscription> {
//
// @SerializedName("channel_tag")
// private String channelTag;
//
// public SubscribeToChannelRequest(String channelTag) {
// super(Urls.SUBSCRIPTIONS);
// this.channelTag = channelTag;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Subscribable.java
// public interface Subscribable {
//
// /**
// * Used to subscribe to this object
// */
// void subscribe();
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
| import com.github.sheigutn.pushbullet.http.defaults.post.SubscribeToChannelRequest;
import com.github.sheigutn.pushbullet.interfaces.Subscribable;
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List; | package com.github.sheigutn.pushbullet.items.channel;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE) | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// @Data
// public class SubscribeToChannelRequest extends PostRequest<Subscription> {
//
// @SerializedName("channel_tag")
// private String channelTag;
//
// public SubscribeToChannelRequest(String channelTag) {
// super(Urls.SUBSCRIPTIONS);
// this.channelTag = channelTag;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Subscribable.java
// public interface Subscribable {
//
// /**
// * Used to subscribe to this object
// */
// void subscribe();
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java
import com.github.sheigutn.pushbullet.http.defaults.post.SubscribeToChannelRequest;
import com.github.sheigutn.pushbullet.interfaces.Subscribable;
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List;
package com.github.sheigutn.pushbullet.items.channel;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE) | public class ChannelInfo extends PushbulletIdentifiable implements Subscribable { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// @Data
// public class SubscribeToChannelRequest extends PostRequest<Subscription> {
//
// @SerializedName("channel_tag")
// private String channelTag;
//
// public SubscribeToChannelRequest(String channelTag) {
// super(Urls.SUBSCRIPTIONS);
// this.channelTag = channelTag;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Subscribable.java
// public interface Subscribable {
//
// /**
// * Used to subscribe to this object
// */
// void subscribe();
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
| import com.github.sheigutn.pushbullet.http.defaults.post.SubscribeToChannelRequest;
import com.github.sheigutn.pushbullet.interfaces.Subscribable;
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List; | package com.github.sheigutn.pushbullet.items.channel;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE) | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// @Data
// public class SubscribeToChannelRequest extends PostRequest<Subscription> {
//
// @SerializedName("channel_tag")
// private String channelTag;
//
// public SubscribeToChannelRequest(String channelTag) {
// super(Urls.SUBSCRIPTIONS);
// this.channelTag = channelTag;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Subscribable.java
// public interface Subscribable {
//
// /**
// * Used to subscribe to this object
// */
// void subscribe();
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java
import com.github.sheigutn.pushbullet.http.defaults.post.SubscribeToChannelRequest;
import com.github.sheigutn.pushbullet.interfaces.Subscribable;
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List;
package com.github.sheigutn.pushbullet.items.channel;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE) | public class ChannelInfo extends PushbulletIdentifiable implements Subscribable { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// @Data
// public class SubscribeToChannelRequest extends PostRequest<Subscription> {
//
// @SerializedName("channel_tag")
// private String channelTag;
//
// public SubscribeToChannelRequest(String channelTag) {
// super(Urls.SUBSCRIPTIONS);
// this.channelTag = channelTag;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Subscribable.java
// public interface Subscribable {
//
// /**
// * Used to subscribe to this object
// */
// void subscribe();
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
| import com.github.sheigutn.pushbullet.http.defaults.post.SubscribeToChannelRequest;
import com.github.sheigutn.pushbullet.interfaces.Subscribable;
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List; | package com.github.sheigutn.pushbullet.items.channel;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ChannelInfo extends PushbulletIdentifiable implements Subscribable {
/**
* The tag of this channel
*/
private String tag;
/**
* The name of this channel
*/
private String name;
/**
* The description of this channel
*/
private String description;
/**
* The url to the image of this channel
*/
@SerializedName("image_url")
private String imageUrl;
/**
* The url to the website of this channel
*/
@SerializedName("website_url")
private String websiteUrl;
/**
* The subscriber count of this channel
*/
@SerializedName("subscriber_count")
private int subscriberCount;
/**
* The recent pushes of this channel
*/
@SerializedName("recent_pushes") | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// @Data
// public class SubscribeToChannelRequest extends PostRequest<Subscription> {
//
// @SerializedName("channel_tag")
// private String channelTag;
//
// public SubscribeToChannelRequest(String channelTag) {
// super(Urls.SUBSCRIPTIONS);
// this.channelTag = channelTag;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Subscribable.java
// public interface Subscribable {
//
// /**
// * Used to subscribe to this object
// */
// void subscribe();
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java
import com.github.sheigutn.pushbullet.http.defaults.post.SubscribeToChannelRequest;
import com.github.sheigutn.pushbullet.interfaces.Subscribable;
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List;
package com.github.sheigutn.pushbullet.items.channel;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ChannelInfo extends PushbulletIdentifiable implements Subscribable {
/**
* The tag of this channel
*/
private String tag;
/**
* The name of this channel
*/
private String name;
/**
* The description of this channel
*/
private String description;
/**
* The url to the image of this channel
*/
@SerializedName("image_url")
private String imageUrl;
/**
* The url to the website of this channel
*/
@SerializedName("website_url")
private String websiteUrl;
/**
* The subscriber count of this channel
*/
@SerializedName("subscriber_count")
private int subscriberCount;
/**
* The recent pushes of this channel
*/
@SerializedName("recent_pushes") | private List<Push> recentPushes; |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// @Data
// public class SubscribeToChannelRequest extends PostRequest<Subscription> {
//
// @SerializedName("channel_tag")
// private String channelTag;
//
// public SubscribeToChannelRequest(String channelTag) {
// super(Urls.SUBSCRIPTIONS);
// this.channelTag = channelTag;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Subscribable.java
// public interface Subscribable {
//
// /**
// * Used to subscribe to this object
// */
// void subscribe();
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
| import com.github.sheigutn.pushbullet.http.defaults.post.SubscribeToChannelRequest;
import com.github.sheigutn.pushbullet.interfaces.Subscribable;
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List; | package com.github.sheigutn.pushbullet.items.channel;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ChannelInfo extends PushbulletIdentifiable implements Subscribable {
/**
* The tag of this channel
*/
private String tag;
/**
* The name of this channel
*/
private String name;
/**
* The description of this channel
*/
private String description;
/**
* The url to the image of this channel
*/
@SerializedName("image_url")
private String imageUrl;
/**
* The url to the website of this channel
*/
@SerializedName("website_url")
private String websiteUrl;
/**
* The subscriber count of this channel
*/
@SerializedName("subscriber_count")
private int subscriberCount;
/**
* The recent pushes of this channel
*/
@SerializedName("recent_pushes")
private List<Push> recentPushes;
public void subscribe() { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SubscribeToChannelRequest.java
// @Data
// public class SubscribeToChannelRequest extends PostRequest<Subscription> {
//
// @SerializedName("channel_tag")
// private String channelTag;
//
// public SubscribeToChannelRequest(String channelTag) {
// super(Urls.SUBSCRIPTIONS);
// this.channelTag = channelTag;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Subscribable.java
// public interface Subscribable {
//
// /**
// * Used to subscribe to this object
// */
// void subscribe();
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/ChannelInfo.java
import com.github.sheigutn.pushbullet.http.defaults.post.SubscribeToChannelRequest;
import com.github.sheigutn.pushbullet.interfaces.Subscribable;
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List;
package com.github.sheigutn.pushbullet.items.channel;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ChannelInfo extends PushbulletIdentifiable implements Subscribable {
/**
* The tag of this channel
*/
private String tag;
/**
* The name of this channel
*/
private String name;
/**
* The description of this channel
*/
private String description;
/**
* The url to the image of this channel
*/
@SerializedName("image_url")
private String imageUrl;
/**
* The url to the website of this channel
*/
@SerializedName("website_url")
private String websiteUrl;
/**
* The subscriber count of this channel
*/
@SerializedName("subscriber_count")
private int subscriberCount;
/**
* The recent pushes of this channel
*/
@SerializedName("recent_pushes")
private List<Push> recentPushes;
public void subscribe() { | getPushbullet().executeRequest(new SubscribeToChannelRequest(tag)); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificContactRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
| import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.http.DeleteRequest; | package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificContactRequest extends DeleteRequest<Void> {
public DeleteSpecificContactRequest(String contactIdentity) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificContactRequest.java
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.http.DeleteRequest;
package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificContactRequest extends DeleteRequest<Void> {
public DeleteSpecificContactRequest(String contactIdentity) { | super(Urls.CONTACTS + "/" + contactIdentity); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/grant/Grant.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificGrantRequest.java
// public class DeleteSpecificGrantRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificGrantRequest(String grantIdentity) {
// super(Urls.GRANTS + "/" + grantIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java
// @Data
// public abstract class PushbulletObject extends PushbulletIdentifiable {
//
// /**
// * Creation timestamp of this object
// */
// private Number created;
//
// /**
// * Last modification timestamp of this object
// */
// private Number modified;
//
// /**
// * Whether this object is active or not
// */
// private boolean active = true;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
| import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificGrantRequest;
import com.github.sheigutn.pushbullet.items.PushbulletObject;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.grant;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE) | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificGrantRequest.java
// public class DeleteSpecificGrantRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificGrantRequest(String grantIdentity) {
// super(Urls.GRANTS + "/" + grantIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java
// @Data
// public abstract class PushbulletObject extends PushbulletIdentifiable {
//
// /**
// * Creation timestamp of this object
// */
// private Number created;
//
// /**
// * Last modification timestamp of this object
// */
// private Number modified;
//
// /**
// * Whether this object is active or not
// */
// private boolean active = true;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/grant/Grant.java
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificGrantRequest;
import com.github.sheigutn.pushbullet.items.PushbulletObject;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.grant;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE) | public class Grant extends PushbulletObject implements Deletable { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/grant/Grant.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificGrantRequest.java
// public class DeleteSpecificGrantRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificGrantRequest(String grantIdentity) {
// super(Urls.GRANTS + "/" + grantIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java
// @Data
// public abstract class PushbulletObject extends PushbulletIdentifiable {
//
// /**
// * Creation timestamp of this object
// */
// private Number created;
//
// /**
// * Last modification timestamp of this object
// */
// private Number modified;
//
// /**
// * Whether this object is active or not
// */
// private boolean active = true;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
| import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificGrantRequest;
import com.github.sheigutn.pushbullet.items.PushbulletObject;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.grant;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE) | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificGrantRequest.java
// public class DeleteSpecificGrantRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificGrantRequest(String grantIdentity) {
// super(Urls.GRANTS + "/" + grantIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java
// @Data
// public abstract class PushbulletObject extends PushbulletIdentifiable {
//
// /**
// * Creation timestamp of this object
// */
// private Number created;
//
// /**
// * Last modification timestamp of this object
// */
// private Number modified;
//
// /**
// * Whether this object is active or not
// */
// private boolean active = true;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/grant/Grant.java
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificGrantRequest;
import com.github.sheigutn.pushbullet.items.PushbulletObject;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.grant;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE) | public class Grant extends PushbulletObject implements Deletable { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/grant/Grant.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificGrantRequest.java
// public class DeleteSpecificGrantRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificGrantRequest(String grantIdentity) {
// super(Urls.GRANTS + "/" + grantIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java
// @Data
// public abstract class PushbulletObject extends PushbulletIdentifiable {
//
// /**
// * Creation timestamp of this object
// */
// private Number created;
//
// /**
// * Last modification timestamp of this object
// */
// private Number modified;
//
// /**
// * Whether this object is active or not
// */
// private boolean active = true;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
| import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificGrantRequest;
import com.github.sheigutn.pushbullet.items.PushbulletObject;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.grant;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Grant extends PushbulletObject implements Deletable {
/**
* The "granted client" of this grant
*/
private GrantClient client;
@Override
public void delete() {
if(!isActive()) return; | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificGrantRequest.java
// public class DeleteSpecificGrantRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificGrantRequest(String grantIdentity) {
// super(Urls.GRANTS + "/" + grantIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletObject.java
// @Data
// public abstract class PushbulletObject extends PushbulletIdentifiable {
//
// /**
// * Creation timestamp of this object
// */
// private Number created;
//
// /**
// * Last modification timestamp of this object
// */
// private Number modified;
//
// /**
// * Whether this object is active or not
// */
// private boolean active = true;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/grant/Grant.java
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificGrantRequest;
import com.github.sheigutn.pushbullet.items.PushbulletObject;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.grant;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Grant extends PushbulletObject implements Deletable {
/**
* The "granted client" of this grant
*/
private GrantClient client;
@Override
public void delete() {
if(!isActive()) return; | getPushbullet().executeRequest(new DeleteSpecificGrantRequest(getIdentity())); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateChatRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/chat/Chat.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class Chat extends PushbulletObject implements Deletable, Mutable, Pushable, Blockable {
//
// /**
// * The user this chat is held with
// */
// private ChatUser with;
//
// /**
// * Whether this chat is muted
// */
// private boolean muted;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificChatRequest chatRequest = new DeleteSpecificChatRequest(getIdentity());
// getPushbullet().executeRequest(chatRequest);
// setActive(false);
// }
//
// public void mute() {
// updateMute(true);
// }
//
// public void unmute() {
// updateMute(false);
// }
//
// /**
// * Used to block the user this chat is held with
// */
// @Override
// public void block() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new BlockUserRequest(getWith().getEmail()));
// setActive(false);
// }
//
// private void updateMute(boolean muteStatus) {
// getPushbullet().executeRequest(new UpdateChatMuteStatusRequest(getIdentity(), muteStatus));
// muted = muteStatus;
// }
//
// @Override
// public Push push(SendablePush push) {
// return with.push(push);
// }
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.chat.Chat;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class CreateChatRequest extends PostRequest<Chat> {
private String email;
public CreateChatRequest(String email) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/chat/Chat.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class Chat extends PushbulletObject implements Deletable, Mutable, Pushable, Blockable {
//
// /**
// * The user this chat is held with
// */
// private ChatUser with;
//
// /**
// * Whether this chat is muted
// */
// private boolean muted;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificChatRequest chatRequest = new DeleteSpecificChatRequest(getIdentity());
// getPushbullet().executeRequest(chatRequest);
// setActive(false);
// }
//
// public void mute() {
// updateMute(true);
// }
//
// public void unmute() {
// updateMute(false);
// }
//
// /**
// * Used to block the user this chat is held with
// */
// @Override
// public void block() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new BlockUserRequest(getWith().getEmail()));
// setActive(false);
// }
//
// private void updateMute(boolean muteStatus) {
// getPushbullet().executeRequest(new UpdateChatMuteStatusRequest(getIdentity(), muteStatus));
// muted = muteStatus;
// }
//
// @Override
// public Push push(SendablePush push) {
// return with.push(push);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateChatRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.chat.Chat;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class CreateChatRequest extends PostRequest<Chat> {
private String email;
public CreateChatRequest(String email) { | super(Urls.CHATS); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListPhonebookRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java
// public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> {
//
// public GetRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/device/Phonebook.java
// @Getter
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class Phonebook extends PushbulletContainer {
//
// /**
// * The entries of the phonebook
// */
// @SerializedName("phonebook")
// private List<PhonebookEntry> entries;
//
// /**
// * The device that this phonebook is linked to
// */
// private Device device;
//
// /**
// * Sets the device of this phonebook
// * @param device The device this phonebook should be linked to
// */
// protected void setDevice(Device device) {
// this.device = device;
// entries.forEach(entry -> entry.setDevice(device));
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.GetRequest;
import com.github.sheigutn.pushbullet.items.device.Phonebook;
import com.github.sheigutn.pushbullet.http.Urls; | package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListPhonebookRequest extends GetRequest<Phonebook> {
public ListPhonebookRequest(String deviceIdentity) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/GetRequest.java
// public abstract class GetRequest<TResult> extends Request<TResult, HttpGet> {
//
// public GetRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/device/Phonebook.java
// @Getter
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class Phonebook extends PushbulletContainer {
//
// /**
// * The entries of the phonebook
// */
// @SerializedName("phonebook")
// private List<PhonebookEntry> entries;
//
// /**
// * The device that this phonebook is linked to
// */
// private Device device;
//
// /**
// * Sets the device of this phonebook
// * @param device The device this phonebook should be linked to
// */
// protected void setDevice(Device device) {
// this.device = device;
// entries.forEach(entry -> entry.setDevice(device));
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListPhonebookRequest.java
import com.github.sheigutn.pushbullet.http.GetRequest;
import com.github.sheigutn.pushbullet.items.device.Phonebook;
import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListPhonebookRequest extends GetRequest<Phonebook> {
public ListPhonebookRequest(String deviceIdentity) { | super(Urls.PHONEBOOK + deviceIdentity); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/ListPush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/ListItem.java
// @Accessors(chain = true)
// @Getter
// public class ListItem {
//
// /**
// * Whether the item is checked or not
// */
// private boolean checked;
//
// /**
// * The text of the item
// */
// private String text;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
| import com.github.sheigutn.pushbullet.items.push.PushType;
import com.github.sheigutn.pushbullet.items.push.sent.ListItem;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import lombok.Getter;
import lombok.ToString;
import java.util.List; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
@Deprecated | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/ListItem.java
// @Accessors(chain = true)
// @Getter
// public class ListItem {
//
// /**
// * Whether the item is checked or not
// */
// private boolean checked;
//
// /**
// * The text of the item
// */
// private String text;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/ListPush.java
import com.github.sheigutn.pushbullet.items.push.PushType;
import com.github.sheigutn.pushbullet.items.push.sent.ListItem;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import lombok.Getter;
import lombok.ToString;
import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
@Deprecated | public class ListPush extends Push { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/ListPush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/ListItem.java
// @Accessors(chain = true)
// @Getter
// public class ListItem {
//
// /**
// * Whether the item is checked or not
// */
// private boolean checked;
//
// /**
// * The text of the item
// */
// private String text;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
| import com.github.sheigutn.pushbullet.items.push.PushType;
import com.github.sheigutn.pushbullet.items.push.sent.ListItem;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import lombok.Getter;
import lombok.ToString;
import java.util.List; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
@Deprecated
public class ListPush extends Push {
private ListPush() { | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/ListItem.java
// @Accessors(chain = true)
// @Getter
// public class ListItem {
//
// /**
// * Whether the item is checked or not
// */
// private boolean checked;
//
// /**
// * The text of the item
// */
// private String text;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/ListPush.java
import com.github.sheigutn.pushbullet.items.push.PushType;
import com.github.sheigutn.pushbullet.items.push.sent.ListItem;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import lombok.Getter;
import lombok.ToString;
import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
@Deprecated
public class ListPush extends Push {
private ListPush() { | setType(PushType.LIST); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/ListPush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/ListItem.java
// @Accessors(chain = true)
// @Getter
// public class ListItem {
//
// /**
// * Whether the item is checked or not
// */
// private boolean checked;
//
// /**
// * The text of the item
// */
// private String text;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
| import com.github.sheigutn.pushbullet.items.push.PushType;
import com.github.sheigutn.pushbullet.items.push.sent.ListItem;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import lombok.Getter;
import lombok.ToString;
import java.util.List; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
@Deprecated
public class ListPush extends Push {
private ListPush() {
setType(PushType.LIST);
}
/**
* The title of the push
*/
private String title;
/**
* The items of the list
*/ | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/ListItem.java
// @Accessors(chain = true)
// @Getter
// public class ListItem {
//
// /**
// * Whether the item is checked or not
// */
// private boolean checked;
//
// /**
// * The text of the item
// */
// private String text;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/ListPush.java
import com.github.sheigutn.pushbullet.items.push.PushType;
import com.github.sheigutn.pushbullet.items.push.sent.ListItem;
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import lombok.Getter;
import lombok.ToString;
import java.util.List;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
@Deprecated
public class ListPush extends Push {
private ListPush() {
setType(PushType.LIST);
}
/**
* The title of the push
*/
private String title;
/**
* The items of the list
*/ | private List<ListItem> items; |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificContactRequest.java
// public class DeleteSpecificContactRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificContactRequest(String contactIdentity) {
// super(Urls.CONTACTS + "/" + contactIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
| import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificContactRequest;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.user;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Deprecated | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificContactRequest.java
// public class DeleteSpecificContactRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificContactRequest(String contactIdentity) {
// super(Urls.CONTACTS + "/" + contactIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificContactRequest;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.user;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Deprecated | public class Contact extends User implements Deletable { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificContactRequest.java
// public class DeleteSpecificContactRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificContactRequest(String contactIdentity) {
// super(Urls.CONTACTS + "/" + contactIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
| import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificContactRequest;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.user;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Deprecated
public class Contact extends User implements Deletable {
/**
* The status of this contact
*/
private String status;
@Override
public void delete() {
if(!isActive()) return; | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificContactRequest.java
// public class DeleteSpecificContactRequest extends DeleteRequest<Void> {
//
// public DeleteSpecificContactRequest(String contactIdentity) {
// super(Urls.CONTACTS + "/" + contactIdentity);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/interfaces/Deletable.java
// @FunctionalInterface
// public interface Deletable {
//
// /**
// * Used to delete this object
// */
// void delete();
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
import com.github.sheigutn.pushbullet.http.defaults.delete.DeleteSpecificContactRequest;
import com.github.sheigutn.pushbullet.interfaces.Deletable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.user;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Deprecated
public class Contact extends User implements Deletable {
/**
* The status of this contact
*/
private String status;
@Override
public void delete() {
if(!isActive()) return; | getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity())); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificChatRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.DeleteRequest;
import com.github.sheigutn.pushbullet.http.Urls; | package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificChatRequest extends DeleteRequest<Void> {
public DeleteSpecificChatRequest(String chatIdentity) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificChatRequest.java
import com.github.sheigutn.pushbullet.http.DeleteRequest;
import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificChatRequest extends DeleteRequest<Void> {
public DeleteSpecificChatRequest(String chatIdentity) { | super(Urls.CHATS + "/" + chatIdentity); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdatePreferencesRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/CurrentUser.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class CurrentUser extends User {
//
// /**
// * The google user info of this user
// */
// @SerializedName("google_userinfo")
// private GoogleUserInfo googleUserInfo;
//
// /**
// * The preferences of this user
// */
// private JsonObject preferences;
//
// /**
// * The maximum allowed upload size for files allowed to this user
// */
// @SerializedName("max_upload_size")
// private long maxUploadSize;
//
// /**
// * Used to update the preferences of this user
// * @param preferences The preferences object
// */
// public void updatePreferences(JsonObject preferences) {
// getPushbullet().executeRequest(new UpdatePreferencesRequest(preferences));
// this.preferences = preferences;
// }
//
// @Override
// public void block() {
// throw new UnsupportedOperationException();
// }
//
// @Getter
// public class GoogleUserInfo {
//
// /**
// * The google name of this user
// */
// private String name;
// }
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.user.CurrentUser;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class UpdatePreferencesRequest extends PostRequest<CurrentUser> {
private JsonObject preferences;
public UpdatePreferencesRequest(JsonObject preferences) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/CurrentUser.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class CurrentUser extends User {
//
// /**
// * The google user info of this user
// */
// @SerializedName("google_userinfo")
// private GoogleUserInfo googleUserInfo;
//
// /**
// * The preferences of this user
// */
// private JsonObject preferences;
//
// /**
// * The maximum allowed upload size for files allowed to this user
// */
// @SerializedName("max_upload_size")
// private long maxUploadSize;
//
// /**
// * Used to update the preferences of this user
// * @param preferences The preferences object
// */
// public void updatePreferences(JsonObject preferences) {
// getPushbullet().executeRequest(new UpdatePreferencesRequest(preferences));
// this.preferences = preferences;
// }
//
// @Override
// public void block() {
// throw new UnsupportedOperationException();
// }
//
// @Getter
// public class GoogleUserInfo {
//
// /**
// * The google name of this user
// */
// private String name;
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdatePreferencesRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.user.CurrentUser;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class UpdatePreferencesRequest extends PostRequest<CurrentUser> {
private JsonObject preferences;
public UpdatePreferencesRequest(JsonObject preferences) { | super(Urls.CURRENT_USER); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificClientRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
| import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.http.DeleteRequest; | package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificClientRequest extends DeleteRequest<Void> {
public DeleteSpecificClientRequest(String clientIdentity) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/DeleteRequest.java
// public class DeleteRequest<TResult> extends Request<TResult, HttpDelete> {
//
// public DeleteRequest(String relativePath) {
// super(relativePath);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/delete/DeleteSpecificClientRequest.java
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.http.DeleteRequest;
package com.github.sheigutn.pushbullet.http.defaults.delete;
public class DeleteSpecificClientRequest extends DeleteRequest<Void> {
public DeleteSpecificClientRequest(String clientIdentity) { | super(Urls.CLIENTS + "/" + clientIdentity); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListPushesRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import lombok.Data; | package com.github.sheigutn.pushbullet.http.defaults.get;
@Data
public class ListPushesRequest extends ListItemsRequest {
public ListPushesRequest() { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListPushesRequest.java
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import lombok.Data;
package com.github.sheigutn.pushbullet.http.defaults.get;
@Data
public class ListPushesRequest extends ListItemsRequest {
public ListPushesRequest() { | super(Urls.PUSHES); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateChannelRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/OwnChannel.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class OwnChannel extends PushbulletObject implements Deletable {
//
// /**
// * The tag of this channel
// */
// private String tag;
//
// /**
// * The name of this channel
// */
// private String name;
//
// /**
// * The description of this channel
// */
// private String description;
//
// /**
// * The url to the image of this channel
// */
// @SerializedName("image_url")
// private String imageUrl;
//
// public void push(SendablePush push) {
// if(!isActive()) return;
// push = push.clone().setReceiver(ReceiverType.CHANNEL, tag);
// getPushbullet().executeRequest(new SendPushToChannelRequest(push));
// }
//
// public void sendPush(Pushbullet pushbullet, SendablePush push) {
// pushbullet.executeRequest(new SendPushRequest(push));
// }
//
// /**
// * Used to push a link to this channel
// * @param title The title of the push
// * @param body The body of the push
// * @param url The link of the push
// */
// public void pushLink(String title, String body, String url) {
// push(new SendableLinkPush(title, body, url));
// }
//
// /**
// * Used to push an address to this channel
// * @param name The name of the address
// * @param address The address
// */
// @Deprecated
// public void pushAddress(String name, String address) {
// push(new SendableAddressPush(name, address));
// }
//
// /**
// * Used to push a note to this channel
// * @param title The title of the note
// * @param body The body of the note
// */
// public void pushNote(String title, String body) {
// push(new SendableNotePush(title, body));
// }
//
// /**
// * Used to push a list to this channel
// * @param title The title of the list
// * @param items The items of the list
// */
// @Deprecated
// public void pushList(String title, List<String> items) {
// push(new SendableListPush(title, items));
// }
//
// /**
// * Used to push a file to this
// * @param body The body of this push
// * @param file The file of this push
// */
// public void pushFile(String body, UploadFile file) {
// push(new SendableFilePush(body, file));
// }
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificChannelRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java
// @Getter
// public class UploadFile {
//
// /**
// * The mime type of this file
// */
// @SerializedName("file_type")
// private String fileType;
//
// /**
// * The name of this file
// */
// @SerializedName("file_name")
// private String fileName;
//
// /**
// * The url to this file
// */
// @SerializedName("file_url")
// private String fileUrl;
//
// /**
// * The upload url that this file should be uploaded to
// */
// @SerializedName("upload_url")
// private String uploadUrl;
//
// /**
// * The data for the upload to AWS
// */
// private AwsAuthData data;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.channel.OwnChannel;
import com.github.sheigutn.pushbullet.items.file.UploadFile;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class CreateChannelRequest extends PostRequest<OwnChannel> {
private String tag;
private String name;
private String description;
@SerializedName("image_url")
private String imageUrl;
public CreateChannelRequest(String tag, String name, String description) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/OwnChannel.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class OwnChannel extends PushbulletObject implements Deletable {
//
// /**
// * The tag of this channel
// */
// private String tag;
//
// /**
// * The name of this channel
// */
// private String name;
//
// /**
// * The description of this channel
// */
// private String description;
//
// /**
// * The url to the image of this channel
// */
// @SerializedName("image_url")
// private String imageUrl;
//
// public void push(SendablePush push) {
// if(!isActive()) return;
// push = push.clone().setReceiver(ReceiverType.CHANNEL, tag);
// getPushbullet().executeRequest(new SendPushToChannelRequest(push));
// }
//
// public void sendPush(Pushbullet pushbullet, SendablePush push) {
// pushbullet.executeRequest(new SendPushRequest(push));
// }
//
// /**
// * Used to push a link to this channel
// * @param title The title of the push
// * @param body The body of the push
// * @param url The link of the push
// */
// public void pushLink(String title, String body, String url) {
// push(new SendableLinkPush(title, body, url));
// }
//
// /**
// * Used to push an address to this channel
// * @param name The name of the address
// * @param address The address
// */
// @Deprecated
// public void pushAddress(String name, String address) {
// push(new SendableAddressPush(name, address));
// }
//
// /**
// * Used to push a note to this channel
// * @param title The title of the note
// * @param body The body of the note
// */
// public void pushNote(String title, String body) {
// push(new SendableNotePush(title, body));
// }
//
// /**
// * Used to push a list to this channel
// * @param title The title of the list
// * @param items The items of the list
// */
// @Deprecated
// public void pushList(String title, List<String> items) {
// push(new SendableListPush(title, items));
// }
//
// /**
// * Used to push a file to this
// * @param body The body of this push
// * @param file The file of this push
// */
// public void pushFile(String body, UploadFile file) {
// push(new SendableFilePush(body, file));
// }
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificChannelRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java
// @Getter
// public class UploadFile {
//
// /**
// * The mime type of this file
// */
// @SerializedName("file_type")
// private String fileType;
//
// /**
// * The name of this file
// */
// @SerializedName("file_name")
// private String fileName;
//
// /**
// * The url to this file
// */
// @SerializedName("file_url")
// private String fileUrl;
//
// /**
// * The upload url that this file should be uploaded to
// */
// @SerializedName("upload_url")
// private String uploadUrl;
//
// /**
// * The data for the upload to AWS
// */
// private AwsAuthData data;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateChannelRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.channel.OwnChannel;
import com.github.sheigutn.pushbullet.items.file.UploadFile;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class CreateChannelRequest extends PostRequest<OwnChannel> {
private String tag;
private String name;
private String description;
@SerializedName("image_url")
private String imageUrl;
public CreateChannelRequest(String tag, String name, String description) { | super(Urls.CHANNELS); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateChannelRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/OwnChannel.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class OwnChannel extends PushbulletObject implements Deletable {
//
// /**
// * The tag of this channel
// */
// private String tag;
//
// /**
// * The name of this channel
// */
// private String name;
//
// /**
// * The description of this channel
// */
// private String description;
//
// /**
// * The url to the image of this channel
// */
// @SerializedName("image_url")
// private String imageUrl;
//
// public void push(SendablePush push) {
// if(!isActive()) return;
// push = push.clone().setReceiver(ReceiverType.CHANNEL, tag);
// getPushbullet().executeRequest(new SendPushToChannelRequest(push));
// }
//
// public void sendPush(Pushbullet pushbullet, SendablePush push) {
// pushbullet.executeRequest(new SendPushRequest(push));
// }
//
// /**
// * Used to push a link to this channel
// * @param title The title of the push
// * @param body The body of the push
// * @param url The link of the push
// */
// public void pushLink(String title, String body, String url) {
// push(new SendableLinkPush(title, body, url));
// }
//
// /**
// * Used to push an address to this channel
// * @param name The name of the address
// * @param address The address
// */
// @Deprecated
// public void pushAddress(String name, String address) {
// push(new SendableAddressPush(name, address));
// }
//
// /**
// * Used to push a note to this channel
// * @param title The title of the note
// * @param body The body of the note
// */
// public void pushNote(String title, String body) {
// push(new SendableNotePush(title, body));
// }
//
// /**
// * Used to push a list to this channel
// * @param title The title of the list
// * @param items The items of the list
// */
// @Deprecated
// public void pushList(String title, List<String> items) {
// push(new SendableListPush(title, items));
// }
//
// /**
// * Used to push a file to this
// * @param body The body of this push
// * @param file The file of this push
// */
// public void pushFile(String body, UploadFile file) {
// push(new SendableFilePush(body, file));
// }
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificChannelRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java
// @Getter
// public class UploadFile {
//
// /**
// * The mime type of this file
// */
// @SerializedName("file_type")
// private String fileType;
//
// /**
// * The name of this file
// */
// @SerializedName("file_name")
// private String fileName;
//
// /**
// * The url to this file
// */
// @SerializedName("file_url")
// private String fileUrl;
//
// /**
// * The upload url that this file should be uploaded to
// */
// @SerializedName("upload_url")
// private String uploadUrl;
//
// /**
// * The data for the upload to AWS
// */
// private AwsAuthData data;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.channel.OwnChannel;
import com.github.sheigutn.pushbullet.items.file.UploadFile;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class CreateChannelRequest extends PostRequest<OwnChannel> {
private String tag;
private String name;
private String description;
@SerializedName("image_url")
private String imageUrl;
public CreateChannelRequest(String tag, String name, String description) {
super(Urls.CHANNELS);
this.tag = tag;
this.name = name;
this.description = description;
}
public CreateChannelRequest(String tag, String name, String description, String imageUrl) {
this(tag, name, description);
this.imageUrl = imageUrl;
}
| // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/channel/OwnChannel.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class OwnChannel extends PushbulletObject implements Deletable {
//
// /**
// * The tag of this channel
// */
// private String tag;
//
// /**
// * The name of this channel
// */
// private String name;
//
// /**
// * The description of this channel
// */
// private String description;
//
// /**
// * The url to the image of this channel
// */
// @SerializedName("image_url")
// private String imageUrl;
//
// public void push(SendablePush push) {
// if(!isActive()) return;
// push = push.clone().setReceiver(ReceiverType.CHANNEL, tag);
// getPushbullet().executeRequest(new SendPushToChannelRequest(push));
// }
//
// public void sendPush(Pushbullet pushbullet, SendablePush push) {
// pushbullet.executeRequest(new SendPushRequest(push));
// }
//
// /**
// * Used to push a link to this channel
// * @param title The title of the push
// * @param body The body of the push
// * @param url The link of the push
// */
// public void pushLink(String title, String body, String url) {
// push(new SendableLinkPush(title, body, url));
// }
//
// /**
// * Used to push an address to this channel
// * @param name The name of the address
// * @param address The address
// */
// @Deprecated
// public void pushAddress(String name, String address) {
// push(new SendableAddressPush(name, address));
// }
//
// /**
// * Used to push a note to this channel
// * @param title The title of the note
// * @param body The body of the note
// */
// public void pushNote(String title, String body) {
// push(new SendableNotePush(title, body));
// }
//
// /**
// * Used to push a list to this channel
// * @param title The title of the list
// * @param items The items of the list
// */
// @Deprecated
// public void pushList(String title, List<String> items) {
// push(new SendableListPush(title, items));
// }
//
// /**
// * Used to push a file to this
// * @param body The body of this push
// * @param file The file of this push
// */
// public void pushFile(String body, UploadFile file) {
// push(new SendableFilePush(body, file));
// }
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificChannelRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/file/UploadFile.java
// @Getter
// public class UploadFile {
//
// /**
// * The mime type of this file
// */
// @SerializedName("file_type")
// private String fileType;
//
// /**
// * The name of this file
// */
// @SerializedName("file_name")
// private String fileName;
//
// /**
// * The url to this file
// */
// @SerializedName("file_url")
// private String fileUrl;
//
// /**
// * The upload url that this file should be uploaded to
// */
// @SerializedName("upload_url")
// private String uploadUrl;
//
// /**
// * The data for the upload to AWS
// */
// private AwsAuthData data;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateChannelRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.channel.OwnChannel;
import com.github.sheigutn.pushbullet.items.file.UploadFile;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class CreateChannelRequest extends PostRequest<OwnChannel> {
private String tag;
private String name;
private String description;
@SerializedName("image_url")
private String imageUrl;
public CreateChannelRequest(String tag, String name, String description) {
super(Urls.CHANNELS);
this.tag = tag;
this.name = name;
this.description = description;
}
public CreateChannelRequest(String tag, String name, String description, String imageUrl) {
this(tag, name, description);
this.imageUrl = imageUrl;
}
| public CreateChannelRequest(String tag, String name, String description, UploadFile file) { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/user/CurrentUser.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdatePreferencesRequest.java
// @Data
// public class UpdatePreferencesRequest extends PostRequest<CurrentUser> {
//
// private JsonObject preferences;
//
// public UpdatePreferencesRequest(JsonObject preferences) {
// super(Urls.CURRENT_USER);
// this.preferences = preferences;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
| import com.github.sheigutn.pushbullet.http.defaults.post.UpdatePreferencesRequest;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.user;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class CurrentUser extends User {
/**
* The google user info of this user
*/
@SerializedName("google_userinfo")
private GoogleUserInfo googleUserInfo;
/**
* The preferences of this user
*/
private JsonObject preferences;
/**
* The maximum allowed upload size for files allowed to this user
*/
@SerializedName("max_upload_size")
private long maxUploadSize;
/**
* Used to update the preferences of this user
* @param preferences The preferences object
*/
public void updatePreferences(JsonObject preferences) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdatePreferencesRequest.java
// @Data
// public class UpdatePreferencesRequest extends PostRequest<CurrentUser> {
//
// private JsonObject preferences;
//
// public UpdatePreferencesRequest(JsonObject preferences) {
// super(Urls.CURRENT_USER);
// this.preferences = preferences;
// }
//
// @Override
// public void applyBody(Gson gson, HttpPost post) {
// setJsonBody(gson.toJson(this), post);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/CurrentUser.java
import com.github.sheigutn.pushbullet.http.defaults.post.UpdatePreferencesRequest;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.user;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class CurrentUser extends User {
/**
* The google user info of this user
*/
@SerializedName("google_userinfo")
private GoogleUserInfo googleUserInfo;
/**
* The preferences of this user
*/
private JsonObject preferences;
/**
* The maximum allowed upload size for files allowed to this user
*/
@SerializedName("max_upload_size")
private long maxUploadSize;
/**
* Used to update the preferences of this user
* @param preferences The preferences object
*/
public void updatePreferences(JsonObject preferences) { | getPushbullet().executeRequest(new UpdatePreferencesRequest(preferences)); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListEverythingRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls; | package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListEverythingRequest extends ListItemsRequest {
public ListEverythingRequest() { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListEverythingRequest.java
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListEverythingRequest extends ListItemsRequest {
public ListEverythingRequest() { | super(Urls.EVERYTHING); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListChatsRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls; | package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListChatsRequest extends ListItemsRequest {
public ListChatsRequest() { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/ListItemsRequest.java
// @Accessors(chain = true)
// @Data
// public class ListItemsRequest extends GetRequest<ListResponse> {
//
// private Number modifiedAfter;
//
// private boolean onlyShowActiveItems = true;
//
// private String cursor;
//
// private Number limit;
//
// public ListItemsRequest(String relativePath) {
// super(relativePath);
// }
//
// @Override
// public void applyParameters(URIBuilder builder) {
// addParam("modified_after", modifiedAfter, builder);
// addParam("active", onlyShowActiveItems, builder);
// addParam("cursor", cursor, builder);
// addParam("limit", limit, builder);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/get/ListChatsRequest.java
import com.github.sheigutn.pushbullet.http.defaults.ListItemsRequest;
import com.github.sheigutn.pushbullet.http.Urls;
package com.github.sheigutn.pushbullet.http.defaults.get;
public class ListChatsRequest extends ListItemsRequest {
public ListChatsRequest() { | super(Urls.CHATS); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SendEphemeralRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/stream/message/PushStreamMessage.java
// @Data
// @ToString(callSuper = true)
// public class PushStreamMessage extends StreamMessage {
//
// public PushStreamMessage() {
// setType(StreamMessageType.PUSH);
// }
//
// /**
// * The ephemeral that has been transferred with this message
// */
// private Ephemeral push;
//
// /**
// * The list of targets this message was or should be transferred to
// */
// private List<String> targets;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/ephemeral/Ephemeral.java
// @Accessors(chain = true)
// @Data
// public class Ephemeral {
//
// /**
// * The type of this ephemeral
// */
// @Setter(AccessLevel.PROTECTED)
// private EphemeralType type;
//
// /**
// * The identity of the user this ephemeral came from
// */
// @SerializedName("source_user_iden")
// private String sourceUserIdentity;
//
// public enum EphemeralType {
//
// /**
// * Used for SMS replies
// */
// @SerializedName("messaging_extension_reply")
// SMS_REPLY,
//
// /**
// * Used for universal copy paste
// */
// @SerializedName("clip")
// CLIP,
//
// /**
// * Used for notification mirroring
// */
// @SerializedName("mirror")
// NOTIFICATION,
//
// /**
// * Used for notification dismissal
// */
// @SerializedName("dismissal")
// DISMISSAL;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/util/ListUtil.java
// public class ListUtil {
//
// /**
// * Returns a distinct list from an array
// * @param input The input array
// * @param <T> The array type
// * @return A distinct list
// */
// public static <T> List<T> distinctList(T[] input) {
// return distinctList(Arrays.asList(input));
// }
//
// /**
// * Returns a distinct list from a list
// * @param input The input list
// * @param <T> The list type
// * @return A distinct list
// */
// public static <T> List<T> distinctList(List<T> input) {
// if(input.isEmpty()) return input;
// return input.stream().distinct().collect(Collectors.toList());
// }
//
// /**
// * Returns a full list of a request that calls /v2/*s (e.g. /v2/pushes, /v2/devices, etc.)
// * @param pushbullet The pushbullet instance
// * @param request The request object
// * @param function The function of {@link ListResponse}
// * @param <T> The result type of the function
// * @return A result object with the result type {@link T}
// */
// public static <T> List<T> fullList(Pushbullet pushbullet, ListItemsRequest request, Function<ListResponse, List<T>> function) {
// ListResponse response = pushbullet.executeRequest(request);
// List<T> returnList = function.apply(response);
// while(response.getCursor() != null) {
// response = pushbullet.executeRequest(request.setCursor(response.getCursor()));
// returnList.addAll(function.apply(response));
// }
// return returnList;
// }
//
// /**
// * Returns a complete {@link ListResponse} by calling /v2/everything
// * @param pushbullet The pushbullet instance
// * @return A complete {@link ListResponse} object
// */
// public static ListResponse completeListResponse(Pushbullet pushbullet) {
// ListItemsRequest request = new ListEverythingRequest();
// ListResponse response = pushbullet.executeRequest(request);
// ListResponse tempResponse = response;
// while(tempResponse.getCursor() != null) {
// tempResponse = pushbullet.executeRequest(request.setCursor(tempResponse.getCursor()));
// response.addAll(tempResponse);
// }
// response.setCursor(null);
// return response;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.stream.message.PushStreamMessage;
import com.github.sheigutn.pushbullet.ephemeral.Ephemeral;
import com.github.sheigutn.pushbullet.util.ListUtil;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
import java.util.List; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class SendEphemeralRequest extends PostRequest<Void> {
| // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/stream/message/PushStreamMessage.java
// @Data
// @ToString(callSuper = true)
// public class PushStreamMessage extends StreamMessage {
//
// public PushStreamMessage() {
// setType(StreamMessageType.PUSH);
// }
//
// /**
// * The ephemeral that has been transferred with this message
// */
// private Ephemeral push;
//
// /**
// * The list of targets this message was or should be transferred to
// */
// private List<String> targets;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/ephemeral/Ephemeral.java
// @Accessors(chain = true)
// @Data
// public class Ephemeral {
//
// /**
// * The type of this ephemeral
// */
// @Setter(AccessLevel.PROTECTED)
// private EphemeralType type;
//
// /**
// * The identity of the user this ephemeral came from
// */
// @SerializedName("source_user_iden")
// private String sourceUserIdentity;
//
// public enum EphemeralType {
//
// /**
// * Used for SMS replies
// */
// @SerializedName("messaging_extension_reply")
// SMS_REPLY,
//
// /**
// * Used for universal copy paste
// */
// @SerializedName("clip")
// CLIP,
//
// /**
// * Used for notification mirroring
// */
// @SerializedName("mirror")
// NOTIFICATION,
//
// /**
// * Used for notification dismissal
// */
// @SerializedName("dismissal")
// DISMISSAL;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/util/ListUtil.java
// public class ListUtil {
//
// /**
// * Returns a distinct list from an array
// * @param input The input array
// * @param <T> The array type
// * @return A distinct list
// */
// public static <T> List<T> distinctList(T[] input) {
// return distinctList(Arrays.asList(input));
// }
//
// /**
// * Returns a distinct list from a list
// * @param input The input list
// * @param <T> The list type
// * @return A distinct list
// */
// public static <T> List<T> distinctList(List<T> input) {
// if(input.isEmpty()) return input;
// return input.stream().distinct().collect(Collectors.toList());
// }
//
// /**
// * Returns a full list of a request that calls /v2/*s (e.g. /v2/pushes, /v2/devices, etc.)
// * @param pushbullet The pushbullet instance
// * @param request The request object
// * @param function The function of {@link ListResponse}
// * @param <T> The result type of the function
// * @return A result object with the result type {@link T}
// */
// public static <T> List<T> fullList(Pushbullet pushbullet, ListItemsRequest request, Function<ListResponse, List<T>> function) {
// ListResponse response = pushbullet.executeRequest(request);
// List<T> returnList = function.apply(response);
// while(response.getCursor() != null) {
// response = pushbullet.executeRequest(request.setCursor(response.getCursor()));
// returnList.addAll(function.apply(response));
// }
// return returnList;
// }
//
// /**
// * Returns a complete {@link ListResponse} by calling /v2/everything
// * @param pushbullet The pushbullet instance
// * @return A complete {@link ListResponse} object
// */
// public static ListResponse completeListResponse(Pushbullet pushbullet) {
// ListItemsRequest request = new ListEverythingRequest();
// ListResponse response = pushbullet.executeRequest(request);
// ListResponse tempResponse = response;
// while(tempResponse.getCursor() != null) {
// tempResponse = pushbullet.executeRequest(request.setCursor(tempResponse.getCursor()));
// response.addAll(tempResponse);
// }
// response.setCursor(null);
// return response;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SendEphemeralRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.stream.message.PushStreamMessage;
import com.github.sheigutn.pushbullet.ephemeral.Ephemeral;
import com.github.sheigutn.pushbullet.util.ListUtil;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
import java.util.List;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class SendEphemeralRequest extends PostRequest<Void> {
| private Ephemeral ephemeral; |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SendEphemeralRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/stream/message/PushStreamMessage.java
// @Data
// @ToString(callSuper = true)
// public class PushStreamMessage extends StreamMessage {
//
// public PushStreamMessage() {
// setType(StreamMessageType.PUSH);
// }
//
// /**
// * The ephemeral that has been transferred with this message
// */
// private Ephemeral push;
//
// /**
// * The list of targets this message was or should be transferred to
// */
// private List<String> targets;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/ephemeral/Ephemeral.java
// @Accessors(chain = true)
// @Data
// public class Ephemeral {
//
// /**
// * The type of this ephemeral
// */
// @Setter(AccessLevel.PROTECTED)
// private EphemeralType type;
//
// /**
// * The identity of the user this ephemeral came from
// */
// @SerializedName("source_user_iden")
// private String sourceUserIdentity;
//
// public enum EphemeralType {
//
// /**
// * Used for SMS replies
// */
// @SerializedName("messaging_extension_reply")
// SMS_REPLY,
//
// /**
// * Used for universal copy paste
// */
// @SerializedName("clip")
// CLIP,
//
// /**
// * Used for notification mirroring
// */
// @SerializedName("mirror")
// NOTIFICATION,
//
// /**
// * Used for notification dismissal
// */
// @SerializedName("dismissal")
// DISMISSAL;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/util/ListUtil.java
// public class ListUtil {
//
// /**
// * Returns a distinct list from an array
// * @param input The input array
// * @param <T> The array type
// * @return A distinct list
// */
// public static <T> List<T> distinctList(T[] input) {
// return distinctList(Arrays.asList(input));
// }
//
// /**
// * Returns a distinct list from a list
// * @param input The input list
// * @param <T> The list type
// * @return A distinct list
// */
// public static <T> List<T> distinctList(List<T> input) {
// if(input.isEmpty()) return input;
// return input.stream().distinct().collect(Collectors.toList());
// }
//
// /**
// * Returns a full list of a request that calls /v2/*s (e.g. /v2/pushes, /v2/devices, etc.)
// * @param pushbullet The pushbullet instance
// * @param request The request object
// * @param function The function of {@link ListResponse}
// * @param <T> The result type of the function
// * @return A result object with the result type {@link T}
// */
// public static <T> List<T> fullList(Pushbullet pushbullet, ListItemsRequest request, Function<ListResponse, List<T>> function) {
// ListResponse response = pushbullet.executeRequest(request);
// List<T> returnList = function.apply(response);
// while(response.getCursor() != null) {
// response = pushbullet.executeRequest(request.setCursor(response.getCursor()));
// returnList.addAll(function.apply(response));
// }
// return returnList;
// }
//
// /**
// * Returns a complete {@link ListResponse} by calling /v2/everything
// * @param pushbullet The pushbullet instance
// * @return A complete {@link ListResponse} object
// */
// public static ListResponse completeListResponse(Pushbullet pushbullet) {
// ListItemsRequest request = new ListEverythingRequest();
// ListResponse response = pushbullet.executeRequest(request);
// ListResponse tempResponse = response;
// while(tempResponse.getCursor() != null) {
// tempResponse = pushbullet.executeRequest(request.setCursor(tempResponse.getCursor()));
// response.addAll(tempResponse);
// }
// response.setCursor(null);
// return response;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.stream.message.PushStreamMessage;
import com.github.sheigutn.pushbullet.ephemeral.Ephemeral;
import com.github.sheigutn.pushbullet.util.ListUtil;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
import java.util.List; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class SendEphemeralRequest extends PostRequest<Void> {
private Ephemeral ephemeral;
private String[] deviceTypes;
public SendEphemeralRequest(Ephemeral ephemeral) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/stream/message/PushStreamMessage.java
// @Data
// @ToString(callSuper = true)
// public class PushStreamMessage extends StreamMessage {
//
// public PushStreamMessage() {
// setType(StreamMessageType.PUSH);
// }
//
// /**
// * The ephemeral that has been transferred with this message
// */
// private Ephemeral push;
//
// /**
// * The list of targets this message was or should be transferred to
// */
// private List<String> targets;
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/ephemeral/Ephemeral.java
// @Accessors(chain = true)
// @Data
// public class Ephemeral {
//
// /**
// * The type of this ephemeral
// */
// @Setter(AccessLevel.PROTECTED)
// private EphemeralType type;
//
// /**
// * The identity of the user this ephemeral came from
// */
// @SerializedName("source_user_iden")
// private String sourceUserIdentity;
//
// public enum EphemeralType {
//
// /**
// * Used for SMS replies
// */
// @SerializedName("messaging_extension_reply")
// SMS_REPLY,
//
// /**
// * Used for universal copy paste
// */
// @SerializedName("clip")
// CLIP,
//
// /**
// * Used for notification mirroring
// */
// @SerializedName("mirror")
// NOTIFICATION,
//
// /**
// * Used for notification dismissal
// */
// @SerializedName("dismissal")
// DISMISSAL;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/util/ListUtil.java
// public class ListUtil {
//
// /**
// * Returns a distinct list from an array
// * @param input The input array
// * @param <T> The array type
// * @return A distinct list
// */
// public static <T> List<T> distinctList(T[] input) {
// return distinctList(Arrays.asList(input));
// }
//
// /**
// * Returns a distinct list from a list
// * @param input The input list
// * @param <T> The list type
// * @return A distinct list
// */
// public static <T> List<T> distinctList(List<T> input) {
// if(input.isEmpty()) return input;
// return input.stream().distinct().collect(Collectors.toList());
// }
//
// /**
// * Returns a full list of a request that calls /v2/*s (e.g. /v2/pushes, /v2/devices, etc.)
// * @param pushbullet The pushbullet instance
// * @param request The request object
// * @param function The function of {@link ListResponse}
// * @param <T> The result type of the function
// * @return A result object with the result type {@link T}
// */
// public static <T> List<T> fullList(Pushbullet pushbullet, ListItemsRequest request, Function<ListResponse, List<T>> function) {
// ListResponse response = pushbullet.executeRequest(request);
// List<T> returnList = function.apply(response);
// while(response.getCursor() != null) {
// response = pushbullet.executeRequest(request.setCursor(response.getCursor()));
// returnList.addAll(function.apply(response));
// }
// return returnList;
// }
//
// /**
// * Returns a complete {@link ListResponse} by calling /v2/everything
// * @param pushbullet The pushbullet instance
// * @return A complete {@link ListResponse} object
// */
// public static ListResponse completeListResponse(Pushbullet pushbullet) {
// ListItemsRequest request = new ListEverythingRequest();
// ListResponse response = pushbullet.executeRequest(request);
// ListResponse tempResponse = response;
// while(tempResponse.getCursor() != null) {
// tempResponse = pushbullet.executeRequest(request.setCursor(tempResponse.getCursor()));
// response.addAll(tempResponse);
// }
// response.setCursor(null);
// return response;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/SendEphemeralRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.stream.message.PushStreamMessage;
import com.github.sheigutn.pushbullet.ephemeral.Ephemeral;
import com.github.sheigutn.pushbullet.util.ListUtil;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
import java.util.List;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
public class SendEphemeralRequest extends PostRequest<Void> {
private Ephemeral ephemeral;
private String[] deviceTypes;
public SendEphemeralRequest(Ephemeral ephemeral) { | super(Urls.EPHEMERALS); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateContactRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateContactRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated | public class CreateContactRequest extends PostRequest<Contact> { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateContactRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateContactRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated | public class CreateContactRequest extends PostRequest<Contact> { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateContactRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated
public class CreateContactRequest extends PostRequest<Contact> {
private String name;
private String email;
public CreateContactRequest(String name, String email) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/CreateContactRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.github.sheigutn.pushbullet.http.Urls;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated
public class CreateContactRequest extends PostRequest<Contact> {
private String name;
private String email;
public CreateContactRequest(String name, String email) { | super(Urls.CONTACTS); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/device/PhonebookEntry.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletContainer.java
// @Data
// public abstract class PushbulletContainer {
//
// /**
// * The pushbullet instance that this object is linked to
// */
// private transient Pushbullet pushbullet;
// }
| import com.github.sheigutn.pushbullet.items.PushbulletContainer;
import com.google.gson.annotations.SerializedName;
import lombok.*; | package com.github.sheigutn.pushbullet.items.device;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE) | // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletContainer.java
// @Data
// public abstract class PushbulletContainer {
//
// /**
// * The pushbullet instance that this object is linked to
// */
// private transient Pushbullet pushbullet;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/device/PhonebookEntry.java
import com.github.sheigutn.pushbullet.items.PushbulletContainer;
import com.google.gson.annotations.SerializedName;
import lombok.*;
package com.github.sheigutn.pushbullet.items.device;
@Getter
@NoArgsConstructor(access = AccessLevel.PRIVATE) | public class PhonebookEntry extends PushbulletContainer { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/grant/GrantClient.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
| import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.grant;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE) | // Path: src/main/java/com/github/sheigutn/pushbullet/items/PushbulletIdentifiable.java
// @Data
// public abstract class PushbulletIdentifiable extends PushbulletContainer {
//
// /**
// * The identity of this object
// */
// @SerializedName("iden")
// private String identity;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/grant/GrantClient.java
import com.github.sheigutn.pushbullet.items.PushbulletIdentifiable;
import com.google.gson.annotations.SerializedName;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.grant;
@Getter
@ToString(callSuper = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE) | public class GrantClient extends PushbulletIdentifiable { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateContactRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateContactRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated | public class UpdateContactRequest extends PostRequest<Contact> { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateContactRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateContactRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated | public class UpdateContactRequest extends PostRequest<Contact> { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateContactRequest.java | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
| import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost; | package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated
public class UpdateContactRequest extends PostRequest<Contact> {
private String name;
public UpdateContactRequest(String contactIdentity, String name) { | // Path: src/main/java/com/github/sheigutn/pushbullet/http/PostRequest.java
// public class PostRequest<TResult> extends EntityEnclosingRequest<TResult, HttpPost> {
//
// public PostRequest(String relativePath) {
// super(relativePath);
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/http/Urls.java
// public class Urls {
//
// public static final String CHANNELS = "/channels";
// public static final String GRANTS = "/grants";
// public static final String PUSHES = "/pushes";
// public static final String SUBSCRIPTIONS = "/subscriptions";
// public static final String EVERYTHING = "/everything";
// public static final String PHONEBOOK = "/permanents/phonebook_";
// public static final String DEVICES = "/devices";
// public static final String CONTACTS = "/contacts";
// public static final String CLIENTS = "/clients";
// public static final String CHATS = "/chats";
// public static final String ACCOUNTS = "/accounts";
// public static final String CURRENT_USER = "/users/me";
// public static final String CHANNEL_INFO = "/channel-info";
// public static final String UPLOAD_REQUEST = "/upload-request";
// public static final String EPHEMERALS = "/ephemerals";
// public static final String BLOCKS = "/blocks";
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/user/Contact.java
// @Getter
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// @Deprecated
// public class Contact extends User implements Deletable {
//
// /**
// * The status of this contact
// */
// private String status;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// getPushbullet().executeRequest(new DeleteSpecificContactRequest(getIdentity()));
// setActive(false);
// }
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/http/defaults/post/UpdateContactRequest.java
import com.github.sheigutn.pushbullet.http.PostRequest;
import com.github.sheigutn.pushbullet.http.Urls;
import com.github.sheigutn.pushbullet.items.user.Contact;
import com.google.gson.Gson;
import lombok.Data;
import org.apache.http.client.methods.HttpPost;
package com.github.sheigutn.pushbullet.http.defaults.post;
@Data
@Deprecated
public class UpdateContactRequest extends PostRequest<Contact> {
private String name;
public UpdateContactRequest(String contactIdentity, String name) { | super(Urls.CONTACTS + "/" + contactIdentity); |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/FilePush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
| import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true) | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/FilePush.java
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true) | public class FilePush extends Push { |
Sheigutn/pushbullet-java-8 | src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/FilePush.java | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
| import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.ToString; | package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
public class FilePush extends Push {
private FilePush() { | // Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/Push.java
// @Getter
// @Setter(AccessLevel.PROTECTED)
// @ToString(callSuper = true)
// @NoArgsConstructor(access = AccessLevel.PROTECTED)
// public class Push extends PushbulletObject implements Deletable, Dismissable {
//
// /**
// * The type of the push
// */
// private PushType type;
//
// /**
// * Whether the push has already been dimissed
// */
// private boolean dismissed;
//
// /**
// * The direction the push was sent to
// */
// private Direction direction;
//
// /**
// * The name of the sender
// */
// @SerializedName("sender_name")
// private String senderName;
//
// /**
// * The identity of the channel the push was sent to
// */
// @SerializedName("channel_iden")
// private String channelIdentity;
//
// /**
// * The client's identity
// */
// @SerializedName("client_iden")
// private String clientIdentity;
//
// /**
// * The identity of the device the push was sent to
// */
// @SerializedName("target_device_iden")
// private String targetDeviceIdentity;
//
// /**
// * The sender's identity
// */
// @SerializedName("sender_iden")
// private String senderIdentity;
//
// /**
// * The sender's email
// */
// @SerializedName("sender_email")
// private String senderEmail;
//
// /**
// * The sender's normalized email
// */
// @SerializedName("sender_email_normalized")
// private String normalizedSenderEmail;
//
// /**
// * The receiver's identity
// */
// @SerializedName("receiver_iden")
// private String receiverIdentity;
//
// /**
// * The receiver's email
// */
// @SerializedName("receiver_email")
// private String receiverEmail;
//
// /**
// * The receiver's normalized email
// */
// @SerializedName("receiver_email_normalized")
// private String normalizedReceiverEmail;
//
// /**
// * The list of awake apps the push was sent to when it was created
// */
// @SerializedName("awake_app_guids")
// private List<String> awakeAppGuids;
//
// /**
// * A unique identifier for the push, set by the client
// */
// private String guid;
//
// @Override
// public void delete() {
// if(!isActive()) return;
// DeleteSpecificPushRequest deleteSpecificPushRequest = new DeleteSpecificPushRequest(getIdentity());
// getPushbullet().executeRequest(deleteSpecificPushRequest);
// setActive(false);
// }
//
// /**
// * Show the push again if it was already dismissed
// */
// public void show() {
// if(!isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), false));
// setDismissed(false);
// }
//
// @Override
// public void dismiss() {
// if(isDismissed()) return;
// getPushbullet().executeRequest(new ChangePushDismissStatusRequest(getIdentity(), true));
// setDismissed(true);
// }
//
// /**
// * Get the title of this push
// * @return The title of this push
// */
// public String getTitle() {
// return null;
// }
//
// /**
// * Get the body of this push
// * @return The body of this push
// */
// public String getBody() {
// return null;
// }
// }
//
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/PushType.java
// public enum PushType {
//
// /**
// * Used for note pushes
// */
// @SerializedName("note")
// NOTE,
//
// /**
// * Used for link pushes
// */
// @SerializedName("link")
// LINK,
//
// /**
// * Used for file pushes
// */
// @SerializedName("file")
// FILE,
//
// /**
// * Used for list pushes
// */
// @SerializedName("list")
// LIST,
//
// /**
// * Used for address pushes
// */
// @SerializedName("address")
// ADDRESS;
// }
// Path: src/main/java/com/github/sheigutn/pushbullet/items/push/sent/defaults/FilePush.java
import com.github.sheigutn.pushbullet.items.push.sent.Push;
import com.github.sheigutn.pushbullet.items.push.PushType;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.ToString;
package com.github.sheigutn.pushbullet.items.push.sent.defaults;
@Getter
@ToString(callSuper = true)
public class FilePush extends Push {
private FilePush() { | setType(PushType.FILE); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.