import java.util.List;
import java.util.Map;
+
+import javax.ws.rs.core.Response;
+
import org.collectionspace.services.CitationJAXBSchema;
import org.collectionspace.services.citation.CitationTermGroup;
import org.collectionspace.services.citation.CitationTermGroupList;
// Submit the request to the service and store the response.
CitationAuthorityClient client = new CitationAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (shortId != null) {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
- res.releaseConnection();
+ res.close();
}
List<AbstractCommonList.ListItem> items =
list.getListItem();
Response readItem(String vcsid, String csid);
//(R)ead Item
- ClientResponse<String> readItem(String vcsid, String csid, Boolean includeDeleted);
+ Response readItem(String vcsid, String csid, Boolean includeDeleted);
//(U)pdate Item
- ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);
+ Response updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);
//(D)elete Item
Response deleteItem(String vcsid, String csid);
// Get a list of objects that
- ClientResponse<AuthorityRefDocList> getReferencingObjects(
+ Response getReferencingObjects(
String parentcsid,
String itemcsid);
/**
* @return
* @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
*/
- public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String itemcsid);
+ public Response getItemAuthorityRefs(String parentcsid, String itemcsid);
/*
*
*/
- ClientResponse<String> readByName(String name);
+ Response readByName(String name);
- ClientResponse<String> readByName(String name, Boolean includeDeleted);
+ Response readByName(String name, Boolean includeDeleted);
/*
* Item subresource methods
* @param shortId the shortIdentifier
* @return the client response
*/
- public ClientResponse<String> readNamedItem(String vcsid, String shortId);
+ public Response readNamedItem(String vcsid, String shortId);
- public ClientResponse<String> readNamedItem(String vcsid, String shortId, Boolean includeDeleted);
+ public Response readNamedItem(String vcsid, String shortId, Boolean includeDeleted);
/**
* Read item in Named Authority.
* @param csid the csid
* @return the client response
*/
- public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid);
+ public Response readItemInNamedAuthority(String authShortId, String csid);
- public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted);
+ public Response readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted);
/**
* Read named item in Named Authority.
* @param itemShortId the shortIdentifier for the item
* @return the client response
*/
- public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId);
+ public Response readNamedItemInNamedAuthority(String authShortId, String itemShortId);
- public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted);
+ public Response readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted);
/**
* Read item list, filtering by partial term match, or keywords. Only one of
* which will filter list results to return only matched resources.
* @return the client response
*/
- public ClientResponse<AbstractCommonList> readItemList(String inAuthority, String partialTerm, String keywords);
+ public Response readItemList(String inAuthority, String partialTerm, String keywords);
- public ClientResponse<AbstractCommonList> readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted);
+ public Response readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted);
/**
* Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
* which will filter list results to return only matched resources.
* @return the client response
*/
- public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(String specifier,
+ public Response readItemListForNamedAuthority(String specifier,
String partialTerm, String keywords);
- public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(String specifier,
+ public Response readItemListForNamedAuthority(String specifier,
String partialTerm,
String keywords,
Boolean includeDeleted);
* Workflow related methods
*/
- public ClientResponse<String> readItemWorkflow(String vcsid, String csid);
+ public Response readItemWorkflow(String vcsid, String csid);
- public ClientResponse<String> updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition);
+ public Response updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition);
}
}
@Override
- public ClientResponse<String> readItem(String vcsid, String csid, Boolean includeDeleted) {
+ public Response readItem(String vcsid, String csid, Boolean includeDeleted) {
return getProxy().readItem(vcsid, csid, includeDeleted.toString());
}
//(U)pdate Item
@Override
- public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {
+ public Response updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {
return getProxy().updateItem(vcsid, csid, poxPayloadOut.getBytes());
}
}
@Override
- public ClientResponse<AuthorityRefDocList> getReferencingObjects(
+ public Response getReferencingObjects( // ClientResponse<AuthorityRefDocList>
String parentcsid,
String itemcsid) {
return getProxy().getReferencingObjects(parentcsid, itemcsid, Boolean.TRUE.toString());
* @return the item authority refs
*/
@Override
- public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {
+ public Response getItemAuthorityRefs(String parentcsid, String csid) {
return getProxy().getItemAuthorityRefs(parentcsid, csid);
}
*/
@Override
- public ClientResponse<String> readByName(String name) {
+ public Response readByName(String name) {
return getProxy().readByName(name, INCLUDE_DELETE_TRUE);
}
@Override
- public ClientResponse<String> readByName(String name, Boolean includeDeleted) {
+ public Response readByName(String name, Boolean includeDeleted) {
return getProxy().readByName(name, includeDeleted.toString());
}
* @return the client response
*/
@Override
- public ClientResponse<String> readNamedItem(String vcsid, String shortId) {
+ public Response readNamedItem(String vcsid, String shortId) {
return getProxy().readNamedItem(vcsid, shortId, INCLUDE_DELETE_TRUE);
}
@Override
- public ClientResponse<String> readNamedItem(String vcsid, String shortId, Boolean includeDeleted) {
+ public Response readNamedItem(String vcsid, String shortId, Boolean includeDeleted) {
return getProxy().readNamedItem(vcsid, shortId, includeDeleted.toString());
}
* @return the client response
*/
@Override
- public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {
+ public Response readItemInNamedAuthority(String authShortId, String csid) {
return getProxy().readItemInNamedAuthority(authShortId, csid, INCLUDE_DELETE_TRUE);
}
@Override
- public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted) {
+ public Response readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted) {
return getProxy().readItemInNamedAuthority(authShortId, csid, includeDeleted.toString());
}
* @return the client response
*/
@Override
- public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
+ public Response readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId, INCLUDE_DELETE_TRUE);
}
@Override
- public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted) {
+ public Response readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted) {
return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId, includeDeleted.toString());
}
* @return the client response
*/
@Override
- public ClientResponse<AbstractCommonList>
- readItemList(String inAuthority, String partialTerm, String keywords) {
+ public Response readItemList(String inAuthority, String partialTerm, String keywords) {
return getProxy().readItemList(inAuthority, partialTerm, keywords, INCLUDE_DELETE_TRUE);
}
@Override
- public ClientResponse<AbstractCommonList>
- readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted) {
+ public Response readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted) {
return getProxy().readItemList(inAuthority, partialTerm, keywords, includeDeleted.toString());
}
*/
@Override
- public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+ public Response readItemListForNamedAuthority(
String specifier, String partialTerm, String keywords) {
return getProxy().readItemListForNamedAuthority(specifier, partialTerm, keywords, INCLUDE_DELETE_TRUE);
}
@Override
- public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+ public Response readItemListForNamedAuthority(
String specifier,
String partialTerm,
String keywords,
*/
@Override
- public ClientResponse<String> readItemWorkflow(String vcsid, String csid) {
+ public Response readItemWorkflow(String vcsid, String csid) {
return getProxy().readItemWorkflow(vcsid, csid);
}
@Override
- public ClientResponse<String> updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition) {
+ public Response updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition) {
return getProxy().updateItemWorkflowWithTransition(vcsid, csid, workflowTransition);
}
//(C)reate Item
@POST
@Path("/{vcsid}/items/")
- ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
+ Response createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
//(R)ead Item
@GET
@Path("/{vcsid}/items/{csid}")
- ClientResponse<String> readItem(@PathParam("vcsid") String vcsid,
+ Response readItem(@PathParam("vcsid") String vcsid,
@PathParam("csid") String csid,
@QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
//(U)pdate Item
@PUT
@Path("/{vcsid}/items/{csid}")
- ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
+ Response updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
//(D)elete Item
@DELETE
@GET
@Path("{csid}/items/{itemcsid}/refObjs")
@Produces("application/xml")
- ClientResponse<AuthorityRefDocList> getReferencingObjects(
+ Response getReferencingObjects( // ClientResponse<AuthorityRefDocList>
@PathParam("csid") String parentcsid,
@PathParam("itemcsid") String itemcsid,
@QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
@GET
@Produces({"application/xml"})
@Path("/{parentcsid}/items/{itemcsid}/authorityrefs/")
- public ClientResponse<AuthorityRefList> getItemAuthorityRefs(
+ public Response getItemAuthorityRefs( // public ClientResponse<AuthorityRefList>
@PathParam("parentcsid") String parentcsid,
@PathParam("itemcsid") String itemcsid);
//(R)ead by name
@GET
@Path("/urn:cspace:name({name})")
- ClientResponse<String> readByName(@PathParam("name") String name,
+ Response readByName(@PathParam("name") String name,
@QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
/*
//(R)ead Named Item
@GET
@Path("/{vcsid}/items/urn:cspace:name({specifier})")
- ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid,
+ Response readNamedItem(@PathParam("vcsid") String vcsid,
@PathParam("specifier") String specifier,
@QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
//(R)ead Item In Named Authority
@GET
@Path("/urn:cspace:name({specifier})/items/{csid}")
- ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier,
+ Response readItemInNamedAuthority(@PathParam("specifier") String specifier,
@PathParam("csid") String csid,
@QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
//(R)ead Named Item In Named Authority
@GET
@Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")
- ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier,
+ Response readNamedItemInNamedAuthority(@PathParam("specifier") String specifier,
@PathParam("itemspecifier") String itemspecifier,
@QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
@GET
@Produces({"application/xml"})
@Path("/{csid}/items/")
- ClientResponse<AbstractCommonList> readItemList(
+ Response readItemList(
@PathParam("csid") String vcsid,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
@GET
@Produces({"application/xml"})
@Path("/urn:cspace:name({specifier})/items/")
- ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+ Response readItemListForNamedAuthority( // ClientResponse<AbstractCommonList>
@PathParam("specifier") String specifier,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
@Produces({"application/xml"})
@Consumes({"application/xml"})
@Path("/{vcsid}/items/{csid}" + WorkflowClient.SERVICE_PATH)
- ClientResponse<String> readItemWorkflow(@PathParam("vcsid") String vcsid,
+ Response readItemWorkflow(@PathParam("vcsid") String vcsid,
@PathParam("csid") String csid);
//(U)pdate Item workflow
@PUT
@Path("/{vcsid}/items/{csid}" + WorkflowClient.SERVICE_PATH + "/{transition}")
- ClientResponse<String> updateItemWorkflowWithTransition(
+ Response updateItemWorkflowWithTransition(
@PathParam("vcsid") String vcsid,
@PathParam("csid") String csid,
@PathParam("transition") String transition);
@GET
@Produces({"application/xml"})
@Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
+ Response getAuthorityRefs(@PathParam("csid") String csid); //ClientResponse<AuthorityRefList>
@GET
@Produces({"application/xml"})
setupRead();
// Submit the request to the service and store the response.
- AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
- ClientResponse<String> res = client.readByName(getKnowResourceIdentifier());
+ AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =
+ (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+ Response res = client.readByName(getKnowResourceIdentifier());
try {
int statusCode = res.getStatus();
// Submit the request to the service and store the response.
AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (shortId != null) {
} else {
Assert.fail("Internal Error: readItemList both vcsid and shortId are null!");
}
- int statusCode = res.getStatus();
-
- // Check the status code of the response: does it match
- // the expected response(s)?
- if (logger.isDebugEnabled()) {
- logger.debug(" " + testName + ": status = " + statusCode);
- }
- Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
- invalidStatusCodeMessage(testRequestType, statusCode));
- Assert.assertEquals(statusCode, testExpectedStatusCode);
-
- AbstractCommonList list = res.getEntity();
- List<AbstractCommonList.ListItem> items = list.getListItem();
- int nItemsReturned = items.size();
- long nItemsTotal = list.getTotalItems();
- if (logger.isDebugEnabled()) {
- logger.debug(" " + testName + ": Expected "
- + nItemsToCreateInList + " items; got: " + nItemsReturned + " of: " + nItemsTotal);
- }
- Assert.assertEquals(nItemsTotal, nItemsToCreateInList);
-
- if(logger.isTraceEnabled()){
- AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+ try {
+ int statusCode = res.getStatus();
+
+ // Check the status code of the response: does it match
+ // the expected response(s)?
+ if (logger.isDebugEnabled()) {
+ logger.debug(" " + testName + ": status = " + statusCode);
+ }
+ Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+ invalidStatusCodeMessage(testRequestType, statusCode));
+ Assert.assertEquals(statusCode, testExpectedStatusCode);
+
+ AbstractCommonList list = res.readEntity(AbstractCommonList.class);
+ List<AbstractCommonList.ListItem> items = list.getListItem();
+ int nItemsReturned = items.size();
+ long nItemsTotal = list.getTotalItems();
+ if (logger.isDebugEnabled()) {
+ logger.debug(" " + testName + ": Expected "
+ + nItemsToCreateInList + " items; got: " + nItemsReturned + " of: " + nItemsTotal);
+ }
+ Assert.assertEquals(nItemsTotal, nItemsToCreateInList);
+
+ if(logger.isTraceEnabled()){
+ AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+ }
+ } finally {
+ res.close();
}
}
AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =
(AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
PoxPayloadOut multipart = createNonExistenceItemInstance(client.getItemCommonPartName(), NON_EXISTENT_ID);
- ClientResponse<String> res =
- client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
+ Response res = client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
try {
int statusCode = res.getStatus();
invalidStatusCodeMessage(testRequestType, statusCode));
Assert.assertEquals(statusCode, testExpectedStatusCode);
} finally {
- res.releaseConnection();
+ res.close();
}
}
// Ask for a list of all resources filtered by the incoming 'includeDeleted' workflow param
//
AuthorityClient client = (AuthorityClient) this.getClientInstance();
- ClientResponse<AbstractCommonList> res = client.readItemList(parentCsid,
+ Response res = client.readItemList(parentCsid,
null, /* partial terms */
null, /* keywords */
includeDeleted);
try {
assertStatusCode(res, testName);
- AbstractCommonList list = res.getEntity();
+ AbstractCommonList list = res.readEntity(AbstractCommonList.class);
result = list.getTotalItems();
} finally {
if (res != null) {
// Next, test that a GET with WorkflowClient.WORKFLOWSTATE_DELETED query param set to 'false' returns a 404
//
AuthorityClient client = (AuthorityClient) this.getClientInstance();
- ClientResponse<String> res = client.readItem(parentCsid, csid, Boolean.FALSE);
+ Response res = client.readItem(parentCsid, csid, Boolean.FALSE);
try {
int result = res.getStatus();
Assert.assertEquals(result, STATUS_NOT_FOUND);
// Read the existing object
//
AuthorityClient client = (AuthorityClient) this.getClientInstance();
- ClientResponse<String> res = client.readItemWorkflow(parentCsid, itemCsid);
+ Response res = client.readItemWorkflow(parentCsid, itemCsid);
WorkflowCommon workflowCommons = null;
try {
assertStatusCode(res, testName);
logger.debug("Got object to update life cycle state with ID: " + itemCsid);
- PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
workflowCommons = (WorkflowCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowCommon.class);
Assert.assertNotNull(workflowCommons);
logger.debug("Current workflow state:" + objectAsXmlString(workflowCommons, WorkflowCommon.class));
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
//
Assert.assertNotNull(updatedWorkflowCommons);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
assertStatusCode(res, testName);
logger.debug(
"Got workflow state of updated object with ID: " + itemCsid);
- PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
updatedWorkflowCommons = (WorkflowCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowCommon.class);
Assert.assertNotNull(workflowCommons);
String currentState = updatedWorkflowCommons.getCurrentLifeCycleState();
currentState);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
trials++;
CollectionobjectsCommon collectionObject = null;
try {
assertStatusCode(res, testName);
- PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
collectionObject = (CollectionobjectsCommon) extractPart(input,
collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
Assert.assertNotNull(collectionObject);
AuthorityRefList list = null;
try {
assertStatusCode(res, testName);
- list = (AuthorityRefList)res.getEntity();
+ list = (AuthorityRefList)res.readEntity(AuthorityRefList.class);
} finally {
if (res != null) {
res.close();
import java.util.List;
import java.util.Map;
+
+import javax.ws.rs.core.Response;
+
import org.collectionspace.services.ConceptJAXBSchema;
import org.collectionspace.services.client.AbstractCommonListUtils;
import org.collectionspace.services.client.AuthorityClient;
// Submit the request to the service and store the response.
ConceptAuthorityClient client = new ConceptAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if(vcsid!= null) {
res = client.readItemList(vcsid, null, null);
} else if(shortId!= null) {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
- res.releaseConnection();
+ res.close();
}
List<AbstractCommonList.ListItem> items =
list.getListItem();
* @param multipart the multipart
* @return the client response
*/
- public ClientResponse<Response> createContact(String parentcsid,
+ public Response createContact(String parentcsid,
String itemcsid, PoxPayloadOut xmlPayload);
/**
* @param multipart
* @return the client response
*/
- public ClientResponse<Response> createContactForNamedItem(
+ public Response createContactForNamedItem(
String parentcsid,
String itemspecifier,
PoxPayloadOut xmlPayload);
* @param multipart
* @return the client response
*/
- public ClientResponse<Response> createContactForItemInNamedAuthority(
+ public Response createContactForItemInNamedAuthority(
String parentspecifier,
String itemcsid,
PoxPayloadOut xmlPayload);
* @param multipart
* @return the client response
*/
- public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+ public Response createContactForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier,
PoxPayloadOut xmlPayload);
* @param csid the csid
* @return the client response
*/
- public ClientResponse<String> readContact(String parentcsid,
+ public Response readContact(String parentcsid,
String itemcsid, String csid);
/**
* @param csid
* @return the client response
*/
- public ClientResponse<String> readContactForNamedItem(
+ public Response readContactForNamedItem(
String parentcsid,
String itemspecifier,
String csid);
* @param csid
* @return the client response
*/
- public ClientResponse<String> readContactInNamedAuthority(
+ public Response readContactInNamedAuthority(
String parentspecifier,
String itemcsid,
String csid);
* @param csid
* @return the client response
*/
- public ClientResponse<String> readContactForNamedItemInNamedAuthority(
+ public Response readContactForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier,
String csid);
* @param itemcsid the itemcsid
* @return the client response
*/
- public ClientResponse<AbstractCommonList> readContactList(String parentcsid,
+ public Response readContactList(String parentcsid,
String itemcsid);
/**
* @param itemspecifier (shortIdentifier)
* @return the client response
*/
- public ClientResponse<AbstractCommonList> readContactListForNamedItem(
+ public Response readContactListForNamedItem(
String parentcsid,
String itemspecifier);
* @param itemcsid
* @return the client response
*/
- public ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+ public Response readContactListForItemInNamedAuthority(
String parentspecifier,
String itemcsid);
* @param itemspecifier (shortIdentifier)
* @return the client response
*/
- public ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+ public Response readContactListForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier);
* @param multipart the multipart
* @return the client response
*/
- public ClientResponse<String> updateContact(String parentcsid,
+ public Response updateContact(String parentcsid,
String itemcsid, String csid, PoxPayloadOut xmlPayload);
/**
* @param multipart the multipart
* @return the client response
*/
- public ClientResponse<String> updateContactForNamedItem(
+ public Response updateContactForNamedItem(
String parentcsid,
String itemspecifier,
String csid,
* @param multipart the multipart
* @return the client response
*/
- public ClientResponse<String> updateContactInNamedAuthority(
+ public Response updateContactInNamedAuthority(
String parentspecifier,
String itemcsid,
String csid,
* @param multipart the multipart
* @return the client response
*/
- public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+ public Response updateContactForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier,
String csid,
* @param csid the csid
* @return the client response
*/
- public ClientResponse<Response> deleteContact(String parentcsid,
+ public Response deleteContact(String parentcsid,
String itemcsid, String csid);
/**
* @param csid the csid
* @return the client response
*/
- public ClientResponse<Response> deleteContactForNamedItem(
+ public Response deleteContactForNamedItem(
String parentcsid,
String itemspecifier,
String csid);
* @param csid the csid
* @return the client response
*/
- public ClientResponse<Response> deleteContactInNamedAuthority(
+ public Response deleteContactInNamedAuthority(
String parentspecifier,
String itemcsid,
String csid);
* @param csid the csid
* @return the client response
*/
- public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+ public Response deleteContactForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier,
String csid);
implements AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P> {
@Override
- public ClientResponse<Response> createContact(String parentcsid,
+ public Response createContact(String parentcsid,
String itemcsid, PoxPayloadOut xmlPayload) {
return getProxy().createContact(parentcsid, itemcsid, xmlPayload.getBytes());
}
* @return the client response
*/
@Override
- public ClientResponse<Response> createContactForNamedItem(
+ public Response createContactForNamedItem(
String parentcsid,
String itemspecifier,
PoxPayloadOut xmlPayload) {
* @return the client response
*/
@Override
- public ClientResponse<Response> createContactForItemInNamedAuthority(
+ public Response createContactForItemInNamedAuthority(
String parentspecifier,
String itemcsid,
PoxPayloadOut xmlPayload) {
* @return the client response
*/
@Override
- public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+ public Response createContactForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier,
PoxPayloadOut xmlPayload) {
* @return the client response
*/
@Override
- public ClientResponse<String> readContact(String parentcsid,
+ public Response readContact(String parentcsid,
String itemcsid, String csid) {
return getProxy().readContact(parentcsid, itemcsid, csid);
}
* @return the client response
*/
@Override
- public ClientResponse<String> readContactForNamedItem(
+ public Response readContactForNamedItem(
String parentcsid,
String itemspecifier,
String csid){
* @return the client response
*/
@Override
- public ClientResponse<String> readContactInNamedAuthority(
+ public Response readContactInNamedAuthority(
String parentspecifier,
String itemcsid,
String csid){
* @return the client response
*/
@Override
- public ClientResponse<String> readContactForNamedItemInNamedAuthority(
+ public Response readContactForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier,
String csid){
* @return the client response
*/
@Override
- public ClientResponse<AbstractCommonList> readContactList(String parentcsid,
+ public Response readContactList(String parentcsid,
String itemcsid) {
return getProxy().readContactList(parentcsid, itemcsid);
}
* @return the client response
*/
@Override
- public ClientResponse<AbstractCommonList> readContactListForNamedItem(
+ public Response readContactListForNamedItem(
String parentcsid,
String itemspecifier){
return getProxy().readContactList(parentcsid, itemspecifier);
* @return the client response
*/
@Override
- public ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+ public Response readContactListForItemInNamedAuthority(
String parentspecifier,
String itemcsid){
return getProxy().readContactList(parentspecifier, itemcsid);
* @return the client response
*/
@Override
- public ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+ public Response readContactListForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier){
return getProxy().readContactList(parentspecifier, itemspecifier);
* @return the client response
*/
@Override
- public ClientResponse<String> updateContact(String parentcsid,
+ public Response updateContact(String parentcsid,
String itemcsid, String csid, PoxPayloadOut xmlPayload) {
return getProxy().updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
}
* @return the client response
*/
@Override
- public ClientResponse<String> updateContactForNamedItem(
+ public Response updateContactForNamedItem(
String parentcsid,
String itemspecifier,
String csid,
* @return the client response
*/
@Override
- public ClientResponse<String> updateContactInNamedAuthority(
+ public Response updateContactInNamedAuthority(
String parentspecifier,
String itemcsid,
String csid,
* @return the client response
*/
@Override
- public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+ public Response updateContactForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier,
String csid,
* @return the client response
*/
@Override
- public ClientResponse<Response> deleteContact(String parentcsid,
+ public Response deleteContact(String parentcsid,
String itemcsid, String csid) {
return getProxy().deleteContact(parentcsid,
itemcsid, csid);
* @return the client response
*/
@Override
- public ClientResponse<Response> deleteContactForNamedItem(
+ public Response deleteContactForNamedItem(
String parentcsid,
String itemspecifier,
String csid) {
* @return the client response
*/
@Override
- public ClientResponse<Response> deleteContactInNamedAuthority(
+ public Response deleteContactInNamedAuthority(
String parentspecifier,
String itemcsid,
String csid) {
* @return the client response
*/
@Override
- public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+ public Response deleteContactForNamedItemInNamedAuthority(
String parentspecifier,
String itemspecifier,
String csid) {
@GET
@Produces({"application/xml"})
@Path("/{parentcsid}/items/{itemcsid}/contacts/")
- public ClientResponse<AbstractCommonList> readContactList(
+ public Response readContactList(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemcsid") String itemcsid);
@GET
@Produces({"application/xml"})
@Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<AbstractCommonList> readContactListForNamedItem(
+ Response readContactListForNamedItem(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemspecifier") String itemspecifier);
@GET
@Produces({"application/xml"})
@Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
- ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+ Response readContactListForItemInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemcsid") String itemcsid);
@GET
@Produces({"application/xml"})
@Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+ Response readContactListForNamedItemInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemspecifier") String itemspecifier);
//(C)reate Contact
@POST
@Path("/{parentcsid}/items/{itemcsid}/contacts/")
- ClientResponse<Response> createContact(
+ Response createContact(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemcsid") String itemcsid,
byte[] xmlPayload);
@POST
@Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<Response> createContactForNamedItem(
+ Response createContactForNamedItem(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemspecifier") String itemspecifier,
byte[] xmlPayload);
@POST
@Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
- ClientResponse<Response> createContactForItemInNamedAuthority(
+ Response createContactForItemInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemcsid") String itemcsid,
byte[] xmlPayload);
@POST
@Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+ Response createContactForNamedItemInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemspecifier") String itemspecifier,
byte[] xmlPayload);
//(R)ead Contact
@GET
@Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> readContact(
+ Response readContact(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemcsid") String itemcsid,
@PathParam("csid") String csid);
@GET
@Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> readContactForNamedItem(
+ Response readContactForNamedItem(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemspecifier") String itemspecifier,
@PathParam("csid") String csid);
@GET
@Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> readContactInNamedAuthority(
+ Response readContactInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemcsid") String itemcsid,
@PathParam("csid") String csid);
@GET
@Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> readContactForNamedItemInNamedAuthority(
+ Response readContactForNamedItemInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemspecifier") String itemspecifier,
@PathParam("csid") String csid);
//(U)pdate Contact
@PUT
@Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> updateContact(
+ Response updateContact(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemcsid") String itemcsid,
@PathParam("csid") String csid,
byte[] xmlPayload);
@PUT
@Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> updateContactForNamedItem(
+ Response updateContactForNamedItem(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemspecifier") String itemspecifier,
@PathParam("csid") String csid,
byte[] xmlPayload);
@PUT
@Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> updateContactInNamedAuthority(
+ Response updateContactInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemcsid") String itemcsid,
@PathParam("csid") String csid,
byte[] xmlPayload);
@PUT
@Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+ Response updateContactForNamedItemInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemspecifier") String itemspecifier,
@PathParam("csid") String csid,
//(D)elete Contact
@DELETE
@Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<Response> deleteContact(
+ Response deleteContact(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemcsid") String itemcsid,
@PathParam("csid") String csid);
@DELETE
@Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<Response> deleteContactForNamedItem(
+ Response deleteContactForNamedItem(
@PathParam("parentcsid") String parentcsid,
@PathParam("itemspecifier") String itemspecifier,
@PathParam("csid") String csid);
@DELETE
@Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<Response> deleteContactInNamedAuthority(
+ Response deleteContactInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemcsid") String itemcsid,
@PathParam("csid") String csid);
@DELETE
@Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+ Response deleteContactForNamedItemInNamedAuthority(
@PathParam("parentspecifier") String parentspecifier,
@PathParam("itemspecifier") String itemspecifier,
@PathParam("csid") String csid);
// Get the auth ref docs and check them
PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
- ClientResponse<AuthorityRefDocList> res =
- personAuthClient.getReferencingObjects(personAuthCSID, currentOwnerPersonCSID);
+ Response res = personAuthClient.getReferencingObjects(personAuthCSID, currentOwnerPersonCSID);
AuthorityRefDocList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AuthorityRefDocList.class);
} finally {
if (res != null) {
res.close();
res = personAuthClient.getReferencingObjects(personAuthCSID, depositorPersonCSID);
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AuthorityRefDocList.class);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
// Single scalar field
PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
- ClientResponse<AuthorityRefDocList> res =
- personAuthClient.getReferencingObjects(personAuthCSID, insurerPersonCSID);
+ Response res = personAuthClient.getReferencingObjects(personAuthCSID, insurerPersonCSID);
AuthorityRefDocList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AuthorityRefDocList.class);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
// Submit the request to the service and store the response.
LocationAuthorityClient client = new LocationAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (shortId != null) {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
res.close();
* @return
*/
public static String getAuthorityRefName(String csid, OrgAuthorityClient client){
- if(client==null)
+ if (client==null) {
client = new OrgAuthorityClient();
+ }
+
Response res = client.read(csid);
try {
int statusCode = res.getStatus();
- if(!READ_REQ.isValidStatusCode(statusCode)
- ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {
+ if (!READ_REQ.isValidStatusCode(statusCode) || statusCode != CollectionSpaceClientUtils.STATUS_OK) {
throw new RuntimeException("Invalid status code returned: "+statusCode);
}
//FIXME: remove the following try catch once Aron fixes signatures
try {
- PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
OrgauthoritiesCommon orgAuthority =
(OrgauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,
client.getCommonPartName(), OrgauthoritiesCommon.class);
}
//FIXME: remove the following try catch once Aron fixes signatures
try {
- PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
OrganizationsCommon org =
(OrganizationsCommon) CollectionSpaceClientUtils.extractPart(input,
client.getItemCommonPartName(), OrganizationsCommon.class);
// Get the auth refs and check them
// FIXME - need to create this method in the client
// and get the ID for the organization item
- ClientResponse<AuthorityRefList> res2 =
- orgAuthClient.getItemAuthorityRefs(knownResourceId, knownItemResourceId);
+ Response res2 = orgAuthClient.getItemAuthorityRefs(knownResourceId, knownItemResourceId);
AuthorityRefList list = null;
try {
assertStatusCode(res2, testName);
- list = res2.getEntity();
+ list = res2.readEntity(AuthorityRefList.class);
} finally {
if (res2 != null) {
res2.close();
itemcsid, identifier, new ContactClient().getCommonPartName());
String newID = null;
- ClientResponse<Response> res =
- client.createContact(parentcsid, itemcsid, multipart);
+ Response res = client.createContact(parentcsid, itemcsid, multipart);
try {
assertStatusCode(res, testName);
newID = OrgAuthorityClientUtils.extractId(res);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
// Submit the request to the service and store the response.
OrgAuthorityClient client = new OrgAuthorityClient();
- ClientResponse<String> res =
- client.readContact(knownResourceId, knownItemResourceId,
+ Response res =client.readContact(knownResourceId, knownItemResourceId,
knownContactResourceId);
try {
assertStatusCode(res, testName);
// Check whether we've received a contact.
- PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
ContactsCommon contact = (ContactsCommon) extractPart(input,
new ContactClient().getCommonPartName(), ContactsCommon.class);
Assert.assertNotNull(contact);
// Submit the request to the service and store the response.
OrgAuthorityClient client = new OrgAuthorityClient();
- ClientResponse<String> res =
- client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
+ Response res = client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
try {
int statusCode = res.getStatus();
// Submit the request to the service and store the response.
OrgAuthorityClient client = new OrgAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (name != null) {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
res.close();
// Submit the request to the service and store the response.
OrgAuthorityClient client = new OrgAuthorityClient();
- ClientResponse<AbstractCommonList> res =
- client.readContactList(parentcsid, itemcsid);
+ Response res = client.readContactList(parentcsid, itemcsid);
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
res.close();
// Retrieve the contents of a resource to update.
OrgAuthorityClient client = new OrgAuthorityClient();
- ClientResponse<String> res =
- client.readContact(knownResourceId, knownItemResourceId, knownContactResourceId);
+ Response res = client.readContact(knownResourceId, knownItemResourceId, knownContactResourceId);
ContactsCommon contact = null;
try {
assertStatusCode(res, testName);
+ " in item: " + knownItemResourceId
+ " in parent: " + knownResourceId);
}
- PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
contact = (ContactsCommon) extractPart(input,
new ContactClient().getCommonPartName(), ContactsCommon.class);
Assert.assertNotNull(contact);
try {
assertStatusCode(res, testName);
// Retrieve the updated resource and verify that its contents exist.
- PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
ContactsCommon updatedContact =
(ContactsCommon) extractPart(input,
new ContactClient().getCommonPartName(), ContactsCommon.class);
// Submit the request to the service and store the response.
OrgAuthorityClient client = new OrgAuthorityClient();
- ClientResponse<Response> res =
- client.deleteContact(knownResourceId, knownItemResourceId, knownContactResourceId);
+ Response res = client.deleteContact(knownResourceId, knownItemResourceId, knownContactResourceId);
try {
assertStatusCode(res, testName);
} finally {
// Submit the request to the service and store the response.
OrgAuthorityClient client = new OrgAuthorityClient();
- ClientResponse<Response> res =
- client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
+ Response res = client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
try {
assertStatusCode(res, testName);
} finally {
}
//FIXME: remove the following try catch once Aron fixes signatures
try {
- PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
PersonauthoritiesCommon personAuthority =
(PersonauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,
client.getCommonPartName(), PersonauthoritiesCommon.class);
}
//FIXME: remove the following try catch once Aron fixes signatures
try {
- PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+ PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
PersonsCommon person =
(PersonsCommon) CollectionSpaceClientUtils.extractPart(input,
client.getItemCommonPartName(), PersonsCommon.class);
// Submit the request to the service and store the response.
PersonAuthorityClient client = new PersonAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (authorityCsid != null) {
res = client.readItemList(authorityCsid, partialTerm, keywords);
} else {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
// Submit the request to the service and store the response.
PersonAuthorityClient client = new PersonAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (authorityCsid != null) {
res = client.readItemList(authorityCsid, partialTerm, keywords);
} else {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
itemcsid, identifier, new ContactClient().getCommonPartName());
setupCreate();
- ClientResponse<Response> res =
- client.createContact(parentcsid, itemcsid, multipart);
+ Response res = client.createContact(parentcsid, itemcsid, multipart);
String newID = null;
try {
assertStatusCode(res, testName);
newID = PersonAuthorityClientUtils.extractId(res);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
// Submit the request to the service and store the response.
PersonAuthorityClient client = new PersonAuthorityClient();
PoxPayloadIn input = null;
- ClientResponse<String> res =
- client.readContact(knownResourceId, knownItemResourceId,
+ Response res = client.readContact(knownResourceId, knownItemResourceId,
knownContactResourceId);
try {
assertStatusCode(res, testName);
// Check whether we've received a contact.
- input = new PoxPayloadIn(res.getEntity());
+ input = new PoxPayloadIn(res.readEntity(String.class));
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
// Submit the request to the service and store the response.
PersonAuthorityClient client = new PersonAuthorityClient();
- ClientResponse<String> res =
- client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
+ Response res = client.readContact(knownResourceId, knownItemResourceId,
+ NON_EXISTENT_ID);
try {
assertStatusCode(res, testName);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
}
setupReadList();
// Submit the request to the service and store the response.
PersonAuthorityClient client = new PersonAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (name != null) {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
// Submit the request to the service and store the response.
PersonAuthorityClient client = new PersonAuthorityClient();
AbstractCommonList list = null;
- ClientResponse<AbstractCommonList> res =
- client.readContactList(parentcsid, itemcsid);
+ Response res = client.readContactList(parentcsid, itemcsid);
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
- res.releaseConnection();
+ res.close();
}
}
PersonAuthorityClient client = new PersonAuthorityClient();
PoxPayloadIn input = null;
setupRead();
- ClientResponse<String> res = client.readContact(knownResourceId, knownItemResourceId,
+ Response res = client.readContact(knownResourceId, knownItemResourceId,
knownContactResourceId);
try {
assertStatusCode(res, testName);
+ " in item: " + knownItemResourceId
+ " in parent: " + knownResourceId);
}
- input = new PoxPayloadIn(res.getEntity());
+ input = new PoxPayloadIn(res.readEntity(String.class));
} finally {
if (res != null) {
res.close();
try {
assertStatusCode(res, testName);
// Retrieve the updated resource and verify that its contents exist.
- input = new PoxPayloadIn(res.getEntity());;
+ input = new PoxPayloadIn(res.readEntity(String.class));;
} finally {
if (res != null) {
res.close();
// Submit the request to the service and store the response.
PersonAuthorityClient client = new PersonAuthorityClient();
setupDelete();
- ClientResponse<Response> res =
- client.deleteContact(knownResourceId, knownItemResourceId, knownContactResourceId);
+ Response res = client.deleteContact(knownResourceId, knownItemResourceId,
+ knownContactResourceId);
try {
assertStatusCode(res, testName);
} finally {
// Submit the request to the service and store the response.
PersonAuthorityClient client = new PersonAuthorityClient();
setupDeleteNonExistent();
- ClientResponse<Response> res =
- client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
+ Response res = client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
try {
assertStatusCode(res, testName);
} finally {
itemResourceId = entry.getValue();
// Note: Any non-success responses from the delete operation
// below are ignored and not reported.
- ClientResponse<Response> res =
- client.deleteContact(parentResourceId, itemResourceId, contactResourceId);
+ Response res = client.deleteContact(parentResourceId, itemResourceId,
+ contactResourceId);
res.close();
}
// Clean up item resources.
// Submit the request to the service and store the response.
PlaceAuthorityClient client = new PlaceAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (shortId != null) {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
res.close();
// Submit the request to the service and store the response.
TaxonomyAuthorityClient client = new TaxonomyAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (shortId != null) {
}
try {
assertStatusCode(res, testName);
- AbstractCommonList list = res.getEntity();
+ AbstractCommonList list = res.readEntity(AbstractCommonList.class);
int statusCode = res.getStatus();
// Check the status code of the response: does it match
// Submit the request to the service and store the response.
WorkAuthorityClient client = new WorkAuthorityClient();
- ClientResponse<AbstractCommonList> res = null;
+ Response res = null;
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (shortId != null) {
AbstractCommonList list = null;
try {
assertStatusCode(res, testName);
- list = res.getEntity();
+ list = res.readEntity(AbstractCommonList.class);
} finally {
if (res != null) {
res.close();