org.glite.lb
Class Context

java.lang.Object
  extended by org.glite.lb.Context
Direct Known Subclasses:
ContextIL

public abstract class Context
extends java.lang.Object

Class representing a context for some job


Constructor Summary
Context()
          Creates new instance of Context class.
Context(Sources src, int flag, java.lang.String host, java.lang.String user, java.lang.String prog, java.lang.String srcInstance, org.glite.jobid.Jobid jobid)
          Creates new instance of Context class.
 
Method Summary
protected  java.lang.String createMessage(Event event)
          Creates message prepared to send
 int getFlag()
          Return flag
 java.lang.String getHost()
          Returns host name
 org.glite.jobid.Jobid getJobid()
          Gets jobid.
 java.lang.String getProg()
          Gets prog.
 SeqCode getSeqCode()
          Gets sequence code.
 Sources getSource()
          Gets source which represents which part of sequence code will be changed
 java.lang.String getSrcInstance()
          Gets srcInstance.
 java.lang.String getUser()
          Gets user name.
abstract  void log(Event event)
          Abstract method which will serve as method for sending messages with events.
 void setFlag(int flag)
          Set flag
 void setHost(java.lang.String host)
          Sets host name
 void setJobid(org.glite.jobid.Jobid jobid)
          Sets jobid.
 void setProg(java.lang.String prog)
          Sets prog, if prog is null then is set default value "edg-wms"
 void setSeqCode(SeqCode seqCode)
          Sets sequence code.
 void setSource(Sources src)
          Sets source which represents which part of sequence code will be changed
 void setSrcInstance(java.lang.String srcInstance)
          Sets srcInstace, if srcInstace null then is set "".
 void setUser(java.lang.String user)
          Sets user name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context()
Creates new instance of Context class.


Context

public Context(Sources src,
               int flag,
               java.lang.String host,
               java.lang.String user,
               java.lang.String prog,
               java.lang.String srcInstance,
               org.glite.jobid.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

log

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

Parameters:
event - event for which will be created and send message
Throws:
LBException

createMessage

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

Parameters:
event - event for which is message generated
Returns:
output String with message
Throws:
java.lang.IllegalArgumentException - if event, source, user or job is null or flag < 0

getFlag

public int getFlag()
Return flag

Returns:
flag

setFlag

public void setFlag(int flag)
Set flag

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

getHost

public java.lang.String getHost()
Returns host name

Returns:
host name

setHost

public void setHost(java.lang.String host)
Sets host name

Parameters:
host - host name
Throws:
java.lang.IllegalArgumentException - if host is null

getJobid

public org.glite.jobid.Jobid getJobid()
Gets jobid.

Returns:
jobid

setJobid

public void setJobid(org.glite.jobid.Jobid jobid)
Sets jobid.

Parameters:
jobid -
Throws:
java.lang.IllegalArgumentException - if jobid is null

getProg

public java.lang.String getProg()
Gets prog.

Returns:
prog

setProg

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

Parameters:
prog -

getSeqCode

public SeqCode getSeqCode()
Gets sequence code.

Returns:
sequence code

setSeqCode

public void setSeqCode(SeqCode seqCode)
Sets sequence code.

Parameters:
seqCode - sequence code
Throws:
java.lang.IllegalArgumentException - if seqCode is null

getSource

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

Returns:
source

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

getSrcInstance

public java.lang.String getSrcInstance()
Gets srcInstance.

Returns:
srcInstance

setSrcInstance

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

Parameters:
srcInstance - srcInstance

getUser

public java.lang.String getUser()
Gets user name.

Returns:
user name

setUser

public void setUser(java.lang.String user)
Sets user name.

Parameters:
user - user name
Throws:
java.lang.IllegalArgumentException - if user is null