de.gold.scim.common.response.BulkResponse Maven / Gradle / Ivy
The newest version!
package de.gold.scim.common.response;
import java.util.Collections;
import java.util.List;
import de.gold.scim.common.constants.AttributeNames;
import de.gold.scim.common.constants.SchemaUris;
import lombok.Builder;
/**
* author Pascal Knueppel
* created at: 25.10.2019 - 20:34
*
* represents a simple bulk response
*/
public class BulkResponse extends ScimResponse
{
/**
* the http status that should be set with this response
*/
private int httpStatus;
@Builder
public BulkResponse(List bulkResponseOperation, int httpStatus)
{
this();
setBulkResponseOperations(bulkResponseOperation);
this.httpStatus = httpStatus;
}
public BulkResponse()
{
super(null);
setSchemas(Collections.singletonList(SchemaUris.BULK_RESPONSE_URI));
}
/**
* {@inheritDoc}
*/
@Override
public int getHttpStatus()
{
return httpStatus;
}
/**
* Defines operations within a bulk job. Each operation corresponds to a single HTTP request against a
* resource endpoint. REQUIRED.
*/
public List getBulkResponseOperations()
{
List operations = getArrayAttribute(AttributeNames.RFC7643.OPERATIONS,
BulkResponseOperation.class);
if (operations.isEmpty())
{
setAttribute(AttributeNames.RFC7643.OPERATIONS, operations);
}
return operations;
}
/**
* Defines operations within a bulk job. Each operation corresponds to a single HTTP request against a
* resource endpoint. REQUIRED.
*/
public void setBulkResponseOperations(List bulkRequestOperations)
{
setAttribute(AttributeNames.RFC7643.OPERATIONS, bulkRequestOperations);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy