Announcement Announcement Module
No announcement yet.
call createStream(..) method of StreamTemplate class Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • call createStream(..) method of StreamTemplate class

    I am trying to call createStream method of StreamTemplate class but finding difficulties to create right instance of ClientHttpRequestFactory to pass into constructor of AbstractTemplate. Since AbstractTemplate's instance need to be
    passed into StreamTemplate's constructor. I tried in following way, its failed.

    Please help me to resolve.. thanks in advance.

    create stream and execute..

    sample code snippets :
    public class StreamOperationMain {
    public static void main(String[] args) {

    RestTemplate template = new RestTemplate();"",HttpMethod.GET, null, CalMainClass.class);

    ClientHttpRequestFactory factory = template.getRequestFactory();

    AbstractTemplate abstractTemplate = new AbstractTemplate(factory);

    StreamTemplate streamTemplate = new StreamTemplate(abstractTemplate);
    streamTemplate.createStream("myusgsStream", "trigger |usgs|log", true);

    Last edited by pkchoudhary06; Dec 11th, 2013, 07:21 AM.