NIHVIVO-3772 Incorporate the most recent changes from Eric (2012-06-20)

This commit is contained in:
j2blake 2012-06-24 17:51:08 +00:00
parent b3c09797b0
commit c4ae8af529
13 changed files with 880 additions and 951 deletions

View file

@ -273,10 +273,15 @@ public class PagedSearchController extends FreemarkerHttpServlet {
// VIVO OpenSocial Extension by UCSF
try {
OpenSocialManager openSocialManager = new OpenSocialManager(vreq, "search");
// put list of people found onto pubsub channel
List<String> ids = OpenSocialManager.getOpenSocialId(individuals);
openSocialManager.setPubsubData(OpenSocialManager.JSON_PERSONID_CHANNEL,
OpenSocialManager.buildJSONPersonIds(ids, "" + ids.size() + " people found"));
// put list of people found onto pubsub channel
// only turn this on for a people only search
if ("http://vivoweb.org/ontology#vitroClassGrouppeople".equals(vreq.getParameter(PARAM_CLASSGROUP))) {
List<String> ids = OpenSocialManager.getOpenSocialId(individuals);
openSocialManager.setPubsubData(OpenSocialManager.JSON_PERSONID_CHANNEL,
OpenSocialManager.buildJSONPersonIds(ids, "" + ids.size() + " people found"));
}
// TODO put this in a better place to guarantee that it gets called at the proper time!
openSocialManager.removePubsubGadgetsWithoutData();
body.put("openSocial", openSocialManager);
if (openSocialManager.isVisible()) {
body.put("bodyOnload", "my.init();");
@ -285,7 +290,7 @@ public class PagedSearchController extends FreemarkerHttpServlet {
log.error("IOException in doTemplate()", e);
} catch (SQLException e) {
log.error("SQLException in doTemplate()", e);
}
}
String template = templateTable.get(format).get(Result.PAGED);

View file

@ -23,7 +23,11 @@ public class GadgetController extends FreemarkerHttpServlet {
@Override
protected ResponseValues processRequest(VitroRequest vreq) {
if (vreq.getServletPath().endsWith("/sandbox")) {
if ("/clearcache".equalsIgnoreCase(vreq.getPathInfo())) {
OpenSocialManager.clearCache();
return new RedirectResponseValues("/");
}
else if ("/sandbox".equalsIgnoreCase(vreq.getPathInfo())) {
boolean sandbox = "True".equalsIgnoreCase(ConfigurationProperties.getBean(vreq.getSession()
.getServletContext()).getProperty("OpenSocial.sandbox"));
if (!sandbox) {
@ -81,7 +85,7 @@ public class GadgetController extends FreemarkerHttpServlet {
try {
OpenSocialManager openSocialManager = new OpenSocialManager(vreq, "gadgetSandbox");
String gadgetURLS = "";
for (PreparedGadget gadget : openSocialManager.getVisibleGadgets())
for (GadgetSpec gadget : openSocialManager.getAllDBGadgets(false).values())
{
gadgetURLS += gadget.getGadgetURL() + System.getProperty("line.separator");
}

View file

@ -5,7 +5,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -13,33 +12,24 @@ import java.util.Map;
import org.apache.commons.dbcp.BasicDataSource;
public class GadgetSpec {
private String openSocialGadgetURL;
private String name;
private int appId = 0;
private String name;
private String openSocialGadgetURL;
private List<String> channels = new ArrayList<String>();
private boolean unknownGadget = false;
private Map<String, GadgetViewRequirements> viewRequirements = new HashMap<String, GadgetViewRequirements>();
boolean enabled;
private boolean unknownGadget = false;
// For preloading
public GadgetSpec(int appId, String name, String openSocialGadgetURL,
List<String> channels) {
List<String> channels, BasicDataSource ds, boolean enabled, boolean unknownGadget)
throws SQLException {
this.appId = appId;
this.name = name;
this.openSocialGadgetURL = openSocialGadgetURL;
this.channels.addAll(channels);
}
public GadgetSpec(int appId, String name, String openSocialGadgetURL,
String channelsStr) {
this(appId, name, openSocialGadgetURL, Arrays.asList(channelsStr != null
&& channelsStr.length() > 0 ? channelsStr.split(" ") : new String[0]));
}
public GadgetSpec(int appId, String name, String openSocialGadgetURL,
List<String> channels, boolean unknownGadget, BasicDataSource ds)
throws SQLException {
this(appId, name, openSocialGadgetURL, channels);
this.enabled = enabled;
this.unknownGadget = unknownGadget;
// Load gadgets from the DB first
if (!unknownGadget) {
Connection conn = null;
@ -47,7 +37,7 @@ public class GadgetSpec {
ResultSet rset = null;
try {
String sqlCommand = "select page, viewer_req, owner_req, view, closed_width, open_width, start_closed, chromeId, display_order from shindig_app_views where appId = "
String sqlCommand = "select page, viewer_req, owner_req, view, closed_width, open_width, start_closed, chromeId, display_order from orng_app_views where appId = "
+ appId;
conn = ds.getConnection();
stmt = conn.createStatement();
@ -63,25 +53,16 @@ public class GadgetSpec {
}
} finally {
try {
if (rset != null) {
rset.close();
}
rset.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
if (stmt != null) {
stmt.close();
}
stmt.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
if (conn != null) {
conn.close();
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@ -103,7 +84,7 @@ public class GadgetSpec {
return channels;
}
public boolean listensTo(String channel) { // if an unknown gadget just say yes,
public boolean listensTo(String channel) { // if an unknownd gadget just say yes,
// we don't care about
// performance in this situation
return unknownGadget || channels.contains(channel);
@ -129,7 +110,7 @@ public class GadgetSpec {
if (viewRequirements.containsKey(page)) {
show = true;
GadgetViewRequirements req = getGadgetViewRequirements(page);
if ('U' == req.getViewerReq() && viewerId != null) {
if ('U' == req.getViewerReq() && viewerId == null) {
show = false;
} else if ('R' == req.getViewerReq()) {
show &= isRegisteredTo(viewerId, ds);
@ -152,7 +133,7 @@ public class GadgetSpec {
ResultSet rset = null;
try {
String sqlCommand = "select count(*) from shindig_app_registry where appId = "
String sqlCommand = "select count(*) from orng_app_registry where appId = "
+ getAppId() + " and personId = '" + personId + "';";
conn = ds.getConnection();
stmt = conn.createStatement();
@ -162,25 +143,16 @@ public class GadgetSpec {
}
} finally {
try {
if (rset != null) {
rset.close();
}
rset.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
if (stmt != null) {
stmt.close();
}
stmt.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
if (conn != null) {
conn.close();
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@ -191,6 +163,10 @@ public class GadgetSpec {
return unknownGadget;
}
public boolean isEnabled() {
return enabled;
}
// who sees it? Return the viewerReq for the ProfileDetails page
public char getVisibleScope() {
GadgetViewRequirements req = getGadgetViewRequirements("/display");

View file

@ -1,7 +1,6 @@
package edu.ucsf.vitro.opensocial;
public class GadgetViewRequirements {
private String page;
private char viewerReq; // U for User or null for no requirement
private char ownerReq; // R for Registered or null for no requirement
private String view;
@ -11,10 +10,9 @@ public class GadgetViewRequirements {
private String chromeId;
private int display_order;
public GadgetViewRequirements(String page, char viewerReq, char ownerReq,
public GadgetViewRequirements(char viewerReq, char ownerReq,
String view, int closedWidth, int openWidth, boolean startClosed,
String chromeId, int display_order) {
this.page = page;
this.viewerReq = viewerReq;
this.ownerReq = ownerReq;
this.view = view;
@ -28,7 +26,7 @@ public class GadgetViewRequirements {
public GadgetViewRequirements(String page, String viewerReq,
String ownerReq, String view, int closedWidth, int openWidth,
boolean startClosed, String chromeId, int display_order) {
this(page, viewerReq != null ? viewerReq.charAt(0) : ' ',
this(viewerReq != null ? viewerReq.charAt(0) : ' ',
ownerReq != null ? ownerReq.charAt(0) : ' ', view, closedWidth,
openWidth, startClosed, chromeId, display_order);
}

View file

@ -8,6 +8,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@ -39,6 +40,9 @@ public class OpenSocialManager {
private static final String DEFAULT_DRIVER = "com.mysql.jdbc.Driver";
// for performance
private static Map<String, GadgetSpec> gadgetCache;
private List<PreparedGadget> gadgets = new ArrayList<PreparedGadget>();
private Map<String, String> pubsubdata = new HashMap<String, String>();
private String viewerId = null;
@ -79,15 +83,13 @@ public class OpenSocialManager {
}
else {
UserAccount viewer = LoginStatusBean.getCurrentUser(vreq);
this.viewerId = viewer != null ? viewer.getUri() : null;
// attempt to use profile URI if present, otherwise user user oriented URI
this.viewerId = viewer != null && viewer.getProxiedIndividualUris().size() == 1 ?
viewer.getProxiedIndividualUris().toArray()[0].toString() : (viewer != null ? viewer.getUri() : null);
}
boolean gadgetSandbox = "gadgetSandbox".equals(pageName);
String requestAppId = vreq.getParameter("appId");
Map<String, GadgetSpec> dbApps = new HashMap<String, GadgetSpec>();
Map<String, GadgetSpec> officialApps = new HashMap<String, GadgetSpec>();
dataSource = new BasicDataSource();
dataSource.setDriverClassName(DEFAULT_DRIVER);
dataSource.setUsername(configuration
@ -98,116 +100,26 @@ public class OpenSocialManager {
.getProperty("VitroConnection.DataSource.url"));
// Load gadgets from the DB first
Connection conn = null;
Statement stmt = null;
ResultSet rset = null;
try {
Map<String, GadgetSpec> allDBGadgets = getAllDBGadgets(!noCache);
String sqlCommand = "select appId, name, url, channels, enabled from shindig_apps";
// if a specific app is requested, only grab it
if (requestAppId != null) {
sqlCommand += " where appId = " + requestAppId;
}
conn = dataSource.getConnection();
stmt = conn.createStatement();
rset = stmt.executeQuery(sqlCommand);
while (rset.next()) {
GadgetSpec spec = new GadgetSpec(rset.getInt(1),
rset.getString(2), rset.getString(3), rset.getString(4));
String gadgetFileName = getGadgetFileNameFromURL(rset
.getString(3));
dbApps.put(gadgetFileName, spec);
if (requestAppId != null || rset.getBoolean(5)) {
officialApps.put(gadgetFileName, spec);
}
}
} finally {
try {
if (rset != null) {
rset.close();
}
} catch (Exception e) {
e.printStackTrace();
}
try {
if (stmt != null) {
stmt.close();
}
} catch (Exception e) {
e.printStackTrace();
}
try {
if (conn != null) {
conn.close();
}
} catch (Exception e) {
e.printStackTrace();
}
// Add sandbox gadgets if they are present
if (vreq.getSession() != null && vreq.getSession().getAttribute(OPENSOCIAL_GADGETS) != null) {
gadgets = getSandboxGadgets(vreq, allDBGadgets, requestAppId);
}
// Add manual gadgets if there are any
// Note that this block of code only gets executed after someone fills in the
// gadget/sandbox form!
int moduleId = 0;
if (vreq.getSession() != null
&& vreq.getSession().getAttribute(OPENSOCIAL_GADGETS) != null) {
String openSocialGadgetURLS = (String) vreq.getSession()
.getAttribute(OPENSOCIAL_GADGETS);
String[] urls = openSocialGadgetURLS.split(System.getProperty("line.separator"));
for (String openSocialGadgetURL : urls) {
if (openSocialGadgetURL.length() == 0)
continue;
int appId = 0; // if URL matches one in the DB, use DB provided
// appId, otherwise generate one
String gadgetFileName = getGadgetFileNameFromURL(openSocialGadgetURL);
String name = gadgetFileName;
List<String> channels = new ArrayList<String>();
boolean unknownGadget = true;
if (dbApps.containsKey(gadgetFileName)) {
appId = dbApps.get(gadgetFileName).getAppId();
name = dbApps.get(gadgetFileName).getName();
channels = dbApps.get(gadgetFileName).getChannels();
unknownGadget = false;
} else {
appId = openSocialGadgetURL.hashCode();
}
// if they asked for a specific one, only let it in
if (requestAppId != null
&& Integer.getInteger(requestAppId) != appId) {
continue;
}
GadgetSpec gadget = new GadgetSpec(appId, name,
openSocialGadgetURL, channels, unknownGadget, dataSource);
else {
// if no manual one were added, use the ones from the DB
for (GadgetSpec gadgetSpec : allDBGadgets.values()) {
// only add ones that are visible in this context!
if (unknownGadget
|| gadget.show(viewerId, ownerId, pageName, dataSource)) {
String securityToken = socketSendReceive(viewerId, ownerId,
"" + gadget.getAppId());
gadgets.add(new PreparedGadget(gadget, this, moduleId++,
securityToken));
}
}
}
// if no manual one were added, use the ones from the DB
if (gadgets.size() == 0) {
// Load DB gadgets
if (gadgetSandbox) {
officialApps = dbApps;
}
for (GadgetSpec spec : officialApps.values()) {
GadgetSpec gadget = new GadgetSpec(spec.getAppId(),
spec.getName(), spec.getGadgetURL(),
spec.getChannels(), false, dataSource);
// only add ones that are visible in this context!
if (gadgetSandbox
|| gadget.show(viewerId, ownerId, pageName, dataSource)) {
String securityToken = socketSendReceive(viewerId, ownerId,
"" + gadget.getAppId());
gadgets.add(new PreparedGadget(gadget, this, moduleId++,
securityToken));
int moduleId = 0;
if (
(
(requestAppId == null && gadgetSpec.isEnabled()) ||
(requestAppId != null && gadgetSpec.getAppId() == Integer.parseInt(requestAppId))
) &&
gadgetSpec.show(viewerId, ownerId, pageName, dataSource)
) {
String securityToken = socketSendReceive(viewerId, ownerId, "" + gadgetSpec.getAppId());
gadgets.add(new PreparedGadget(gadgetSpec, this, moduleId++, securityToken));
}
}
}
@ -215,6 +127,10 @@ public class OpenSocialManager {
// sort the gadgets
Collections.sort(gadgets);
}
public static void clearCache() {
gadgetCache = null;
}
private String figureOwnerId(VitroRequest vreq) {
IndividualRequestAnalyzer requestAnalyzer = new IndividualRequestAnalyzer(vreq,
@ -278,17 +194,6 @@ public class OpenSocialManager {
personIds.add(ind.getURI());
return buildJSONPersonIds(personIds, message);
}
/****
* public static String BuildJSONPubMedIds(Person person) { List<Int32>
* pubIds = new List<Int32>(); foreach (Publication pub in
* person.PublicationList) { foreach (PublicationSource pubSource in
* pub.PublicationSourceList) { if ("PubMed".Equals(pubSource.Name)) {
* pubIds.Add(Int32.Parse(pubSource.ID)); } } } Dictionary<string, Object>
* foundPubs = new Dictionary<string, object>(); foundPubs.Add("pubIds",
* pubIds); foundPubs.Add("message", "PubMedIDs for " +
* person.Name.FullName); JavaScriptSerializer serializer = new
* JavaScriptSerializer(); return serializer.Serialize(foundPubs); }
***/
public void setPubsubData(String key, String value) {
if (pubsubdata.containsKey(key)) {
@ -374,7 +279,7 @@ public class OpenSocialManager {
String xtraId1Type, String xtraId1Value) throws SQLException {
Connection conn = null;
Statement stmt = null;
String sqlCommand = "INSERT INTO shindig_activity (userId, activity, xtraId1Type, xtraId1Value) VALUES ('"
String sqlCommand = "INSERT INTO orng_activity (userId, activity, xtraId1Type, xtraId1Value) VALUES ('"
+ userId + "','<activity xmlns=\"http://ns.opensocial.org/2008/opensocial\"><postedTime>"
+ System.currentTimeMillis() + "</postedTime><title>" + title + "</title>"
+ (body != null ? "<body>" + body + "</body>" : "") + "</activity>','"
@ -385,18 +290,12 @@ public class OpenSocialManager {
stmt.executeUpdate(sqlCommand);
} finally {
try {
if (stmt != null) {
stmt.close();
}
stmt.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
if (conn != null) {
conn.close();
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@ -427,22 +326,20 @@ public class OpenSocialManager {
// The following will block until the page is transmitted.
while ((bytes = s.getInputStream().read(bytesReceived)) > 0) {
page += new String(bytesReceived, 0, bytes);
}
};
return page;
}
public String getContainerJavascriptSrc() {
return configuration.getProperty(SHINDIG_URL_PROP)
+ "/gadgets/js/core:dynamic-height:osapi:pubsub:rpc:views:shindig-container.js?c=1"
+ "/gadgets/js/core:dynamic-height:osapi:pubsub:rpc:views:rdf:shindig-container.js?c=1"
+ (isDebug ? "&debug=1" : "");
}
public String getGadgetJavascript() {
String lineSeparator = System.getProperty("line.separator");
String gadgetScriptText = lineSeparator
+ "var my = {};"
+ lineSeparator
String gadgetScriptText = "var my = {};" + lineSeparator
+ "my.gadgetSpec = function(appId, name, url, secureToken, view, closed_width, open_width, start_closed, chrome_id, visible_scope) {"
+ lineSeparator + "this.appId = appId;" + lineSeparator
+ "this.name = name;" + lineSeparator + "this.url = url;"
@ -480,4 +377,98 @@ public class OpenSocialManager {
return gadgetScriptText;
}
Map<String, GadgetSpec> getAllDBGadgets(boolean useCache) throws SQLException
{
// great place to add cache
// check cache first
Map<String, GadgetSpec> allDBGadgets = useCache ? gadgetCache : null;
if (allDBGadgets == null) {
allDBGadgets = new HashMap<String, GadgetSpec>();
Connection conn = null;
Statement stmt = null;
ResultSet rset = null;
try {
String sqlCommand = "select appId, name, url, channels, enabled from orng_apps";
conn = dataSource.getConnection();
stmt = conn.createStatement();
rset = stmt.executeQuery(sqlCommand);
while (rset.next()) {
String channelsStr = rset.getString(4);
List<String> channels = Arrays.asList(channelsStr != null && channelsStr.length() > 0 ? channelsStr.split(" ") : new String[0]);
GadgetSpec spec = new GadgetSpec(rset.getInt(1),
rset.getString(2), rset.getString(3), channels, dataSource, rset.getBoolean(5), false);
String gadgetFileName = getGadgetFileNameFromURL(rset.getString(3));
allDBGadgets.put(gadgetFileName, spec);
}
}
finally {
try {
rset.close();
} catch (Exception e) {
}
try {
stmt.close();
} catch (Exception e) {
}
try {
conn.close();
} catch (Exception e) {
}
}
if (useCache) {
gadgetCache = allDBGadgets;
}
}
return allDBGadgets;
}
private List<PreparedGadget> getSandboxGadgets(VitroRequest vreq, Map<String, GadgetSpec> allDBGadgets, String requestAppId) throws SQLException, IOException {
List<PreparedGadget> sandboxGadgets = new ArrayList<PreparedGadget>();
// Note that this block of code only gets executed after someone fills in the
// gadget/sandbox form!
String openSocialGadgetURLS = (String) vreq.getSession()
.getAttribute(OPENSOCIAL_GADGETS);
String[] urls = openSocialGadgetURLS.split(System.getProperty("line.separator"));
for (String openSocialGadgetURL : urls) {
if (openSocialGadgetURL.length() == 0)
continue;
int appId = 0; // if URL matches one in the DB, use DB provided
// appId, otherwise generate one
String gadgetFileName = getGadgetFileNameFromURL(openSocialGadgetURL);
String name = gadgetFileName;
List<String> channels = new ArrayList<String>();
boolean unknownGadget = true;
if (allDBGadgets.containsKey(gadgetFileName)) {
appId = allDBGadgets.get(gadgetFileName).getAppId();
name = allDBGadgets.get(gadgetFileName).getName();
channels = allDBGadgets.get(gadgetFileName).getChannels();
unknownGadget = false;
} else {
appId = openSocialGadgetURL.hashCode();
}
// if they asked for a specific one, only let it in
if (requestAppId != null && Integer.parseInt(requestAppId) != appId) {
continue;
}
GadgetSpec gadget = new GadgetSpec(appId, name,
openSocialGadgetURL, channels, dataSource, true, unknownGadget);
// only add ones that are visible in this context!
int moduleId = 0;
if (unknownGadget
|| gadget.show(viewerId, ownerId, pageName, dataSource)) {
String securityToken = socketSendReceive(viewerId, ownerId,
"" + gadget.getAppId());
sandboxGadgets.add(new PreparedGadget(gadget, this, moduleId++,
securityToken));
}
}
return sandboxGadgets;
}
}

View file

@ -44,7 +44,7 @@ public class OpenSocialSmokeTests implements ServletContextListener {
private static final String PROPERTY_DB_USERNAME = "VitroConnection.DataSource.username";
private static final String PROPERTY_DB_PASSWORD = "VitroConnection.DataSource.password";
private static final String FILENAME_SHINDIG_PROPERTIES = "shindig.orng.properties";
private static final String FILENAME_SHINDIG_PROPERTIES = "shindigorng.properties";
/*
* If a connection fails in the tester thread, how long do we wait before
@ -133,7 +133,7 @@ public class OpenSocialSmokeTests implements ServletContextListener {
conn = dataSource.getConnection();
stmt = conn.createStatement();
rset = stmt.executeQuery("select * from shindig_apps");
rset = stmt.executeQuery("select * from orng_apps");
} catch (NoSuchPropertyException e) {
warnings.add(new Warning(e.getMessage()));
} catch (SQLException e) {
@ -182,8 +182,7 @@ public class OpenSocialSmokeTests implements ServletContextListener {
message += "Has the Tomcat classpath been set to include the "
+ "Shindig config directory? "
+ "(inside the Vitro home directory) ";
message += "Was the openSocial build script run? "
+ "('ant -file openSocialBuild.xml')";
message += "Was the openSocial build script run? ('ant orng')";
warnings.add(new Warning(message));
}
}
@ -346,12 +345,14 @@ public class OpenSocialSmokeTests implements ServletContextListener {
private static final int SOCKET_TIMEOUT_STATUS = -500;
private final String shindigBaseUrl;
private final String shindigTestUrl;
private final HttpClient httpClient = new HttpClient();
private int statusCode = Integer.MIN_VALUE;
public ShindigTester(String shindigBaseUrl) {
this.shindigBaseUrl = shindigBaseUrl;
this.shindigTestUrl = shindigBaseUrl + "/rest/appdata";
}
public void connect() throws ShindigTesterException {
@ -368,12 +369,12 @@ public class OpenSocialSmokeTests implements ServletContextListener {
}
if (statusCode != HttpStatus.SC_OK) {
throw new ShindigTesterException(statusCode);
throw new ShindigTesterException(statusCode, shindigBaseUrl,
shindigTestUrl);
}
}
private void testConnection() throws ShindigTesterException {
String shindigTestUrl = shindigBaseUrl + "/rest/activities";
GetMethod method = new GetMethod(shindigTestUrl);
try {
log.debug("Trying to connect to Shindig");
@ -388,7 +389,8 @@ public class OpenSocialSmokeTests implements ServletContextListener {
// Save the status so we know why we failed.
statusCode = SOCKET_TIMEOUT_STATUS;
} catch (Exception e) {
throw new ShindigTesterException(e);
throw new ShindigTesterException(e, shindigBaseUrl,
shindigTestUrl);
} finally {
method.releaseConnection();
}
@ -415,14 +417,18 @@ public class OpenSocialSmokeTests implements ServletContextListener {
protected static class ShindigTesterException extends Exception {
private final int httpStatusCode;
protected ShindigTesterException(Integer httpStatusCode) {
super("Failed to connect to the Shindig service. "
protected ShindigTesterException(Integer httpStatusCode,
String baseUrl, String testUrl) {
super("Failed to connect to the Shindig service at '" + baseUrl
+ "' (tried for a response at '" + testUrl + "'). "
+ "status code was " + httpStatusCode);
this.httpStatusCode = httpStatusCode;
}
protected ShindigTesterException(Throwable cause) {
super("Failed to connect to the Shindig service.", cause);
protected ShindigTesterException(Throwable cause, String baseUrl,
String testUrl) {
super("Failed to connect to the Shindig service at '" + baseUrl
+ "' (tried for a response at '" + testUrl + "').", cause);
this.httpStatusCode = Integer.MIN_VALUE;
}