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
openbakery/timetracker
src/main/java/org/openbakery/timetracker/service/CustomerService.java
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // // Path: src/main/java/org/openbakery/timetracker/persistence/Persistence.java // public interface Persistence { // public void flush() throws PersistenceException; // // public void close() throws PersistenceException; // // public <T> T store(T object) throws PersistenceException; // // public <T> List<T> query(String query, Class<T> type) throws PersistenceException; // // public <T extends Object> T querySingle(String query, Class<T> type) throws PersistenceException; // // public <T> List<T> query(String queryString, Map<String, Object> parameters, Class<T> type) throws PersistenceException; // // public List<? extends Object> queryNative(String query, String name) throws PersistenceException; // // public List<? extends Object> queryNative(String query, Class<? extends Object> clazz) throws PersistenceException; // // public <T> T delete(T object) throws PersistenceException; // // }
import java.util.List; import javax.persistence.PersistenceException; import org.openbakery.timetracker.data.Customer; import org.openbakery.timetracker.persistence.Persistence; import org.springframework.beans.factory.annotation.Autowired;
package org.openbakery.timetracker.service; public class CustomerService { @Autowired
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // // Path: src/main/java/org/openbakery/timetracker/persistence/Persistence.java // public interface Persistence { // public void flush() throws PersistenceException; // // public void close() throws PersistenceException; // // public <T> T store(T object) throws PersistenceException; // // public <T> List<T> query(String query, Class<T> type) throws PersistenceException; // // public <T extends Object> T querySingle(String query, Class<T> type) throws PersistenceException; // // public <T> List<T> query(String queryString, Map<String, Object> parameters, Class<T> type) throws PersistenceException; // // public List<? extends Object> queryNative(String query, String name) throws PersistenceException; // // public List<? extends Object> queryNative(String query, Class<? extends Object> clazz) throws PersistenceException; // // public <T> T delete(T object) throws PersistenceException; // // } // Path: src/main/java/org/openbakery/timetracker/service/CustomerService.java import java.util.List; import javax.persistence.PersistenceException; import org.openbakery.timetracker.data.Customer; import org.openbakery.timetracker.persistence.Persistence; import org.springframework.beans.factory.annotation.Autowired; package org.openbakery.timetracker.service; public class CustomerService { @Autowired
private Persistence persistence;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/service/CustomerService.java
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // // Path: src/main/java/org/openbakery/timetracker/persistence/Persistence.java // public interface Persistence { // public void flush() throws PersistenceException; // // public void close() throws PersistenceException; // // public <T> T store(T object) throws PersistenceException; // // public <T> List<T> query(String query, Class<T> type) throws PersistenceException; // // public <T extends Object> T querySingle(String query, Class<T> type) throws PersistenceException; // // public <T> List<T> query(String queryString, Map<String, Object> parameters, Class<T> type) throws PersistenceException; // // public List<? extends Object> queryNative(String query, String name) throws PersistenceException; // // public List<? extends Object> queryNative(String query, Class<? extends Object> clazz) throws PersistenceException; // // public <T> T delete(T object) throws PersistenceException; // // }
import java.util.List; import javax.persistence.PersistenceException; import org.openbakery.timetracker.data.Customer; import org.openbakery.timetracker.persistence.Persistence; import org.springframework.beans.factory.annotation.Autowired;
package org.openbakery.timetracker.service; public class CustomerService { @Autowired private Persistence persistence;
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // // Path: src/main/java/org/openbakery/timetracker/persistence/Persistence.java // public interface Persistence { // public void flush() throws PersistenceException; // // public void close() throws PersistenceException; // // public <T> T store(T object) throws PersistenceException; // // public <T> List<T> query(String query, Class<T> type) throws PersistenceException; // // public <T extends Object> T querySingle(String query, Class<T> type) throws PersistenceException; // // public <T> List<T> query(String queryString, Map<String, Object> parameters, Class<T> type) throws PersistenceException; // // public List<? extends Object> queryNative(String query, String name) throws PersistenceException; // // public List<? extends Object> queryNative(String query, Class<? extends Object> clazz) throws PersistenceException; // // public <T> T delete(T object) throws PersistenceException; // // } // Path: src/main/java/org/openbakery/timetracker/service/CustomerService.java import java.util.List; import javax.persistence.PersistenceException; import org.openbakery.timetracker.data.Customer; import org.openbakery.timetracker.persistence.Persistence; import org.springframework.beans.factory.annotation.Autowired; package org.openbakery.timetracker.service; public class CustomerService { @Autowired private Persistence persistence;
public List<Customer> getAllCustomers() throws PersistenceException {
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/project/ProjectListView.java
// Path: src/main/java/org/openbakery/timetracker/data/Project.java // @Entity // @Table(name = "project") // public class Project implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "description") // private String description; // // @ManyToOne // @JoinColumn(name = "customer_id") // private Customer customer; // // // @Column(name = "issueTrackerURL") // private String issueTrackerURL; // // @Column(name = "disabled") // private boolean disabled; // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // public String getIssueTrackerURL() { // return issueTrackerURL; // } // // public void setIssueTrackerURL(String issueTrackerURL) { // this.issueTrackerURL = issueTrackerURL; // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // Project project = (Project) o; // // if (disabled != project.disabled) return false; // if (id != project.id) return false; // if (customer != null ? !customer.equals(project.customer) : project.customer != null) return false; // if (description != null ? !description.equals(project.description) : project.description != null) return false; // if (issueTrackerURL != null ? !issueTrackerURL.equals(project.issueTrackerURL) : project.issueTrackerURL != null) // return false; // if (name != null ? !name.equals(project.name) : project.name != null) return false; // // return true; // } // // @Override // public int hashCode() { // int result = id; // result = 31 * result + (name != null ? name.hashCode() : 0); // result = 31 * result + (description != null ? description.hashCode() : 0); // result = 31 * result + (customer != null ? customer.hashCode() : 0); // result = 31 * result + (issueTrackerURL != null ? issueTrackerURL.hashCode() : 0); // result = 31 * result + (disabled ? 1 : 0); // return result; // } // // @Override // public String toString() { // return "Project{" + // "id=" + id + // ", name='" + name + '\'' + // ", description='" + description + '\'' + // ", customer=" + customer + // ", issueTrackerURL='" + issueTrackerURL + '\'' + // ", disabled=" + disabled + // '}'; // } // } // // Path: src/main/java/org/openbakery/timetracker/web/RedirectLink.java // public class RedirectLink<T extends Serializable> extends Link<T> { // // private static Logger log = LoggerFactory.getLogger(RedirectLink.class); // // /** // * // */ // private static final long serialVersionUID = 1L; // // private Class<? extends WebPage> pageClass; // // public RedirectLink(String id, Class<? extends WebPage> pageClass) { // super(id); // this.pageClass = pageClass; // } // // public RedirectLink(String id, Class<? extends WebPage> pageClass, T model) { // super(id, new Model<T>(model)); // this.pageClass = pageClass; // } // // @Override // public void onClick() { // if (getModelObject() != null) { // Constructor<? extends WebPage> constructor; // try { // constructor = pageClass.getConstructor(PageParameters.class, getModelObject().getClass()); // WebPage webPage = constructor.newInstance(new PageParameters(), getModelObject()); // setResponsePage(webPage); // } catch (Exception e) { // log.error(e.getMessage(), e); // } // } else { // setResponsePage(pageClass); // } // } // }
import java.util.List; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.openbakery.timetracker.data.Project; import org.openbakery.timetracker.web.RedirectLink;
package org.openbakery.timetracker.web.project; public class ProjectListView extends ListView<Project> { private static final long serialVersionUID = 1L; public ProjectListView(String id, List<Project> adminMessageList) { super(id, adminMessageList); } protected void populateItem(ListItem<Project> item) { Project project = item.getModelObject(); item.add(new Label("name", project.getName())); if (project.getCustomer() != null) { item.add(new Label("customer", project.getCustomer().getName())); } else { item.add(new Label("customer", "")); }
// Path: src/main/java/org/openbakery/timetracker/data/Project.java // @Entity // @Table(name = "project") // public class Project implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "description") // private String description; // // @ManyToOne // @JoinColumn(name = "customer_id") // private Customer customer; // // // @Column(name = "issueTrackerURL") // private String issueTrackerURL; // // @Column(name = "disabled") // private boolean disabled; // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // public String getIssueTrackerURL() { // return issueTrackerURL; // } // // public void setIssueTrackerURL(String issueTrackerURL) { // this.issueTrackerURL = issueTrackerURL; // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // Project project = (Project) o; // // if (disabled != project.disabled) return false; // if (id != project.id) return false; // if (customer != null ? !customer.equals(project.customer) : project.customer != null) return false; // if (description != null ? !description.equals(project.description) : project.description != null) return false; // if (issueTrackerURL != null ? !issueTrackerURL.equals(project.issueTrackerURL) : project.issueTrackerURL != null) // return false; // if (name != null ? !name.equals(project.name) : project.name != null) return false; // // return true; // } // // @Override // public int hashCode() { // int result = id; // result = 31 * result + (name != null ? name.hashCode() : 0); // result = 31 * result + (description != null ? description.hashCode() : 0); // result = 31 * result + (customer != null ? customer.hashCode() : 0); // result = 31 * result + (issueTrackerURL != null ? issueTrackerURL.hashCode() : 0); // result = 31 * result + (disabled ? 1 : 0); // return result; // } // // @Override // public String toString() { // return "Project{" + // "id=" + id + // ", name='" + name + '\'' + // ", description='" + description + '\'' + // ", customer=" + customer + // ", issueTrackerURL='" + issueTrackerURL + '\'' + // ", disabled=" + disabled + // '}'; // } // } // // Path: src/main/java/org/openbakery/timetracker/web/RedirectLink.java // public class RedirectLink<T extends Serializable> extends Link<T> { // // private static Logger log = LoggerFactory.getLogger(RedirectLink.class); // // /** // * // */ // private static final long serialVersionUID = 1L; // // private Class<? extends WebPage> pageClass; // // public RedirectLink(String id, Class<? extends WebPage> pageClass) { // super(id); // this.pageClass = pageClass; // } // // public RedirectLink(String id, Class<? extends WebPage> pageClass, T model) { // super(id, new Model<T>(model)); // this.pageClass = pageClass; // } // // @Override // public void onClick() { // if (getModelObject() != null) { // Constructor<? extends WebPage> constructor; // try { // constructor = pageClass.getConstructor(PageParameters.class, getModelObject().getClass()); // WebPage webPage = constructor.newInstance(new PageParameters(), getModelObject()); // setResponsePage(webPage); // } catch (Exception e) { // log.error(e.getMessage(), e); // } // } else { // setResponsePage(pageClass); // } // } // } // Path: src/main/java/org/openbakery/timetracker/web/project/ProjectListView.java import java.util.List; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.openbakery.timetracker.data.Project; import org.openbakery.timetracker.web.RedirectLink; package org.openbakery.timetracker.web.project; public class ProjectListView extends ListView<Project> { private static final long serialVersionUID = 1L; public ProjectListView(String id, List<Project> adminMessageList) { super(id, adminMessageList); } protected void populateItem(ListItem<Project> item) { Project project = item.getModelObject(); item.add(new Label("name", project.getName())); if (project.getCustomer() != null) { item.add(new Label("customer", project.getCustomer().getName())); } else { item.add(new Label("customer", "")); }
item.add(new RedirectLink<Project>("edit", EditProjectPage.class, project));
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/TodayButton.java
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web.timesheet; public class TodayButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L;
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/TodayButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web.timesheet; public class TodayButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L;
private TimeSheetData timeSheetData;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/TodayButton.java
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web.timesheet; public class TodayButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L; private TimeSheetData timeSheetData; public TodayButton(String id) { super(id, new ResourceModel(id)); } @Override public void onSubmit() {
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/TodayButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web.timesheet; public class TodayButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L; private TimeSheetData timeSheetData; public TodayButton(String id) { super(id, new ResourceModel(id)); } @Override public void onSubmit() {
((TimeTrackerSession) getSession()).setCurrentDate(new DateTime());
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/DayEntry.java
// Path: src/main/java/org/openbakery/timetracker/data/TimeEntry.java // @Entity // @Table(name = "timeentry") // public class TimeEntry implements Serializable { // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "begin_time") // @Temporal(TemporalType.TIMESTAMP) // private Date begin; // // @Column(name = "end_time") // @Temporal(TemporalType.TIMESTAMP) // private Date end; // // @ManyToOne // @JoinColumn(name = "project_id") // private Project project; // // @Column(name = "description", length = 4096) // private String description; // // // @Column(name = "issue") // private String issue; // // @ManyToOne // @JoinColumn(name = "user_id") // private User user; // // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public Date getBegin() { // return begin; // } // // public void setBegin(java.util.Date begin) { // this.begin = begin; // } // // public Date getEnd() { // return end; // } // // public void setEnd(Date end) { // this.end = end; // } // // public Project getProject() { // return project; // } // // public void setProject(Project project) { // this.project = project; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // public String getIssue() { // return issue; // } // // public void setIssue(String issue) { // this.issue = issue; // } // // public Duration getDuration() { // if (begin == null || end == null) { // return Duration.ZERO; // } // return new Duration(begin.getTime(), end.getTime()); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TimeEntry timeEntry = (TimeEntry) o; // // if (id != timeEntry.id) return false; // if (begin != null ? !begin.equals(timeEntry.begin) : timeEntry.begin != null) return false; // if (description != null ? !description.equals(timeEntry.description) : timeEntry.description != null) return false; // if (end != null ? !end.equals(timeEntry.end) : timeEntry.end != null) return false; // if (issue != null ? !issue.equals(timeEntry.issue) : timeEntry.issue != null) return false; // if (project != null ? !project.equals(timeEntry.project) : timeEntry.project != null) return false; // if (user != null ? !user.equals(timeEntry.user) : timeEntry.user != null) return false; // // return true; // } // // @Override // public int hashCode() { // int result = id; // result = 31 * result + begin.hashCode(); // result = 31 * result + end.hashCode(); // result = 31 * result + project.hashCode(); // result = 31 * result + description.hashCode(); // result = 31 * result + issue.hashCode(); // result = 31 * result + user.hashCode(); // return result; // } // // @Override // public String toString() { // return "TimeEntry{" + // "id=" + id + // ", begin=" + begin + // ", end=" + end + // ", project=" + project + // ", description='" + description + '\'' + // ", issue='" + issue + '\'' + // ", user=" + user + // '}'; // } // } // // Path: src/main/java/org/openbakery/timetracker/util/DurationHelper.java // public class DurationHelper { // // private static Logger log = LoggerFactory.getLogger(DurationHelper.class); // // // public static Duration calculateDurationSum(List<TimeEntry> timeEntryList) { // Duration sum = Duration.ZERO; // // for (TimeEntry entry : timeEntryList) { // sum = sum.plus(entry.getDuration()); // log.debug("add {}, sum {}", entry.getDuration(), sum); // } // return sum; // } // // public static String toTimeString(Duration duration) { // Period period = duration.toPeriod(); // return period.getHours() + "," + period.getMinutes()*100/60; // } // // public static double toTime(Duration duration) { // Period period = duration.toPeriod(); // return period.getHours() + period.getMinutes()/60.0; // } // // }
import org.apache.commons.lang.time.DateUtils; import org.openbakery.timetracker.data.TimeEntry; import org.openbakery.timetracker.util.DurationHelper; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List;
package org.openbakery.timetracker.web.timesheet; /** * Created with IntelliJ IDEA. * User: rene * Date: 25.02.13 * Time: 17:09 * To change this template use File | Settings | File Templates. */ public class DayEntry implements Serializable { private static final long serialVersionUID = 1L; private Date date;
// Path: src/main/java/org/openbakery/timetracker/data/TimeEntry.java // @Entity // @Table(name = "timeentry") // public class TimeEntry implements Serializable { // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "begin_time") // @Temporal(TemporalType.TIMESTAMP) // private Date begin; // // @Column(name = "end_time") // @Temporal(TemporalType.TIMESTAMP) // private Date end; // // @ManyToOne // @JoinColumn(name = "project_id") // private Project project; // // @Column(name = "description", length = 4096) // private String description; // // // @Column(name = "issue") // private String issue; // // @ManyToOne // @JoinColumn(name = "user_id") // private User user; // // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public Date getBegin() { // return begin; // } // // public void setBegin(java.util.Date begin) { // this.begin = begin; // } // // public Date getEnd() { // return end; // } // // public void setEnd(Date end) { // this.end = end; // } // // public Project getProject() { // return project; // } // // public void setProject(Project project) { // this.project = project; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // public String getIssue() { // return issue; // } // // public void setIssue(String issue) { // this.issue = issue; // } // // public Duration getDuration() { // if (begin == null || end == null) { // return Duration.ZERO; // } // return new Duration(begin.getTime(), end.getTime()); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TimeEntry timeEntry = (TimeEntry) o; // // if (id != timeEntry.id) return false; // if (begin != null ? !begin.equals(timeEntry.begin) : timeEntry.begin != null) return false; // if (description != null ? !description.equals(timeEntry.description) : timeEntry.description != null) return false; // if (end != null ? !end.equals(timeEntry.end) : timeEntry.end != null) return false; // if (issue != null ? !issue.equals(timeEntry.issue) : timeEntry.issue != null) return false; // if (project != null ? !project.equals(timeEntry.project) : timeEntry.project != null) return false; // if (user != null ? !user.equals(timeEntry.user) : timeEntry.user != null) return false; // // return true; // } // // @Override // public int hashCode() { // int result = id; // result = 31 * result + begin.hashCode(); // result = 31 * result + end.hashCode(); // result = 31 * result + project.hashCode(); // result = 31 * result + description.hashCode(); // result = 31 * result + issue.hashCode(); // result = 31 * result + user.hashCode(); // return result; // } // // @Override // public String toString() { // return "TimeEntry{" + // "id=" + id + // ", begin=" + begin + // ", end=" + end + // ", project=" + project + // ", description='" + description + '\'' + // ", issue='" + issue + '\'' + // ", user=" + user + // '}'; // } // } // // Path: src/main/java/org/openbakery/timetracker/util/DurationHelper.java // public class DurationHelper { // // private static Logger log = LoggerFactory.getLogger(DurationHelper.class); // // // public static Duration calculateDurationSum(List<TimeEntry> timeEntryList) { // Duration sum = Duration.ZERO; // // for (TimeEntry entry : timeEntryList) { // sum = sum.plus(entry.getDuration()); // log.debug("add {}, sum {}", entry.getDuration(), sum); // } // return sum; // } // // public static String toTimeString(Duration duration) { // Period period = duration.toPeriod(); // return period.getHours() + "," + period.getMinutes()*100/60; // } // // public static double toTime(Duration duration) { // Period period = duration.toPeriod(); // return period.getHours() + period.getMinutes()/60.0; // } // // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/DayEntry.java import org.apache.commons.lang.time.DateUtils; import org.openbakery.timetracker.data.TimeEntry; import org.openbakery.timetracker.util.DurationHelper; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; package org.openbakery.timetracker.web.timesheet; /** * Created with IntelliJ IDEA. * User: rene * Date: 25.02.13 * Time: 17:09 * To change this template use File | Settings | File Templates. */ public class DayEntry implements Serializable { private static final long serialVersionUID = 1L; private Date date;
private ArrayList<TimeEntry> timeEntryList;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/util/DurationHelper.java
// Path: src/main/java/org/openbakery/timetracker/data/TimeEntry.java // @Entity // @Table(name = "timeentry") // public class TimeEntry implements Serializable { // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "begin_time") // @Temporal(TemporalType.TIMESTAMP) // private Date begin; // // @Column(name = "end_time") // @Temporal(TemporalType.TIMESTAMP) // private Date end; // // @ManyToOne // @JoinColumn(name = "project_id") // private Project project; // // @Column(name = "description", length = 4096) // private String description; // // // @Column(name = "issue") // private String issue; // // @ManyToOne // @JoinColumn(name = "user_id") // private User user; // // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public Date getBegin() { // return begin; // } // // public void setBegin(java.util.Date begin) { // this.begin = begin; // } // // public Date getEnd() { // return end; // } // // public void setEnd(Date end) { // this.end = end; // } // // public Project getProject() { // return project; // } // // public void setProject(Project project) { // this.project = project; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // public String getIssue() { // return issue; // } // // public void setIssue(String issue) { // this.issue = issue; // } // // public Duration getDuration() { // if (begin == null || end == null) { // return Duration.ZERO; // } // return new Duration(begin.getTime(), end.getTime()); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TimeEntry timeEntry = (TimeEntry) o; // // if (id != timeEntry.id) return false; // if (begin != null ? !begin.equals(timeEntry.begin) : timeEntry.begin != null) return false; // if (description != null ? !description.equals(timeEntry.description) : timeEntry.description != null) return false; // if (end != null ? !end.equals(timeEntry.end) : timeEntry.end != null) return false; // if (issue != null ? !issue.equals(timeEntry.issue) : timeEntry.issue != null) return false; // if (project != null ? !project.equals(timeEntry.project) : timeEntry.project != null) return false; // if (user != null ? !user.equals(timeEntry.user) : timeEntry.user != null) return false; // // return true; // } // // @Override // public int hashCode() { // int result = id; // result = 31 * result + begin.hashCode(); // result = 31 * result + end.hashCode(); // result = 31 * result + project.hashCode(); // result = 31 * result + description.hashCode(); // result = 31 * result + issue.hashCode(); // result = 31 * result + user.hashCode(); // return result; // } // // @Override // public String toString() { // return "TimeEntry{" + // "id=" + id + // ", begin=" + begin + // ", end=" + end + // ", project=" + project + // ", description='" + description + '\'' + // ", issue='" + issue + '\'' + // ", user=" + user + // '}'; // } // }
import org.joda.time.Duration; import org.joda.time.Period; import org.openbakery.timetracker.data.TimeEntry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List;
package org.openbakery.timetracker.util; /** * Created with IntelliJ IDEA. * User: rene * Date: 25.02.13 * Time: 17:39 * To change this template use File | Settings | File Templates. */ public class DurationHelper { private static Logger log = LoggerFactory.getLogger(DurationHelper.class);
// Path: src/main/java/org/openbakery/timetracker/data/TimeEntry.java // @Entity // @Table(name = "timeentry") // public class TimeEntry implements Serializable { // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "begin_time") // @Temporal(TemporalType.TIMESTAMP) // private Date begin; // // @Column(name = "end_time") // @Temporal(TemporalType.TIMESTAMP) // private Date end; // // @ManyToOne // @JoinColumn(name = "project_id") // private Project project; // // @Column(name = "description", length = 4096) // private String description; // // // @Column(name = "issue") // private String issue; // // @ManyToOne // @JoinColumn(name = "user_id") // private User user; // // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public Date getBegin() { // return begin; // } // // public void setBegin(java.util.Date begin) { // this.begin = begin; // } // // public Date getEnd() { // return end; // } // // public void setEnd(Date end) { // this.end = end; // } // // public Project getProject() { // return project; // } // // public void setProject(Project project) { // this.project = project; // } // // public String getDescription() { // return description; // } // // public void setDescription(String description) { // this.description = description; // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // public String getIssue() { // return issue; // } // // public void setIssue(String issue) { // this.issue = issue; // } // // public Duration getDuration() { // if (begin == null || end == null) { // return Duration.ZERO; // } // return new Duration(begin.getTime(), end.getTime()); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // TimeEntry timeEntry = (TimeEntry) o; // // if (id != timeEntry.id) return false; // if (begin != null ? !begin.equals(timeEntry.begin) : timeEntry.begin != null) return false; // if (description != null ? !description.equals(timeEntry.description) : timeEntry.description != null) return false; // if (end != null ? !end.equals(timeEntry.end) : timeEntry.end != null) return false; // if (issue != null ? !issue.equals(timeEntry.issue) : timeEntry.issue != null) return false; // if (project != null ? !project.equals(timeEntry.project) : timeEntry.project != null) return false; // if (user != null ? !user.equals(timeEntry.user) : timeEntry.user != null) return false; // // return true; // } // // @Override // public int hashCode() { // int result = id; // result = 31 * result + begin.hashCode(); // result = 31 * result + end.hashCode(); // result = 31 * result + project.hashCode(); // result = 31 * result + description.hashCode(); // result = 31 * result + issue.hashCode(); // result = 31 * result + user.hashCode(); // return result; // } // // @Override // public String toString() { // return "TimeEntry{" + // "id=" + id + // ", begin=" + begin + // ", end=" + end + // ", project=" + project + // ", description='" + description + '\'' + // ", issue='" + issue + '\'' + // ", user=" + user + // '}'; // } // } // Path: src/main/java/org/openbakery/timetracker/util/DurationHelper.java import org.joda.time.Duration; import org.joda.time.Period; import org.openbakery.timetracker.data.TimeEntry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; package org.openbakery.timetracker.util; /** * Created with IntelliJ IDEA. * User: rene * Date: 25.02.13 * Time: 17:39 * To change this template use File | Settings | File Templates. */ public class DurationHelper { private static Logger log = LoggerFactory.getLogger(DurationHelper.class);
public static Duration calculateDurationSum(List<TimeEntry> timeEntryList) {
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/LoginPage.java
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // }
import java.util.HashMap; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.PasswordTextField; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.ResourceModel; import org.openbakery.timetracker.data.User;
package org.openbakery.timetracker.web; public class LoginPage extends WebPage { /** * */ private static final long serialVersionUID = 1L; public LoginPage() { add(new Label("pageTitle", new ResourceModel("loginPage.title"))); FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); add(feedbackPanel);
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // Path: src/main/java/org/openbakery/timetracker/web/LoginPage.java import java.util.HashMap; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.PasswordTextField; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.ResourceModel; import org.openbakery.timetracker.data.User; package org.openbakery.timetracker.web; public class LoginPage extends WebPage { /** * */ private static final long serialVersionUID = 1L; public LoginPage() { add(new Label("pageTitle", new ResourceModel("loginPage.title"))); FeedbackPanel feedbackPanel = new FeedbackPanel("feedback"); add(feedbackPanel);
Form<User> form = new Form<User>("form");
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/user/SaveButton.java
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map;
package org.openbakery.timetracker.web.user; public class SaveButton extends Button { private static final long serialVersionUID = 1L; @SpringBean
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // } // Path: src/main/java/org/openbakery/timetracker/web/user/SaveButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map; package org.openbakery.timetracker.web.user; public class SaveButton extends Button { private static final long serialVersionUID = 1L; @SpringBean
private UserService userService;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/user/SaveButton.java
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map;
package org.openbakery.timetracker.web.user; public class SaveButton extends Button { private static final long serialVersionUID = 1L; @SpringBean private UserService userService;
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // } // Path: src/main/java/org/openbakery/timetracker/web/user/SaveButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map; package org.openbakery.timetracker.web.user; public class SaveButton extends Button { private static final long serialVersionUID = 1L; @SpringBean private UserService userService;
private User user;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/user/SaveButton.java
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map;
package org.openbakery.timetracker.web.user; public class SaveButton extends Button { private static final long serialVersionUID = 1L; @SpringBean private UserService userService; private User user; private Map<String, String> data; public SaveButton(String id, User user, Map<String, String> data) { super(id, new ResourceModel("save")); this.user = user; this.data = data; } @Override public void onSubmit() { if (data.containsKey("password")) {
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // } // Path: src/main/java/org/openbakery/timetracker/web/user/SaveButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map; package org.openbakery.timetracker.web.user; public class SaveButton extends Button { private static final long serialVersionUID = 1L; @SpringBean private UserService userService; private User user; private Map<String, String> data; public SaveButton(String id, User user, Map<String, String> data) { super(id, new ResourceModel("save")); this.user = user; this.data = data; } @Override public void onSubmit() { if (data.containsKey("password")) {
String passwordHash = PasswordEncoder.encode(data.get("password"));
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/PageAuthorizationStrategy.java
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // }
import org.apache.wicket.Page; import org.apache.wicket.Session; import org.apache.wicket.authorization.strategies.page.AbstractPageAuthorizationStrategy; import org.apache.wicket.markup.html.WebPage; import org.openbakery.timetracker.annotation.RequireRole; import org.openbakery.timetracker.data.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web; /** * User: rene * Date: 04.05.11 */ public class PageAuthorizationStrategy extends AbstractPageAuthorizationStrategy { private static Logger log = LoggerFactory.getLogger(PageAuthorizationStrategy.class); protected <T extends Page> boolean isPageAuthorized(Class<T> pageClass) { RequireRole requireRole = pageClass.getAnnotation(RequireRole.class); log.debug("requireRole: {}", requireRole); if (requireRole == null) { return true; }
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // Path: src/main/java/org/openbakery/timetracker/web/PageAuthorizationStrategy.java import org.apache.wicket.Page; import org.apache.wicket.Session; import org.apache.wicket.authorization.strategies.page.AbstractPageAuthorizationStrategy; import org.apache.wicket.markup.html.WebPage; import org.openbakery.timetracker.annotation.RequireRole; import org.openbakery.timetracker.data.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web; /** * User: rene * Date: 04.05.11 */ public class PageAuthorizationStrategy extends AbstractPageAuthorizationStrategy { private static Logger log = LoggerFactory.getLogger(PageAuthorizationStrategy.class); protected <T extends Page> boolean isPageAuthorized(Class<T> pageClass) { RequireRole requireRole = pageClass.getAnnotation(RequireRole.class); log.debug("requireRole: {}", requireRole); if (requireRole == null) { return true; }
User user = ((TimeTrackerSession)Session.get()).getUser();
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/PreviousButton.java
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web.timesheet; public class PreviousButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L;
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/PreviousButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web.timesheet; public class PreviousButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L;
private TimeSheetData timeSheetData;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/PreviousButton.java
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web.timesheet; public class PreviousButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L; private TimeSheetData timeSheetData; public PreviousButton(String id, TimeSheetData timeSheetData) { super(id, new ResourceModel(id)); this.timeSheetData = timeSheetData; } @Override public void onSubmit() { DateTime currentDay = new DateTime(timeSheetData.getCurrentDay().getTime()); currentDay = currentDay.minusDays(1); log.debug("set current day to: {}", currentDay);
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/PreviousButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web.timesheet; public class PreviousButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L; private TimeSheetData timeSheetData; public PreviousButton(String id, TimeSheetData timeSheetData) { super(id, new ResourceModel(id)); this.timeSheetData = timeSheetData; } @Override public void onSubmit() { DateTime currentDay = new DateTime(timeSheetData.getCurrentDay().getTime()); currentDay = currentDay.minusDays(1); log.debug("set current day to: {}", currentDay);
((TimeTrackerSession) getSession()).setCurrentDate(currentDay);
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/user/DeleteButton.java
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map;
package org.openbakery.timetracker.web.user; /** * Created with IntelliJ IDEA. * User: rene * Date: 25.02.13 * Time: 14:06 * To change this template use File | Settings | File Templates. */ public class DeleteButton extends Button { @SpringBean
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // } // Path: src/main/java/org/openbakery/timetracker/web/user/DeleteButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map; package org.openbakery.timetracker.web.user; /** * Created with IntelliJ IDEA. * User: rene * Date: 25.02.13 * Time: 14:06 * To change this template use File | Settings | File Templates. */ public class DeleteButton extends Button { @SpringBean
private UserService userService;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/user/DeleteButton.java
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map;
package org.openbakery.timetracker.web.user; /** * Created with IntelliJ IDEA. * User: rene * Date: 25.02.13 * Time: 14:06 * To change this template use File | Settings | File Templates. */ public class DeleteButton extends Button { @SpringBean private UserService userService;
// Path: src/main/java/org/openbakery/timetracker/data/User.java // @Entity // @Table(name = "user") // public class User implements Serializable { // private static Logger log = LoggerFactory.getLogger(User.class); // // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // @Column(name = "email") // private String email; // // @Column(name = "password") // private String password; // // @Column(name = "role") // private Role role; // // @Column(name = "firstname") // private String firstname; // // @Column(name = "lastname") // private String lastname; // // @Column(name = "disabled") // private boolean disabled; // // @Transient // private boolean authenticated; // // public int getId() { // return id; // } // // public String getName() { // if (name == null) { // return ""; // } // return name; // } // // public void setId(int id) { // this.id = id; // } // // public void setName(String name) { // this.name = name; // } // // public void setPassword(String password) { // this.password = password; // } // // public boolean isAuthenticated() { // return authenticated; // } // // public void setAuthenticated(boolean authenticated) { // this.authenticated = authenticated; // } // // public Role getRole() { // return role; // } // // public void setRole(Role role) { // this.role = role; // } // // public String getEmail() { // return email; // } // // public void setEmail(String email) { // this.email = email; // } // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + (authenticated ? 1231 : 1237); // result = prime * result + ((email == null) ? 0 : email.hashCode()); // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // result = prime * result + ((role == null) ? 0 : role.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // User other = (User) obj; // if (authenticated != other.authenticated) // return false; // if (email == null) { // if (other.email != null) // return false; // } else if (!email.equals(other.email)) // return false; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // if (role != other.role) // return false; // return true; // } // // @Override // public String toString() { // return "User [id=" + id + ", name=" + name + ", email=" + email + ", role=" + role + ", authenticated=" + authenticated + "]"; // } // // public boolean hasRole(Role role) { // log.debug("user has role {}? (is {})", role, this.role); // return this.role.ordinal() >= role.ordinal(); // } // // public boolean hasPassword() { // return StringUtils.isNotEmpty(password); // } // // public boolean equalsPassword(String oldPasswordHash) { // return password.equals(oldPasswordHash); // } // } // // Path: src/main/java/org/openbakery/timetracker/service/UserService.java // public interface UserService { // public User login(String username, String password) throws LoginFailedException; // public void logoff(User user); // public void store(User user); // public void delete(User user); // public List<User> getAllUsers(); // public List<User> getAllActiveUsers(); // // } // // Path: src/main/java/org/openbakery/timetracker/util/PasswordEncoder.java // public class PasswordEncoder { // // public static String encode(String password) { // byte[] hash = DigestUtils.sha(password); // return Base64.encodeBase64String(hash); // } // // } // Path: src/main/java/org/openbakery/timetracker/web/user/DeleteButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.User; import org.openbakery.timetracker.service.UserService; import org.openbakery.timetracker.util.PasswordEncoder; import java.util.Map; package org.openbakery.timetracker.web.user; /** * Created with IntelliJ IDEA. * User: rene * Date: 25.02.13 * Time: 14:06 * To change this template use File | Settings | File Templates. */ public class DeleteButton extends Button { @SpringBean private UserService userService;
private User user;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/customer/SaveButton.java
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // // Path: src/main/java/org/openbakery/timetracker/service/CustomerService.java // public class CustomerService { // // @Autowired // private Persistence persistence; // // // public List<Customer> getAllCustomers() throws PersistenceException { // return persistence.query("Select customer from Customer as customer", Customer.class); // } // // public List<Customer> getAllActiveCustomers() throws PersistenceException { // return persistence.query("Select customer from Customer as customer WHERE customer.disabled = false", Customer.class); // } // // public void delete(Customer modelObject) { // persistence.delete(modelObject); // } // // public void store(Customer modelObject) { // persistence.store(modelObject); // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.Customer; import org.openbakery.timetracker.service.CustomerService;
package org.openbakery.timetracker.web.customer; public class SaveButton extends Button { private static final long serialVersionUID = 4362358310047172583L; @SpringBean
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // // Path: src/main/java/org/openbakery/timetracker/service/CustomerService.java // public class CustomerService { // // @Autowired // private Persistence persistence; // // // public List<Customer> getAllCustomers() throws PersistenceException { // return persistence.query("Select customer from Customer as customer", Customer.class); // } // // public List<Customer> getAllActiveCustomers() throws PersistenceException { // return persistence.query("Select customer from Customer as customer WHERE customer.disabled = false", Customer.class); // } // // public void delete(Customer modelObject) { // persistence.delete(modelObject); // } // // public void store(Customer modelObject) { // persistence.store(modelObject); // } // } // Path: src/main/java/org/openbakery/timetracker/web/customer/SaveButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.Customer; import org.openbakery.timetracker.service.CustomerService; package org.openbakery.timetracker.web.customer; public class SaveButton extends Button { private static final long serialVersionUID = 4362358310047172583L; @SpringBean
private CustomerService customerService;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/customer/SaveButton.java
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // // Path: src/main/java/org/openbakery/timetracker/service/CustomerService.java // public class CustomerService { // // @Autowired // private Persistence persistence; // // // public List<Customer> getAllCustomers() throws PersistenceException { // return persistence.query("Select customer from Customer as customer", Customer.class); // } // // public List<Customer> getAllActiveCustomers() throws PersistenceException { // return persistence.query("Select customer from Customer as customer WHERE customer.disabled = false", Customer.class); // } // // public void delete(Customer modelObject) { // persistence.delete(modelObject); // } // // public void store(Customer modelObject) { // persistence.store(modelObject); // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.Customer; import org.openbakery.timetracker.service.CustomerService;
package org.openbakery.timetracker.web.customer; public class SaveButton extends Button { private static final long serialVersionUID = 4362358310047172583L; @SpringBean private CustomerService customerService;
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // // Path: src/main/java/org/openbakery/timetracker/service/CustomerService.java // public class CustomerService { // // @Autowired // private Persistence persistence; // // // public List<Customer> getAllCustomers() throws PersistenceException { // return persistence.query("Select customer from Customer as customer", Customer.class); // } // // public List<Customer> getAllActiveCustomers() throws PersistenceException { // return persistence.query("Select customer from Customer as customer WHERE customer.disabled = false", Customer.class); // } // // public void delete(Customer modelObject) { // persistence.delete(modelObject); // } // // public void store(Customer modelObject) { // persistence.store(modelObject); // } // } // Path: src/main/java/org/openbakery/timetracker/web/customer/SaveButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.spring.injection.annot.SpringBean; import org.openbakery.timetracker.data.Customer; import org.openbakery.timetracker.service.CustomerService; package org.openbakery.timetracker.web.customer; public class SaveButton extends Button { private static final long serialVersionUID = 4362358310047172583L; @SpringBean private CustomerService customerService;
private Customer customer;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/NextButton.java
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web.timesheet; public class NextButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L;
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/NextButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web.timesheet; public class NextButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L;
private TimeSheetData timeSheetData;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/NextButton.java
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web.timesheet; public class NextButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L; private TimeSheetData timeSheetData; public NextButton(String id, TimeSheetData timeSheetData) { super(id, new ResourceModel(id)); this.timeSheetData = timeSheetData; } @Override public void onSubmit() { DateTime currentDay = new DateTime(timeSheetData.getCurrentDay().getTime()); currentDay = currentDay.plusDays(1); log.debug("set current day to: {}", currentDay);
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/NextButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web.timesheet; public class NextButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L; private TimeSheetData timeSheetData; public NextButton(String id, TimeSheetData timeSheetData) { super(id, new ResourceModel(id)); this.timeSheetData = timeSheetData; } @Override public void onSubmit() { DateTime currentDay = new DateTime(timeSheetData.getCurrentDay().getTime()); currentDay = currentDay.plusDays(1); log.debug("set current day to: {}", currentDay);
((TimeTrackerSession) getSession()).setCurrentDate(currentDay);
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/GoButton.java
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web.timesheet; /** * Created by IntelliJ IDEA. * User: rene * Date: 05.05.11 * Time: 17:26 * To change this template use File | Settings | File Templates. */ public class GoButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L;
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/GoButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web.timesheet; /** * Created by IntelliJ IDEA. * User: rene * Date: 05.05.11 * Time: 17:26 * To change this template use File | Settings | File Templates. */ public class GoButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L;
private TimeSheetData timeSheetData;
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/timesheet/GoButton.java
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // }
import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.openbakery.timetracker.web.timesheet; /** * Created by IntelliJ IDEA. * User: rene * Date: 05.05.11 * Time: 17:26 * To change this template use File | Settings | File Templates. */ public class GoButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L; private TimeSheetData timeSheetData; public GoButton(String id, TimeSheetData timeSheetData) { super(id, new ResourceModel(id)); this.timeSheetData = timeSheetData; } @Override public void onSubmit() { DateTime currentDay = new DateTime(timeSheetData.getCurrentDay().getTime()); log.debug("set current day to: {}", currentDay);
// Path: src/main/java/org/openbakery/timetracker/web/TimeTrackerSession.java // public class TimeTrackerSession extends WebSession { // // private static Logger log = LoggerFactory.getLogger(TimeTrackerSession.class); // // private static final long serialVersionUID = 1L; // // private User user; // private DateTime currentDate; // private Project lastStoredProject; // // public TimeTrackerSession(Request request) { // super(request); // user = new User(); // } // // public User getUser() { // return user; // } // // public void setUser(User user) { // this.user = user; // } // // // public List<MenuItem> getMenuItems() { // // return ((TimeTrackerWebApplication) getApplication()).getMenuItems(); // } // // public DateTime getCurrentDate() { // if (currentDate == null) { // currentDate = DateHelper.trimDateTime(new DateTime()); // } // return currentDate; // } // // // public void setCurrentDate(DateTime currentDate) { // this.currentDate = DateHelper.trimDateTime(currentDate); // } // // public Project getLastStoredProject() { // return lastStoredProject; // } // // public void setLastStoredProject(Project lastStoredProject) { // this.lastStoredProject = lastStoredProject; // } // // } // // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java // public class TimeSheetData implements Serializable { // private static final long serialVersionUID = 1L; // // // private Date currentDay; // private Customer customer; // // public Date getCurrentDay() { // return currentDay; // } // // public void setCurrentDay(Date currentDay) { // this.currentDay = currentDay; // } // // public Customer getCustomer() { // return customer; // } // // public void setCustomer(Customer customer) { // this.customer = customer; // } // } // Path: src/main/java/org/openbakery/timetracker/web/timesheet/GoButton.java import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.model.ResourceModel; import org.joda.time.DateTime; import org.openbakery.timetracker.web.TimeTrackerSession; import org.openbakery.timetracker.web.bean.TimeSheetData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; package org.openbakery.timetracker.web.timesheet; /** * Created by IntelliJ IDEA. * User: rene * Date: 05.05.11 * Time: 17:26 * To change this template use File | Settings | File Templates. */ public class GoButton extends Button { private static final Logger log = LoggerFactory.getLogger(NextButton.class); private static final long serialVersionUID = 1L; private TimeSheetData timeSheetData; public GoButton(String id, TimeSheetData timeSheetData) { super(id, new ResourceModel(id)); this.timeSheetData = timeSheetData; } @Override public void onSubmit() { DateTime currentDay = new DateTime(timeSheetData.getCurrentDay().getTime()); log.debug("set current day to: {}", currentDay);
((TimeTrackerSession) getSession()).setCurrentDate(currentDay);
openbakery/timetracker
src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // }
import org.openbakery.timetracker.data.Customer; import java.io.Serializable; import java.util.Date;
package org.openbakery.timetracker.web.bean; public class TimeSheetData implements Serializable { private static final long serialVersionUID = 1L; private Date currentDay;
// Path: src/main/java/org/openbakery/timetracker/data/Customer.java // @Entity // @Table(name = "customer") // public class Customer implements Serializable { // // /** // * // */ // private static final long serialVersionUID = 1L; // // @Id // @GeneratedValue // private int id; // // @Column(name = "name") // private String name; // // // @OneToMany(mappedBy = "project") // @Transient // private List<Project> projects; // // @Column(name = "disabled") // private boolean disabled; // // public Customer() { // super(); // projects = new LinkedList<Project>(); // } // // public int getId() { // return id; // } // // public void setId(int id) { // this.id = id; // } // // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } // // public void addProject(Project project) { // projects.add(project); // } // // // public boolean isDisabled() { // return disabled; // } // // public void setDisabled(boolean disabled) { // this.disabled = disabled; // } // // @Override // public int hashCode() { // final int prime = 31; // int result = 1; // result = prime * result + id; // result = prime * result + ((name == null) ? 0 : name.hashCode()); // return result; // } // // @Override // public boolean equals(Object obj) { // if (this == obj) // return true; // if (obj == null) // return false; // if (getClass() != obj.getClass()) // return false; // Customer other = (Customer) obj; // if (id != other.id) // return false; // if (name == null) { // if (other.name != null) // return false; // } else if (!name.equals(other.name)) // return false; // return true; // } // // @Override // public String toString() { // return "Customer [id=" + id + ", name=" + name + ", projects=" + projects // + "]"; // } // // } // Path: src/main/java/org/openbakery/timetracker/web/bean/TimeSheetData.java import org.openbakery.timetracker.data.Customer; import java.io.Serializable; import java.util.Date; package org.openbakery.timetracker.web.bean; public class TimeSheetData implements Serializable { private static final long serialVersionUID = 1L; private Date currentDay;
private Customer customer;
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override
public void doAction(Operation operator, Response respose, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override
public void doAction(Operation operator, Response respose, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override
public void doAction(Operation operator, Response respose, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override public void doAction(Operation operator, Response respose, RequestContext request,
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override public void doAction(Operation operator, Response respose, RequestContext request,
ApplicationContext application) {
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override public void doAction(Operation operator, Response respose, RequestContext request, ApplicationContext application) {
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override public void doAction(Operation operator, Response respose, RequestContext request, ApplicationContext application) {
respose.getResults().put(operator.getId(), ActionUtil.simpleResult(Constants.SESSION_ID, request.saveSession()));
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override public void doAction(Operation operator, Response respose, RequestContext request, ApplicationContext application) {
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionUtil.java // public class ActionUtil { // // public static List<Map<String, Object>> simpleResult (String key, Object value){ // Map<String,Object> m = new HashMap<>(); // m.put(key, value); // return Arrays.asList(m); // } // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/SaveSessionAction.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionUtil; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class SaveSessionAction implements Action { @Override public void doAction(Operation operator, Response respose, RequestContext request, ApplicationContext application) {
respose.getResults().put(operator.getId(), ActionUtil.simpleResult(Constants.SESSION_ID, request.saveSession()));
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/CreateKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.KsDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class CreateKeyspaceAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/CreateKeyspaceAction.java import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.KsDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class CreateKeyspaceAction implements Action { @Override
public void doAction(Operation operation, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/CreateKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.KsDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class CreateKeyspaceAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/CreateKeyspaceAction.java import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.KsDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class CreateKeyspaceAction implements Action { @Override
public void doAction(Operation operation, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/CreateKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.KsDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class CreateKeyspaceAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/CreateKeyspaceAction.java import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.KsDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class CreateKeyspaceAction implements Action { @Override
public void doAction(Operation operation, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/CreateKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // }
import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.KsDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext;
package io.teknek.intravert.action.impl; public class CreateKeyspaceAction implements Action { @Override public void doAction(Operation operation, Response response, RequestContext request,
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // Path: src/main/java/io/teknek/intravert/action/impl/CreateKeyspaceAction.java import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.KsDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; package io.teknek.intravert.action.impl; public class CreateKeyspaceAction implements Action { @Override public void doAction(Operation operation, Response response, RequestContext request,
ApplicationContext application) {
zznate/intravert-ug
src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionFactory.java // public class ActionFactory { // // public static final String CREATE_SESSION = "createsession"; // public static final String LOAD_SESSION = "loadsession"; // public static final String SET_KEYSPACE = "setkeyspace"; // public static final String GET_KEYSPACE = "getkeyspace"; // public static final String CREATE_FILTER = "createfilter"; // public static final String UPSERT = "upsert"; // public static final String CREATE_KEYSPACE = "createkeyspace"; // public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily"; // public static final String SLICE ="slice"; // private Map<String,Action> actions; // // public ActionFactory(){ // actions = new HashMap<String,Action>(); // actions.put(CREATE_SESSION, new SaveSessionAction()); // actions.put(LOAD_SESSION, new LoadSessionAction()); // actions.put(SET_KEYSPACE, new SetKeyspaceAction()); // actions.put(GET_KEYSPACE, new GetKeyspaceAction()); // actions.put(CREATE_FILTER, new CreateFilterAction()); // actions.put(UPSERT, new UpsertAction()); // actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction()); // actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction()); // actions.put(SLICE, new SliceAction()); // } // // public Action findAction(String operation){ // Action a = actions.get(operation); // if (a == null) // throw new IllegalArgumentException("Do not know what to do with " + operation); // return a; // } // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionFactory; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response;
package io.teknek.intravert.service; public class DefaultRequestProcessor implements RequestProcessor { private ActionFactory actionFatory = new ActionFactory(); @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionFactory.java // public class ActionFactory { // // public static final String CREATE_SESSION = "createsession"; // public static final String LOAD_SESSION = "loadsession"; // public static final String SET_KEYSPACE = "setkeyspace"; // public static final String GET_KEYSPACE = "getkeyspace"; // public static final String CREATE_FILTER = "createfilter"; // public static final String UPSERT = "upsert"; // public static final String CREATE_KEYSPACE = "createkeyspace"; // public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily"; // public static final String SLICE ="slice"; // private Map<String,Action> actions; // // public ActionFactory(){ // actions = new HashMap<String,Action>(); // actions.put(CREATE_SESSION, new SaveSessionAction()); // actions.put(LOAD_SESSION, new LoadSessionAction()); // actions.put(SET_KEYSPACE, new SetKeyspaceAction()); // actions.put(GET_KEYSPACE, new GetKeyspaceAction()); // actions.put(CREATE_FILTER, new CreateFilterAction()); // actions.put(UPSERT, new UpsertAction()); // actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction()); // actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction()); // actions.put(SLICE, new SliceAction()); // } // // public Action findAction(String operation){ // Action a = actions.get(operation); // if (a == null) // throw new IllegalArgumentException("Do not know what to do with " + operation); // return a; // } // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionFactory; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; package io.teknek.intravert.service; public class DefaultRequestProcessor implements RequestProcessor { private ActionFactory actionFatory = new ActionFactory(); @Override
public void process(Request request, Response response, RequestContext requestContext,
zznate/intravert-ug
src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionFactory.java // public class ActionFactory { // // public static final String CREATE_SESSION = "createsession"; // public static final String LOAD_SESSION = "loadsession"; // public static final String SET_KEYSPACE = "setkeyspace"; // public static final String GET_KEYSPACE = "getkeyspace"; // public static final String CREATE_FILTER = "createfilter"; // public static final String UPSERT = "upsert"; // public static final String CREATE_KEYSPACE = "createkeyspace"; // public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily"; // public static final String SLICE ="slice"; // private Map<String,Action> actions; // // public ActionFactory(){ // actions = new HashMap<String,Action>(); // actions.put(CREATE_SESSION, new SaveSessionAction()); // actions.put(LOAD_SESSION, new LoadSessionAction()); // actions.put(SET_KEYSPACE, new SetKeyspaceAction()); // actions.put(GET_KEYSPACE, new GetKeyspaceAction()); // actions.put(CREATE_FILTER, new CreateFilterAction()); // actions.put(UPSERT, new UpsertAction()); // actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction()); // actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction()); // actions.put(SLICE, new SliceAction()); // } // // public Action findAction(String operation){ // Action a = actions.get(operation); // if (a == null) // throw new IllegalArgumentException("Do not know what to do with " + operation); // return a; // } // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionFactory; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response;
package io.teknek.intravert.service; public class DefaultRequestProcessor implements RequestProcessor { private ActionFactory actionFatory = new ActionFactory(); @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionFactory.java // public class ActionFactory { // // public static final String CREATE_SESSION = "createsession"; // public static final String LOAD_SESSION = "loadsession"; // public static final String SET_KEYSPACE = "setkeyspace"; // public static final String GET_KEYSPACE = "getkeyspace"; // public static final String CREATE_FILTER = "createfilter"; // public static final String UPSERT = "upsert"; // public static final String CREATE_KEYSPACE = "createkeyspace"; // public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily"; // public static final String SLICE ="slice"; // private Map<String,Action> actions; // // public ActionFactory(){ // actions = new HashMap<String,Action>(); // actions.put(CREATE_SESSION, new SaveSessionAction()); // actions.put(LOAD_SESSION, new LoadSessionAction()); // actions.put(SET_KEYSPACE, new SetKeyspaceAction()); // actions.put(GET_KEYSPACE, new GetKeyspaceAction()); // actions.put(CREATE_FILTER, new CreateFilterAction()); // actions.put(UPSERT, new UpsertAction()); // actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction()); // actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction()); // actions.put(SLICE, new SliceAction()); // } // // public Action findAction(String operation){ // Action a = actions.get(operation); // if (a == null) // throw new IllegalArgumentException("Do not know what to do with " + operation); // return a; // } // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionFactory; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; package io.teknek.intravert.service; public class DefaultRequestProcessor implements RequestProcessor { private ActionFactory actionFatory = new ActionFactory(); @Override
public void process(Request request, Response response, RequestContext requestContext,
zznate/intravert-ug
src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionFactory.java // public class ActionFactory { // // public static final String CREATE_SESSION = "createsession"; // public static final String LOAD_SESSION = "loadsession"; // public static final String SET_KEYSPACE = "setkeyspace"; // public static final String GET_KEYSPACE = "getkeyspace"; // public static final String CREATE_FILTER = "createfilter"; // public static final String UPSERT = "upsert"; // public static final String CREATE_KEYSPACE = "createkeyspace"; // public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily"; // public static final String SLICE ="slice"; // private Map<String,Action> actions; // // public ActionFactory(){ // actions = new HashMap<String,Action>(); // actions.put(CREATE_SESSION, new SaveSessionAction()); // actions.put(LOAD_SESSION, new LoadSessionAction()); // actions.put(SET_KEYSPACE, new SetKeyspaceAction()); // actions.put(GET_KEYSPACE, new GetKeyspaceAction()); // actions.put(CREATE_FILTER, new CreateFilterAction()); // actions.put(UPSERT, new UpsertAction()); // actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction()); // actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction()); // actions.put(SLICE, new SliceAction()); // } // // public Action findAction(String operation){ // Action a = actions.get(operation); // if (a == null) // throw new IllegalArgumentException("Do not know what to do with " + operation); // return a; // } // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionFactory; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response;
package io.teknek.intravert.service; public class DefaultRequestProcessor implements RequestProcessor { private ActionFactory actionFatory = new ActionFactory(); @Override public void process(Request request, Response response, RequestContext requestContext, ApplicationContext application) { for (int i = 0; i < request.getOperations().size(); i++) {
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionFactory.java // public class ActionFactory { // // public static final String CREATE_SESSION = "createsession"; // public static final String LOAD_SESSION = "loadsession"; // public static final String SET_KEYSPACE = "setkeyspace"; // public static final String GET_KEYSPACE = "getkeyspace"; // public static final String CREATE_FILTER = "createfilter"; // public static final String UPSERT = "upsert"; // public static final String CREATE_KEYSPACE = "createkeyspace"; // public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily"; // public static final String SLICE ="slice"; // private Map<String,Action> actions; // // public ActionFactory(){ // actions = new HashMap<String,Action>(); // actions.put(CREATE_SESSION, new SaveSessionAction()); // actions.put(LOAD_SESSION, new LoadSessionAction()); // actions.put(SET_KEYSPACE, new SetKeyspaceAction()); // actions.put(GET_KEYSPACE, new GetKeyspaceAction()); // actions.put(CREATE_FILTER, new CreateFilterAction()); // actions.put(UPSERT, new UpsertAction()); // actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction()); // actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction()); // actions.put(SLICE, new SliceAction()); // } // // public Action findAction(String operation){ // Action a = actions.get(operation); // if (a == null) // throw new IllegalArgumentException("Do not know what to do with " + operation); // return a; // } // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionFactory; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; package io.teknek.intravert.service; public class DefaultRequestProcessor implements RequestProcessor { private ActionFactory actionFatory = new ActionFactory(); @Override public void process(Request request, Response response, RequestContext requestContext, ApplicationContext application) { for (int i = 0; i < request.getOperations().size(); i++) {
Operation operation = null;
zznate/intravert-ug
src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionFactory.java // public class ActionFactory { // // public static final String CREATE_SESSION = "createsession"; // public static final String LOAD_SESSION = "loadsession"; // public static final String SET_KEYSPACE = "setkeyspace"; // public static final String GET_KEYSPACE = "getkeyspace"; // public static final String CREATE_FILTER = "createfilter"; // public static final String UPSERT = "upsert"; // public static final String CREATE_KEYSPACE = "createkeyspace"; // public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily"; // public static final String SLICE ="slice"; // private Map<String,Action> actions; // // public ActionFactory(){ // actions = new HashMap<String,Action>(); // actions.put(CREATE_SESSION, new SaveSessionAction()); // actions.put(LOAD_SESSION, new LoadSessionAction()); // actions.put(SET_KEYSPACE, new SetKeyspaceAction()); // actions.put(GET_KEYSPACE, new GetKeyspaceAction()); // actions.put(CREATE_FILTER, new CreateFilterAction()); // actions.put(UPSERT, new UpsertAction()); // actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction()); // actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction()); // actions.put(SLICE, new SliceAction()); // } // // public Action findAction(String operation){ // Action a = actions.get(operation); // if (a == null) // throw new IllegalArgumentException("Do not know what to do with " + operation); // return a; // } // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionFactory; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response;
package io.teknek.intravert.service; public class DefaultRequestProcessor implements RequestProcessor { private ActionFactory actionFatory = new ActionFactory(); @Override public void process(Request request, Response response, RequestContext requestContext, ApplicationContext application) { for (int i = 0; i < request.getOperations().size(); i++) { Operation operation = null; try { operation = request.getOperations().get(i);
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/action/ActionFactory.java // public class ActionFactory { // // public static final String CREATE_SESSION = "createsession"; // public static final String LOAD_SESSION = "loadsession"; // public static final String SET_KEYSPACE = "setkeyspace"; // public static final String GET_KEYSPACE = "getkeyspace"; // public static final String CREATE_FILTER = "createfilter"; // public static final String UPSERT = "upsert"; // public static final String CREATE_KEYSPACE = "createkeyspace"; // public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily"; // public static final String SLICE ="slice"; // private Map<String,Action> actions; // // public ActionFactory(){ // actions = new HashMap<String,Action>(); // actions.put(CREATE_SESSION, new SaveSessionAction()); // actions.put(LOAD_SESSION, new LoadSessionAction()); // actions.put(SET_KEYSPACE, new SetKeyspaceAction()); // actions.put(GET_KEYSPACE, new GetKeyspaceAction()); // actions.put(CREATE_FILTER, new CreateFilterAction()); // actions.put(UPSERT, new UpsertAction()); // actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction()); // actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction()); // actions.put(SLICE, new SliceAction()); // } // // public Action findAction(String operation){ // Action a = actions.get(operation); // if (a == null) // throw new IllegalArgumentException("Do not know what to do with " + operation); // return a; // } // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java import io.teknek.intravert.action.Action; import io.teknek.intravert.action.ActionFactory; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; package io.teknek.intravert.service; public class DefaultRequestProcessor implements RequestProcessor { private ActionFactory actionFatory = new ActionFactory(); @Override public void process(Request request, Response response, RequestContext requestContext, ApplicationContext application) { for (int i = 0; i < request.getOperations().size(); i++) { Operation operation = null; try { operation = request.getOperations().get(i);
Action action = actionFatory.findAction(operation.getType());
zznate/intravert-ug
src/main/java/io/teknek/intravert/util/ResponseUtil.java
// Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // }
import io.teknek.intravert.model.Constants; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map;
package io.teknek.intravert.util; public class ResponseUtil { public static List getDefaultHappy(){ Map m = new HashMap();
// Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java import io.teknek.intravert.model.Constants; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; package io.teknek.intravert.util; public class ResponseUtil { public static List getDefaultHappy(){ Map m = new HashMap();
m.put(Constants.RESULT, Constants.OK);
zznate/intravert-ug
src/test/java/io/teknek/intravert/daemon/JsonFileTest.java
// Path: src/main/java/io/teknek/intravert/client/Client.java // public class Client { // // private ObjectMapper MAPPER = new ObjectMapper(); // private DefaultHttpClient httpClient = new DefaultHttpClient(); // // @Deprecated // public String postAsString(String url, String message) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // // HttpPost postRequest = new HttpPost(url); // // StringEntity input = new StringEntity(message); // input.setContentType("application/json"); // postRequest.setEntity(input); // // HttpResponse response = httpClient.execute(postRequest); // // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // // BufferedReader br = new BufferedReader(new InputStreamReader( // (response.getEntity().getContent()))); // // String output; // StringBuffer totalOutput = new StringBuffer(); // System.out.println("Output from Server .... \n"); // while ((output = br.readLine()) != null) { // System.out.println(output); // totalOutput.append(output); // } // return totalOutput.toString(); // } // // public Response post(String url, Request request) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // HttpPost postRequest = new HttpPost(url); // ByteArrayEntity input = new ByteArrayEntity(MAPPER.writeValueAsBytes(request)); // input.setContentType("application/json"); // postRequest.setEntity(input); // HttpResponse response = httpClient.execute(postRequest); // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // Response r = MAPPER.readValue(response.getEntity().getContent(), Response.class); // response.getEntity().getContent().close(); // return r; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.client.Client; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import junit.framework.Assert; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.SerializationConfig.Feature; import org.junit.Before; import org.junit.Test;
package io.teknek.intravert.daemon; public class JsonFileTest extends BaseIntravertTest { private File jtest; @Before public void before(){ File resources = new File("src/test/resources"); jtest = new File(resources, "jtest"); } public void innerTest(String testname) throws JsonParseException, JsonMappingException, IOException{ File testDir = new File(jtest, testname); if (!testDir.isDirectory()){ throw new RuntimeException(testDir+" is not a directory"); } File input = new File(testDir, "input.json"); File output = new File(testDir, "output.json");
// Path: src/main/java/io/teknek/intravert/client/Client.java // public class Client { // // private ObjectMapper MAPPER = new ObjectMapper(); // private DefaultHttpClient httpClient = new DefaultHttpClient(); // // @Deprecated // public String postAsString(String url, String message) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // // HttpPost postRequest = new HttpPost(url); // // StringEntity input = new StringEntity(message); // input.setContentType("application/json"); // postRequest.setEntity(input); // // HttpResponse response = httpClient.execute(postRequest); // // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // // BufferedReader br = new BufferedReader(new InputStreamReader( // (response.getEntity().getContent()))); // // String output; // StringBuffer totalOutput = new StringBuffer(); // System.out.println("Output from Server .... \n"); // while ((output = br.readLine()) != null) { // System.out.println(output); // totalOutput.append(output); // } // return totalOutput.toString(); // } // // public Response post(String url, Request request) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // HttpPost postRequest = new HttpPost(url); // ByteArrayEntity input = new ByteArrayEntity(MAPPER.writeValueAsBytes(request)); // input.setContentType("application/json"); // postRequest.setEntity(input); // HttpResponse response = httpClient.execute(postRequest); // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // Response r = MAPPER.readValue(response.getEntity().getContent(), Response.class); // response.getEntity().getContent().close(); // return r; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/test/java/io/teknek/intravert/daemon/JsonFileTest.java import io.teknek.intravert.client.Client; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import junit.framework.Assert; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.SerializationConfig.Feature; import org.junit.Before; import org.junit.Test; package io.teknek.intravert.daemon; public class JsonFileTest extends BaseIntravertTest { private File jtest; @Before public void before(){ File resources = new File("src/test/resources"); jtest = new File(resources, "jtest"); } public void innerTest(String testname) throws JsonParseException, JsonMappingException, IOException{ File testDir = new File(jtest, testname); if (!testDir.isDirectory()){ throw new RuntimeException(testDir+" is not a directory"); } File input = new File(testDir, "input.json"); File output = new File(testDir, "output.json");
Client c = new Client();
zznate/intravert-ug
src/test/java/io/teknek/intravert/daemon/JsonFileTest.java
// Path: src/main/java/io/teknek/intravert/client/Client.java // public class Client { // // private ObjectMapper MAPPER = new ObjectMapper(); // private DefaultHttpClient httpClient = new DefaultHttpClient(); // // @Deprecated // public String postAsString(String url, String message) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // // HttpPost postRequest = new HttpPost(url); // // StringEntity input = new StringEntity(message); // input.setContentType("application/json"); // postRequest.setEntity(input); // // HttpResponse response = httpClient.execute(postRequest); // // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // // BufferedReader br = new BufferedReader(new InputStreamReader( // (response.getEntity().getContent()))); // // String output; // StringBuffer totalOutput = new StringBuffer(); // System.out.println("Output from Server .... \n"); // while ((output = br.readLine()) != null) { // System.out.println(output); // totalOutput.append(output); // } // return totalOutput.toString(); // } // // public Response post(String url, Request request) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // HttpPost postRequest = new HttpPost(url); // ByteArrayEntity input = new ByteArrayEntity(MAPPER.writeValueAsBytes(request)); // input.setContentType("application/json"); // postRequest.setEntity(input); // HttpResponse response = httpClient.execute(postRequest); // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // Response r = MAPPER.readValue(response.getEntity().getContent(), Response.class); // response.getEntity().getContent().close(); // return r; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.client.Client; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import junit.framework.Assert; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.SerializationConfig.Feature; import org.junit.Before; import org.junit.Test;
package io.teknek.intravert.daemon; public class JsonFileTest extends BaseIntravertTest { private File jtest; @Before public void before(){ File resources = new File("src/test/resources"); jtest = new File(resources, "jtest"); } public void innerTest(String testname) throws JsonParseException, JsonMappingException, IOException{ File testDir = new File(jtest, testname); if (!testDir.isDirectory()){ throw new RuntimeException(testDir+" is not a directory"); } File input = new File(testDir, "input.json"); File output = new File(testDir, "output.json"); Client c = new Client(); ObjectMapper om = new ObjectMapper(); om.configure(Feature.INDENT_OUTPUT, true);
// Path: src/main/java/io/teknek/intravert/client/Client.java // public class Client { // // private ObjectMapper MAPPER = new ObjectMapper(); // private DefaultHttpClient httpClient = new DefaultHttpClient(); // // @Deprecated // public String postAsString(String url, String message) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // // HttpPost postRequest = new HttpPost(url); // // StringEntity input = new StringEntity(message); // input.setContentType("application/json"); // postRequest.setEntity(input); // // HttpResponse response = httpClient.execute(postRequest); // // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // // BufferedReader br = new BufferedReader(new InputStreamReader( // (response.getEntity().getContent()))); // // String output; // StringBuffer totalOutput = new StringBuffer(); // System.out.println("Output from Server .... \n"); // while ((output = br.readLine()) != null) { // System.out.println(output); // totalOutput.append(output); // } // return totalOutput.toString(); // } // // public Response post(String url, Request request) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // HttpPost postRequest = new HttpPost(url); // ByteArrayEntity input = new ByteArrayEntity(MAPPER.writeValueAsBytes(request)); // input.setContentType("application/json"); // postRequest.setEntity(input); // HttpResponse response = httpClient.execute(postRequest); // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // Response r = MAPPER.readValue(response.getEntity().getContent(), Response.class); // response.getEntity().getContent().close(); // return r; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/test/java/io/teknek/intravert/daemon/JsonFileTest.java import io.teknek.intravert.client.Client; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import junit.framework.Assert; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.SerializationConfig.Feature; import org.junit.Before; import org.junit.Test; package io.teknek.intravert.daemon; public class JsonFileTest extends BaseIntravertTest { private File jtest; @Before public void before(){ File resources = new File("src/test/resources"); jtest = new File(resources, "jtest"); } public void innerTest(String testname) throws JsonParseException, JsonMappingException, IOException{ File testDir = new File(jtest, testname); if (!testDir.isDirectory()){ throw new RuntimeException(testDir+" is not a directory"); } File input = new File(testDir, "input.json"); File output = new File(testDir, "output.json"); Client c = new Client(); ObjectMapper om = new ObjectMapper(); om.configure(Feature.INDENT_OUTPUT, true);
Request r = om.readValue(input, Request.class);
zznate/intravert-ug
src/test/java/io/teknek/intravert/daemon/JsonFileTest.java
// Path: src/main/java/io/teknek/intravert/client/Client.java // public class Client { // // private ObjectMapper MAPPER = new ObjectMapper(); // private DefaultHttpClient httpClient = new DefaultHttpClient(); // // @Deprecated // public String postAsString(String url, String message) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // // HttpPost postRequest = new HttpPost(url); // // StringEntity input = new StringEntity(message); // input.setContentType("application/json"); // postRequest.setEntity(input); // // HttpResponse response = httpClient.execute(postRequest); // // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // // BufferedReader br = new BufferedReader(new InputStreamReader( // (response.getEntity().getContent()))); // // String output; // StringBuffer totalOutput = new StringBuffer(); // System.out.println("Output from Server .... \n"); // while ((output = br.readLine()) != null) { // System.out.println(output); // totalOutput.append(output); // } // return totalOutput.toString(); // } // // public Response post(String url, Request request) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // HttpPost postRequest = new HttpPost(url); // ByteArrayEntity input = new ByteArrayEntity(MAPPER.writeValueAsBytes(request)); // input.setContentType("application/json"); // postRequest.setEntity(input); // HttpResponse response = httpClient.execute(postRequest); // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // Response r = MAPPER.readValue(response.getEntity().getContent(), Response.class); // response.getEntity().getContent().close(); // return r; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.client.Client; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import junit.framework.Assert; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.SerializationConfig.Feature; import org.junit.Before; import org.junit.Test;
package io.teknek.intravert.daemon; public class JsonFileTest extends BaseIntravertTest { private File jtest; @Before public void before(){ File resources = new File("src/test/resources"); jtest = new File(resources, "jtest"); } public void innerTest(String testname) throws JsonParseException, JsonMappingException, IOException{ File testDir = new File(jtest, testname); if (!testDir.isDirectory()){ throw new RuntimeException(testDir+" is not a directory"); } File input = new File(testDir, "input.json"); File output = new File(testDir, "output.json"); Client c = new Client(); ObjectMapper om = new ObjectMapper(); om.configure(Feature.INDENT_OUTPUT, true); Request r = om.readValue(input, Request.class);
// Path: src/main/java/io/teknek/intravert/client/Client.java // public class Client { // // private ObjectMapper MAPPER = new ObjectMapper(); // private DefaultHttpClient httpClient = new DefaultHttpClient(); // // @Deprecated // public String postAsString(String url, String message) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // // HttpPost postRequest = new HttpPost(url); // // StringEntity input = new StringEntity(message); // input.setContentType("application/json"); // postRequest.setEntity(input); // // HttpResponse response = httpClient.execute(postRequest); // // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // // BufferedReader br = new BufferedReader(new InputStreamReader( // (response.getEntity().getContent()))); // // String output; // StringBuffer totalOutput = new StringBuffer(); // System.out.println("Output from Server .... \n"); // while ((output = br.readLine()) != null) { // System.out.println(output); // totalOutput.append(output); // } // return totalOutput.toString(); // } // // public Response post(String url, Request request) // throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { // HttpPost postRequest = new HttpPost(url); // ByteArrayEntity input = new ByteArrayEntity(MAPPER.writeValueAsBytes(request)); // input.setContentType("application/json"); // postRequest.setEntity(input); // HttpResponse response = httpClient.execute(postRequest); // if (response.getStatusLine().getStatusCode() != 200) { // throw new RuntimeException("Failed : HTTP error code : " // + response.getStatusLine().getStatusCode()); // } // Response r = MAPPER.readValue(response.getEntity().getContent(), Response.class); // response.getEntity().getContent().close(); // return r; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/test/java/io/teknek/intravert/daemon/JsonFileTest.java import io.teknek.intravert.client.Client; import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import junit.framework.Assert; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.SerializationConfig.Feature; import org.junit.Before; import org.junit.Test; package io.teknek.intravert.daemon; public class JsonFileTest extends BaseIntravertTest { private File jtest; @Before public void before(){ File resources = new File("src/test/resources"); jtest = new File(resources, "jtest"); } public void innerTest(String testname) throws JsonParseException, JsonMappingException, IOException{ File testDir = new File(jtest, testname); if (!testDir.isDirectory()){ throw new RuntimeException(testDir+" is not a directory"); } File input = new File(testDir, "input.json"); File output = new File(testDir, "output.json"); Client c = new Client(); ObjectMapper om = new ObjectMapper(); om.configure(Feature.INDENT_OUTPUT, true); Request r = om.readValue(input, Request.class);
Response resp = c.post("http://localhost:7654", r);
zznate/intravert-ug
src/main/java/io/teknek/intravert/daemon/IntravertCassandraServer.java
// Path: src/main/java/io/teknek/intravert/service/DefaultIntravertService.java // public class DefaultIntravertService implements IntravertService { // // private RequestProcessor requestProcessor = new DefaultRequestProcessor(); // private ApplicationContext applicationContext = new ApplicationContext(); // // @Override // public Response doRequest(Request request) { // Response response = new Response(); // RequestContext requestContext = new RequestContext(); // requestProcessor.process(request, response, requestContext, applicationContext); // return response; // } // // } // // Path: src/main/java/io/teknek/intravert/service/IntravertService.java // public interface IntravertService { // Response doRequest(Request request); // }
import io.teknek.intravert.service.DefaultIntravertService; import io.teknek.intravert.service.IntravertService; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletRequest; import org.apache.cassandra.service.CassandraDaemon.Server; import org.codehaus.jackson.map.ObjectMapper; import org.mortbay.jetty.Handler; import org.mortbay.jetty.HttpConnection; import org.mortbay.jetty.Request; import org.mortbay.jetty.handler.AbstractHandler;
package io.teknek.intravert.daemon; public class IntravertCassandraServer implements Server { public static final int port = 7654; private static final AtomicBoolean RUNNING = new AtomicBoolean(false); private org.mortbay.jetty.Server server;
// Path: src/main/java/io/teknek/intravert/service/DefaultIntravertService.java // public class DefaultIntravertService implements IntravertService { // // private RequestProcessor requestProcessor = new DefaultRequestProcessor(); // private ApplicationContext applicationContext = new ApplicationContext(); // // @Override // public Response doRequest(Request request) { // Response response = new Response(); // RequestContext requestContext = new RequestContext(); // requestProcessor.process(request, response, requestContext, applicationContext); // return response; // } // // } // // Path: src/main/java/io/teknek/intravert/service/IntravertService.java // public interface IntravertService { // Response doRequest(Request request); // } // Path: src/main/java/io/teknek/intravert/daemon/IntravertCassandraServer.java import io.teknek.intravert.service.DefaultIntravertService; import io.teknek.intravert.service.IntravertService; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletRequest; import org.apache.cassandra.service.CassandraDaemon.Server; import org.codehaus.jackson.map.ObjectMapper; import org.mortbay.jetty.Handler; import org.mortbay.jetty.HttpConnection; import org.mortbay.jetty.Request; import org.mortbay.jetty.handler.AbstractHandler; package io.teknek.intravert.daemon; public class IntravertCassandraServer implements Server { public static final int port = 7654; private static final AtomicBoolean RUNNING = new AtomicBoolean(false); private org.mortbay.jetty.Server server;
private IntravertService intraService;
zznate/intravert-ug
src/main/java/io/teknek/intravert/daemon/IntravertCassandraServer.java
// Path: src/main/java/io/teknek/intravert/service/DefaultIntravertService.java // public class DefaultIntravertService implements IntravertService { // // private RequestProcessor requestProcessor = new DefaultRequestProcessor(); // private ApplicationContext applicationContext = new ApplicationContext(); // // @Override // public Response doRequest(Request request) { // Response response = new Response(); // RequestContext requestContext = new RequestContext(); // requestProcessor.process(request, response, requestContext, applicationContext); // return response; // } // // } // // Path: src/main/java/io/teknek/intravert/service/IntravertService.java // public interface IntravertService { // Response doRequest(Request request); // }
import io.teknek.intravert.service.DefaultIntravertService; import io.teknek.intravert.service.IntravertService; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletRequest; import org.apache.cassandra.service.CassandraDaemon.Server; import org.codehaus.jackson.map.ObjectMapper; import org.mortbay.jetty.Handler; import org.mortbay.jetty.HttpConnection; import org.mortbay.jetty.Request; import org.mortbay.jetty.handler.AbstractHandler;
package io.teknek.intravert.daemon; public class IntravertCassandraServer implements Server { public static final int port = 7654; private static final AtomicBoolean RUNNING = new AtomicBoolean(false); private org.mortbay.jetty.Server server; private IntravertService intraService; private static ObjectMapper MAPPER = new ObjectMapper(); public IntravertService getService(){ return intraService; } @Override public boolean isRunning() { return RUNNING.get(); } @Override public void start() {
// Path: src/main/java/io/teknek/intravert/service/DefaultIntravertService.java // public class DefaultIntravertService implements IntravertService { // // private RequestProcessor requestProcessor = new DefaultRequestProcessor(); // private ApplicationContext applicationContext = new ApplicationContext(); // // @Override // public Response doRequest(Request request) { // Response response = new Response(); // RequestContext requestContext = new RequestContext(); // requestProcessor.process(request, response, requestContext, applicationContext); // return response; // } // // } // // Path: src/main/java/io/teknek/intravert/service/IntravertService.java // public interface IntravertService { // Response doRequest(Request request); // } // Path: src/main/java/io/teknek/intravert/daemon/IntravertCassandraServer.java import io.teknek.intravert.service.DefaultIntravertService; import io.teknek.intravert.service.IntravertService; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletRequest; import org.apache.cassandra.service.CassandraDaemon.Server; import org.codehaus.jackson.map.ObjectMapper; import org.mortbay.jetty.Handler; import org.mortbay.jetty.HttpConnection; import org.mortbay.jetty.Request; import org.mortbay.jetty.handler.AbstractHandler; package io.teknek.intravert.daemon; public class IntravertCassandraServer implements Server { public static final int port = 7654; private static final AtomicBoolean RUNNING = new AtomicBoolean(false); private org.mortbay.jetty.Server server; private IntravertService intraService; private static ObjectMapper MAPPER = new ObjectMapper(); public IntravertService getService(){ return intraService; } @Override public boolean isRunning() { return RUNNING.get(); } @Override public void start() {
intraService = new DefaultIntravertService();
zznate/intravert-ug
src/main/java/io/teknek/intravert/client/Client.java
// Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.InputStreamEntity; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.codehaus.jackson.map.ObjectMapper;
package io.teknek.intravert.client; public class Client { private ObjectMapper MAPPER = new ObjectMapper(); private DefaultHttpClient httpClient = new DefaultHttpClient(); @Deprecated public String postAsString(String url, String message) throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { HttpPost postRequest = new HttpPost(url); StringEntity input = new StringEntity(message); input.setContentType("application/json"); postRequest.setEntity(input); HttpResponse response = httpClient.execute(postRequest); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (response.getEntity().getContent()))); String output; StringBuffer totalOutput = new StringBuffer(); System.out.println("Output from Server .... \n"); while ((output = br.readLine()) != null) { System.out.println(output); totalOutput.append(output); } return totalOutput.toString(); }
// Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/main/java/io/teknek/intravert/client/Client.java import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.InputStreamEntity; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.codehaus.jackson.map.ObjectMapper; package io.teknek.intravert.client; public class Client { private ObjectMapper MAPPER = new ObjectMapper(); private DefaultHttpClient httpClient = new DefaultHttpClient(); @Deprecated public String postAsString(String url, String message) throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { HttpPost postRequest = new HttpPost(url); StringEntity input = new StringEntity(message); input.setContentType("application/json"); postRequest.setEntity(input); HttpResponse response = httpClient.execute(postRequest); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (response.getEntity().getContent()))); String output; StringBuffer totalOutput = new StringBuffer(); System.out.println("Output from Server .... \n"); while ((output = br.readLine()) != null) { System.out.println(output); totalOutput.append(output); } return totalOutput.toString(); }
public Response post(String url, Request request)
zznate/intravert-ug
src/main/java/io/teknek/intravert/client/Client.java
// Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.InputStreamEntity; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.codehaus.jackson.map.ObjectMapper;
package io.teknek.intravert.client; public class Client { private ObjectMapper MAPPER = new ObjectMapper(); private DefaultHttpClient httpClient = new DefaultHttpClient(); @Deprecated public String postAsString(String url, String message) throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { HttpPost postRequest = new HttpPost(url); StringEntity input = new StringEntity(message); input.setContentType("application/json"); postRequest.setEntity(input); HttpResponse response = httpClient.execute(postRequest); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (response.getEntity().getContent()))); String output; StringBuffer totalOutput = new StringBuffer(); System.out.println("Output from Server .... \n"); while ((output = br.readLine()) != null) { System.out.println(output); totalOutput.append(output); } return totalOutput.toString(); }
// Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/main/java/io/teknek/intravert/client/Client.java import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.InputStreamEntity; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.codehaus.jackson.map.ObjectMapper; package io.teknek.intravert.client; public class Client { private ObjectMapper MAPPER = new ObjectMapper(); private DefaultHttpClient httpClient = new DefaultHttpClient(); @Deprecated public String postAsString(String url, String message) throws IOException, IllegalStateException, UnsupportedEncodingException, RuntimeException { HttpPost postRequest = new HttpPost(url); StringEntity input = new StringEntity(message); input.setContentType("application/json"); postRequest.setEntity(input); HttpResponse response = httpClient.execute(postRequest); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (response.getEntity().getContent()))); String output; StringBuffer totalOutput = new StringBuffer(); System.out.println("Output from Server .... \n"); while ((output = br.readLine()) != null) { System.out.println(output); totalOutput.append(output); } return totalOutput.toString(); }
public Response post(String url, Request request)
zznate/intravert-ug
src/main/java/io/teknek/intravert/util/TypeUtil.java
// Path: src/main/java/io/teknek/intravert/model/Type.java // public class Type { // // private String theClass; // private Object value; // // public Type(Object o){ // setValue(o); // setTheClass(o.getClass().getSimpleName()); // } // // public Type(String theClass, Object o){ // setTheClass(theClass); // setValue(o); // } // // public String getTheClass() { // return theClass; // } // // public void setTheClass(String theClass) { // this.theClass = theClass; // } // // public Object getValue() { // return value; // } // // public void setValue(Object theValue) { // this.value = theValue; // } // // }
import io.teknek.intravert.model.Type; import java.util.Map; import org.codehaus.jackson.map.ObjectMapper;
package io.teknek.intravert.util; public class TypeUtil { private static ObjectMapper om = new ObjectMapper(); public static <T> T convert(Object in){ if (in instanceof Map){
// Path: src/main/java/io/teknek/intravert/model/Type.java // public class Type { // // private String theClass; // private Object value; // // public Type(Object o){ // setValue(o); // setTheClass(o.getClass().getSimpleName()); // } // // public Type(String theClass, Object o){ // setTheClass(theClass); // setValue(o); // } // // public String getTheClass() { // return theClass; // } // // public void setTheClass(String theClass) { // this.theClass = theClass; // } // // public Object getValue() { // return value; // } // // public void setValue(Object theValue) { // this.value = theValue; // } // // } // Path: src/main/java/io/teknek/intravert/util/TypeUtil.java import io.teknek.intravert.model.Type; import java.util.Map; import org.codehaus.jackson.map.ObjectMapper; package io.teknek.intravert.util; public class TypeUtil { private static ObjectMapper om = new ObjectMapper(); public static <T> T convert(Object in){ if (in instanceof Map){
Type t = om.convertValue(in, Type.class);
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.CfDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class CreateColumnFamilyAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.CfDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class CreateColumnFamilyAction implements Action { @Override
public void doAction(Operation operation, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.CfDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class CreateColumnFamilyAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.CfDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class CreateColumnFamilyAction implements Action { @Override
public void doAction(Operation operation, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.CfDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class CreateColumnFamilyAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.CfDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class CreateColumnFamilyAction implements Action { @Override
public void doAction(Operation operation, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.CfDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class CreateColumnFamilyAction implements Action { @Override public void doAction(Operation operation, Response response, RequestContext request,
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.KSMetaData; import org.apache.cassandra.config.Schema; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.thrift.CfDef; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class CreateColumnFamilyAction implements Action { @Override public void doAction(Operation operation, Response response, RequestContext request,
ApplicationContext application) {
zznate/intravert-ug
src/main/java/io/teknek/intravert/service/DefaultIntravertService.java
// Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response;
package io.teknek.intravert.service; public class DefaultIntravertService implements IntravertService { private RequestProcessor requestProcessor = new DefaultRequestProcessor(); private ApplicationContext applicationContext = new ApplicationContext(); @Override
// Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/main/java/io/teknek/intravert/service/DefaultIntravertService.java import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; package io.teknek.intravert.service; public class DefaultIntravertService implements IntravertService { private RequestProcessor requestProcessor = new DefaultRequestProcessor(); private ApplicationContext applicationContext = new ApplicationContext(); @Override
public Response doRequest(Request request) {
zznate/intravert-ug
src/main/java/io/teknek/intravert/service/DefaultIntravertService.java
// Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // }
import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response;
package io.teknek.intravert.service; public class DefaultIntravertService implements IntravertService { private RequestProcessor requestProcessor = new DefaultRequestProcessor(); private ApplicationContext applicationContext = new ApplicationContext(); @Override
// Path: src/main/java/io/teknek/intravert/model/Request.java // public class Request { // private List<Operation> operations; // // public Request(){ // operations = new ArrayList<Operation>(); // } // // public List<Operation> getOperations() { // return operations; // } // // public void setOperations(List<Operation> operations) { // this.operations = operations; // } // // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // Path: src/main/java/io/teknek/intravert/service/DefaultIntravertService.java import io.teknek.intravert.model.Request; import io.teknek.intravert.model.Response; package io.teknek.intravert.service; public class DefaultIntravertService implements IntravertService { private RequestProcessor requestProcessor = new DefaultRequestProcessor(); private ApplicationContext applicationContext = new ApplicationContext(); @Override
public Response doRequest(Request request) {
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override
public void doAction(Operation o, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override
public void doAction(Operation o, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override
public void doAction(Operation o, Response response, RequestContext request,
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override public void doAction(Operation o, Response response, RequestContext request,
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override public void doAction(Operation o, Response response, RequestContext request,
ApplicationContext application) {
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // }
import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil;
package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override public void doAction(Operation o, Response response, RequestContext request, ApplicationContext application) { String name = (String) o.getArguments().get("name"); request.getSession().setCurrentKeyspace(name);
// Path: src/main/java/io/teknek/intravert/action/Action.java // public interface Action { // void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application); // } // // Path: src/main/java/io/teknek/intravert/model/Constants.java // public class Constants { // public static final String STATUS = "status"; // public static final String OK = "ok"; // public static final String SESSION_ID = "session_id"; // public static final String RESULT = "result"; // } // // Path: src/main/java/io/teknek/intravert/model/Operation.java // public class Operation { // private String type; // private String id; // private Map<String,Object> arguments; // // public Operation(){ // arguments = new HashMap<String,Object>(); // } // // public String getType() { // return type; // } // // public void setType(String type) { // this.type = type; // } // // public Map<String, Object> getArguments() { // return arguments; // } // // public void setArguments(Map<String, Object> arguments) { // this.arguments = arguments; // } // // public String getId() { // return id; // } // // public void setId(String id) { // this.id = id; // } // // public Operation withId(String id){ // setId(id); // return this; // } // // public Operation withType(String type){ // setType(type); // return this; // } // // public Operation withArguments(Map<String,Object> arguments){ // setArguments(arguments); // return this; // } // // public Map<String,Object> withArgument(String name, Object value){ // arguments.put(name, value); // return arguments; // } // } // // Path: src/main/java/io/teknek/intravert/model/Response.java // public class Response { // private String exceptionMessage; // private String exceptionId; // private LinkedHashMap<String,Object> results; // private LinkedHashMap<String,Object> metaData; // // public Response(){ // results = new LinkedHashMap<String,Object>(); // metaData = new LinkedHashMap<String,Object>(); // } // // public String getExceptionMessage() { // return exceptionMessage; // } // // public void setExceptionMessage(String exceptionMessage) { // this.exceptionMessage = exceptionMessage; // } // // public String getExceptionId() { // return exceptionId; // } // // public void setExceptionId(String exceptionId) { // this.exceptionId = exceptionId; // } // // public Map<String, Object> getResults() { // return results; // } // // public void setResults(LinkedHashMap<String, Object> results) { // this.results = results; // } // // public Map<String, Object> getMetaData() { // return metaData; // } // // public void setMetaData(LinkedHashMap<String, Object> metaData) { // this.metaData = metaData; // } // // } // // Path: src/main/java/io/teknek/intravert/service/ApplicationContext.java // public class ApplicationContext { // // private Map<String,Filter> filters; // // public ApplicationContext(){ // filters = new HashMap<>(); // } // // public void putFilter(String name, Filter f){ // filters.put(name, f); // } // // public Filter getFilter(String name){ // Filter f = filters.get(name); // //todo get from column family // if (f == null){ // throw new RuntimeException ("filter not found"); // } // return f; // } // } // // Path: src/main/java/io/teknek/intravert/service/RequestContext.java // public class RequestContext { // // private static final AtomicLong SESSION_ID = new AtomicLong(0); // private static LoadingCache<Long,Session> CACHE; // private Session session; // // static { // CacheLoader <Long,Session> loader = new CacheLoader<Long,Session>(){ // @Override // public Session load(Long id) throws Exception { // return new Session(); // } // }; // CACHE = CacheBuilder.newBuilder() // .maximumSize(10000) // //.expireAfterAccess(60, TimeUnit.SECONDS) // .build(loader); // } // // public RequestContext(){ // // } // // public Session recoverSession(Long l){ // try { // session = CACHE.get(l); // } catch (ExecutionException e) { // throw new RuntimeException(e); // } // return session; // } // // public Long saveSession(){ // Long id = SESSION_ID.getAndIncrement(); // CACHE.put(id, getSession()); // return id; // } // // public Session getSession(){ // if (session == null){ // session = new Session(); // } // return session; // } // // } // // Path: src/main/java/io/teknek/intravert/util/ResponseUtil.java // public class ResponseUtil { // // public static List getDefaultHappy(){ // Map m = new HashMap(); // m.put(Constants.RESULT, Constants.OK); // return Arrays.asList(m); // } // } // Path: src/main/java/io/teknek/intravert/action/impl/SetKeyspaceAction.java import java.util.Arrays; import java.util.HashMap; import java.util.Map; import io.teknek.intravert.action.Action; import io.teknek.intravert.model.Constants; import io.teknek.intravert.model.Operation; import io.teknek.intravert.model.Response; import io.teknek.intravert.service.ApplicationContext; import io.teknek.intravert.service.RequestContext; import io.teknek.intravert.util.ResponseUtil; package io.teknek.intravert.action.impl; public class SetKeyspaceAction implements Action { @Override public void doAction(Operation o, Response response, RequestContext request, ApplicationContext application) { String name = (String) o.getArguments().get("name"); request.getSession().setCurrentKeyspace(name);
response.getResults().put(o.getId(), ResponseUtil.getDefaultHappy());
zznate/intravert-ug
src/main/java/io/teknek/intravert/service/Session.java
// Path: src/main/java/io/teknek/intravert/action/filter/Filter.java // public interface Filter { // Map filter(Map m); // }
import io.teknek.intravert.action.filter.Filter; import java.util.HashMap; import java.util.Map;
package io.teknek.intravert.service; public class Session { private String currentKeyspace;
// Path: src/main/java/io/teknek/intravert/action/filter/Filter.java // public interface Filter { // Map filter(Map m); // } // Path: src/main/java/io/teknek/intravert/service/Session.java import io.teknek.intravert.action.filter.Filter; import java.util.HashMap; import java.util.Map; package io.teknek.intravert.service; public class Session { private String currentKeyspace;
private Map<String,Filter> filters;
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.server; /** * Thrown when trying to use an invalid bitcoin address. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class InvalidAddressException extends BitcoinServerException {
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.server; /** * Thrown when trying to use an invalid bitcoin address. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class InvalidAddressException extends BitcoinServerException {
public InvalidAddressException(BitcoindErrorResponse errorResponse) {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/request/TemplateRequest.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.request; /** * Arguments for BitcoindClient's getBlockTemplate method. * * @see {@link https://en.bitcoin.it/wiki/BIP_0022} * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/request/TemplateRequest.java import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.request; /** * Arguments for BitcoindClient's getBlockTemplate method. * * @see {@link https://en.bitcoin.it/wiki/BIP_0022} * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
public class TemplateRequest extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetBlockTemplateResult.java
// Path: src/main/java/dk/clanie/bitcoin/client/Transaction.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({ // "data", // "hash", // "required", // "depends", // "fee", // "sigops" // }) // public class Transaction extends JsonExtra { // // /** // * Transaction data encoded in hexadecimal (byte-for-byte). // */ // private String data; // // /** // * If provided and true, this transaction must be in the final block. // */ // @JsonInclude(Include.NON_NULL) // private Boolean required; // // /** // * Hash/id encoded in little-endian hexadecimal. // */ // private String hash; // // /** // * Other transactions before this one (by 1-based index in "transactions" // * list) that must be present in the final block if this one is; if key is // * not present, dependencies are unknown and clients MUST NOT assume there // * aren't any. // */ // @JsonInclude(Include.NON_NULL) // private Integer[] depends; // // /** // * Fee in Satoshis. // * <p> // * Difference in value between transaction inputs and outputs (in Satoshis); // * for coinbase transactions, this is a negative Number of the total // * collected block fees (ie, not including the block subsidy); if key is not // * present, fee is unknown and clients MUST NOT assume there isn't one. // */ // @JsonInclude(Include.NON_NULL) // private Long fee; // // /** // * Total number of SigOps, as counted for purposes of block limits; if key // * is not present, sigop count is unknown and clients MUST NOT assume there // * aren't any. // */ // @JsonInclude(Include.NON_NULL) // private Integer sigops; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.client.Transaction; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getBlockTemplate method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "version", "previousblockhash", "transactions", "coinbaseaux", "coinbasetxn", "coinbasevalue", "target", "mintime", "mutable", "noncerange", "sigoplimit", "sizelimit", "curtime", "bits", "height", "workid" })
// Path: src/main/java/dk/clanie/bitcoin/client/Transaction.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({ // "data", // "hash", // "required", // "depends", // "fee", // "sigops" // }) // public class Transaction extends JsonExtra { // // /** // * Transaction data encoded in hexadecimal (byte-for-byte). // */ // private String data; // // /** // * If provided and true, this transaction must be in the final block. // */ // @JsonInclude(Include.NON_NULL) // private Boolean required; // // /** // * Hash/id encoded in little-endian hexadecimal. // */ // private String hash; // // /** // * Other transactions before this one (by 1-based index in "transactions" // * list) that must be present in the final block if this one is; if key is // * not present, dependencies are unknown and clients MUST NOT assume there // * aren't any. // */ // @JsonInclude(Include.NON_NULL) // private Integer[] depends; // // /** // * Fee in Satoshis. // * <p> // * Difference in value between transaction inputs and outputs (in Satoshis); // * for coinbase transactions, this is a negative Number of the total // * collected block fees (ie, not including the block subsidy); if key is not // * present, fee is unknown and clients MUST NOT assume there isn't one. // */ // @JsonInclude(Include.NON_NULL) // private Long fee; // // /** // * Total number of SigOps, as counted for purposes of block limits; if key // * is not present, sigop count is unknown and clients MUST NOT assume there // * aren't any. // */ // @JsonInclude(Include.NON_NULL) // private Integer sigops; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetBlockTemplateResult.java import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.client.Transaction; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getBlockTemplate method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "version", "previousblockhash", "transactions", "coinbaseaux", "coinbasetxn", "coinbasevalue", "target", "mintime", "mutable", "noncerange", "sigoplimit", "sizelimit", "curtime", "bits", "height", "workid" })
public class GetBlockTemplateResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetBlockTemplateResult.java
// Path: src/main/java/dk/clanie/bitcoin/client/Transaction.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({ // "data", // "hash", // "required", // "depends", // "fee", // "sigops" // }) // public class Transaction extends JsonExtra { // // /** // * Transaction data encoded in hexadecimal (byte-for-byte). // */ // private String data; // // /** // * If provided and true, this transaction must be in the final block. // */ // @JsonInclude(Include.NON_NULL) // private Boolean required; // // /** // * Hash/id encoded in little-endian hexadecimal. // */ // private String hash; // // /** // * Other transactions before this one (by 1-based index in "transactions" // * list) that must be present in the final block if this one is; if key is // * not present, dependencies are unknown and clients MUST NOT assume there // * aren't any. // */ // @JsonInclude(Include.NON_NULL) // private Integer[] depends; // // /** // * Fee in Satoshis. // * <p> // * Difference in value between transaction inputs and outputs (in Satoshis); // * for coinbase transactions, this is a negative Number of the total // * collected block fees (ie, not including the block subsidy); if key is not // * present, fee is unknown and clients MUST NOT assume there isn't one. // */ // @JsonInclude(Include.NON_NULL) // private Long fee; // // /** // * Total number of SigOps, as counted for purposes of block limits; if key // * is not present, sigop count is unknown and clients MUST NOT assume there // * aren't any. // */ // @JsonInclude(Include.NON_NULL) // private Integer sigops; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.client.Transaction; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getBlockTemplate method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "version", "previousblockhash", "transactions", "coinbaseaux", "coinbasetxn", "coinbasevalue", "target", "mintime", "mutable", "noncerange", "sigoplimit", "sizelimit", "curtime", "bits", "height", "workid" }) public class GetBlockTemplateResult extends JsonExtra { /** * Block version. */ private Integer version; /** * Hash of current highest block. */ @JsonProperty("previousblockhash") private String previousBlockHash; /** * Contents of non-coinbase transactions that should be included in the next * block. */
// Path: src/main/java/dk/clanie/bitcoin/client/Transaction.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({ // "data", // "hash", // "required", // "depends", // "fee", // "sigops" // }) // public class Transaction extends JsonExtra { // // /** // * Transaction data encoded in hexadecimal (byte-for-byte). // */ // private String data; // // /** // * If provided and true, this transaction must be in the final block. // */ // @JsonInclude(Include.NON_NULL) // private Boolean required; // // /** // * Hash/id encoded in little-endian hexadecimal. // */ // private String hash; // // /** // * Other transactions before this one (by 1-based index in "transactions" // * list) that must be present in the final block if this one is; if key is // * not present, dependencies are unknown and clients MUST NOT assume there // * aren't any. // */ // @JsonInclude(Include.NON_NULL) // private Integer[] depends; // // /** // * Fee in Satoshis. // * <p> // * Difference in value between transaction inputs and outputs (in Satoshis); // * for coinbase transactions, this is a negative Number of the total // * collected block fees (ie, not including the block subsidy); if key is not // * present, fee is unknown and clients MUST NOT assume there isn't one. // */ // @JsonInclude(Include.NON_NULL) // private Long fee; // // /** // * Total number of SigOps, as counted for purposes of block limits; if key // * is not present, sigop count is unknown and clients MUST NOT assume there // * aren't any. // */ // @JsonInclude(Include.NON_NULL) // private Integer sigops; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetBlockTemplateResult.java import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.client.Transaction; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getBlockTemplate method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "version", "previousblockhash", "transactions", "coinbaseaux", "coinbasetxn", "coinbasevalue", "target", "mintime", "mutable", "noncerange", "sigoplimit", "sizelimit", "curtime", "bits", "height", "workid" }) public class GetBlockTemplateResult extends JsonExtra { /** * Block version. */ private Integer version; /** * Hash of current highest block. */ @JsonProperty("previousblockhash") private String previousBlockHash; /** * Contents of non-coinbase transactions that should be included in the next * block. */
private Transaction[] transactions;
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetRawTransactionResult.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getRawTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hex", "txid", "version", "locktime", "vin", "vout", "blockhash", "confirmations", "time", "blocktime" })
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetRawTransactionResult.java import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getRawTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hex", "txid", "version", "locktime", "vin", "vout", "blockhash", "confirmations", "time", "blocktime" })
public class GetRawTransactionResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetRawTransactionResult.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getRawTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hex", "txid", "version", "locktime", "vin", "vout", "blockhash", "confirmations", "time", "blocktime" }) public class GetRawTransactionResult extends JsonExtra { private String hex; @JsonProperty("txid") private String txId; public Integer version; @JsonProperty("locktime") private Integer lockTime; @JsonProperty("vin")
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetRawTransactionResult.java import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getRawTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hex", "txid", "version", "locktime", "vin", "vout", "blockhash", "confirmations", "time", "blocktime" }) public class GetRawTransactionResult extends JsonExtra { private String hex; @JsonProperty("txid") private String txId; public Integer version; @JsonProperty("locktime") private Integer lockTime; @JsonProperty("vin")
private TransactionInput[] txInputs;
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetRawTransactionResult.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getRawTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hex", "txid", "version", "locktime", "vin", "vout", "blockhash", "confirmations", "time", "blocktime" }) public class GetRawTransactionResult extends JsonExtra { private String hex; @JsonProperty("txid") private String txId; public Integer version; @JsonProperty("locktime") private Integer lockTime; @JsonProperty("vin") private TransactionInput[] txInputs; @JsonProperty("vout")
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetRawTransactionResult.java import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getRawTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hex", "txid", "version", "locktime", "vin", "vout", "blockhash", "confirmations", "time", "blocktime" }) public class GetRawTransactionResult extends JsonExtra { private String hex; @JsonProperty("txid") private String txId; public Integer version; @JsonProperty("locktime") private Integer lockTime; @JsonProperty("vin") private TransactionInput[] txInputs; @JsonProperty("vout")
private TransactionOutput[] txOutputs;
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.client; /** * Indicates that an HTTP 400-series (client error) status was received from the server. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class BitcoinClientException extends BitcoinException {
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.client; /** * Indicates that an HTTP 400-series (client error) status was received from the server. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class BitcoinClientException extends BitcoinException {
public BitcoinClientException(BitcoindErrorResponse errorResponse) {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetWorkResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getWork method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "data", "target" }) @JsonIgnoreProperties({"midstate", "hash1"})
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetWorkResult.java import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getWork method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "data", "target" }) @JsonIgnoreProperties({"midstate", "hash1"})
public class GetWorkResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/Transaction.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra;
/* * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client; /** * A bitcoin transaction. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "data", "hash", "required", "depends", "fee", "sigops" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/Transaction.java import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra; /* * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client; /** * A bitcoin transaction. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "data", "hash", "required", "depends", "fee", "sigops" })
public class Transaction extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/TransactionDetail.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * @author Claus Nielsen * */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "account", "address", "category", "amount", "fee" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/TransactionDetail.java import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * @author Claus Nielsen * */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "account", "address", "category", "amount", "fee" })
public class TransactionDetail extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/ListLockUnspentResponse.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionOutputRef.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({"txid", "vout"}) // public class TransactionOutputRef extends BaseClass { // // @JsonProperty("txid") // private String txId; // // @JsonProperty("vout") // private Integer vout; // // /** // * Full constructor. // * // * @param txId - transaction id. // * @param vout - output number. // */ // public TransactionOutputRef(@JsonProperty("txid") String txId, @JsonProperty("vout") Integer vout) { // this.txId = txId; // this.vout = vout; // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.TransactionOutputRef;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Response object returned by BitconidClient's listLockUnspent method. * * Holds an array of {@link TransactionOutputRef} objects, each a reference to * one temporarily unspendable transaction output. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
// Path: src/main/java/dk/clanie/bitcoin/TransactionOutputRef.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({"txid", "vout"}) // public class TransactionOutputRef extends BaseClass { // // @JsonProperty("txid") // private String txId; // // @JsonProperty("vout") // private Integer vout; // // /** // * Full constructor. // * // * @param txId - transaction id. // * @param vout - output number. // */ // public TransactionOutputRef(@JsonProperty("txid") String txId, @JsonProperty("vout") Integer vout) { // this.txId = txId; // this.vout = vout; // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/ListLockUnspentResponse.java import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.TransactionOutputRef; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Response object returned by BitconidClient's listLockUnspent method. * * Holds an array of {@link TransactionOutputRef} objects, each a reference to * one temporarily unspendable transaction output. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
public class ListLockUnspentResponse extends BitcoindJsonRpcResponse<TransactionOutputRef[]> {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/PeerInfo.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getPeerInfo method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "addr", "services", "lastsend", "lastrecv", "conntime", "version", "subver", "inbound", "releasetime", "startingheight", "banscore" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/PeerInfo.java import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getPeerInfo method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "addr", "services", "lastsend", "lastrecv", "conntime", "version", "subver", "inbound", "releasetime", "startingheight", "banscore" })
public class PeerInfo extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // }
import org.apache.commons.lang3.builder.ToStringBuilder; import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.exception.AbstractRuntimeException;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception; /** * Superclass for all exceptions thrown when a call to bitcoind fails. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class BitcoinException extends AbstractRuntimeException {
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java import org.apache.commons.lang3.builder.ToStringBuilder; import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.exception.AbstractRuntimeException; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception; /** * Superclass for all exceptions thrown when a call to bitcoind fails. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class BitcoinException extends AbstractRuntimeException {
private BitcoindErrorResponse errorResponse = null;
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/DecodeRawTransactionResult.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Decoded raw transaction. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "txid", "version", "locktime", "vin", "vout" })
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/DecodeRawTransactionResult.java import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Decoded raw transaction. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "txid", "version", "locktime", "vin", "vout" })
public class DecodeRawTransactionResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/DecodeRawTransactionResult.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Decoded raw transaction. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "txid", "version", "locktime", "vin", "vout" }) public class DecodeRawTransactionResult extends JsonExtra { @JsonProperty("txid") private String txId; private Integer version; private Integer locktime; @JsonProperty("vin")
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/DecodeRawTransactionResult.java import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Decoded raw transaction. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "txid", "version", "locktime", "vin", "vout" }) public class DecodeRawTransactionResult extends JsonExtra { @JsonProperty("txid") private String txId; private Integer version; private Integer locktime; @JsonProperty("vin")
private TransactionInput[] txInputs;
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/DecodeRawTransactionResult.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Decoded raw transaction. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "txid", "version", "locktime", "vin", "vout" }) public class DecodeRawTransactionResult extends JsonExtra { @JsonProperty("txid") private String txId; private Integer version; private Integer locktime; @JsonProperty("vin") private TransactionInput[] txInputs; @JsonProperty("vout")
// Path: src/main/java/dk/clanie/bitcoin/TransactionInput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionInput extends BaseClass { // // @JsonUnwrapped // private TransactionOutputRef txRef; // // private ScriptSig scriptSig; // private Long sequence; // // } // // Path: src/main/java/dk/clanie/bitcoin/TransactionOutput.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class TransactionOutput extends BaseClass { // // private BigDecimal value; // private Integer n; // private ScriptPubKey scriptPubKey; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/DecodeRawTransactionResult.java import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.TransactionInput; import dk.clanie.bitcoin.TransactionOutput; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Decoded raw transaction. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "txid", "version", "locktime", "vin", "vout" }) public class DecodeRawTransactionResult extends JsonExtra { @JsonProperty("txid") private String txId; private Integer version; private Integer locktime; @JsonProperty("vin") private TransactionInput[] txInputs; @JsonProperty("vout")
private TransactionOutput[] txOutputs;
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/ValidateAddressResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by validateAddress. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "isvalid", "address", "ismine", "isscript", "pubkey", "iscompressed", "account" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/ValidateAddressResult.java import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by validateAddress. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "isvalid", "address", "ismine", "isscript", "pubkey", "iscompressed", "account" })
public class ValidateAddressResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/ListUnspentResult.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionOutputRef.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({"txid", "vout"}) // public class TransactionOutputRef extends BaseClass { // // @JsonProperty("txid") // private String txId; // // @JsonProperty("vout") // private Integer vout; // // /** // * Full constructor. // * // * @param txId - transaction id. // * @param vout - output number. // */ // public TransactionOutputRef(@JsonProperty("txid") String txId, @JsonProperty("vout") Integer vout) { // this.txId = txId; // this.vout = vout; // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonUnwrapped; import dk.clanie.bitcoin.TransactionOutputRef; import dk.clanie.bitcoin.json.JsonExtra;
/* Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about one unspent transaction output. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
// Path: src/main/java/dk/clanie/bitcoin/TransactionOutputRef.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({"txid", "vout"}) // public class TransactionOutputRef extends BaseClass { // // @JsonProperty("txid") // private String txId; // // @JsonProperty("vout") // private Integer vout; // // /** // * Full constructor. // * // * @param txId - transaction id. // * @param vout - output number. // */ // public TransactionOutputRef(@JsonProperty("txid") String txId, @JsonProperty("vout") Integer vout) { // this.txId = txId; // this.vout = vout; // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/ListUnspentResult.java import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonUnwrapped; import dk.clanie.bitcoin.TransactionOutputRef; import dk.clanie.bitcoin.json.JsonExtra; /* Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about one unspent transaction output. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
public class ListUnspentResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/ListUnspentResult.java
// Path: src/main/java/dk/clanie/bitcoin/TransactionOutputRef.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({"txid", "vout"}) // public class TransactionOutputRef extends BaseClass { // // @JsonProperty("txid") // private String txId; // // @JsonProperty("vout") // private Integer vout; // // /** // * Full constructor. // * // * @param txId - transaction id. // * @param vout - output number. // */ // public TransactionOutputRef(@JsonProperty("txid") String txId, @JsonProperty("vout") Integer vout) { // this.txId = txId; // this.vout = vout; // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonUnwrapped; import dk.clanie.bitcoin.TransactionOutputRef; import dk.clanie.bitcoin.json.JsonExtra;
/* Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about one unspent transaction output. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) public class ListUnspentResult extends JsonExtra { @JsonUnwrapped
// Path: src/main/java/dk/clanie/bitcoin/TransactionOutputRef.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // @JsonPropertyOrder({"txid", "vout"}) // public class TransactionOutputRef extends BaseClass { // // @JsonProperty("txid") // private String txId; // // @JsonProperty("vout") // private Integer vout; // // /** // * Full constructor. // * // * @param txId - transaction id. // * @param vout - output number. // */ // public TransactionOutputRef(@JsonProperty("txid") String txId, @JsonProperty("vout") Integer vout) { // this.txId = txId; // this.vout = vout; // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/ListUnspentResult.java import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonUnwrapped; import dk.clanie.bitcoin.TransactionOutputRef; import dk.clanie.bitcoin.json.JsonExtra; /* Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about one unspent transaction output. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) public class ListUnspentResult extends JsonExtra { @JsonUnwrapped
private TransactionOutputRef txRef;
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/ListSinceBlockResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's sistSinceBlock method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "transactions", "lastblock" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/ListSinceBlockResult.java import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's sistSinceBlock method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "transactions", "lastblock" })
public class ListSinceBlockResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/ListReceivedByAccountResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Amount received by an account. * * BitcoindClient.listReceivedByAccountResult returns an array with one of these * for each account. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/ListReceivedByAccountResult.java import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Amount received by an account. * * BitcoindClient.listReceivedByAccountResult returns an array with one of these * for each account. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
public class ListReceivedByAccountResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetTxOutSetInfoResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getTxOutSetInfo method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "bestblock", "transactions", "txouts", "bytes_serialized" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetTxOutSetInfoResult.java import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getTxOutSetInfo method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "bestblock", "transactions", "txouts", "bytes_serialized" })
public class GetTxOutSetInfoResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.client; /** * Thrown when calling a non-existing json-rpc method. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class MethodNotFoundException extends BitcoinClientException {
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.client; /** * Thrown when calling a non-existing json-rpc method. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class MethodNotFoundException extends BitcoinClientException {
public MethodNotFoundException(BitcoindErrorResponse errorResponse) {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/CreateMultiSigResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's createMultiSig method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/CreateMultiSigResult.java import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's createMultiSig method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
public class CreateMultiSigResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.server; /** * Indicates that an HTTP 500-series (server error) status was received from the server. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class BitcoinServerException extends BitcoinException {
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.server; /** * Indicates that an HTTP 500-series (server error) status was received from the server. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class BitcoinServerException extends BitcoinException {
public BitcoinServerException(BitcoindErrorResponse errorResponse) {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/BitcoindJsonRpcErrorHandler.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java // @SuppressWarnings("serial") // public class BitcoinClientException extends BitcoinException { // // public BitcoinClientException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java // @SuppressWarnings("serial") // public class MethodNotFoundException extends BitcoinClientException { // // // public MethodNotFoundException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java // @SuppressWarnings("serial") // public class BitcoinServerException extends BitcoinException { // // public BitcoinServerException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java // @SuppressWarnings("serial") // public class InvalidAddressException extends BitcoinServerException { // // // public InvalidAddressException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java // @SuppressWarnings("serial") // public class WalletEncryptionException extends BitcoinServerException { // // // public WalletEncryptionException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; import dk.clanie.bitcoin.exception.client.BitcoinClientException; import dk.clanie.bitcoin.exception.client.MethodNotFoundException; import dk.clanie.bitcoin.exception.server.BitcoinServerException; import dk.clanie.bitcoin.exception.server.InvalidAddressException; import dk.clanie.bitcoin.exception.server.WalletEncryptionException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.FileCopyUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.UnknownHttpStatusCodeException; import com.fasterxml.jackson.databind.ObjectMapper;
/* * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client; /** * Handles error responses from bitcoind. * <p> * When bitcoind returns an client- or server-error response (an HTTP 4xx * or 5xx response) this handler will throw an BitcoinClient- or * BitcoinServerException including the response body as an {@link * BitcoindErrorResponse}.<br> * If the response body isn't valid JSON, or if parsing it fails for * any reason, an BitcoinException is thrown. It will indicate which * HTTP status code was received. * <p> * In case of other HTTP errors an BitcoinException is also thrown. It * will <b>not</b> include the response body, but it will include * whatever exception Spring's {@link DefaultResponseErrorHandler} would * have thrown as it's cause. * * @author Claus Nielsen */ public class BitcoindJsonRpcErrorHandler extends DefaultResponseErrorHandler { private static final ObjectMapper objectMapper = new ObjectMapper(); public void handleError(ClientHttpResponse response) throws IOException { HttpStatus statusCode = getHttpStatusCode(response); switch (statusCode.series()) { case SERVER_ERROR: {
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java // @SuppressWarnings("serial") // public class BitcoinClientException extends BitcoinException { // // public BitcoinClientException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java // @SuppressWarnings("serial") // public class MethodNotFoundException extends BitcoinClientException { // // // public MethodNotFoundException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java // @SuppressWarnings("serial") // public class BitcoinServerException extends BitcoinException { // // public BitcoinServerException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java // @SuppressWarnings("serial") // public class InvalidAddressException extends BitcoinServerException { // // // public InvalidAddressException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java // @SuppressWarnings("serial") // public class WalletEncryptionException extends BitcoinServerException { // // // public WalletEncryptionException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/BitcoindJsonRpcErrorHandler.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; import dk.clanie.bitcoin.exception.client.BitcoinClientException; import dk.clanie.bitcoin.exception.client.MethodNotFoundException; import dk.clanie.bitcoin.exception.server.BitcoinServerException; import dk.clanie.bitcoin.exception.server.InvalidAddressException; import dk.clanie.bitcoin.exception.server.WalletEncryptionException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.FileCopyUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.UnknownHttpStatusCodeException; import com.fasterxml.jackson.databind.ObjectMapper; /* * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client; /** * Handles error responses from bitcoind. * <p> * When bitcoind returns an client- or server-error response (an HTTP 4xx * or 5xx response) this handler will throw an BitcoinClient- or * BitcoinServerException including the response body as an {@link * BitcoindErrorResponse}.<br> * If the response body isn't valid JSON, or if parsing it fails for * any reason, an BitcoinException is thrown. It will indicate which * HTTP status code was received. * <p> * In case of other HTTP errors an BitcoinException is also thrown. It * will <b>not</b> include the response body, but it will include * whatever exception Spring's {@link DefaultResponseErrorHandler} would * have thrown as it's cause. * * @author Claus Nielsen */ public class BitcoindJsonRpcErrorHandler extends DefaultResponseErrorHandler { private static final ObjectMapper objectMapper = new ObjectMapper(); public void handleError(ClientHttpResponse response) throws IOException { HttpStatus statusCode = getHttpStatusCode(response); switch (statusCode.series()) { case SERVER_ERROR: {
BitcoindErrorResponse errorResponse = parseResponse(response, statusCode);
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/BitcoindJsonRpcErrorHandler.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java // @SuppressWarnings("serial") // public class BitcoinClientException extends BitcoinException { // // public BitcoinClientException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java // @SuppressWarnings("serial") // public class MethodNotFoundException extends BitcoinClientException { // // // public MethodNotFoundException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java // @SuppressWarnings("serial") // public class BitcoinServerException extends BitcoinException { // // public BitcoinServerException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java // @SuppressWarnings("serial") // public class InvalidAddressException extends BitcoinServerException { // // // public InvalidAddressException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java // @SuppressWarnings("serial") // public class WalletEncryptionException extends BitcoinServerException { // // // public WalletEncryptionException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; import dk.clanie.bitcoin.exception.client.BitcoinClientException; import dk.clanie.bitcoin.exception.client.MethodNotFoundException; import dk.clanie.bitcoin.exception.server.BitcoinServerException; import dk.clanie.bitcoin.exception.server.InvalidAddressException; import dk.clanie.bitcoin.exception.server.WalletEncryptionException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.FileCopyUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.UnknownHttpStatusCodeException; import com.fasterxml.jackson.databind.ObjectMapper;
case -4: // Private key for address <bitcoinaddress> is not known // Wallet backup failed! // Error adding key to wallet throw new BitcoinServerException(errorResponse); case -5: // Invalid Bitcoin address throw new InvalidAddressException(errorResponse); case -13: // Error: Please enter the wallet passphrase with walletpassphrase first. throw new BitcoinServerException(errorResponse); case -14: // Error: The wallet passphrase entered was incorrect. throw new BitcoinServerException(errorResponse); case -15: // Error: running with an unencrypted wallet, but walletpassphrasechange was called. // Error: running with an encrypted wallet, but encryptwallet was called. throw new WalletEncryptionException(errorResponse); case -17: // Error: Wallet is already unlocked. throw new BitcoinServerException(errorResponse); default: throw new BitcoinServerException(errorResponse); } } case CLIENT_ERROR: { BitcoindErrorResponse errorResponse = parseResponse(response, statusCode); switch (errorResponse.getError().getCode()) { case -32601: // Method not found
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java // @SuppressWarnings("serial") // public class BitcoinClientException extends BitcoinException { // // public BitcoinClientException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java // @SuppressWarnings("serial") // public class MethodNotFoundException extends BitcoinClientException { // // // public MethodNotFoundException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java // @SuppressWarnings("serial") // public class BitcoinServerException extends BitcoinException { // // public BitcoinServerException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java // @SuppressWarnings("serial") // public class InvalidAddressException extends BitcoinServerException { // // // public InvalidAddressException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java // @SuppressWarnings("serial") // public class WalletEncryptionException extends BitcoinServerException { // // // public WalletEncryptionException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/BitcoindJsonRpcErrorHandler.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; import dk.clanie.bitcoin.exception.client.BitcoinClientException; import dk.clanie.bitcoin.exception.client.MethodNotFoundException; import dk.clanie.bitcoin.exception.server.BitcoinServerException; import dk.clanie.bitcoin.exception.server.InvalidAddressException; import dk.clanie.bitcoin.exception.server.WalletEncryptionException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.FileCopyUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.UnknownHttpStatusCodeException; import com.fasterxml.jackson.databind.ObjectMapper; case -4: // Private key for address <bitcoinaddress> is not known // Wallet backup failed! // Error adding key to wallet throw new BitcoinServerException(errorResponse); case -5: // Invalid Bitcoin address throw new InvalidAddressException(errorResponse); case -13: // Error: Please enter the wallet passphrase with walletpassphrase first. throw new BitcoinServerException(errorResponse); case -14: // Error: The wallet passphrase entered was incorrect. throw new BitcoinServerException(errorResponse); case -15: // Error: running with an unencrypted wallet, but walletpassphrasechange was called. // Error: running with an encrypted wallet, but encryptwallet was called. throw new WalletEncryptionException(errorResponse); case -17: // Error: Wallet is already unlocked. throw new BitcoinServerException(errorResponse); default: throw new BitcoinServerException(errorResponse); } } case CLIENT_ERROR: { BitcoindErrorResponse errorResponse = parseResponse(response, statusCode); switch (errorResponse.getError().getCode()) { case -32601: // Method not found
throw new MethodNotFoundException(errorResponse);
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/BitcoindJsonRpcErrorHandler.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java // @SuppressWarnings("serial") // public class BitcoinClientException extends BitcoinException { // // public BitcoinClientException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java // @SuppressWarnings("serial") // public class MethodNotFoundException extends BitcoinClientException { // // // public MethodNotFoundException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java // @SuppressWarnings("serial") // public class BitcoinServerException extends BitcoinException { // // public BitcoinServerException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java // @SuppressWarnings("serial") // public class InvalidAddressException extends BitcoinServerException { // // // public InvalidAddressException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java // @SuppressWarnings("serial") // public class WalletEncryptionException extends BitcoinServerException { // // // public WalletEncryptionException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; import dk.clanie.bitcoin.exception.client.BitcoinClientException; import dk.clanie.bitcoin.exception.client.MethodNotFoundException; import dk.clanie.bitcoin.exception.server.BitcoinServerException; import dk.clanie.bitcoin.exception.server.InvalidAddressException; import dk.clanie.bitcoin.exception.server.WalletEncryptionException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.FileCopyUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.UnknownHttpStatusCodeException; import com.fasterxml.jackson.databind.ObjectMapper;
// Wallet backup failed! // Error adding key to wallet throw new BitcoinServerException(errorResponse); case -5: // Invalid Bitcoin address throw new InvalidAddressException(errorResponse); case -13: // Error: Please enter the wallet passphrase with walletpassphrase first. throw new BitcoinServerException(errorResponse); case -14: // Error: The wallet passphrase entered was incorrect. throw new BitcoinServerException(errorResponse); case -15: // Error: running with an unencrypted wallet, but walletpassphrasechange was called. // Error: running with an encrypted wallet, but encryptwallet was called. throw new WalletEncryptionException(errorResponse); case -17: // Error: Wallet is already unlocked. throw new BitcoinServerException(errorResponse); default: throw new BitcoinServerException(errorResponse); } } case CLIENT_ERROR: { BitcoindErrorResponse errorResponse = parseResponse(response, statusCode); switch (errorResponse.getError().getCode()) { case -32601: // Method not found throw new MethodNotFoundException(errorResponse); default:
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java // @SuppressWarnings("serial") // public class BitcoinClientException extends BitcoinException { // // public BitcoinClientException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java // @SuppressWarnings("serial") // public class MethodNotFoundException extends BitcoinClientException { // // // public MethodNotFoundException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java // @SuppressWarnings("serial") // public class BitcoinServerException extends BitcoinException { // // public BitcoinServerException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java // @SuppressWarnings("serial") // public class InvalidAddressException extends BitcoinServerException { // // // public InvalidAddressException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java // @SuppressWarnings("serial") // public class WalletEncryptionException extends BitcoinServerException { // // // public WalletEncryptionException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/BitcoindJsonRpcErrorHandler.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; import dk.clanie.bitcoin.exception.client.BitcoinClientException; import dk.clanie.bitcoin.exception.client.MethodNotFoundException; import dk.clanie.bitcoin.exception.server.BitcoinServerException; import dk.clanie.bitcoin.exception.server.InvalidAddressException; import dk.clanie.bitcoin.exception.server.WalletEncryptionException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.FileCopyUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.UnknownHttpStatusCodeException; import com.fasterxml.jackson.databind.ObjectMapper; // Wallet backup failed! // Error adding key to wallet throw new BitcoinServerException(errorResponse); case -5: // Invalid Bitcoin address throw new InvalidAddressException(errorResponse); case -13: // Error: Please enter the wallet passphrase with walletpassphrase first. throw new BitcoinServerException(errorResponse); case -14: // Error: The wallet passphrase entered was incorrect. throw new BitcoinServerException(errorResponse); case -15: // Error: running with an unencrypted wallet, but walletpassphrasechange was called. // Error: running with an encrypted wallet, but encryptwallet was called. throw new WalletEncryptionException(errorResponse); case -17: // Error: Wallet is already unlocked. throw new BitcoinServerException(errorResponse); default: throw new BitcoinServerException(errorResponse); } } case CLIENT_ERROR: { BitcoindErrorResponse errorResponse = parseResponse(response, statusCode); switch (errorResponse.getError().getCode()) { case -32601: // Method not found throw new MethodNotFoundException(errorResponse); default:
throw new BitcoinClientException(errorResponse);
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/BitcoindJsonRpcErrorHandler.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java // @SuppressWarnings("serial") // public class BitcoinClientException extends BitcoinException { // // public BitcoinClientException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java // @SuppressWarnings("serial") // public class MethodNotFoundException extends BitcoinClientException { // // // public MethodNotFoundException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java // @SuppressWarnings("serial") // public class BitcoinServerException extends BitcoinException { // // public BitcoinServerException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java // @SuppressWarnings("serial") // public class InvalidAddressException extends BitcoinServerException { // // // public InvalidAddressException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java // @SuppressWarnings("serial") // public class WalletEncryptionException extends BitcoinServerException { // // // public WalletEncryptionException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; import dk.clanie.bitcoin.exception.client.BitcoinClientException; import dk.clanie.bitcoin.exception.client.MethodNotFoundException; import dk.clanie.bitcoin.exception.server.BitcoinServerException; import dk.clanie.bitcoin.exception.server.InvalidAddressException; import dk.clanie.bitcoin.exception.server.WalletEncryptionException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.FileCopyUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.UnknownHttpStatusCodeException; import com.fasterxml.jackson.databind.ObjectMapper;
// Error: Please enter the wallet passphrase with walletpassphrase first. throw new BitcoinServerException(errorResponse); case -14: // Error: The wallet passphrase entered was incorrect. throw new BitcoinServerException(errorResponse); case -15: // Error: running with an unencrypted wallet, but walletpassphrasechange was called. // Error: running with an encrypted wallet, but encryptwallet was called. throw new WalletEncryptionException(errorResponse); case -17: // Error: Wallet is already unlocked. throw new BitcoinServerException(errorResponse); default: throw new BitcoinServerException(errorResponse); } } case CLIENT_ERROR: { BitcoindErrorResponse errorResponse = parseResponse(response, statusCode); switch (errorResponse.getError().getCode()) { case -32601: // Method not found throw new MethodNotFoundException(errorResponse); default: throw new BitcoinClientException(errorResponse); } } default: try { super.handleError(response); } catch (Exception cause) {
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/BitcoinException.java // @SuppressWarnings("serial") // public class BitcoinException extends AbstractRuntimeException { // // private BitcoindErrorResponse errorResponse = null; // // // protected BitcoinException(BitcoindErrorResponse errorResponse) { // super(errorResponse.getError().getMessage()); // this.errorResponse = errorResponse; // } // // // public BitcoinException(Exception cause) { // super(cause); // } // // // public BitcoinException(String message, Exception cause) { // super(message, cause); // } // // // /** // * Gets the whole response received from bitcoind. // * // * @return {@link BitcoindErrorResponse} - may be null. // */ // public BitcoindErrorResponse getErrorResponse() { // return errorResponse; // } // // // /** // * Gets the error code received from bitcoind. // * // * @return errorcode or null if no error code was received. // */ // public Integer getErrorCode() { // if (errorResponse == null || errorResponse.getError() == null) return null; // return errorResponse.getError().getCode(); // } // // // @Override // public String toString() { // return ToStringBuilder.reflectionToString(this); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/BitcoinClientException.java // @SuppressWarnings("serial") // public class BitcoinClientException extends BitcoinException { // // public BitcoinClientException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/client/MethodNotFoundException.java // @SuppressWarnings("serial") // public class MethodNotFoundException extends BitcoinClientException { // // // public MethodNotFoundException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/BitcoinServerException.java // @SuppressWarnings("serial") // public class BitcoinServerException extends BitcoinException { // // public BitcoinServerException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/InvalidAddressException.java // @SuppressWarnings("serial") // public class InvalidAddressException extends BitcoinServerException { // // // public InvalidAddressException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java // @SuppressWarnings("serial") // public class WalletEncryptionException extends BitcoinServerException { // // // public WalletEncryptionException(BitcoindErrorResponse errorResponse) { // super(errorResponse); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/BitcoindJsonRpcErrorHandler.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; import dk.clanie.bitcoin.exception.BitcoinException; import dk.clanie.bitcoin.exception.client.BitcoinClientException; import dk.clanie.bitcoin.exception.client.MethodNotFoundException; import dk.clanie.bitcoin.exception.server.BitcoinServerException; import dk.clanie.bitcoin.exception.server.InvalidAddressException; import dk.clanie.bitcoin.exception.server.WalletEncryptionException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.FileCopyUtils; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.UnknownHttpStatusCodeException; import com.fasterxml.jackson.databind.ObjectMapper; // Error: Please enter the wallet passphrase with walletpassphrase first. throw new BitcoinServerException(errorResponse); case -14: // Error: The wallet passphrase entered was incorrect. throw new BitcoinServerException(errorResponse); case -15: // Error: running with an unencrypted wallet, but walletpassphrasechange was called. // Error: running with an encrypted wallet, but encryptwallet was called. throw new WalletEncryptionException(errorResponse); case -17: // Error: Wallet is already unlocked. throw new BitcoinServerException(errorResponse); default: throw new BitcoinServerException(errorResponse); } } case CLIENT_ERROR: { BitcoindErrorResponse errorResponse = parseResponse(response, statusCode); switch (errorResponse.getError().getCode()) { case -32601: // Method not found throw new MethodNotFoundException(errorResponse); default: throw new BitcoinClientException(errorResponse); } } default: try { super.handleError(response); } catch (Exception cause) {
throw new BitcoinException(cause);
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // }
import dk.clanie.bitcoin.client.response.BitcoindErrorResponse;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.server; /** * Indicates that an operation could not be performed on the wallet because it wasn't encrypted. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class WalletEncryptionException extends BitcoinServerException {
// Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindErrorResponse.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class BitcoindErrorResponse extends BitcoindJsonRpcResponse<Object> { // // } // Path: src/main/java/dk/clanie/bitcoin/exception/server/WalletEncryptionException.java import dk.clanie.bitcoin.client.response.BitcoindErrorResponse; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.exception.server; /** * Indicates that an operation could not be performed on the wallet because it wasn't encrypted. * * @author Claus Nielsen */ @SuppressWarnings("serial") public class WalletEncryptionException extends BitcoinServerException {
public WalletEncryptionException(BitcoindErrorResponse errorResponse) {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/ListReceivedByAddressResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Amount received by an address. * * BitcoindClient.listReceivedByAccountAddress returns an array with one of these * for each address. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/ListReceivedByAddressResult.java import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Amount received by an address. * * BitcoindClient.listReceivedByAccountAddress returns an array with one of these * for each address. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
public class ListReceivedByAddressResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/BitcoindJsonRpcResponse.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * A bitcoind JSON RPC response. * * @author Claus Nielsen * * @param <RT> type of the result field. */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/BitcoindJsonRpcResponse.java import org.springframework.roo.addon.javabean.RooJavaBean; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * A bitcoind JSON RPC response. * * @author Claus Nielsen * * @param <RT> type of the result field. */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false)
public abstract class BitcoindJsonRpcResponse<RT> extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/TransactionData.java
// Path: src/main/java/dk/clanie/bitcoin/json/BigDecimalPlainSerializer.java // public class BigDecimalPlainSerializer extends JsonSerializer<BigDecimal> { // // @Override // public void serialize(BigDecimal value, JsonGenerator jgen, // SerializerProvider provider) throws IOException, // JsonProcessingException { // jgen.writeNumber(value.toPlainString()); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import dk.clanie.bitcoin.json.BigDecimalPlainSerializer; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about one transaction as returned by BitconidClient's listTransactions * and listSinceBlock methods. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "account", "address", "category", "amount", "fee", "confirmations", "generated", "blockhash", "blockindex", "blocktime", "txid", "time", "timereceived", "comment", "to" })
// Path: src/main/java/dk/clanie/bitcoin/json/BigDecimalPlainSerializer.java // public class BigDecimalPlainSerializer extends JsonSerializer<BigDecimal> { // // @Override // public void serialize(BigDecimal value, JsonGenerator jgen, // SerializerProvider provider) throws IOException, // JsonProcessingException { // jgen.writeNumber(value.toPlainString()); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/TransactionData.java import java.math.BigDecimal; import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import dk.clanie.bitcoin.json.BigDecimalPlainSerializer; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about one transaction as returned by BitconidClient's listTransactions * and listSinceBlock methods. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "account", "address", "category", "amount", "fee", "confirmations", "generated", "blockhash", "blockindex", "blocktime", "txid", "time", "timereceived", "comment", "to" })
public class TransactionData extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/TransactionData.java
// Path: src/main/java/dk/clanie/bitcoin/json/BigDecimalPlainSerializer.java // public class BigDecimalPlainSerializer extends JsonSerializer<BigDecimal> { // // @Override // public void serialize(BigDecimal value, JsonGenerator jgen, // SerializerProvider provider) throws IOException, // JsonProcessingException { // jgen.writeNumber(value.toPlainString()); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import dk.clanie.bitcoin.json.BigDecimalPlainSerializer; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about one transaction as returned by BitconidClient's listTransactions * and listSinceBlock methods. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "account", "address", "category", "amount", "fee", "confirmations", "generated", "blockhash", "blockindex", "blocktime", "txid", "time", "timereceived", "comment", "to" }) public class TransactionData extends JsonExtra { private String account; private String address; private String category;
// Path: src/main/java/dk/clanie/bitcoin/json/BigDecimalPlainSerializer.java // public class BigDecimalPlainSerializer extends JsonSerializer<BigDecimal> { // // @Override // public void serialize(BigDecimal value, JsonGenerator jgen, // SerializerProvider provider) throws IOException, // JsonProcessingException { // jgen.writeNumber(value.toPlainString()); // } // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/TransactionData.java import java.math.BigDecimal; import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import dk.clanie.bitcoin.json.BigDecimalPlainSerializer; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about one transaction as returned by BitconidClient's listTransactions * and listSinceBlock methods. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "account", "address", "category", "amount", "fee", "confirmations", "generated", "blockhash", "blockindex", "blocktime", "txid", "time", "timereceived", "comment", "to" }) public class TransactionData extends JsonExtra { private String account; private String address; private String category;
@JsonSerialize(using = BigDecimalPlainSerializer.class)
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetBlockResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getBlock method * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hash", "confirmations", "size", "height", "version", "merkleroot", "tx", "time", "nonce", "bits", "difficulty", "previousblockhash", "nextblockhash" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetBlockResult.java import java.math.BigDecimal; import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getBlock method * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hash", "confirmations", "size", "height", "version", "merkleroot", "tx", "time", "nonce", "bits", "difficulty", "previousblockhash", "nextblockhash" })
public class GetBlockResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/SignRawTransactionResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's BitcoindClient's signRawTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hex", "complete" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/SignRawTransactionResult.java import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's BitcoindClient's signRawTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "hex", "complete" })
public class SignRawTransactionResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/AddedNodeAddressInfo.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "address", "connected" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/AddedNodeAddressInfo.java import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "address", "connected" })
public class AddedNodeAddressInfo extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetMiningInfoResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getMiningInfo method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "blocks", "currentblocksize", "currentblocktx", "difficulty", "errors", "generate", "genproclimit", "hashespersec", "pooledtx", "testnet" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetMiningInfoResult.java import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data returned by BitcoindClient's getMiningInfo method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "blocks", "currentblocksize", "currentblocktx", "difficulty", "errors", "generate", "genproclimit", "hashespersec", "pooledtx", "testnet" })
public class GetMiningInfoResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetTransactionResult.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about a transaction as returned by BitcoindClient's getTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "amount", "confirmations", "blockhash", "blockindex", "blocktime", "txid", "time", "timereceived", "details" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetTransactionResult.java import java.math.BigDecimal; import java.util.Date; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about a transaction as returned by BitcoindClient's getTransaction method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "amount", "confirmations", "blockhash", "blockindex", "blocktime", "txid", "time", "timereceived", "details" })
public class GetTransactionResult extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/AddedNodeInfo.java
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Information about an added node. * <p> * An array of these are returned by BitcoindClients getAddedNodeInfo method. * Connected information is only available if getAddedNodeInfo was called with * <code>dns=true</code>. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "addednode", "connected", "addresses" })
// Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/AddedNodeInfo.java import dk.clanie.bitcoin.json.JsonExtra; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Information about an added node. * <p> * An array of these are returned by BitcoindClients getAddedNodeInfo method. * Connected information is only available if getAddedNodeInfo was called with * <code>dns=true</code>. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "addednode", "connected", "addresses" })
public class AddedNodeInfo extends JsonExtra {
clanie/bitcoind-client
src/main/java/dk/clanie/bitcoin/client/response/GetTxOutResult.java
// Path: src/main/java/dk/clanie/bitcoin/ScriptPubKey.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class ScriptPubKey extends BaseClass { // // private String asm; // private String hex; // private Integer reqSigs; // private String type; // private List<String> addresses; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // }
import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.ScriptPubKey; import dk.clanie.bitcoin.json.JsonExtra;
/** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about a transaction output as returned by BitcoindClient's getTxOut method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "bestblock", "confirmations", "value", "scriptPubKey", "version", "coinbase" })
// Path: src/main/java/dk/clanie/bitcoin/ScriptPubKey.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public class ScriptPubKey extends BaseClass { // // private String asm; // private String hex; // private Integer reqSigs; // private String type; // private List<String> addresses; // // } // // Path: src/main/java/dk/clanie/bitcoin/json/JsonExtra.java // @SuppressWarnings("serial") // @RooJavaBean(settersByDefault = false) // public abstract class JsonExtra extends BaseClass { // // private Map<String, Object> otherFields = newHashMap(); // // /** // * Sets name and value of other (unknown) JSON fields. // * // * @param field // * @param value // */ // @JsonAnySetter // @SuppressWarnings("unused") // Is used by Jackson // private void set(String field, Object value) { // otherFields.put(field, value); // } // // // /** // * Gets names and values of all other (unknown) JSON fields. // * // * @return Names and values of other fields available. // */ // @JsonAnyGetter // public Map<String, Object> getOtherFields() { // return Collections.unmodifiableMap(otherFields); // } // // // } // Path: src/main/java/dk/clanie/bitcoin/client/response/GetTxOutResult.java import java.math.BigDecimal; import org.springframework.roo.addon.javabean.RooJavaBean; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import dk.clanie.bitcoin.ScriptPubKey; import dk.clanie.bitcoin.json.JsonExtra; /** * Copyright (C) 2013, Claus Nielsen, [email protected] * * 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 3 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 dk.clanie.bitcoin.client.response; /** * Data about a transaction output as returned by BitcoindClient's getTxOut method. * * @author Claus Nielsen */ @SuppressWarnings("serial") @RooJavaBean(settersByDefault = false) @JsonPropertyOrder({ "bestblock", "confirmations", "value", "scriptPubKey", "version", "coinbase" })
public class GetTxOutResult extends JsonExtra {