com.poscoict.glueframework.scheduling.remote
Class GlueHttpJobEventSender

java.lang.Object
  extended by com.poscoict.glueframework.scheduling.remote.GlueHttpJobEventSender
All Implemented Interfaces:
GlueJobEventSender, org.springframework.beans.factory.InitializingBean

public class GlueHttpJobEventSender
extends Object
implements GlueJobEventSender, org.springframework.beans.factory.InitializingBean

GlueJobEventSender ±¸Çöü. ¿ø°Ý¿¡ À§Ä¡ÇÑ ½ºÄÉÁÙ·¯ ¼­¹ö·Î Job ±âµ¿ ¿äûÀ» º¸³»´Â Http Sender Ŭ·¡½º.

 Bean Property
 
 - address : default java.net.InetAddress.getLocalHost().getHostAddress()
 
 - retryCount : default "2"
 
 - charset : default "EUC-KR"
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     <bean id="sender" class="com.poscoict.glueframework.scheduling.remote.GlueHttpJobEventSender"/>
 
 
 »ç¿ë ¿¹# 2
 
     <bean id="sender" class="com.poscoict.glueframework.scheduling.remote.GlueHttpJobEventSender">
         <property name="retryCount" value="2" />
     </bean>
 
 
 
 Âü°í : {pgm}-service.xml
 
     <?xml version="1.0" encoding="UTF-8"?>
     <service ...
         <activity name="FireJob" class="com.poscoict.glueframework.scheduling.activity.GlueJobCall">
             <transition name="success" value="end" />
             <property name="sender" value="eventSender" />
             ...
         </activity>
     </service>
 


Field Summary
protected static String HTTP_PREFIX
           
 
Constructor Summary
GlueHttpJobEventSender()
           
 
Method Summary
 void afterPropertiesSet()
           
 String getAddress()
           
 String getCharset()
           
 int getRetryCount()
           
protected  org.apache.commons.httpclient.NameValuePair[] makeRequestBody(GlueJobDefinition jobDef)
           
 String sendJobEvent(GlueJobDefinition jobDef)
          TargetUrl¿¡ Á¤ÀÇµÈ ¼­¹ö·Î http request¸¦ º¸³½´Ù.
 String sendJobEvent(GlueJobDefinition jobDef, String targetUri)
          targetUrl¿¡ Á¤ÀÇµÈ ¼­¹ö·Î http request¸¦ º¸³½´Ù.
 void setAddress(String address)
           
 void setCharset(String charset)
           
 void setRetryCount(int retryCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_PREFIX

protected static final String HTTP_PREFIX
See Also:
Constant Field Values
Constructor Detail

GlueHttpJobEventSender

public GlueHttpJobEventSender()
Method Detail

getAddress

public String getAddress()

setAddress

public void setAddress(String address)

getRetryCount

public int getRetryCount()

setRetryCount

public void setRetryCount(int retryCount)

sendJobEvent

public String sendJobEvent(GlueJobDefinition jobDef,
                           String targetUri)
Description copied from interface: GlueJobEventSender
targetUrl¿¡ Á¤ÀÇµÈ ¼­¹ö·Î http request¸¦ º¸³½´Ù. JobDefinition Á¤º¸¸¦ ÃßÃâÇÏ¿© request¸¦ »ý¼ºÇÑ´Ù. ¼­¹ö ½ºÄÉÁÙ·¯¿¡¼­ Á¤»óÀûÀ¸·Î Á¢¼ö°¡ µÇ¸é "success"°¡ ¸®ÅϵȴÙ. (Scheduled JobÀÌ Á¤»óÀûÀ¸·Î ó¸®µÈ °ÍÀ» ÀǹÌÇÏ´Â °ÍÀÌ ¾Æ´Ï´Ù.) /glue-scheduler ¿¡ ´ëÇؼ­´Â °íÁ¤°ªÀÌ´Ù.

Specified by:
sendJobEvent in interface GlueJobEventSender
targetUri - : http://127.0.0.1:8805/glue-scheduler
Returns:
¼º°ø ½Ã "success"

sendJobEvent

public String sendJobEvent(GlueJobDefinition jobDef)
TargetUrl¿¡ Á¤ÀÇµÈ ¼­¹ö·Î http request¸¦ º¸³½´Ù. JobDefinition Á¤º¸¸¦ ÃßÃâÇÏ¿© request¸¦ »ý¼ºÇÑ´Ù. ¼­¹ö ½ºÄÉÁÙ·¯¿¡¼­ Á¤»óÀûÀ¸·Î Á¢¼ö°¡ µÇ¸é "success"°¡ ¸®ÅϵȴÙ. (Scheduled JobÀÌ Á¤»óÀûÀ¸·Î ó¸®µÈ °ÍÀ» ÀǹÌÇÏ´Â °ÍÀÌ ¾Æ´Ï´Ù.)

Specified by:
sendJobEvent in interface GlueJobEventSender
Parameters:
jobDef -
Returns:
¼º°ø ½Ã "success"
Throws:
GlueException - - Request ¼Û½Å ½ÇÆÐ ½Ã

makeRequestBody

protected org.apache.commons.httpclient.NameValuePair[] makeRequestBody(GlueJobDefinition jobDef)

getCharset

public String getCharset()
Returns:
the charset

setCharset

public void setCharset(String charset)
Parameters:
charset - the charset to set

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception


Copyright © 2013–2018 POSCO ICT. All rights reserved.