text stringlengths 3 1.18M |
|---|
package common;
class TODOs {
// TODO change all equals of IHASids to jsonobject tests
// TODO change the way events are differentiated from messages in the DB
// TODO change logging to composite logging
// TODO change past in registrations
// TODO add count number of voters
} |
package common;
/**
* A basic pair object
*
* @author Gal Lalouche
* @param <First> The first type
* @param <Second> The second type
*/
public class Pair<First, Second> {
/**
* The first object in the pair
*/
public final First first;
/**
* The second object in the pair
*/
public fi... |
package common;
/**
* A wrapper that allows "final" elements to be changed because Java is <i>stupid</i>
*
* @author Gal Lalouche
* @param <T> The type of the element wrapped
*/
public class MutableWrapper<T> {
private T element;
/**
* Creates new MutableWrapper with no element
*/
public M... |
package common;
import java.text.MessageFormat;
/**
* A basic triplet object
*
* @author Gal Lalouche
* @param <First> The first type
* @param <Second> The second type
* @param <Third> Third type
*/
public class Triple<First, Second, Third> {
/**
* The first object in the triple
*/
publi... |
package registration.servlet;
import java.net.*;
import java.sql.SQLException;
import java.util.Collection;
import javax.annotation.Resource;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import javax.ws.rs.core.Response.Status;
import msg.*;
import msg.xml.XMLTransformer;
import org.json.*;
impor... |
package registration.servlet;
import java.net.*;
import java.sql.SQLException;
import java.util.Collection;
import javax.annotation.Resource;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import javax.ws.rs.core.Response.Status;
import org.json.*;
import registration.Consensus;
import user.User;
i... |
package registration;
import java.sql.*;
import java.util.*;
import msg.*;
import user.*;
import common.Pair;
import common.dal.*;
import common.dal.SQLDataColumn.Constraints;
import common.exceptions.*;
import common.interfaces.IEventRegistration;
class DBEventRegister extends AbstractPersistent impl... |
package registration;
import java.sql.*;
import java.util.*;
import user.*;
import common.Pair;
import common.dal.*;
import common.dal.SQLDataColumn.Constraints;
import common.exceptions.*;
import common.extensions.*;
import common.interfaces.IVoteManager;
class DBVoteManager extends AbstractPersisten... |
package registration;
import java.sql.*;
import java.util.*;
import msg.*;
import common.Pair;
import common.dal.*;
import common.dal.SQLDataColumn.Constraints;
import common.exceptions.*;
import common.interfaces.IConsensusManager;
class DBConsensusManager extends AbstractDAL<Consensus, Long> implemen... |
package registration;
import msg.EventMessage;
import common.interfaces.AbstractHasID;
/**
* A question asked of an event, that all participants must reach a consensus on
*
* @author Gal Lalouche
*/
public class Consensus extends AbstractHasID<Long> {
private final long id;
private final String... |
package registration;
import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import msg.*;
import user.User;
import common.*;
import common.dal.Transaction;
import common.exceptions.*;
import common.extensions.*;
import common.interfaces.*;
/**
* A class th... |
package ws.servlet;
import java.rmi.RemoteException;
import java.util.*;
import org.json.*;
import ws.search.SearchWSProxy;
import cs236369.hw5.SearchWS;
class KeywordsSearcher implements WSSearcher {
private final String[] keywords;
private KeywordsSearcher(JSONArray array) {
Collection<String>... |
package ws.servlet;
import java.rmi.RemoteException;
import javax.annotation.Resource;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import org.json.*;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import ws.reg.*;
import common.logger.*;
import common.logger.Logger.LogLev... |
package ws.servlet;
import java.rmi.RemoteException;
import org.json.*;
interface WSSearcher {
WSSearcher build(JSONObject parameters) throws JSONException;
String[] search(String endpoint) throws RemoteException;
} |
package ws.servlet;
import java.rmi.RemoteException;
import org.json.JSONException;
import org.json.JSONObject;
import ws.search.SearchWSProxy;
import cs236369.hw5.SearchWS;
class LocalSearcher implements WSSearcher {
private final double locationX;
private final double locationY;
private final do... |
package ws.reg;
public class RegistrationServiceProxy implements RegistrationService {
private String _endpoint = null;
private RegistrationService registrationService = null;
public RegistrationServiceProxy() {
_initRegistrationServiceProxy();
}
public RegistrationServiceProxy(String endpoin... |
package ws.reg;
import java.util.Arrays;
public class RegistrationServiceClient {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
RegistrationService service = new RegistrationServiceProxy();
String[] endPoints = service.getRegisteredEndpoints();
System.out.pri... |
package ws.search;
import cs236369.hw5.SearchWS;
public class SearchWSProxy implements cs236369.hw5.SearchWS {
private String _endpoint = null;
private SearchWS searchWS = null;
public SearchWSProxy() {
_initSearchWSProxy();
}
public SearchWSProxy(String endpoint) {
_endpoint = endpoint;
... |
package cs236369.hw5;
import java.sql.SQLException;
import java.text.MessageFormat;
import java.util.*;
import msg.*;
import common.dal.Transaction;
import common.logger.*;
import common.logger.Logger.LogLevel;
/**
* Finds messages by location.<br>
* To be used by a Web Service
*
* @author Gal ... |
package cs236369.hw5;
import java.rmi.RemoteException;
import java.sql.SQLException;
@SuppressWarnings("javadoc")
public interface SearchWS extends java.rmi.Remote {
/**
* Searches for all messages in a given radius
*
* @param locationX The long coordinate
* @param locationY The lat coordinate
... |
package cs236369.hw5;
import java.sql.SQLException;
import java.text.MessageFormat;
import java.util.*;
import msg.*;
import common.dal.Transaction;
import common.extensions.*;
import common.logger.*;
import common.logger.Logger.LogLevel;
/**
* Finds messages by location.<br>
* To be used by a Web ... |
package org.json;
/*
Copyright (c) 2006 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, me... |
package org.json;
/*
* Copyright (c) 2002 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, mo... |
package org.json;
/*
* Copyright (c) 2002 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, mo... |
package org.json;
/**
* The JSONException is thrown by the JSON.org classes when things are amiss.
*
* @author JSON.org
* @version 2010-12-24
*/
@SuppressWarnings("all")
public class JSONException extends RuntimeException {
private static final long serialVersionUID = 0;
private Throwable cause;
... |
package org.json;
/**
* The <code>JSONString</code> interface allows a <code>toJSONString()</code>
* method so that a class can change the behavior of
* <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
* and <code>JSONWriter.value(</code>Object<code>)</code>. The
* <code>toJSONString... |
package org.json;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
/*
* Copyright (c) 2002 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this so... |
package org.json;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... |
package org.json;
import java.io.IOException;
import java.io.Writer;
/*
* Copyright (c) 2006 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, inclu... |
package org.json;
/*
* Copyright (c) 2002 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, m... |
package org.json;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... |
package org.json;
/*
* Copyright (c) 2002 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, mo... |
package org.json;
/*
* Copyright (c) 2002 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, m... |
package org.json;
/*
* Copyright (c) 2008 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, m... |
package org.json;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... |
package org.json;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import junit.framework.TestCase;
/*
* Copyright (c) 2002 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a... |
package org.json;
/*
* Copyright (c) 2002 JSON.org
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, m... |
package msg.servlet;
import java.net.*;
import java.sql.SQLException;
import java.util.Collection;
import javax.annotation.Resource;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import javax.ws.rs.core.Response.Status;
import msg.*;
import msg.xml.XMLTransformer;
import org.json.*;
import org.w3c... |
package msg;
import java.text.MessageFormat;
import java.util.*;
import user.User;
import common.interfaces.IMessageVisitor;
/**
* A message type with a capacity and a time
*
* @author Gal Lalouche
*/
public class EventMessage extends Message {
private final int capacity;
/**
* Creates ... |
package msg.services;
import static org.junit.Assert.*;
import msg.*;
import org.apache.catalina.tribes.util.Arrays;
import org.junit.*;
import user.*;
import common.DALTests;
import common.dal.Transaction;
import cs236369.hw5.*;
@SuppressWarnings({"javadoc", "static-method"})
public class Message... |
package msg;
import java.util.*;
import user.User;
import common.interfaces.*;
/**
* Represents a message with a location
*
* @author Gal Lalouche
*/
public class Message extends AbstractHasID<Long> {
private final long id;
private final Location location;
private final String content;
... |
package msg.visitors;
import msg.EventMessage;
import msg.Message;
import org.json.JSONObject;
import common.interfaces.IMessageVisitor;
/**
* Constructs a {@link JSONObject} of the message
*
* @author Gal Lalouche
*/
public class MessageToJson implements IMessageVisitor<JSONObject> {
@Override... |
package msg.visitors;
import msg.*;
import org.w3c.dom.*;
import common.interfaces.IMessageVisitor;
/**
* Creates an XML element of the message
*
* @author Gal Lalouche
*/
public class MessageToXML implements IMessageVisitor<Element> {
private final Document doc;
/**
* Creates a new inst... |
package msg.visitors;
import msg.*;
import common.interfaces.IMessageVisitor;
/**
* Check if a given message is an actual message or an event.<br>
* Returns <code>true</code> for {@link EventMessage} and <code>false</code> for {@link Message}
*
* @author Gal Lalouche
*/
public class EventCataloguer... |
package msg;
import java.sql.*;
import java.util.*;
import java.util.Date;
import user.*;
import common.Pair;
import common.dal.*;
import common.dal.SQLDataColumn.Constraints;
import common.exceptions.*;
import common.extensions.*;
import common.interfaces.IMessagePersistencyManager;
/**
* A databa... |
package msg;
import static java.lang.Math.*;
import java.text.MessageFormat;
import org.json.*;
import common.Pair;
/**
* Represents a location using lat/long coordinates
*
* @author Gal Lalouche
*/
public class Location {
private static final double EARTH_RADIUS = 6371 * 1000;
private stat... |
package msg;
import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import registration.RegistrationManager;
import user.User;
import common.AbstractManager;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.*;
/**
* A <i> S... |
package msg.xml;
import java.io.StringWriter;
import java.util.Collection;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
import msg.Message;
import msg.visitors.MessageToXML;
import org.w3c.dom.*;
import common.Config... |
package user.servlet;
import java.net.*;
import java.sql.SQLException;
import java.util.Collection;
import javax.annotation.Resource;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import javax.ws.rs.core.Response.Status;
import msg.*;
import org.json.*;
import user.*;
import common.exceptions.... |
package user;
import java.security.*;
import java.sql.*;
import java.util.*;
import common.dal.*;
import common.dal.SQLDataColumn.Constraints;
import common.exceptions.ExistingEntityException;
import common.interfaces.IUserRegisteryManager;
/**
* A database implementation of {@link IUserRegisteryManager... |
package user;
import java.sql.*;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import common.AbstractManager;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.IUserRegisteryManager;
/**
* A <i> Single... |
package user;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import common.interfaces.AbstractHasID;
/**
* A session associated with a user's login
*
* @author Gal Lalouche
*
*/
public class Session extends AbstractHasID<Long> {
private final User user;
private final... |
package user;
/**
* Represents an administrator within the system<br>
* An admin can do everything a user can, plus has extra privileges
*
* @author Gal Lalouche
*/
@Deprecated
public final class Administrator extends User {
// final so no one can override equals
/**
* Creates a new admin
*
... |
package user;
import common.interfaces.AbstractHasID;
/**
* Represents a user in the system
*
* @author Gal Lalouche
*/
public class User extends AbstractHasID<String> {
private static final String REG_EXP = "[A-Za-z]\\w*";
private final String login;
private final String name;
/**
* Cre... |
package common.servlet;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.Cookie;
import msg.MessageManager;
import msg.visitors.MessageToJson;
import org.apache.catalina.Context;
import org.apache.catalina.Wrapper;
import... |
package common.extensions;
import static org.junit.Assert.*;
import java.util.*;
import org.junit.*;
@SuppressWarnings({"javadoc", "static-method"})
public class ExtenderTests {
private static final int SET_SIZE = 100;
private Set<Integer> set;
private List<Integer> list;
private static cla... |
package common;
import msg.*;
import msg.services.MessageFinderTest;
import msg.servlet.MessageResourceTest;
import org.json.Test;
import org.junit.runner.RunWith;
import org.junit.runners.*;
import org.junit.runners.Suite.SuiteClasses;
import registration.*;
import registration.servlet.*;
import user.*... |
package common;
import static junit.framework.Assert.*;
import java.io.*;
import java.util.*;
import msg.*;
import org.junit.*;
import registration.RegistrationManager;
import user.*;
import common.dal.*;
import common.logger.*;
import common.logger.Logger.LogLevel;
@SuppressWarnings({"static-m... |
package common;
import org.junit.*;
import common.dal.Transaction;
import common.interfaces.IPersistent;
@SuppressWarnings({"javadoc"})
public abstract class DBTest extends DALTests {
private IPersistent $;
protected abstract IPersistent setPersistent(Transaction t);
protected abstract IPersisten... |
package registration.servlet;
import static org.junit.Assert.*;
import java.net.HttpURLConnection;
import java.util.*;
import javax.ws.rs.core.MediaType;
import msg.*;
import msg.servlet.MessageResourceTest;
import org.apache.wink.client.*;
import org.json.*;
import org.junit.*;
import org.junit.Tes... |
package registration.servlet;
import static org.junit.Assert.*;
import java.net.HttpURLConnection;
import java.util.*;
import msg.*;
import org.apache.wink.client.*;
import org.json.*;
import org.junit.*;
import org.junit.Test;
import registration.*;
import user.*;
import common.dal.Transaction;
... |
package registration;
import static org.junit.Assert.*;
import java.util.*;
import msg.*;
import org.junit.Test;
import common.DBTest;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.IPersistent;
@SuppressWarnings({"javadoc", "static-method"})
public class DBCon... |
package registration;
import static org.junit.Assert.*;
import java.sql.SQLException;
import java.util.*;
import msg.EventMessage;
import org.junit.Test;
import user.User;
import common.DBTest;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.IPersistent;
@Sup... |
package registration;
import static org.junit.Assert.*;
import java.sql.SQLException;
import java.util.*;
import msg.*;
import org.junit.Test;
import user.*;
import common.*;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.IPersistent;
@SuppressWarnings({"sta... |
package registration;
import static org.junit.Assert.*;
import java.util.*;
import org.junit.*;
import user.*;
import common.*;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.IPersistent;
@SuppressWarnings({"javadoc"})
public class DBVoteManagerTest extends DBT... |
package ws.servlet;
import static org.junit.Assert.*;
import org.junit.Test;
import common.DALTests;
@SuppressWarnings({"static-method", "javadoc"})
public class WebServiceResourceTest extends DALTests {
@Test
public void testSearchLocal() {
fail("Not yet implemented");
}
@Test
public vo... |
package cs236369.hw5;
import java.util.*;
import ws.reg.RegistrationService;
/**
* This is a VERY simple class for the registration web service being used in the 5th assignment of course cs236369,
* IIT. It is responsible for managing the registration of Endpoints - a full and valid url. The registration i... |
package cs236369.hw5;
import java.util.Arrays;
import ws.reg.*;
public class Main {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
RegistrationService service = new RegistrationServiceProxy(
"http://localhost:9090/WSRegisteryStub/services/RegistrationService... |
package msg.servlet;
import static org.junit.Assert.*;
import java.net.HttpURLConnection;
import java.sql.SQLException;
import java.text.MessageFormat;
import java.util.*;
import msg.*;
import org.apache.wink.client.*;
import org.json.*;
import org.junit.*;
import org.junit.Test;
import registratio... |
package msg;
import static org.junit.Assert.*;
import java.util.*;
import msg.visitors.MessageToJson;
import org.json.JSONObject;
import org.junit.Test;
import user.*;
import common.DBTest;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.IPersistent;
@Suppres... |
package msg;
import static msg.xml.XMLTransformer.*;
import static org.junit.Assert.*;
import java.util.Arrays;
import msg.xml.XMLTransformer;
import org.junit.*;
import org.w3c.dom.Document;
import common.DALTests;
@SuppressWarnings({"javadoc"})
public class XMLTests extends DALTests {
private D... |
package msg;
import static org.junit.Assert.*;
import javax.xml.parsers.*;
import msg.visitors.MessageToXML;
import org.junit.*;
import org.w3c.dom.*;
import common.DALTests;
@SuppressWarnings({"javadoc", "static-method"})
public class MessageToXMLTest extends DALTests {
private static Document d... |
package msg;
import static org.junit.Assert.*;
import java.util.*;
import msg.visitors.MessageToJson;
import org.json.JSONObject;
import org.junit.Test;
import user.*;
import common.DBTest;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.IPersistent;
@Suppres... |
package msg;
import static java.lang.Math.*;
import static org.junit.Assert.*;
import org.json.JSONObject;
import org.junit.Test;
import common.Pair;
@SuppressWarnings({"javadoc", "static-method"})
public class LocationTests {
@Test
public void testLocationDoubleDouble() {
Location loc = new Lo... |
package user.servlet;
import static org.junit.Assert.*;
import java.net.HttpURLConnection;
import java.util.*;
import msg.*;
import org.apache.wink.client.*;
import org.json.*;
import org.junit.*;
import org.junit.Test;
import registration.*;
import user.*;
import common.dal.Transaction;
import ... |
package user;
import static org.junit.Assert.*;
import java.util.*;
import msg.*;
import org.junit.*;
import registration.RegistrationManager;
import common.*;
import common.dal.Transaction;
import common.exceptions.*;
import common.interfaces.IPersistent;
@SuppressWarnings({"static-method", "ja... |
package user;
import static org.junit.Assert.*;
import java.util.*;
import msg.MessageManager;
import org.junit.*;
import registration.RegistrationManager;
import common.*;
import common.dal.Transaction;
import common.exceptions.ExistingEntityException;
import common.interfaces.IPersistent;
@Sup... |
package user;
import org.junit.Test;
@SuppressWarnings({"javadoc", "static-method", "unused"})
public class UserTest {
private static final String PASSWORD = "bla";
@Test(expected = IllegalArgumentException.class)
public void testUser1() {
new User("", PASSWORD);
}
@Test(expected = IllegalArgume... |
package il.technion.cs236369.dal;
import java.util.Properties;
import il.technion.cs236369.exceptions.InvalidPropertiesFile;
import il.technion.cs236369.interfaces.ICacheManager;
import il.technion.cs236369.interfaces.ICacheManagerFactory;
import il.technion.cs236369.interfaces.IHttpCommunicator;
/**
* A ... |
package il.technion.cs236369.dal;
import il.technion.cs236369.exceptions.DatabaseException;
import il.technion.cs236369.exceptions.InvalidPropertiesFile;
import il.technion.cs236369.exceptions.NotFoundException;
import il.technion.cs236369.exceptions.NotValidException;
import il.technion.cs236369.interfaces.ICac... |
package il.technion.cs236369.dal;
import il.technion.cs236369.interfaces.ICacheEntry;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.a... |
package il.technion.cs236369.dal;
import il.technion.cs236369.exceptions.NotFoundException;
import il.technion.cs236369.interfaces.ICacheEntry;
import il.technion.cs236369.interfaces.ICacheEntryDal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.... |
package il.technion.cs236369.interfaces;
import java.util.Map;
/**
* Represents an entry in the DB cache of an HTTP response
*
* @author Gal Lalouche 036933489 sgallal@t2
*
*/
public interface ICacheEntry {
/**
* Gets the URL
*
* @return The URL
*/
String getURL();
/**
* Gets ... |
package il.technion.cs236369.interfaces;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
/**
* Http Communicator Interface
*
* @author Gil Fruchter 037023231 sgilf@t2
*
*/
public interface IHttpCommunicator {
public HttpResponse get(HttpRequest request);
}
|
package il.technion.cs236369.interfaces;
import il.technion.cs236369.exceptions.DatabaseException;
import il.technion.cs236369.exceptions.NotFoundException;
import il.technion.cs236369.exceptions.NotValidException;
import java.io.IOException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRe... |
package il.technion.cs236369.interfaces;
import java.util.Properties;
import il.technion.cs236369.exceptions.InvalidPropertiesFile;
public interface ICacheManagerFactory {
/**
* Creates a cache manager
*
* @param getter An http getter to allow sending get requests for validity
* check... |
package il.technion.cs236369.interfaces;
import il.technion.cs236369.exceptions.NotFoundException;
import java.sql.SQLException;
public interface ICacheEntryDal {
final static int MAX_ALLOWED_LENGTH = 255;
/**
* Stores the entry in to the DB
*
* @param entry The entry to store
* @return True... |
package il.technion.cs236369.exceptions;
/**
* Thrown when a method is not yet implemented
*
* @author Gal Lalouche 036933489 sgallal@t2
*
*/
public class NotImplementedException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = -214608792888381862L;
public ... |
package il.technion.cs236369.exceptions;
public class NotFoundException extends Exception {
/**
*
*/
private static final long serialVersionUID = -1690032212051091954L;
public NotFoundException() {
super();
}
public NotFoundException(String arg0, Throwable arg1) {
super(arg0, arg1);
}
... |
package il.technion.cs236369.exceptions;
import org.apache.http.HttpResponse;
public class NotValidException extends Exception {
private final HttpResponse response;
/**
*
*/
private static final long serialVersionUID = -2632540420163382113L;
public NotValidException(HttpResponse response) {
... |
package il.technion.cs236369.proxy;
import il.technion.cs236369.dal.CacheMangerFactoryImpl;
import il.technion.cs236369.exceptions.DatabaseException;
import il.technion.cs236369.exceptions.NotFoundException;
import il.technion.cs236369.exceptions.NotValidException;
import il.technion.cs236369.interfaces.ICacheMa... |
package il.technion.cs236369.proxy;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Properties;
import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
import org.apache.http.HttpException;
import org.apache.http.impl.De... |
package il.technion.cs236369.proxy;
import java.util.Properties;
import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.google.inject.name.Names;
public class HttpProxyModule extends AbstractModule {
private final... |
package il.technion.cs236369.dal;
import il.technion.cs236369.exceptions.NotFoundException;
import il.technion.cs236369.interfaces.ICacheEntry;
import il.technion.cs236369.interfaces.ICacheEntryDal;
import java.net.MalformedURLException;
import java.sql.SQLException;
import java.util.HashMap;
import junit.... |
package il.technion.cs236369.dal;
import il.technion.cs236369.exceptions.NotFoundException;
import il.technion.cs236369.exceptions.NotValidException;
import il.technion.cs236369.interfaces.ICacheEntryDal;
import il.technion.cs236369.interfaces.ICacheManager;
import il.technion.cs236369.interfaces.IHttpCommunicat... |
package il.technion.cs236369.interfaces;
/**
* An interface to be notified when event occur
*
* @author Gal Lalouche
*
*/
public interface IObserver {
/**
* Notify the observer of the event
*/
void notifyObserver();
}
|
package il.technion.cs236369.interfaces;
import java.io.PrintStream;
import java.util.Map;
/**
* A writer that writes a dynamic TSP page
* @author Gal Lalouche
*
*/
public interface ITSPWriter {
/**
* Writes the TSP page
* @param params The page's parameters
* @param out The stream to write t... |
package il.technion.cs236369.interfaces;
/**
* A cookie used to identify the client Implementations are expected to override
* equals and hashCode as the cookie will be used in map
*
* @author Gal Lalouche
*
*/
public interface ICookie {
/**
* Gets the cookie's name
*
* @return The cookie'... |
package il.technion.cs236369.interfaces;
/**
* A session interface
*
* @author Gal Lalouche
*
*/
public interface ISession {
/**
* Sets a session variable
*
* @param name The variable's name
* @param value The variable's value
*/
void set(String name, Object value);
/**
* Gets... |
package il.technion.cs236369.interfaces;
/**
* An interface for object that can be observed
* @author Gal Lalouche
*
*/
public interface IObservable {
/**
* Sets the observer
* @param observer The observer
*/
void setObservable(IObserver observer);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.