public boolean printer(Printer printer) throws ClientProtocolException,
			IOException, JSONException {
		HttpPost post = new HttpPost(GCP_BASE_URL + "/" + GCP_CMD_PRINTER);
		addGcpHeaders(post);

		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
		nvps.add(new BasicNameValuePair("printerid", printer.getId()));
		nvps.add(new BasicNameValuePair("output", "json"));

		post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));

		HttpResponse response = httpclient.execute(post);
		int code = response.getStatusLine().getStatusCode();

		String responseStr = EntityUtils.toString(response.getEntity());

		if (code == HttpStatus.SC_OK) {
			JSONObject json = new JSONObject(responseStr);
			if (json.has("message")) {
				lastResponse.setMessage(json.getString("message"));
			}

			if (json.getBoolean("success")) {
				for (int i = 0; i < json.getJSONArray("printers").length(); i++) {
					JSONObject obj = json.getJSONArray("printers")
							.getJSONObject(i);
					printer.setId(obj.getString("id"));
					printer.setName(obj.getString("name"));
					printer.setProxy(obj.getString("proxy"));
					
					/* 
					 * No longer available in final specification!
					 */
					/*
					printer.setNumberOfDocuments(Integer.parseInt(obj
							.getString("numberOfDocuments")));
							
					printer.setNumberOfPages(Integer.parseInt(obj
							.getString("numberOfPages")));
					*/
					
					printer.setCapsFormat(obj.getString("capsFormat"));

					printer.setCreateTime(new Date(Long.parseLong(obj
							.getString("createTime"))));
					printer.setUpdateTime(new Date(Long.parseLong(obj
							.getString("updateTime"))));
					printer.setCreateTime(new Date(Long.parseLong(obj
							.getString("createTime"))));
					printer.setAccessTime(new Date(Long.parseLong(obj
							.getString("accessTime"))));

					List<String> tags = new ArrayList<String>();
					for (int j = 0; j < obj.getJSONArray("tags").length(); j++) {
						tags.add(obj.getJSONArray("tags").getString(j));
					}
					printer.setTags(tags);

					List<AccessRole> roles = new ArrayList<AccessRole>();
					for (int j = 0; j < obj.getJSONArray("access").length(); j++) {
						JSONObject access = obj.getJSONArray("access")
								.getJSONObject(j);
						AccessRole role = new AccessRole();
						role.setEmail(access.getString("email"));
						role.setName(access.getString("name"));
						role.setRole(access.getString("role"));
						roles.add(role);
					}
					printer.setAccess(roles);

					printer.setCapabilities(obj.getJSONArray("capabilities")
							.toString());
				}

				lastResponse.setSuccess(true);
				return true;
			} else {
				lastResponse.setSuccess(false);
				return false;
			}
		} else {
			lastResponse.setSuccess(false);
			lastResponse.setMessage("HTTP result code: " + code);
			return false;
		}
	}