Search in sources :

Example 1 with BadRequestAlertException

use of de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException in project ca3sCore by kuehne-trustable-de.

the class PipelineAttributeResource method createPipelineAttribute.

/**
 * {@code POST  /pipeline-attributes} : Create a new pipelineAttribute.
 *
 * @param pipelineAttribute the pipelineAttribute to create.
 * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new pipelineAttribute, or with status {@code 400 (Bad Request)} if the pipelineAttribute has already an ID.
 * @throws URISyntaxException if the Location URI syntax is incorrect.
 */
@PostMapping("/pipeline-attributes")
public ResponseEntity<PipelineAttribute> createPipelineAttribute(@Valid @RequestBody PipelineAttribute pipelineAttribute) throws URISyntaxException {
    log.debug("REST request to save PipelineAttribute : {}", pipelineAttribute);
    if (pipelineAttribute.getId() != null) {
        throw new BadRequestAlertException("A new pipelineAttribute cannot already have an ID", ENTITY_NAME, "idexists");
    }
    PipelineAttribute result = pipelineAttributeService.save(pipelineAttribute);
    return ResponseEntity.created(new URI("/api/pipeline-attributes/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())).body(result);
}
Also used : BadRequestAlertException(de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException) URI(java.net.URI) PipelineAttribute(de.trustable.ca3s.core.domain.PipelineAttribute)

Example 2 with BadRequestAlertException

use of de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException in project ca3sCore by kuehne-trustable-de.

the class PipelineAttributeResource method updatePipelineAttribute.

/**
 * {@code PUT  /pipeline-attributes} : Updates an existing pipelineAttribute.
 *
 * @param pipelineAttribute the pipelineAttribute to update.
 * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated pipelineAttribute,
 * or with status {@code 400 (Bad Request)} if the pipelineAttribute is not valid,
 * or with status {@code 500 (Internal Server Error)} if the pipelineAttribute couldn't be updated.
 * @throws URISyntaxException if the Location URI syntax is incorrect.
 */
@PutMapping("/pipeline-attributes")
public ResponseEntity<PipelineAttribute> updatePipelineAttribute(@Valid @RequestBody PipelineAttribute pipelineAttribute) throws URISyntaxException {
    log.debug("REST request to update PipelineAttribute : {}", pipelineAttribute);
    if (pipelineAttribute.getId() == null) {
        throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
    }
    PipelineAttribute result = pipelineAttributeService.save(pipelineAttribute);
    return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, pipelineAttribute.getId().toString())).body(result);
}
Also used : BadRequestAlertException(de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException) PipelineAttribute(de.trustable.ca3s.core.domain.PipelineAttribute)

Example 3 with BadRequestAlertException

use of de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException in project ca3sCore by kuehne-trustable-de.

the class PipelineResource method createPipeline.

/**
 * {@code POST  /pipelines} : Create a new pipeline.
 *
 * @param pipeline the pipeline to create.
 * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new pipeline, or with status {@code 400 (Bad Request)} if the pipeline has already an ID.
 * @throws URISyntaxException if the Location URI syntax is incorrect.
 */
