org.glite.lb

Class Context

public abstract class Context extends Object

Class representing a context for some job
Constructor Summary
Context()
Creates new instance of Context class.
Context(Sources src, int flag, String host, String user, String prog, String srcInstance, Jobid jobid)
Creates new instance of Context class.
Method Summary
protected StringcreateMessage(Event event)
Creates message prepared to send
intgetFlag()
Return flag
StringgetHost()
Returns host name
JobidgetJobid()
Gets jobid.
StringgetProg()
Gets prog.
SeqCodegetSeqCode()
Gets sequence code.
SourcesgetSource()
Gets source which represents which part of sequence code will be changed
StringgetSrcInstance()
Gets srcInstance.
StringgetUser()
Gets user name.
abstract voidlog(Event event)
Abstract method which will serve as method for sending messages with events.
voidsetFlag(int flag)
Set flag
voidsetHost(String host)
Sets host name
voidsetJobid(Jobid jobid)
Sets jobid.
voidsetProg(String prog)
Sets prog, if prog is null then is set default value "edg-wms"
voidsetSeqCode(SeqCode seqCode)
Sets sequence code.
voidsetSource(Sources src)
Sets source which represents which part of sequence code will be changed
voidsetSrcInstance(String srcInstance)
Sets srcInstace, if srcInstace null then is set "".
voidsetUser(String user)
Sets user name.

Constructor Detail

Context

public Context()
Creates new instance of Context class.

Context

public Context(Sources src, int flag, String host, String user, String prog, String srcInstance, Jobid jobid)
Creates new instance of Context class.

Parameters: id message id, if null, random number is generated source one if paramaters of Sources enumeration flag host host name, if null or "", the name is get from host name of this computer user user name prog if null then is used "egd-wms" srcInstance if null then it is set as "" jobid

Throws: java.lang.IllegalArgumentException if user or jobid is null or flag < 0 or source <=0 || >= 9

Method Detail

createMessage

protected String createMessage(Event event)
Creates message prepared to send

Parameters: event event for which is message generated

Returns: output String with message

Throws: IllegalArgumentException if event, source, user or job is null or flag < 0

getFlag

public int getFlag()
Return flag

Returns: flag

getHost

public String getHost()
Returns host name

Returns: host name

getJobid

public Jobid getJobid()
Gets jobid.

Returns: jobid

getProg

public String getProg()
Gets prog.

Returns: prog

getSeqCode

public SeqCode getSeqCode()
Gets sequence code.

Returns: sequence code

getSource

public Sources getSource()
Gets source which represents which part of sequence code will be changed

Returns: source

getSrcInstance

public String getSrcInstance()
Gets srcInstance.

Returns: srcInstance

getUser

public String getUser()
Gets user name.

Returns: user name

log

public abstract void log(Event event)
Abstract method which will serve as method for sending messages with events.

Parameters: event event for which will be created and send message

setFlag

public void setFlag(int flag)
Set flag

Parameters: flag

Throws: java.lang.IllegalArgumentException if flag is lower than 0

setHost

public void setHost(String host)
Sets host name

Parameters: host host name

Throws: java.lang.IllegalArgumentException if host is null

setJobid

public void setJobid(Jobid jobid)
Sets jobid.

Parameters: jobid

Throws: java.lang.IllegalArgumentException if jobid is null

setProg

public void setProg(String prog)
Sets prog, if prog is null then is set default value "edg-wms"

Parameters: prog

setSeqCode

public void setSeqCode(SeqCode seqCode)
Sets sequence code.

Parameters: seqCode sequence code

Throws: java.lang.IllegalArgumentException if seqCode is null

setSource

public void setSource(Sources src)
Sets source which represents which part of sequence code will be changed

Parameters: source source

Throws: java.lang.IllegalArgumentException if source is null

setSrcInstance

public void setSrcInstance(String srcInstance)
Sets srcInstace, if srcInstace null then is set "".

Parameters: srcInstance srcInstance

setUser

public void setUser(String user)
Sets user name.

Parameters: user user name

Throws: java.lang.IllegalArgumentException if user is null