org.xwiki.job
Class AbstractRequest

java.lang.Object
  extended by org.xwiki.job.AbstractRequest
All Implemented Interfaces:
Serializable, Request
Direct Known Subclasses:
DefaultRequest

public abstract class AbstractRequest
extends Object
implements Request

Base class for Request implementations.

Since:
4.0M1
Version:
$Id$
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.xwiki.job.Request
PROPERTY_REMOTE
 
Constructor Summary
AbstractRequest()
          Default constructor.
AbstractRequest(Request request)
           
 
Method Summary
 String getId()
           
<T> T
getProperty(String key)
           
<T> T
getProperty(String key, T def)
           
 Collection<String> getPropertyNames()
           
 boolean isRemote()
           
 void setId(String id)
           
 void setProperty(String key, Object value)
           
 void setRemote(boolean remote)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRequest

public AbstractRequest()
Default constructor.


AbstractRequest

public AbstractRequest(Request request)
Parameters:
request - the request to copy
Method Detail

getId

public String getId()
Specified by:
getId in interface Request
Returns:
identifier used to access the job. If none is provided the job will not be accessible by id and the status of the job will not be stored.

setId

public void setId(String id)
Parameters:
id - the identifier used to acccess the job

isRemote

public boolean isRemote()
Specified by:
isRemote in interface Request
Returns:
indicate if the job has been triggered by a remote event

setRemote

public void setRemote(boolean remote)
Parameters:
remote - indicate if the job has been triggered by a remote event

setProperty

public void setProperty(String key,
                        Object value)
Parameters:
key - the name of the property
value - the value of the property

getProperty

public <T> T getProperty(String key)
Specified by:
getProperty in interface Request
Type Parameters:
T - the type of the value
Parameters:
key - the name of the property
Returns:
the value of the property

getProperty

public <T> T getProperty(String key,
                         T def)
Specified by:
getProperty in interface Request
Type Parameters:
T - the type of the value
Parameters:
key - the name of the property
def - the default value of the property
Returns:
the value of the property

getPropertyNames

public Collection<String> getPropertyNames()
Specified by:
getPropertyNames in interface Request
Returns:
the names of all the properties


Copyright © 2004-2012 XWiki. All Rights Reserved.