Package org.ejbca.core.model.ca.publisher

Examples of org.ejbca.core.model.ca.publisher.PublisherQueueVolatileData


     *
     * @return VolatileData is optional in publisher queue data
     */
    @Transient
    public PublisherQueueVolatileData getPublisherQueueVolatileData() {
        PublisherQueueVolatileData ret = null;
        try {
            String vd = getVolatileData();
            if ((vd != null) && (vd.length() > 0)) {
                byte[] databytes = vd.getBytes("UTF8");
                java.beans.XMLDecoder decoder;
                decoder = new java.beans.XMLDecoder(new java.io.ByteArrayInputStream(databytes));
                HashMap h = (HashMap) decoder.readObject();
                decoder.close();
                // Handle Base64 encoded string values
                HashMap data = new Base64GetHashMap(h);
                ret = new PublisherQueueVolatileData();
                ret.loadData(data);
                if (ret.isUpgraded()) {
                    setPublisherQueueVolatileData(ret);
                }
            }
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
View Full Code Here


                }
                if ((publishStatus != PublisherConst.STATUS_SUCCESS || getPublisher(pdl).getKeepPublishedInQueue())
                        && getPublisher(pdl).getUseQueueForCertificates()) {
                    // Write to the publisher queue either for audit reasons or
                    // to be able try again
                    PublisherQueueVolatileData pqvd = new PublisherQueueVolatileData();
                    pqvd.setUsername(username);
                    pqvd.setPassword(password);
                    pqvd.setExtendedInformation(extendedinformation);
                    pqvd.setUserDN(userDN);
                    String fp = CertTools.getFingerprintAsString(cert);
                    try {
                        publisherQueueSession.addQueueData(id.intValue(), PublisherConst.PUBLISH_TYPE_CERT, fp, pqvd, publishStatus);
                        String msg = intres.getLocalizedMessage("publisher.storequeue", pdl.getName(), fp, status);
                        logSession.log(admin, cert, LogConstants.MODULE_CA, new java.util.Date(), username, cert, logInfoEvent, msg);
View Full Code Here

                }
                if ((publishStatus != PublisherConst.STATUS_SUCCESS || getPublisher(pdl).getKeepPublishedInQueue())
                        && getPublisher(pdl).getUseQueueForCRLs()) {
                    // Write to the publisher queue either for audit reasons or
                    // to be able try again
                    final PublisherQueueVolatileData pqvd = new PublisherQueueVolatileData();
                    pqvd.setUserDN(userDN);
                    String fp = CertTools.getFingerprintAsString(incrl);
                    try {
                        publisherQueueSession.addQueueData(id.intValue(), PublisherConst.PUBLISH_TYPE_CRL, fp, pqvd, PublisherConst.STATUS_PENDING);
                        String msg = intres.getLocalizedMessage("publisher.storequeue", pdl.getName(), fp, "CRL");
                        logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new java.util.Date(), null, null, LogConstants.EVENT_INFO_STORECRL, msg);
View Full Code Here

      assertEquals(0,d.getTryCounter());
      assertNull(d.getVolatileData());
     
      String xxpk = d.getPk(); // Keep for later so we can set to success
     
      PublisherQueueVolatileData vd = new PublisherQueueVolatileData();
      vd.setUsername("foo");
      vd.setPassword("bar");
      ExtendedInformation ei = new ExtendedInformation();
      ei.setSubjectDirectoryAttributes("directoryAttr");
      vd.setExtendedInformation(ei);
      publisherQueueSession.addQueueData(123456, PublisherConst.PUBLISH_TYPE_CRL, "YY", vd, PublisherConst.STATUS_PENDING);
     
      c = publisherQueueSession.getPendingEntriesForPublisher(123456);
      assertEquals(2, c.size());
      boolean testedXX = false;
      boolean testedYY = false;
      i = c.iterator();
      while (i.hasNext()) {
          d = i.next();
          if (d.getFingerprint().equals("XX")) {
            assertEquals(PublisherConst.PUBLISH_TYPE_CERT, d.getPublishType());
              assertNotNull(d.getLastUpdate());
              assertNotNull(d.getTimeCreated());
              assertEquals(PublisherConst.STATUS_PENDING, d.getPublishStatus());
              assertEquals(0,d.getTryCounter());
              testedXX = true;
          }
          if (d.getFingerprint().equals("YY")) {
            assertEquals(PublisherConst.PUBLISH_TYPE_CRL, d.getPublishType());
              assertEquals(PublisherConst.STATUS_PENDING, d.getPublishStatus());
              assertEquals(0,d.getTryCounter());
              PublisherQueueVolatileData v = d.getVolatileData();
              assertEquals("bar", v.getPassword());
              assertEquals("foo", v.getUsername());
              ExtendedInformation e = v.getExtendedInformation();
              assertNotNull(e);
              assertEquals("directoryAttr", e.getSubjectDirectoryAttributes());
              testedYY = true;
          }
      }
View Full Code Here

            int publishType = pqd.getPublishType();
            if (log.isDebugEnabled()) {
                log.debug("Publishing from queue to publisher: " + publisherId + ", fingerprint: " + fingerprint + ", pk: " + pqd.getPk()
                        + ", type: " + publishType);
            }
            PublisherQueueVolatileData voldata = pqd.getVolatileData();
            String username = null;
            String password = null;
            ExtendedInformation ei = null;
            String userDataDN = null;
            if (voldata != null) {
                username = voldata.getUsername();
                password = voldata.getPassword();
                ei = voldata.getExtendedInformation();
                userDataDN = voldata.getUserDN();
            }
            boolean published = false;

           
            try {
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.ca.publisher.PublisherQueueVolatileData

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.