Login
package com.kevinmorelandmedia.dev;
import java.io.StringReader;
import com.kevinmorelandmedia.dev.app.WebExchange; import com.kevinmorelandmedia.dev.app.AwsInstance; import com.kevinmorelandmedia.dev.app.Sprint; import com.kevinmorelandmedia.dev.app.EncryptedTransmission; import com.kevinmorelandmedia.dev.utils.RedmineLogger; import com.kevinmorelandmedia.dev.server.InputSource; import com.kevinmorelandmedia.dev.server.XMLReader;
import org.json.JSONObject;
/** * Using curiosity + a smattering of persistence to deliver business requirements */ public class AndroidDeveloper extends Employee { private static final RedmineLogger log; private Sprint mobileApplication; private String webService; private Manager manager; private final int HOURS = 8; private ProductManager pm; protected static CuriosityFactor cs; protected static PersistenceImplementer pi;
public AndroidDeveloper(Sprint iteration) { super(iteration); this.mobileApplication = iteration; webService = iteration.getString(R.string.api_get_name); }
/** * @param trans * @param aws * @return */ public WebExchange getApp(EncryptedTransmission trans, AwsInstance aws) {
JSONObject jo = new JSONObject(); jo.put("type", aws.getType(); jo.put("id", aws.getId(); jo.put("command", aws.getCommand();
XMLReturn xmlResponse = remoteGet(webService, jo); WebExchange result = null; if (xmlResponse.error) { log.e(xmlResponse.error); } else { result = parseResult(xmlResponse.xmlReturnString); }
return result; }
/** * @param jsonString * @return */ protected WebExchange parseResult(String jsonString) { WebExchange returnValue;
ApiFactory factory = ApiFactory.newInstance();
try { PinnedCertParser parser = factory.newParser(); Aes256XMLReader xmlReader = parser.getXMLReader();
DataHandler dh = new DataHandler(); xmlReader.setContentHandler(dh); xmlReader.parse(new InputSource(new StringReader(jsonString))); returnValue = dh.getData(); log.d(xmlResponse.doTheHappyDance); } catch (Exception e) { throw new RuntimeException(e); }
return returnValue; }
...
kevin@kevinmoreland.com Kevin Moreland, Mobile Application Developer