org.xwiki.job
Class AbstractRequest

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

public abstract class AbstractRequest
extends Object
implements Request

Base class for Request implementations.

Since:
4.0M1
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.xwiki.job.Request
PROPERTY_INTERACTIVE, PROPERTY_REMOTE
 
Constructor Summary
AbstractRequest()
          Default constructor.
AbstractRequest(Request request)
           
 
Method Summary
 boolean containsProperty(String key)
           
 List<String> getId()
           
<T> T
getProperty(String key)
           
<T> T
getProperty(String key, T def)
           
 Collection<String> getPropertyNames()
           
 boolean isInteractive()
           
 boolean isRemote()
           
<T> T
removeProperty(String key)
           
 void setId(List<String> id)
           
 void setId(String id)
           
 void setInteractive(boolean interactive)
           
 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 List<String> getId()
Specified by:
getId in interface Request
Returns:
list based 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(List<String> id)
Parameters:
id - the identifier used to access the job
Since:
4.1M2

setId

public void setId(String id)
Parameters:
id - the identifier used to access 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

isInteractive

public boolean isInteractive()
Specified by:
isInteractive in interface Request
Returns:
indicate if the job is allowed to ask questions if it it should be fully automated (i.e. use default answers)

setInteractive

public void setInteractive(boolean interactive)
Parameters:
interactive - indicate if the job is allowed to ask questions if it it should be fully automated (i.e. use default answers)

setProperty

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

removeProperty

public <T> T removeProperty(String key)
Type Parameters:
T - the type of the value
Parameters:
key - the name of the property
Returns:
the previous value associated to the passed key
Since:
4.2M2

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

containsProperty

public boolean containsProperty(String key)
Specified by:
containsProperty in interface Request
Parameters:
key - the name of the property
Returns:
true if this map contains a property for the specified key