Examples of BasePublisher


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

                                        cprofile.setAvailableCAs(cas);
                                        // Remove and warn about unknown publishers
                                        Collection<Integer> publishers = cprofile.getPublisherList();
                                        ArrayList<Integer> allToRemove = new ArrayList<Integer>();
                                        for (Integer publisher : publishers) {
                                          BasePublisher pub = null;
                                          try {
                                            pub = ejb.getPublisherSession().getPublisher(getAdmin(), publisher);
                                          } catch (Exception e) {
                                            String msg = e.getMessage();
                                            if (e.getCause() != null) {
View Full Code Here

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

    @Override
    public void clonePublisher(Admin admin, String oldname, String newname) {
        if (log.isTraceEnabled()) {
            log.trace(">clonePublisher(name: " + oldname + ")");
        }
        BasePublisher publisherdata = null;
        try {
          PublisherData htp = PublisherData.findByName(entityManager, oldname);
          if (htp == null) {
            throw new Exception("Could not find publisher " + oldname);
          }
View Full Code Here

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

    }

    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    @Override
    public BasePublisher getPublisher(Admin admin, String name) {
        BasePublisher returnval = null;
        PublisherData pd = PublisherData.findByName(entityManager, name);
        if (pd != null) {
          returnval = getPublisher(pd);
        }
        return returnval;
View Full Code Here

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

    }

    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    @Override
    public BasePublisher getPublisher(Admin admin, int id) {
        BasePublisher returnval = null;
        PublisherData pd = PublisherData.findById(entityManager, Integer.valueOf(id));
        if (pd != null) {
          returnval = getPublisher(pd);
        }
        return returnval;
View Full Code Here

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

      return Integer.valueOf(id);
    }

    /** @return the publisher data and updates it if necessary. */
    private BasePublisher getPublisher(PublisherData pData) {
        BasePublisher publisher = pData.getCachedPublisher();
        if (publisher == null) {
            java.beans.XMLDecoder decoder;
            try {
                decoder = new java.beans.XMLDecoder(new java.io.ByteArrayInputStream(pData.getData().getBytes("UTF8")));
            } catch (UnsupportedEncodingException e) {
                throw new EJBException(e);
            }
            HashMap h = (HashMap) decoder.readObject();
            decoder.close();
            // Handle Base64 encoded string values
            HashMap data = new Base64GetHashMap(h);

            switch (((Integer) (data.get(BasePublisher.TYPE))).intValue()) {
            case PublisherConst.TYPE_LDAPPUBLISHER:
                publisher = new LdapPublisher();
                break;
            case PublisherConst.TYPE_LDAPSEARCHPUBLISHER:
                publisher = new LdapSearchPublisher();
                break;
            case PublisherConst.TYPE_ADPUBLISHER:
                publisher = new ActiveDirectoryPublisher();
                break;
            case PublisherConst.TYPE_CUSTOMPUBLISHERCONTAINER:
                publisher = new CustomPublisherContainer();
                break;
            case PublisherConst.TYPE_VAPUBLISHER:
                publisher = new ValidationAuthorityPublisher();
                break;
            }
            publisher.loadData(data);
        }
        return publisher;
    }
View Full Code Here

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

                    // anything in the queue
                    String[] ids = StringUtils.split(idstr, ';');
                    for (int i = 0; i < ids.length; i++) {
                        int publisherId = Integer.valueOf(ids[i]).intValue();
                        // Get everything from the queue for this publisher id
                        BasePublisher publisher = publisherSession.getPublisher(getAdmin(), publisherId);
                        publisherQueueSession.plainFifoTryAlwaysLimit100EntriesOrderByTimeCreated(getAdmin(), publisherId, publisher);
                    }
                } else {
                    log.debug("No publisher ids configured for worker.");
                }
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.