Search in sources :

Example 6 with Entrypoint

use of io.gravitee.repository.management.model.Entrypoint in project gravitee-management-rest-api by gravitee-io.

the class EntrypointServiceImpl method create.

@Override
public EntrypointEntity create(final NewEntryPointEntity entrypointEntity, String referenceId, EntrypointReferenceType referenceType) {
    try {
        final Entrypoint entrypoint = convert(entrypointEntity, referenceId, referenceType);
        final EntrypointEntity savedEntryPoint = convert(entrypointRepository.create(entrypoint));
        auditService.createEnvironmentAuditLog(Collections.singletonMap(ENTRYPOINT, entrypoint.getId()), ENTRYPOINT_CREATED, new Date(), null, entrypoint);
        return savedEntryPoint;
    } catch (TechnicalException ex) {
        LOGGER.error("An error occurs while trying to create entrypoint {}", entrypointEntity.getValue(), ex);
        throw new TechnicalManagementException("An error occurs while trying to create entrypoint " + entrypointEntity.getValue(), ex);
    }
}
Also used : TechnicalException(io.gravitee.repository.exceptions.TechnicalException) Entrypoint(io.gravitee.repository.management.model.Entrypoint) EntrypointEntity(io.gravitee.rest.api.model.EntrypointEntity) TechnicalManagementException(io.gravitee.rest.api.service.exceptions.TechnicalManagementException)

Aggregations

Entrypoint (io.gravitee.repository.management.model.Entrypoint)6 TechnicalException (io.gravitee.repository.exceptions.TechnicalException)4 TechnicalManagementException (io.gravitee.rest.api.service.exceptions.TechnicalManagementException)4 EntrypointNotFoundException (io.gravitee.rest.api.service.exceptions.EntrypointNotFoundException)3 EntrypointEntity (io.gravitee.rest.api.model.EntrypointEntity)2