@@ -600,7 +600,8 @@ private BulkOperationResponse<CreateOperationStatus> setCreateBulkResponse(WebRe
600600 {
601601 BulkOperationResponse <CreateOperationStatus > response = new BulkOperationResponse <CreateOperationStatus >();
602602 setBaseResponseData (response , clientResponse , requestHeaders , zone , context , true , requestType , service .getURI ().toString ());
603- if ((clientResponse .getStatusInfo ().getStatusCode () == Status .CREATED .getStatusCode ()) ||
603+ if ((clientResponse .getStatusInfo ().getStatusCode () == Status .OK .getStatusCode ()) ||
604+ (clientResponse .getStatusInfo ().getStatusCode () == Status .CREATED .getStatusCode ()) ||
604605 (clientResponse .getStatusInfo ().getStatusCode () == Status .ACCEPTED .getStatusCode ()) ||
605606 (clientResponse .getStatusInfo ().getStatusCode () == Status .NO_CONTENT .getStatusCode ()))
606607 {
@@ -610,37 +611,6 @@ private BulkOperationResponse<CreateOperationStatus> setCreateBulkResponse(WebRe
610611 MultiOperationStatusList <CreateOperationStatus > statusList = getInfraMapper ().toStatusListFromSIFCreateString (payload , getResponseMediaType ());
611612 response .setError (statusList .getError ());
612613 response .setOperationStatuses (statusList .getOperationStatuses ());
613-
614- // try
615- // {
616- // //Because CreateResponseType is a Infrastructure thing we must ensure we use the Infrastructure Unmarshaller
617- // CreateResponseType createManyResponse = (CreateResponseType)getInfraUnmarshaller().unmarshal(payload, CreateResponseType.class, getResponseMediaType());
618- // if (createManyResponse == null)// this is strange. So set the unmarshalled value.
619- // {
620- // response.setError(new ErrorDetails(response.getStatus(), "Could not unmarshal payload. See error description for payload details.", payload));
621- // }
622- // else
623- // {
624- // response.setOperationStatuses(new ArrayList<CreateOperationStatus>());
625- // for (CreateType createStatus : createManyResponse.getCreates().getCreate())
626- // {
627- // CreateOperationStatus opStatus = new CreateOperationStatus();
628- // opStatus.setResourceID(createStatus.getId());
629- // opStatus.setAdvisoryID(createStatus.getAdvisoryId());
630- // opStatus.setStatus(toInt(createStatus.getStatusCode()));
631- // opStatus.setError(convertFromErrorType(createStatus.getError()));
632- // response.getOperationStatuses().add(opStatus);
633- // }
634- // }
635- // }
636- // catch (UnmarshalException ex)
637- // {
638- // response.setError(new ErrorDetails(response.getStatus(), "Could not unmarshal payload: "+ex.getMessage()+". See error description for payload details.", payload));
639- // }
640- // catch (UnsupportedMediaTypeExcpetion ex)
641- // {
642- // response.setError(new ErrorDetails(Status.UNSUPPORTED_MEDIA_TYPE.getStatusCode(), "Could not unmarshal payload (unsupported media type): "+ex.getMessage()+". See error description for payload details.", payload));
643- // }
644614 }
645615 }
646616 else // We are dealing with an error case.
@@ -670,35 +640,6 @@ private BulkOperationResponse<OperationStatus> setDeleteBulkResponse(WebResource
670640 response .setError (statusList .getError ());
671641 response .setOperationStatuses (statusList .getOperationStatuses ());
672642
673- // try
674- // {
675- // //Because DeleteResponseType is a Infrastructure thing we must ensure we use the Infrastructure Unmarshaller
676- // DeleteResponseType deleteManyResponse = (DeleteResponseType)getInfraUnmarshaller().unmarshal(payload, DeleteResponseType.class, getResponseMediaType());
677- // if (deleteManyResponse == null)// this is strange. So set the unmarshalled value.
678- // {
679- // response.setError(new ErrorDetails(response.getStatus(), "Could not unmarshal payload. See error description for payload details.", payload));
680- // }
681- // else
682- // {
683- // response.setOperationStatuses(new ArrayList<OperationStatus>());
684- // for (DeleteStatus deleteStatus : deleteManyResponse.getDeletes().getDelete())
685- // {
686- // OperationStatus opStatus = new OperationStatus();
687- // opStatus.setResourceID(deleteStatus.getId());
688- // opStatus.setStatus(toInt(deleteStatus.getStatusCode()));
689- // opStatus.setError(convertFromErrorType(deleteStatus.getError()));
690- // response.getOperationStatuses().add(opStatus);
691- // }
692- // }
693- // }
694- // catch (UnmarshalException ex)
695- // {
696- // response.setError(new ErrorDetails(response.getStatus(), "Could not unmarshal payload: "+ex.getMessage()+". See error description for payload details.", payload));
697- // }
698- // catch (UnsupportedMediaTypeExcpetion ex)
699- // {
700- // response.setError(new ErrorDetails(Status.UNSUPPORTED_MEDIA_TYPE.getStatusCode(), "Could not unmarshal payload (unsupported media type): "+ex.getMessage()+". See error description for payload details.", payload));
701- // }
702643 }
703644 }
704645 else // We are dealing with an error case.
@@ -792,37 +733,4 @@ private HeaderProperties addAuthenticationHdrProps(HeaderProperties hdrPropertie
792733
793734 return hdrProperties ;
794735 }
795-
796- // /*
797- // * Caller MUST ensure that the requestHdrProperties are not null. They really shouldn't since this class is only called
798- // * by the AbstractConsumer which must set a few header properties anyway.
799- // */
800- // private boolean isDelayedRequest(HeaderProperties requestHdrProperties)
801- // {
802- // String requestType = requestHdrProperties.getHeaderProperty(RequestHeaderConstants.HDR_REQUEST_TYPE);
803- //
804- // if (requestType != null)
805- // {
806- // return HeaderValues.RequestType.valueOf(requestType) == RequestType.DELAYED;
807- // }
808- //
809- // // Nothing found => Assume IMMEDIATE
810- // return false;
811- // }
812- //
813- // /*
814- // * Caller MUST ensure that the requestHdrProperties are not null. They really shouldn't since this class is only called
815- // * by the AbstractConsumer which must set a few header properties anyway.
816- // */
817- // private ServiceType getServiceTypeFromRequestHeaders(HeaderProperties requestHdrProperties)
818- // {
819- // String serviceType = requestHdrProperties.getHeaderProperty(RequestHeaderConstants.HDR_SERVICE_NAME);
820- //
821- // if (serviceType != null)
822- // {
823- // return HeaderValues.ServiceType.valueOf(serviceType);
824- // }
825- //
826- // return null;
827- // }
828736}
0 commit comments