Search in sources :

Example 1 with ResourceReference

use of org.apache.cxf.ws.transfer.resourcefactory.resolver.ResourceReference in project cxf by apache.

the class ResourceFactoryImpl method create.

@Override
public CreateResponse create(Create body) {
    if (body.getDialect() != null && !body.getDialect().isEmpty()) {
        if (dialects.containsKey(body.getDialect())) {
            Dialect dialect = dialects.get(body.getDialect());
            Representation representation = dialect.processCreate(body);
            body.setRepresentation(representation);
        } else {
            throw new UnknownDialect();
        }
    }
    ValidAndTransformHelper.validationAndTransformation(resourceTypeIdentifiers, body.getRepresentation(), null);
    ResourceReference resourceReference = resourceResolver.resolve(body);
    if (resourceReference.getResourceManager() != null) {
        return createLocally(body, resourceReference);
    }
    return createRemotely(body, resourceReference);
}
Also used : UnknownDialect(org.apache.cxf.ws.transfer.shared.faults.UnknownDialect) UnknownDialect(org.apache.cxf.ws.transfer.shared.faults.UnknownDialect) Dialect(org.apache.cxf.ws.transfer.dialect.Dialect) Representation(org.apache.cxf.ws.transfer.Representation) ResourceReference(org.apache.cxf.ws.transfer.resourcefactory.resolver.ResourceReference)

Aggregations

Representation (org.apache.cxf.ws.transfer.Representation)1 Dialect (org.apache.cxf.ws.transfer.dialect.Dialect)1 ResourceReference (org.apache.cxf.ws.transfer.resourcefactory.resolver.ResourceReference)1 UnknownDialect (org.apache.cxf.ws.transfer.shared.faults.UnknownDialect)1