@PostMapping("/pipelines")
public ResponseEntity<Pipeline> createPipeline(@Valid @RequestBody Pipeline pipeline) throws URISyntaxException {
    log.debug("REST request to save Pipeline : {}", pipeline);
    if (pipeline.getId() != null) {
        throw new BadRequestAlertException("A new pipeline cannot already have an ID", ENTITY_NAME, "idexists");
    }
    Pipeline result = pipelineService.save(pipeline);
    return ResponseEntity.created(new URI("/api/pipelines/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())).body(result);
}
Also used : BadRequestAlertException(de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException) URI(java.net.URI) Pipeline(de.trustable.ca3s.core.domain.Pipeline)

Example 4 with BadRequestAlertException

use of de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException in project ca3sCore by kuehne-trustable-de.

the class PipelineViewResource method createPipeline.

/**
 * {@code POST  /pipelineViews} : Create a new pipeline.
 *
 * @param pipelineView the pipeline to create.
 * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new pipeline, or with status {@code 400 (Bad Request)} if the pipeline has already an ID.
 * @throws URISyntaxException if the Location URI syntax is incorrect.
 */
@PostMapping("/pipelineViews")
public ResponseEntity<PipelineView> createPipeline(@Valid @RequestBody PipelineView pipelineView) throws URISyntaxException {
    log.debug("REST request to save PipelineView : {}", pipelineView);
    if (pipelineView.getId() != null) {
        throw new BadRequestAlertException("A new pipeline request cannot have an ID", ENTITY_NAME, "idexists");
    }
    if (pipelineUtil.getPipelineByRealm(pipelineView.getType(), pipelineView.getUrlPart()) != null) {
        throw new BadRequestAlertException("Realm '" + pipelineView.getUrlPart() + "' already exists", ENTITY_NAME, "realmexists");
    }
    Pipeline p = pipelineUtil.toPipeline(pipelineView);
    return ResponseEntity.created(new URI("/api/pipelineViews/" + p.getId())).headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, p.getId().toString())).body(pipelineView);
}
Also used : BadRequestAlertException(de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException) URI(java.net.URI) Pipeline(de.trustable.ca3s.core.domain.Pipeline)

Example 5 with BadRequestAlertException

use of de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException in project ca3sCore by kuehne-trustable-de.

the class ProtectedContentResource method createProtectedContent.

/**
 * {@code POST  /protected-contents} : Create a new protectedContent.
 *
 * @param protectedContent the protectedContent to create.
 * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new protectedContent, or with status {@code 400 (Bad Request)} if the protectedContent has already an ID.
 * @throws URISyntaxException if the Location URI syntax is incorrect.
 */
@PostMapping("/protected-contents")
public ResponseEntity<ProtectedContent> createProtectedContent(@Valid @RequestBody ProtectedContent protectedContent) throws URISyntaxException {
    log.debug("REST request to save ProtectedContent : {}", protectedContent);
    if (protectedContent.getId() != null) {
        throw new BadRequestAlertException("A new protectedContent cannot already have an ID", ENTITY_NAME, "idexists");
    }
    ProtectedContent result = protectedContentService.save(protectedContent);
    return ResponseEntity.created(new URI("/api/protected-contents/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())).body(result);
}
Also used : BadRequestAlertException(de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException) ProtectedContent(de.trustable.ca3s.core.domain.ProtectedContent) URI(java.net.URI)

Aggregations

BadRequestAlertException (de.trustable.ca3s.core.web.rest.errors.BadRequestAlertException)50 URI (java.net.URI)25 Pipeline (de.trustable.ca3s.core.domain.Pipeline)4 ProtectedContent (de.trustable.ca3s.core.domain.ProtectedContent)4 ACMEAccount (de.trustable.ca3s.core.domain.ACMEAccount)2 AcmeAuthorization (de.trustable.ca3s.core.domain.AcmeAuthorization)2 AcmeChallenge (de.trustable.ca3s.core.domain.AcmeChallenge)2 AcmeContact (de.trustable.ca3s.core.domain.AcmeContact)2 AcmeIdentifier (de.trustable.ca3s.core.domain.AcmeIdentifier)2 AcmeNonce (de.trustable.ca3s.core.domain.AcmeNonce)2 AcmeOrder (de.trustable.ca3s.core.domain.AcmeOrder)2 AuditTrace (de.trustable.ca3s.core.domain.AuditTrace)2 BPMNProcessInfo (de.trustable.ca3s.core.domain.BPMNProcessInfo)2 CAConnectorConfig (de.trustable.ca3s.core.domain.CAConnectorConfig)2 Certificate (de.trustable.ca3s.core.domain.Certificate)2 CertificateAttribute (de.trustable.ca3s.core.domain.CertificateAttribute)2 CsrAttribute (de.trustable.ca3s.core.domain.CsrAttribute)2 ImportedURL (de.trustable.ca3s.core.domain.ImportedURL)2 PipelineAttribute (de.trustable.ca3s.core.domain.PipelineAttribute)2 RDN (de.trustable.ca3s.core.domain.RDN)2