com.citygrid
Class CGShared
java.lang.Object
com.citygrid.CGShared
- All Implemented Interfaces:
- Serializable
public class CGShared
- extends Object
- implements Serializable
- See Also:
- Serialized Form
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
logger
private static Logger logger
instance
private static final CGShared instance
publisher
private String publisher
placement
private String placement
connectTimeout
private int connectTimeout
readTimeout
private int readTimeout
baseUrl
private String baseUrl
debug
private boolean debug
simulation
private boolean simulation
muid
private String muid
mobileType
private String mobileType
CGShared
private CGShared()
getSharedInstance
public static CGShared getSharedInstance()
getPublisher
public String getPublisher()
setPublisher
public void setPublisher(String publisher)
getPlacement
public String getPlacement()
setPlacement
public void setPlacement(String placement)
getConnectTimeout
public Integer getConnectTimeout()
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
getReadTimeout
public int getReadTimeout()
setReadTimeout
public void setReadTimeout(int readTimeout)
getBaseUrl
public String getBaseUrl()
setBaseUrl
public void setBaseUrl(String baseUrl)
getDebug
public boolean getDebug()
setDebug
public void setDebug(boolean debug)
getSimulation
public boolean getSimulation()
setSimulation
public void setSimulation(boolean simulation)
getMuid
public String getMuid()
setMuid
public void setMuid(String muid)
getMobileType
public String getMobileType()
setMobileType
public void setMobileType(String mobileType)
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
sendSynchronousRequest
public org.codehaus.jackson.JsonNode sendSynchronousRequest(String apiUrl,
Map<String,Object> parameters,
int connectTimeout,
int readTimeout)
throws CGException
- Mirroring citygrid-ios API so using List to return errors instead of throw exceptions.
- Parameters:
apiUrl
- parameters
- connectTimeout
- readTimeout
- @return
- Throws:
CGException
buildSimulationJsonPath
String buildSimulationJsonPath(String apiUrl)
getResponseAsString
private String getResponseAsString(HttpURLConnection connection)
throws IOException
- Throws:
IOException
readStringFromInputStream
private String readStringFromInputStream(InputStream is)
throws IOException
- Throws:
IOException
dictAsUrlEncodedParameters
String dictAsUrlEncodedParameters(Map<String,Object> dict)
- IMPOOTANT!!! Only String and String[] are allowed as value of a parameter. Other types
will lead to run time exception!!!
- Parameters:
dict
-
- Returns:
errorWithErrorNum
public CGError errorWithErrorNum(CGErrorNum errorNum)
Copyright © 2011. All Rights Reserved.