org.wso2.carbon.registry.core.jdbc.handlers
Class RequestContext

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.handlers.RequestContext

public class RequestContext
extends Object

Objects of this class contains the information about the current request to the registry. All attributes of such objects should be either null or should contain a *valid" value. That is, if an attribute contains a non-null value it is safe to assume that attribute contains a valid value as mentioned by the javadoc of that attribute.


Constructor Summary
RequestContext(Registry registry, Repository repository, VersionRepository versionRepository)
          Construct the request context.
 
Method Summary
 String getAction()
          Method to get the Action.
 String getActualPath()
          Method to get the Actual Path.
 Aspect getAspect()
          Method to get the Aspect.
 String getAssociationType()
          Method to get the Association Type.
 long getBytesRead()
          Method to get the bytes read when performing a registry restoration operation.
 long getBytesWritten()
          Method to get the bytes written when performing a registry dump operation.
 Comment getComment()
          Method to get the Comment.
 Reader getDumpingReader()
          Method to get the Dumping Reader.
 Writer getDumpingWriter()
          Method to get the Dumping Writer.
 String getHandlerExecutionIdString()
          Method to get the Handler Execution Id
 Map<String,List<String[]>> getHandlerExecutionStatusMap()
          Method to get the HandlerExecutionStatusMap.
 String getKeywords()
          Method to get the Keywords.
 Association[] getOldAssociationsOnSource()
          Method to get the Old Associations On Source.
 Association[] getOldAssociationsOnTarget()
          Method to get the Old Associations On Target.
 float getOldAverageRating()
          Method to get the Old Average Rating.
 Comment[] getOldComments()
          Method to get the Old Comments.
 int getOldRating()
          Method to get the Old Rating.
 Resource getOldResource()
          Method to get the Old Resource.
 Tag[] getOldTags()
          Method to get the Old Tags.
 Collection getParentCollection()
          Method to get the Parent Collection.
 String getParentPath()
          Method to get the Parent Path.
 Object getProperty(String name)
          Method to get the Property by name.
 Map getQueryParameters()
          Method to get the Query Parameters.
 int getRating()
          Method to get the Rating.
 Registry getRegistry()
          Method to get the Registry.
 RegistryContext getRegistryContext()
          Method to get the Registry Context.
 Repository getRepository()
          Method to get the Repository.
 Resource getResource()
          Method to get the Resource.
 ResourcePath getResourcePath()
          Method to get the Resource Path.
 String getSourcePath()
          Method to get the Source Path.
 String getSourceURL()
          Method to get the Source URL.
 Registry getSystemRegistry()
          Method to get the System Registry.
 String getTag()
          Method to get the Tag.
 String getTargetPath()
          Method to get the Target Path.
 String getTargetSubPath()
          Method to get the Target Sub Path.
 String getUserName()
          Method to get the User Name.
 String getVersionPath()
          Method to get the Version Path.
 VersionRepository getVersionRepository()
          Method to get the Version Repository.
 boolean isExecutionStatusSet(Handler handler)
          Check whether the execution status is set.
 boolean isLoggingActivity()
          Check whether activities must be logged or not.
 boolean isProcessingComplete()
          Method to determine whether processing is complete or not.
 boolean isSimulation()
          Check whether this is running in simulation mode
 void setAction(String action)
          Method to set Action.
 void setActualPath(String actualPath)
          Method to set Actual Path.
 void setAspect(Aspect aspect)
          Method to set Aspect.
 void setAssociationType(String associationType)
          Method to set Association Type.
 void setBytesRead(long bytesRead)
          Method to set the bytes read when performing a registry restoration operation.
 void setBytesWritten(long bytesWritten)
          Method to set the bytes written when performing a registry dump operation.
 void setComment(Comment comment)
          Method to set Comment.
 void setDumpingReader(Reader dumpingReader)
          Method to set Dumping Reader.
 void setDumpingWriter(Writer dumpingWriter)
          Method to set Dumping Writer.
 void setExecutionStatus(Handler handler, boolean status)
          Method to set Execution Status.
 void setExecutionStatus(Handler handler, Throwable exception)
          Method to set Execution Status.
 void setKeywords(String keywords)
          Method to set Keywords.
 void setLoggingActivity(boolean loggingActivity)
          Method to set whether activities must be logged for this operation.
 void setOldAssociationsOnSource(Association[] oldAssociationsOnSource)
          Method to set Old Associations On Source.
 void setOldAssociationsOnTarget(Association[] oldAssociationsOnTarget)
          Method to set Old Associations On Target.
 void setOldAverageRating(float oldAverageRating)
          Method to set Old Average Rating.
 void setOldComments(Comment[] oldComments)
          Method to set Old Comments.
 void setOldRating(int oldRating)
          Method to set Old Rating.
 void setOldResource(Resource oldResource)
          Method to set Old Resource.
 void setOldTags(Tag[] oldTags)
          Method to set Old Tags.
 void setParentCollection(Collection parentCollection)
          Method to set Parent Collection.
 void setParentPath(String parentPath)
          Method to set Parent Path.
 void setProcessingComplete(boolean processingComplete)
          Method to set Processing Complete.
 void setProperty(String name, Object value)
          Method to set Property.
 void setQueryParameters(Map queryParameters)
          Method to set Query Parameters.
 void setRating(int rating)
          Method to set Rating.
 void setRegistryContext(RegistryContext registryContext)
          Method to set Registry Context.
 void setResource(Resource resource)
          Method to set Resource.
 void setResourcePath(ResourcePath resourcePath)
          Method to set Resource Path.
 void setSourcePath(String sourcePath)
          Method to set Source Path.
 void setSourceURL(String sourceURL)
          Method to set Source URL.
 void setTag(String tag)
          Method to set Tag.
 void setTargetPath(String targetPath)
          Method to set Target Path.
 void setTargetSubPath(String targetSubPath)
          Method to set Target Sub Path.
 void setUserName(String userName)
          Method to set User Name.
 void setVersionPath(String versionPath)
          Method to set Version Path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestContext

