com.technicolor.eloyente
Class ElOyente

java.lang.Object
  extended by hudson.triggers.Trigger<hudson.model.Project>
      extended by com.technicolor.eloyente.ElOyente
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.triggers.Trigger<?>>

public class ElOyente
extends hudson.triggers.Trigger<hudson.model.Project>

Author:
Juan Luis Pardo González, Isabel Fernández Díaz

Nested Class Summary
static class ElOyente.DescriptorImpl
          Descriptor for ElOyente.
 
Nested classes/interfaces inherited from class hudson.triggers.Trigger
hudson.triggers.Trigger.Cron
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
protected  hudson.model.Project project
           
protected  SubscriptionProperties[] subscriptions
           
 
Fields inherited from class hudson.triggers.Trigger
job, spec, tabs, timer
 
Constructor Summary
ElOyente(SubscriptionProperties[] s)
           
 
Method Summary
 void addListeners(org.jivesoftware.smack.Connection con, String user)
          Add listeners to the connections.
 boolean checkAnyParameterEmpty(String server, String user, String password)
           
static boolean connectionOK(String server, String user, String password)
           
 org.jivesoftware.smack.Connection createConnection(hudson.model.Project project, String server, String user, String password)
           
 ElOyente.DescriptorImpl getDescriptor()
          Retrieves the descriptor for the plugin elOyente.
 List<SubscriptionProperties> getNodeSubscriptions(String node)
           
 List<SubscriptionProperties> getSubscriptions()
           
 Object readResolve()
           
 void run()
          Run a job.
 void runWithEnvironment(hudson.EnvVars vars)
           
 void start(hudson.model.Project project, boolean newInstance)
          Method used for starting a job.
 void stop()
           
 void subscribeIfNecessary(hudson.model.Project project)
           
 
Methods inherited from class hudson.triggers.Trigger
all, checkTriggers, for_, getProjectAction, getProjectActions, getSpec, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subscriptions

protected SubscriptionProperties[] subscriptions

project

protected transient hudson.model.Project project
Constructor Detail

ElOyente

@DataBoundConstructor
public ElOyente(SubscriptionProperties[] s)
Method Detail

readResolve

public Object readResolve()
                   throws ObjectStreamException
Overrides:
readResolve in class hudson.triggers.Trigger<hudson.model.Project>
Throws:
ObjectStreamException

getSubscriptions

public List<SubscriptionProperties> getSubscriptions()

getNodeSubscriptions

public List<SubscriptionProperties> getNodeSubscriptions(String node)

start

public void start(hudson.model.Project project,
                  boolean newInstance)
Method used for starting a job. This method is called when the Save or Apply button are pressed in a job configuration in case this plugin is activated. It checks if there is all the information required for an XMPP connection in the main configuration and creates the connection. It is also called when restarting a connection because of changes in the main configuration.

Overrides:
start in class hudson.triggers.Trigger<hudson.model.Project>
Parameters:
project -
newInstance -

createConnection

public org.jivesoftware.smack.Connection createConnection(hudson.model.Project project,
                                                          String server,
                                                          String user,
                                                          String password)
                                                   throws org.jivesoftware.smack.XMPPException
Throws:
org.jivesoftware.smack.XMPPException

subscribeIfNecessary

public void subscribeIfNecessary(hudson.model.Project project)
                          throws org.jivesoftware.smack.XMPPException
Throws:
org.jivesoftware.smack.XMPPException

checkAnyParameterEmpty

public boolean checkAnyParameterEmpty(String server,
                                      String user,
                                      String password)

connectionOK

public static boolean connectionOK(String server,
                                   String user,
                                   String password)

addListeners

public void addListeners(org.jivesoftware.smack.Connection con,
                         String user)
                  throws org.jivesoftware.smack.XMPPException
Add listeners to the connections. This method is in charge of adding listeners to a node to which a job is subscribed to. This way it will receive events that will trigger it.

Parameters:
con -
project -
Throws:
org.jivesoftware.smack.XMPPException

run

public void run()
Run a job. This method will be called by the ItemEventCoordinator when an XMPP event is received and a job must be triggered.

Overrides:
run in class hudson.triggers.Trigger<hudson.model.Project>

runWithEnvironment

public void runWithEnvironment(hudson.EnvVars vars)

stop

public void stop()
Overrides:
stop in class hudson.triggers.Trigger<hudson.model.Project>

getDescriptor

public final ElOyente.DescriptorImpl getDescriptor()
Retrieves the descriptor for the plugin elOyente. Used by the plugin to set and work with the main configuration.

Specified by:
getDescriptor in interface hudson.model.Describable<hudson.triggers.Trigger<?>>
Overrides:
getDescriptor in class hudson.triggers.Trigger<hudson.model.Project>
Returns:
DescriptorImpl


Copyright © 2004-2012. All Rights Reserved.