Examples of RegisterPublisher


Examples of org.activemq.ws.xmlbeans.notification.brokered.RegisterPublisherDocument.RegisterPublisher

   

    public RegisterPublisherResponseDocument registerPublisher(RegisterPublisherDocument requestDoc) {

        // Check request.
        RegisterPublisher publisherInfo = requestDoc.getRegisterPublisher();
        ActiveMQTopic topic = TopicExpressionConverter.toActiveMQTopic(publisherInfo.getTopicArray());
        Calendar terminationTime = publisherInfo.getInitialTerminationTime();
        if( terminationTime!=null ) {
            // Termination time cannot be in the past
            if( terminationTime.before( Calendar.getInstance() ) ) {
                // Is this the right way to fault??
                throw new RuntimeException("Termination time cannot be in the past.");
            }           
            // We could fault here if the time is too far in the future.
        } else {
            // We could default a sensible timeout here.
        }
       
        // Create publisher and assoicate an EndpointReference with it.
        EndpointReferenceType registrationEndpointReference;
        try {
           
            ActiveMQPublisherRegistration publisher = new ActiveMQPublisherRegistration(connection);
            registrationEndpointReference = publisherManager.register(publisher);
            publisher.setEndpointReference(registrationEndpointReference);
            publisher.setTerminationTime(terminationTime);
            publisher.setDemand(publisherInfo.getDemand());
           
            if( publisherInfo.getDemand() ) {
                publisher.setPublisherReference(publisherInfo.getPublisherReference());           
            }

            publisher.setTopic( topic );
            publisher.start();
           
View Full Code Here

Examples of org.oasis_open.docs.wsn.br_2.RegisterPublisher

    /* (non-Javadoc)
     * @see org.springframework.beans.factory.FactoryBean#getObject()
     */
    public Object getObject() throws Exception {
        RegisterPublisher registerPublisher = new RegisterPublisher();
        registerPublisher.setPublisherReference(AbstractWSAClient.createWSA(publisher));
        if (topic != null) {
            TopicExpressionType topicExp = new TopicExpressionType();
            topicExp.getContent().add(topic);
            registerPublisher.getTopic().add(topicExp);
        }
        registerPublisher.setDemand(Boolean.valueOf(demand));
        return registerPublisher;
    }
View Full Code Here

Examples of org.oasis_open.docs.wsn.br_2.RegisterPublisher

    }

    public Publisher registerPublisher(EndpointReferenceType publisherReference,
                                       String topic, boolean demand) throws JBIException {

        RegisterPublisher registerPublisherRequest = new RegisterPublisher();
        registerPublisherRequest.setPublisherReference(publisherReference);
        if (topic != null) {
            TopicExpressionType topicExp = new TopicExpressionType();
            topicExp.getContent().add(topic);
            registerPublisherRequest.getTopic().add(topicExp);
        }
        registerPublisherRequest.setDemand(Boolean.valueOf(demand));
        RegisterPublisherResponse response = (RegisterPublisherResponse) request(registerPublisherRequest);
        return new Publisher(response.getPublisherRegistrationReference(), getClient());
    }
View Full Code Here

Examples of org.oasis_open.docs.wsn.br_2.RegisterPublisher

        throws TopicNotSupportedFault, PublisherRegistrationFailedFault,
        UnacceptableInitialTerminationTimeFault, InvalidTopicExpressionFault, ResourceUnknownFault,
        PublisherRegistrationRejectedFault {
        //CHECKSTYLE:ON

        RegisterPublisher registerPublisherRequest = new RegisterPublisher();
        registerPublisherRequest.setPublisherReference(publisher.getEpr());
        if (topics != null) {
            for (String topic : topics) {
                TopicExpressionType topicExp = new TopicExpressionType();
                topicExp.getContent().add(topic);
                registerPublisherRequest.getTopic().add(topicExp);
            }
        }
        registerPublisherRequest.setDemand(demand);
        RegisterPublisherResponse response = broker.registerPublisher(registerPublisherRequest);
        return new Registration(response.getPublisherRegistrationReference());
    }
View Full Code Here

Examples of org.oasis_open.docs.wsn.br_2.RegisterPublisher

    /* (non-Javadoc)
     * @see org.springframework.beans.factory.FactoryBean#getObject()
     */
    public Object getObject() throws Exception {
        RegisterPublisher registerPublisher = new RegisterPublisher();
        registerPublisher.setPublisherReference(AbstractWSAClient.createWSA(publisher));
        if (topic != null) {
            TopicExpressionType topicExp = new TopicExpressionType();
            topicExp.getContent().add(topic);
            registerPublisher.getTopic().add(topicExp);
        }
        registerPublisher.setDemand(new Boolean(demand));
        return registerPublisher;
    }
View Full Code Here

Examples of org.oasis_open.docs.wsn.br_2.RegisterPublisher

  public Publisher registerPublisher(EndpointReferenceType publisherReference,
                     String topic,
                     boolean demand) throws JBIException {
   
    RegisterPublisher registerPublisherRequest = new RegisterPublisher();
    registerPublisherRequest.setPublisherReference(publisherReference);
    if (topic != null) {
      TopicExpressionType topicExp = new TopicExpressionType();
      topicExp.getContent().add(topic);
      registerPublisherRequest.getTopic().add(topicExp);
    }
    registerPublisherRequest.setDemand(Boolean.valueOf(demand));
    RegisterPublisherResponse response = (RegisterPublisherResponse) request(registerPublisherRequest);
    return new Publisher(response.getPublisherRegistrationReference(), getClient());
  }
View Full Code Here

Examples of org.oasis_open.docs.wsn.br_2.RegisterPublisher

        throws TopicNotSupportedFault, PublisherRegistrationFailedFault,
        UnacceptableInitialTerminationTimeFault, InvalidTopicExpressionFault, ResourceUnknownFault,
        PublisherRegistrationRejectedFault {
        //CHECKSTYLE:ON

        RegisterPublisher registerPublisherRequest = new RegisterPublisher();
        registerPublisherRequest.setPublisherReference(publisher.getEpr());
        if (topics != null) {
            for (String topic : topics) {
                TopicExpressionType topicExp = new TopicExpressionType();
                topicExp.getContent().add(topic);
                registerPublisherRequest.getTopic().add(topicExp);
            }
        }
        registerPublisherRequest.setDemand(demand);
        RegisterPublisherResponse response = getBroker().registerPublisher(registerPublisherRequest);
        return new Registration(response.getPublisherRegistrationReference());
    }
View Full Code Here

Examples of org.servicemix.ws.xmlbeans.notification.brokered.RegisterPublisherDocument.RegisterPublisher


    public RegisterPublisherResponseDocument registerPublisher(RegisterPublisherDocument requestDoc) {

        // Check request.
        RegisterPublisher publisherInfo = requestDoc.getRegisterPublisher();
        ActiveMQTopic topic = TopicExpressionConverter.toActiveMQTopic(publisherInfo.getTopicArray());
        Calendar terminationTime = publisherInfo.getInitialTerminationTime();
        if (terminationTime != null) {
            // Termination time cannot be in the past
            if (terminationTime.before(Calendar.getInstance())) {
                // Is this the right way to fault??
                throw new NotificationException("Termination time cannot be in the past.");
            }           
            // We could fault here if the time is too far in the future.
        }
        else {
            // We could default a sensible timeout here.
        }
       
        // Create publisher and assoicate an EndpointReference with it.
        EndpointReferenceType registrationEndpointReference;
        try {

            ActiveMQPublisherRegistration publisher = new ActiveMQPublisherRegistration(connection);
            registrationEndpointReference = publisherManager.register(publisher);
            publisher.setEndpointReference(registrationEndpointReference);
            publisher.setTerminationTime(terminationTime);
            publisher.setDemand(publisherInfo.getDemand());

            if (publisherInfo.getDemand()) {
                publisher.setPublisherReference(publisherInfo.getPublisherReference());
            }

            publisher.setTopic(topic);
            publisher.start();
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.