Search in sources :

Example 1 with VariableContentPaginatedResults

use of org.sagebionetworks.repo.model.VariableContentPaginatedResults in project Synapse-Repository-Services by Sage-Bionetworks.

the class Synapse method getAccessRequirements.

public VariableContentPaginatedResults<AccessRequirement> getAccessRequirements(String entityId) throws SynapseException {
    String uri = ENTITY + "/" + entityId + ACCESS_REQUIREMENT;
    JSONObject jsonAccessRequirements = getEntity(uri);
    JSONObjectAdapter adapter = new JSONObjectAdapterImpl(jsonAccessRequirements);
    VariableContentPaginatedResults<AccessRequirement> results = new VariableContentPaginatedResults<AccessRequirement>();
    try {
        results.initializeFromJSONObject(adapter);
        return results;
    } catch (JSONObjectAdapterException e) {
        throw new SynapseException(e);
    }
}
Also used : JSONObject(org.json.JSONObject) SynapseException(org.sagebionetworks.client.exceptions.SynapseException) JSONObjectAdapter(org.sagebionetworks.schema.adapter.JSONObjectAdapter) JSONObjectAdapterException(org.sagebionetworks.schema.adapter.JSONObjectAdapterException) VariableContentPaginatedResults(org.sagebionetworks.repo.model.VariableContentPaginatedResults) JSONObjectAdapterImpl(org.sagebionetworks.schema.adapter.org.json.JSONObjectAdapterImpl) AccessRequirement(org.sagebionetworks.repo.model.AccessRequirement)

Example 2 with VariableContentPaginatedResults

use of org.sagebionetworks.repo.model.VariableContentPaginatedResults in project Synapse-Repository-Services by Sage-Bionetworks.

the class Synapse method getUnmetAccessReqAccessRequirements.

public VariableContentPaginatedResults<AccessRequirement> getUnmetAccessReqAccessRequirements(String entityId) throws SynapseException {
    String uri = ENTITY + "/" + entityId + ACCESS_REQUIREMENT_UNFULFILLED;
    JSONObject jsonAccessRequirements = getEntity(uri);
    JSONObjectAdapter adapter = new JSONObjectAdapterImpl(jsonAccessRequirements);
    VariableContentPaginatedResults<AccessRequirement> results = new VariableContentPaginatedResults<AccessRequirement>();
    try {
        results.initializeFromJSONObject(adapter);
        return results;
    } catch (JSONObjectAdapterException e) {
        throw new SynapseException(e);
    }
}
Also used : JSONObject(org.json.JSONObject) SynapseException(org.sagebionetworks.client.exceptions.SynapseException) JSONObjectAdapter(org.sagebionetworks.schema.adapter.JSONObjectAdapter) JSONObjectAdapterException(org.sagebionetworks.schema.adapter.JSONObjectAdapterException) VariableContentPaginatedResults(org.sagebionetworks.repo.model.VariableContentPaginatedResults) JSONObjectAdapterImpl(org.sagebionetworks.schema.adapter.org.json.JSONObjectAdapterImpl) AccessRequirement(org.sagebionetworks.repo.model.AccessRequirement)

Aggregations

JSONObject (org.json.JSONObject)2 SynapseException (org.sagebionetworks.client.exceptions.SynapseException)2 AccessRequirement (org.sagebionetworks.repo.model.AccessRequirement)2 VariableContentPaginatedResults (org.sagebionetworks.repo.model.VariableContentPaginatedResults)2 JSONObjectAdapter (org.sagebionetworks.schema.adapter.JSONObjectAdapter)2 JSONObjectAdapterException (org.sagebionetworks.schema.adapter.JSONObjectAdapterException)2 JSONObjectAdapterImpl (org.sagebionetworks.schema.adapter.org.json.JSONObjectAdapterImpl)2