public RequestContext(Registry registry,
                      Repository repository,
                      VersionRepository versionRepository)
Construct the request context.

Parameters:
registry - the registry
repository - the repository.
versionRepository - the version repository.
Method Detail

getRegistry

public Registry getRegistry()
Method to get the Registry.

Returns:
the Registry.

getSystemRegistry

public Registry getSystemRegistry()
                           throws RegistryException
Method to get the System Registry.

Returns:
the System Registry.
Throws:
RegistryException - if the operation failed.

getRepository

public Repository getRepository()
Method to get the Repository.

Returns:
the Repository.

getVersionRepository

public VersionRepository getVersionRepository()
Method to get the Version Repository.

Returns:
the Version Repository.

isProcessingComplete

public boolean isProcessingComplete()
Method to determine whether processing is complete or not.

Returns:
whether processing is complete or not.

setProcessingComplete

public void setProcessingComplete(boolean processingComplete)
Method to set Processing Complete.

Parameters:
processingComplete - the Processing Complete.

getResourcePath

public ResourcePath getResourcePath()
Method to get the Resource Path.

Returns:
the Resource Path.

setResourcePath

public void setResourcePath(ResourcePath resourcePath)
Method to set Resource Path.

Parameters:
resourcePath - the Resource Path.

getSourceURL

public String getSourceURL()
Method to get the Source URL.

Returns:
the Source URL.

setSourceURL

public void setSourceURL(String sourceURL)
Method to set Source URL.

Parameters:
sourceURL - the Source URL.

getActualPath

public String getActualPath()
Method to get the Actual Path.

Returns:
the Actual Path.

setActualPath

public void setActualPath(String actualPath)
Method to set Actual Path.

Parameters:
actualPath - the Actual Path.

getResource

public Resource getResource()
Method to get the Resource.

Returns:
the Resource.

setResource

public void setResource(Resource resource)
Method to set Resource.

Parameters:
resource - the Resource.

getParentPath

public String getParentPath()
Method to get the Parent Path.

Returns:
the Parent Path.

setParentPath

public void setParentPath(String parentPath)
Method to set Parent Path.

Parameters:
parentPath - the Parent Path.

getAspect

public Aspect getAspect()
Method to get the Aspect.

