parameters.put(AuthorizationConstants.DOMAIN_PARAM, domain.name());
return parameters;
}
<<<<<<< HEAD
@Override
public Questionnaire getCertifiedUserTest() throws SynapseException {
JSONObject jsonObj = getEntity(CERTIFIED_USER_TEST);
JSONObjectAdapter adapter = new JSONObjectAdapterImpl(jsonObj);
Questionnaire results = new Questionnaire();
try {
results.initializeFromJSONObject(adapter);
return results;
} catch (JSONObjectAdapterException e) {
throw new SynapseClientException(e);
}
}
@Override
public QuestionnaireResponse submitCertifiedUserTestResponse(
QuestionnaireResponse response) throws SynapseException {
try {
JSONObject jsonObj = EntityFactory.createJSONObjectForEntity(response);
jsonObj = createJSONObject(CERTIFIED_USER_TEST_RESPONSE, jsonObj);
return initializeFromJSONObject(jsonObj, QuestionnaireResponse.class);
} catch (JSONObjectAdapterException e) {
throw new SynapseClientException(e);
}
}
@Override
public PaginatedResults getCertifiedUserTestResponses(
long offset, long limit, Long principalId) throws SynapseException {
String uri = null;
if (principalId==null) {
uri = CERTIFIED_USER_TEST_RESPONSE+"?"+OFFSET+"="+offset+"&"+LIMIT+"="+limit;
} else {
uri = CERTIFIED_USER_TEST_RESPONSE+"?"+TEAM_ID_REQUEST_PARAMETER+"="+principalId+"&"+OFFSET+"="+offset+"&"+LIMIT+"="+limit;
}
JSONObject jsonObj = getEntity(uri);
JSONObjectAdapter adapter = new JSONObjectAdapterImpl(jsonObj);
PaginatedResults results = new PaginatedResults(QuestionnaireResponse.class);
try {
results.initializeFromJSONObject(adapter);
return results;
} catch (JSONObjectAdapterException e) {
throw new SynapseClientException(e);
}
}
@Override
public void deleteCertifiedUserTestResponse(Long id) throws SynapseException {
getSharedClientConnection().deleteUri(repoEndpoint, CERTIFIED_USER_TEST_RESPONSE + "/" + id, getUserAgent());
}
@Override
public PassingRecord getCertifiedUserPassingRecord(Long principalId) throws SynapseException {
if (principalId==null) throw new IllegalArgumentException("principalId may not be null.");
JSONObject jsonObj = getEntity(USER+principalId+CERTIFIED_USER_PASSING_RECORD);
JSONObjectAdapter adapter = new JSONObjectAdapterImpl(jsonObj);
PassingRecord results = new PassingRecord();
try {
results.initializeFromJSONObject(adapter);
return results;
} catch (JSONObjectAdapterException e) {
throw new SynapseClientException(e);
}
}
=======
>>>>>>> 015a48ccb8ea826c7a96acea190af1d309765709
}
|