Package org.cometd.bayeux.server

Examples of org.cometd.bayeux.server.BayeuxServer$Extension


        // basic request generation with nonce
        OCSPReqBuilder gen = new OCSPReqBuilder();

        gen.addRequest(id);

        Extension ext = new Extension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce, false, new DEROctetString(new DEROctetString(PdfEncryption.createDocumentId()).getEncoded()));
        gen.setRequestExtensions(new Extensions(new Extension[]{ext}));

        return gen.build();
    }
View Full Code Here


        // basic request generation with nonce
        OCSPReqBuilder gen = new OCSPReqBuilder();

        gen.addRequest(id);

        Extension ext = new Extension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce, false, new DEROctetString(new DEROctetString(PdfEncryption.createDocumentId()).getEncoded()));
        gen.setRequestExtensions(new Extensions(new Extension[]{ext}));

        return gen.build();
    }
View Full Code Here

       
        // request
        //create a nonce to avoid replay attack
        BigInteger nonce = BigInteger.valueOf(nonceTimeinMillis);
        DEROctetString nonceDer = new DEROctetString(nonce.toByteArray());
        Extension ext = new Extension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce, true, nonceDer);
        Extensions exts = new Extensions(ext);
       
        OCSPReqBuilder ocspReqBuilder = new OCSPReqBuilder();
        ocspReqBuilder.addRequest(certId);
        ocspReqBuilder.setRequestExtensions(exts);
View Full Code Here

      DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();
      DigestCalculator digestCalculator = digestCalculatorProvider.get(CertificateID.HASH_SHA1);

      BasicOCSPRespBuilder builder = new BasicOCSPRespBuilder(keyInfo, digestCalculator);

      Extension ocspNonce = ocspReq.getExtension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce);
      if (ocspNonce != null) {
        builder.setResponseExtensions(new Extensions(new Extension[] { ocspNonce }));
      }

      Req[] list = ocspReq.getRequestList();
View Full Code Here

  }

  @Provides
  @Singleton
  public UpdateManager getUpdateManager(Injector injector) {
    BayeuxServer bayeuxServer = injector.getInstance(BayeuxServer.class);
    UpdateManager updateManager = new UpdateManager(bayeuxServer);
    updateManager.addUpdaterFactory(new ObservableUpdaterFactory());
    return updateManager;
  }
View Full Code Here

        this.unregister();
    }

    private void register(CometdService cometdService) {
        try {
            BayeuxServer bayeuxServer = cometdService.getBayeuxServer();
            if (bayeuxServer != null) {
                Hashtable<String, String> props = new Hashtable<String, String>();
                props.put("alias", "/system/time");
                // whiteboard servlet registration
                this.reg = context.registerService(Servlet.class.getName(), new TimeServlet(bayeuxServer), props);
View Full Code Here

    @Override
    protected void doStart() throws Exception
    {
        session.handshake();
        BayeuxServer bayeuxServer = oort.getBayeuxServer();
        bayeuxServer.createChannelIfAbsent(forwardChannelName).getReference().addListener(this);
        bayeuxServer.createChannelIfAbsent(broadcastChannelName).getReference().addListener(this);
        bayeuxServer.createChannelIfAbsent(resultChannelName).getReference().addListener(this);
        oort.observeChannel(broadcastChannelName);
        if (logger.isDebugEnabled())
            logger.debug("Started {}", this);
    }
View Full Code Here

    @Override
    protected void doStop() throws Exception
    {
        oort.deobserveChannel(broadcastChannelName);
        BayeuxServer bayeuxServer = oort.getBayeuxServer();
        ServerChannel channel = bayeuxServer.getChannel(resultChannelName);
        if (channel != null)
            channel.removeListener(this);
        channel = bayeuxServer.getChannel(broadcastChannelName);
        if (channel != null)
            channel.removeListener(this);
        channel = bayeuxServer.getChannel(forwardChannelName);
        if (channel != null)
            channel.removeListener(this);
        session.disconnect();
        if (logger.isDebugEnabled())
            logger.debug("Stopped {}", this);
View Full Code Here

        context.addServlet(cometdServletHolder, cometdURLMapping);

        server.start();
        String url = "http://localhost:" + connector.getLocalPort() + cometdServletPath;
        server.setAttribute(OortConfigServlet.OORT_URL_PARAM, url);
        BayeuxServer bayeux = (BayeuxServer)context.getServletContext().getAttribute(BayeuxServer.ATTRIBUTE);
        server.setAttribute(BayeuxServer.ATTRIBUTE, bayeux);

        servers.add(server);

        return server;
View Full Code Here

    }

    protected Oort startOort(Server server) throws Exception
    {
        String url = (String)server.getAttribute(OortConfigServlet.OORT_URL_PARAM);
        final BayeuxServer bayeuxServer = (BayeuxServer)server.getAttribute(BayeuxServer.ATTRIBUTE);
        Oort oort = new Oort(bayeuxServer, url);
        oort.start();
        oorts.add(oort);
        return oort;
    }
View Full Code Here

TOP

Related Classes of org.cometd.bayeux.server.BayeuxServer$Extension

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.