Package com.alu.e3.prov.restapi.model

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


        }

        com.alu.e3.data.model.sub.QuotaRLBucket authIdsDataModel = BeanConverterUtil.toDataModel(authIds);
        dataManager.addAuthsToBucket(policyId, bucketId, authIdsDataModel);

        return new PolicyResponse(PolicyResponse.SUCCESS);
      }
    };
  }
View Full Code Here


        if(LOG.isDebugEnabled()) {
          LOG.debug("Remove auth:" + authId + " from policy:" + policyId + "/bucket:" + bucketId);
        }
        dataManager.removeAuthFromBucket(policyId, bucketId, authId);

        return new PolicyResponse(PolicyResponse.SUCCESS);
      }
    };
  }
View Full Code Here

        for (String authId : authIds.getAuthIds())
        {
          dataManager.removeAuthFromBucket(policyId, bucketId, authId);
        }

        return new PolicyResponse(PolicyResponse.SUCCESS);
      }
    };
  }
View Full Code Here

    Authkey ak = new Authkey();
    ak.setKeyName    (apiDetail.getAuthKeyName());
    ak.setHeaderName  (apiDetail.getAuthHeaderName());

    ProvisionAuthentication p = new ProvisionAuthentication();
    p.setAuthKey    (ak);
    p.getAuths().addAll  (BeanConverterUtil.<AuthType, NBAuthType>fromDataModels(apiDetail.getEnabledAuthType()));

    return p;
  }
View Full Code Here

    return mSchema;
  }

  private static final com.alu.e3.prov.restapi.model.ResourceItem fromDataModel(com.alu.e3.data.model.sub.ResourceItem item) {

    ResourceItem wsItem = new ResourceItem();
    wsItem.setName(item.getName());
    wsItem.setGrammar(item.getGrammar());
    wsItem.setIsMain(item.isIsMain());   

    return wsItem;
  }
View Full Code Here

  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

          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

  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

    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

  }

  public static final SSLCert fromDataModel(Certificate cert){
    if(cert == null) throw new IllegalArgumentException("cert must not be null");

    SSLCert sslCert = new SSLCert();
    sslCert.setDisplayName(cert.getCertDetail().getName());
    sslCert.setContent(cert.getData());
    sslCert.setId(cert.getId());
    sslCert.setKeyId(cert.getCertDetail().getKeyId());

    return sslCert;
  }
View Full Code Here

TOP

Related Classes of com.alu.e3.prov.restapi.model.SSLCRL

Copyright © 2018 www.massapicom. 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.