Returns:
the Aspect.

setAspect

public void setAspect(Aspect aspect)
Method to set Aspect.

Parameters:
aspect - the Aspect.

getAction

public String getAction()
Method to get the Action.

Returns:
the Action.

setAction

public void setAction(String action)
Method to set Action.

Parameters:
action - the Action.

getParentCollection

public Collection getParentCollection()
Method to get the Parent Collection.

Returns:
the Parent Collection.

setParentCollection

public void setParentCollection(Collection parentCollection)
Method to set Parent Collection.

Parameters:
parentCollection - the Parent Collection.

setProperty

public void setProperty(String name,
                        Object value)
Method to set Property.

Parameters:
name - the name of the property.
value - the value of the property.

getProperty

public Object getProperty(String name)
Method to get the Property by name.

Parameters:
name - the name of the property.
Returns:
the Property.

getSourcePath

public String getSourcePath()
Method to get the Source Path.

Returns:
the Source Path.

setSourcePath

public void setSourcePath(String sourcePath)
Method to set Source Path.

Parameters:
sourcePath - the Source Path.

getTargetPath

public String getTargetPath()
Method to get the Target Path.

Returns:
the Target Path.

setTargetPath

public void setTargetPath(String targetPath)
Method to set Target Path.

Parameters:
targetPath - the Target Path.

getTargetSubPath

public String getTargetSubPath()
Method to get the Target Sub Path.

Returns:
the Target Sub Path.

setTargetSubPath

public void setTargetSubPath(String targetSubPath)
Method to set Target Sub Path.

Parameters:
targetSubPath - the Target Sub Path.

getUserName

public String getUserName()
Method to get the User Name.

Returns:
the User Name.

setUserName

public void setUserName(String userName)
Method to set User Name.

Parameters:
userName - the User Name.

getTag

public String getTag()
Method to get the Tag.

Returns:
the Tag.

setTag

public void setTag(String tag)
Method to set Tag.

Parameters:
tag - the Tag.

getAssociationType

public String getAssociationType()
Method to get the Association Type.

Returns:
the Association Type.

setAssociationType

public void setAssociationType(String associationType)
Method to set Association Type.

Parameters:
associationType - the Association Type.

getRating

public int getRating()
Method to get the Rating.

Returns:
the Rating.

setRating

public void setRating(int rating)
Method to set Rating.

Parameters:
rating - the Rating.

getComment

public Comment getComment()
Method to get the Comment.

Returns:
the Comment.

setComment

public void setComment(Comment comment)
Method to set Comment.

Parameters:
comment - the Comment.

getVersionPath

public String getVersionPath()
Method to get the Version Path.

Returns:
the Version Path.

setVersionPath

public void setVersionPath(String versionPath)
Method to set Version Path.

Parameters:
versionPath - the Version Path.

getQueryParameters

public Map getQueryParameters()
Method to get the Query Parameters.

Returns:
the Query Parameters.

setQueryParameters

public void setQueryParameters(Map queryParameters)
Method to set Query Parameters.

Parameters:
queryParameters - the Query Parameters.

getKeywords

public String getKeywords()
Method to get the Keywords.

Returns:
the Keywords.

setKeywords

public void setKeywords(String keywords)
Method to set Keywords.

Parameters:
keywords - the Keywords.

getBytesRead

public long getBytesRead()
Method to get the bytes read when performing a registry restoration operation.

Returns:
the number of bytes read.

setBytesRead

public void setBytesRead(long bytesRead)
Method to set the bytes read when performing a registry restoration operation.

Parameters:
bytesRead - the number of bytes read.

getBytesWritten

public long getBytesWritten()
Method to get the bytes written when performing a registry dump operation.

Returns:
the number of bytes written.

setBytesWritten

public void setBytesWritten(long bytesWritten)
Method to set the bytes written when performing a registry dump operation.

Parameters:
bytesWritten - the number of bytes written.

getDumpingReader

public Reader getDumpingReader()
Method to get the Dumping Reader.

Returns:
the Dumping Reader.

setDumpingReader

public void setDumpingReader(Reader dumpingReader)
Method to set Dumping Reader.

