All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.remoteClass_interface_java.ftl Maven / Gradle / Ivy

Go to download

Kurento Client The Kurento Client project allows server applications to control media server resources.

There is a newer version: 7.1.0
Show newest version
${packageToFolder(module.code.api.java.packageName)}/${remoteClass.name}.java
<#include "macros.ftm" >
/**
 * This file is generated with Kurento-maven-plugin.
 * Please don't edit.
 */
package ${module.code.api.java.packageName};

<#if module.code.api.java.packageName != "org.kurento.client">
import org.kurento.client.*;


<@comment remoteClass.doc />
@org.kurento.client.internal.RemoteClass
public interface ${remoteClass.name} extends <#if remoteClass.extends??>${remoteClass.extends.name}<#else>KurentoObject {

   <#list remoteClass.properties as property>
     <@comment_set_get property.doc "Get"/>
     ${getJavaObjectType(property.type,false)} get${property.name?cap_first}();

     <@comment_set_get property.doc "Get"/>
     void get${property.name?cap_first}(Continuation<${getJavaObjectType(property.type,true)}> cont);

     <@comment_set_get property.doc "Get"/>
     TFuture<${getJavaObjectType(property.type,true)}> get${property.name?cap_first}(Transaction tx);

     <#if !property.readOnly && !property.final>
     <@comment_set_get property.doc "Set"/>
     void set${property.name?cap_first}(@org.kurento.client.internal.server.Param("${property.name}") ${getJavaObjectType(property.type,false)} ${property.name});

     <@comment_set_get property.doc "Set"/>
     void set${property.name?cap_first}(@org.kurento.client.internal.server.Param("${property.name}") ${getJavaObjectType(property.type,false)} ${property.name}, Continuation cont);

     <@comment_set_get property.doc "Set"/>
     void set${property.name?cap_first}(@org.kurento.client.internal.server.Param("${property.name}") ${getJavaObjectType(property.type,false)} ${property.name}, Transaction tx);
     
   

   <#list remoteClass.methods as method>

  <@comment method.doc method.params method.return />
  ${getJavaObjectType(method.return,false)} ${method.name}(<#rt>
    <#lt><#list method.params as param>@org.kurento.client.internal.server.Param("${param.name}") ${getJavaObjectType(param.type,false)} ${param.name}<#if param_has_next>, );

  <#assign doc>
Asynchronous version of ${method.name}:
{@link Continuation#onSuccess} is called when the action is
done. If an error occurs, {@link Continuation#onError} is called.

@see ${remoteClass.name}#${method.name}
    
    <@comment doc method.params />
    void ${method.name}(<#rt>
    <#lt><#list method.params as param>@org.kurento.client.internal.server.Param("${param.name}") ${getJavaObjectType(param.type,false)} ${param.name}, Continuation<${getJavaObjectType(method.return)}> cont);

    <@comment method.doc method.params method.return />
    <#assign type = getJavaObjectType(method.return,true)>
    <#if type == "Void">void<#else>TFuture<${type}> ${method.name}(Transaction tx<#rt>
    <#lt><#list method.params as param>, @org.kurento.client.internal.server.Param("${param.name}") ${getJavaObjectType(param.type,false)} ${param.name});

    
  <#list remoteClass.events as event>
    /**
     * Add a {@link EventListener} for event {@link ${event.name}Event}. Synchronous call.
     *
     * @param  listener Listener to be called on ${event.name}Event
     * @return ListenerSubscription for the given Listener
     *
     **/
    @org.kurento.client.internal.server.EventSubscription(${event.name}Event.class)
    ListenerSubscription add${event.name}Listener(EventListener<${event.name}Event> listener);
    /**
     * Add a {@link EventListener} for event {@link ${event.name}Event}. Asynchronous call.
     * Calls Continuation<ListenerSubscription> when it has been added.
     *
     * @param listener Listener to be called on ${event.name}Event
     * @param cont     Continuation to be called when the listener is registered
     *
     **/
    @org.kurento.client.internal.server.EventSubscription(${event.name}Event.class)
    void add${event.name}Listener(EventListener<${event.name}Event> listener, Continuation cont);
    
	/**
     * Remove a {@link ListenerSubscription} for event {@link ${event.name}Event}. Synchronous call.
     *
     * @param listenerSubscription Listener subscription to be removed
     *
     **/
    @org.kurento.client.internal.server.EventSubscription(${event.name}Event.class)
    void remove${event.name}Listener(ListenerSubscription listenerSubscription);
    /**
     * Remove a {@link ListenerSubscription} for event {@link ${event.name}Event}. Asynchronous call.
     * Calls Continuation<Void> when it has been removed.
     *
     * @param listenerSubscription Listener subscription to be removed
     * @param cont                 Continuation to be called when the listener is removed
     *
     **/
    @org.kurento.client.internal.server.EventSubscription(${event.name}Event.class)
    void remove${event.name}Listener(ListenerSubscription listenerSubscription, Continuation cont);
    
    
    <#if remoteClass.name == "MediaPipeline">
    Transaction beginTransaction();
    


    <#if !remoteClass.abstract && remoteClass.name != "MediaPipeline">

    public class Builder extends AbstractBuilder<${remoteClass.name}> {

    <#assign doc="Creates a Builder for ${remoteClass.name}" />
    <@comment doc param />
    public Builder(<#rt>
          <#assign first=true>
          <#lt><#list remoteClass.constructor.params as param>
          <#if !param.optional>
              <#lt><#if first><#assign first=false><#else>, <#rt>
              <#lt>${getJavaObjectType(param.type,false)} ${param.name}<#rt>
          
          
          <#lt>){

      super(${remoteClass.name}.class,${remoteClass.constructor.params[0].name});

          <#list remoteClass.constructor.params as param>
          <#if !param.optional>
      props.add("${param.name}",${param.name});
          
          
    }

	public Builder withProperties(Properties properties) {
    	return (Builder)super.withProperties(properties);
  	}

	public Builder with(String name, Object value) {
		return (Builder)super.with(name, value);
	}
	
        <#list remoteClass.constructor.params as param>
        <#if param.optional>
        <#if param.type.name != "boolean" >
    <#assign par=[param] />
    <@comment  "Sets a value for ${param.name} in Builder for ${remoteClass.name}." par />
    public Builder with${param.name?cap_first}(${getJavaObjectType(param.type,false)} ${param.name}){
      props.add("${param.name}",${param.name});
      return this;
    }
        <#else>
            <@comment  param.doc />
    public Builder ${param.name}(){
      props.add("${param.name}",Boolean.TRUE);
      return this;
    }
    
        
       
    }
  


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy