Examples of SSLCRL


Examples of com.alu.e3.data.model.SSLCRL

  }

  public static final SSLCRL toDataModel(com.alu.e3.prov.restapi.model.SSLCRL crl) {
    if (crl==null) throw new IllegalArgumentException("crl must not be null");

    SSLCRL r = new SSLCRL();
    r.setId(crl.getId());
    r.setContent(crl.getContent());
    r.setDisplayName(crl.getDisplayName());
    return r;   
  }
View Full Code Here

Examples of com.alu.e3.data.model.SSLCRL

  @Override
  public SSLCRL getCRLById(String id) throws InvalidIDException {
    if(!cachingTableCRL.containsKey(id))
      throw new InvalidIDException("A CRL with that ID [" + id + "] doesn't exist");
    SSLCRL crl = cachingTableCRL.get(id)

    return crl;
  }
View Full Code Here

Examples of com.alu.e3.data.model.SSLCRL

    return crl;
  }

  @Override
  public void updateCRL(SSLCRL crl) throws InvalidIDException {
    SSLCRL knownCRL = getCRLById(crl.getId());

    if( crl.getContent() != null && crl.getContent().length() > 0)
      throw new IllegalArgumentException("CRL data cannot be changed with an update");

    if(crl.getDisplayName() != null){
      knownCRL.setDisplayName(crl.getDisplayName());
    }

    cachingTableCRL.set(crl.getId(), knownCRL);
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.SSLCRL

  protected final Action newCreateCRLAction() {
    return new Action() {

      protected Object doAction(Object... params) {
        SSLCRL crl = (SSLCRL) params[0];

        if ((crl.getId() == null) || (crl.getId().equals("")))
        {
          // create the id
          crl.setId(UUID.randomUUID().toString());
        }
       
        if(LOG.isDebugEnabled()) {
          LOG.debug("Creating CLR:", crl.getId());
        }
       
        com.alu.e3.data.model.SSLCRL clrDataModel = BeanConverterUtil.toDataModel(crl);
        dataManager.addCRL(clrDataModel);
       
        SSLCRLResponse response = new SSLCRLResponse(SSLCRLResponse.SUCCESS);
        response.setId(crl.getId());

        return response;
      }
    };
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.SSLCRL

          LOG.debug("Getting CRL:", crlID);
        }
       
        com.alu.e3.data.model.SSLCRL crlDataModel = dataManager.getCRLById(crlID);
       
        SSLCRL crl = BeanConverterUtil.fromDataModel(crlDataModel);

        SSLCRLResponse response = new SSLCRLResponse(SSLCRLResponse.SUCCESS);
        response.setCRL(crl);
       
        return response;
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.SSLCRL

  protected final Action newUpdateCRLAction() {
    return new Action() {

      protected Object doAction(Object... params) {
        SSLCRL crl = (SSLCRL) params[0];
        String crlID = (String) params[1];

        if(LOG.isDebugEnabled()) {
          LOG.debug("Updating CRL:", crlID);
        }

        if(crl.getId() == null || crl.getId().equals(""))
          crl.setId(crlID);
        else if(crl.getId().equals(crlID) == false)
          throw new InvalidParameterException("CRL ID mismatch");

        com.alu.e3.data.model.SSLCRL crlDataModel = BeanConverterUtil.toDataModel(crl);       
        dataManager.updateCRL(crlDataModel);
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.SSLCRL

    baseTestCreateUpdateDeleteCA(null);
  }

  private void baseTestCreateUpdateDeleteCRL(String id) throws Exception {
    // CREATE
    SSLCRL crl = new SSLCRL();
   
    crl.setId(id);
    String content = "abc";
    crl.setContent(content);

    BasicResponse response = given()
    .contentType("application/xml")
    .body(crl, ObjectMapper.JAXB)
    .expect()
    .statusCode(200)
    .rootPath("response")
    .body("status", equalTo("SUCCESS"))
    .log().ifError()
    .when()
    .post("/crls")
    .andReturn()
    .as(BasicResponse.class, ObjectMapper.JAXB);

    assertNotNull(response);
    assertEquals("SUCCESS", response.getStatus());
   
    if (id != null)
    {
      assertEquals(id, response.getId());
    }
    else
    {
      assertNotNull(response.getId());
      id = response.getId();
    }

    // UPDATE
    crl.setContent(null);
    crl.setDisplayName("toto");
 
    response = given()
    .contentType("application/xml")
    .body(crl, ObjectMapper.JAXB)
    .expect()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.