Parameters:
dumpingReader - the Dumping Reader.

getDumpingWriter

public Writer getDumpingWriter()
Method to get the Dumping Writer.

Returns:
the Dumping Writer.

setDumpingWriter

public void setDumpingWriter(Writer dumpingWriter)
Method to set Dumping Writer.

Parameters:
dumpingWriter - the Dumping Writer.

getRegistryContext

public RegistryContext getRegistryContext()
Method to get the Registry Context.

Returns:
the Registry Context.

setRegistryContext

public void setRegistryContext(RegistryContext registryContext)
Method to set Registry Context.

Parameters:
registryContext - the Registry Context.

getOldResource

public Resource getOldResource()
Method to get the Old Resource.

Returns:
the Old Resource.

setOldResource

public void setOldResource(Resource oldResource)
Method to set Old Resource.

Parameters:
oldResource - the Old Resource.

getOldAssociationsOnSource

public Association[] getOldAssociationsOnSource()
Method to get the Old Associations On Source.

Returns:
the Old Associations On Source.

setOldAssociationsOnSource

public void setOldAssociationsOnSource(Association[] oldAssociationsOnSource)
Method to set Old Associations On Source.

Parameters:
oldAssociationsOnSource - the Old Associations On Source.

getOldAssociationsOnTarget

public Association[] getOldAssociationsOnTarget()
Method to get the Old Associations On Target.

Returns:
the Old Associations On Target.

setOldAssociationsOnTarget

public void setOldAssociationsOnTarget(Association[] oldAssociationsOnTarget)
Method to set Old Associations On Target.

Parameters:
oldAssociationsOnTarget - the Old Associations On Target.

getOldTags

public Tag[] getOldTags()
Method to get the Old Tags.

Returns:
the Old Tags.

setOldTags

public void setOldTags(Tag[] oldTags)
Method to set Old Tags.

Parameters:
oldTags - the Old Tags.

getOldComments

public Comment[] getOldComments()
Method to get the Old Comments.

Returns:
the Old Comments.

setOldComments

public void setOldComments(Comment[] oldComments)
Method to set Old Comments.

Parameters:
oldComments - the Old Comments.

getOldRating

public int getOldRating()
Method to get the Old Rating.

Returns:
the Old Rating.

setOldRating

public void setOldRating(int oldRating)
Method to set Old Rating.

Parameters:
oldRating - the Old Rating.

getOldAverageRating

public float getOldAverageRating()
Method to get the Old Average Rating.

Returns:
the Old Average Rating.

setOldAverageRating

public void setOldAverageRating(float oldAverageRating)
Method to set Old Average Rating.

Parameters:
oldAverageRating - the Old Average Rating.

getHandlerExecutionIdString

public String getHandlerExecutionIdString()
Method to get the Handler Execution Id

Returns:
the Handler Execution Id String.

setExecutionStatus

public void setExecutionStatus(Handler handler,
                               boolean status)
Method to set Execution Status.

Parameters:
handler - the Execution Status.
status - the status.

setExecutionStatus

public void setExecutionStatus(Handler handler,
                               Throwable exception)
Method to set Execution Status.

Parameters:
handler - the Execution Status.
exception - the exception to throw at a failure.

isExecutionStatusSet

public boolean isExecutionStatusSet(Handler handler)
Check whether the execution status is set.

Parameters:
handler - The handler the execution status checking.
Returns:
whether the status is set or not.

getHandlerExecutionStatusMap

public Map<String,List<String[]>> getHandlerExecutionStatusMap()
Method to get the HandlerExecutionStatusMap.

Returns:
the HandlerExecutionStatusMap.

isSimulation

public boolean isSimulation()
Check whether this is running in simulation mode

Returns:
true if it is running on simulation mode, false otherwise.

isLoggingActivity

public boolean isLoggingActivity()
Check whether activities must be logged or not. This is true by default.

Returns:
true if activities must be logged, false otherwise.

setLoggingActivity

public void setLoggingActivity(boolean loggingActivity)
Method to set whether activities must be logged for this operation.

Parameters:
loggingActivity - whether activities should be logged or not.


Copyright © 2012 WSO2 Inc. All Rights Reserved.