org.openrdf.http.object.model
Class ResourceRequest

java.lang.Object
  extended by org.openrdf.http.object.model.EditableHttpEntityEnclosingRequest
      extended by org.openrdf.http.object.model.Request
          extended by org.openrdf.http.object.model.ResourceRequest
All Implemented Interfaces:
Cloneable, org.apache.http.HttpEntityEnclosingRequest, org.apache.http.HttpMessage, org.apache.http.HttpRequest
Direct Known Subclasses:
ResourceOperation

public class ResourceRequest
extends Request

Tracks the target resource with the request.

Author:
James Leigh

Constructor Summary
ResourceRequest(File dataDir, Request request, ObjectRepository repository)
           
 
Method Summary
 void close()
           
 void commit()
           
 ResponseEntity createResultEntity(Object result, Class<?> ctype, Type gtype, String[] mimeTypes)
           
 URI createURI(String uriSpec)
           
 void flush()
           
 SortedSet<? extends MimeType> getAcceptable()
           
 BodyEntity getBody()
           
 String getContentType(Method method)
           
 File getFile()
           
 Entity getHeader(String[] mediaTypes, String... names)
           
 ObjectConnection getObjectConnection()
           
 String getOperation()
           
 Entity getParameter(String[] mediaTypes, String... names)
           
 Entity getQueryString(String[] mediaTypes)
           
 RDFObject getRequestedResource()
           
 Transaction getRevision()
           
 Collection<String> getVary()
           
 String getVaryHeader(String name)
           
 List<String> getVaryHeaders(String... name)
           
 void init()
           
 boolean isAcceptable(Class<?> type, Type genericType)
           
 boolean isAcceptable(String mediaType)
           
 boolean isAcceptable(String mediaType, Class<?> type, Type genericType)
           
 boolean isQueryStringPresent()
           
 String revisionTag(int code)
           
 void rollback()
           
 String variantTag(String mediaType, int code)
           
 
Methods inherited from class org.openrdf.http.object.model.Request
clone, getAuthority, getDateHeader, getHeader, getHeaderEnumeration, getHeaderValues, getIRI, getMaxAge, getMaxStale, getMethod, getMinFresh, getQueryString, getReceivedOn, getRemoteAddr, getRequestTarget, getRequestURI, getRequestURL, getResolvedHeader, getURIFromRequestTarget, getX509Certificate, invalidatesCache, isMessageBody, isNoCache, isOnlyIfCache, isSafe, isStorable, parseURI, resolve, setIRI, setReceivedOn, toString
 
Methods inherited from class org.openrdf.http.object.model.EditableHttpEntityEnclosingRequest
addHeader, addHeader, containsHeader, expectContinue, getAllHeaders, getEnclosingRequest, getEntity, getFirstHeader, getHeaders, getLastHeader, getParams, getProtocolVersion, getRequestLine, headerIterator, headerIterator, removeHeader, removeHeaders, setEntity, setHeader, setHeader, setHeaders, setParams, setRequestLine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceRequest

public ResourceRequest(File dataDir,
                       Request request,
                       ObjectRepository repository)
                throws QueryEvaluationException,
                       RepositoryException,
                       MimeTypeParseException
Throws:
QueryEvaluationException
RepositoryException
MimeTypeParseException
Method Detail

init

public void init()
          throws RepositoryException,
                 QueryEvaluationException,
                 MimeTypeParseException
Throws:
RepositoryException
QueryEvaluationException
MimeTypeParseException

getVaryHeader

public String getVaryHeader(String name)

getVaryHeaders

public List<String> getVaryHeaders(String... name)

getVary

public Collection<String> getVary()

createResultEntity

public ResponseEntity createResultEntity(Object result,
                                         Class<?> ctype,
                                         Type gtype,
                                         String[] mimeTypes)

createURI

public URI createURI(String uriSpec)

flush

public void flush()
           throws RepositoryException,
                  QueryEvaluationException,
                  IOException
Throws:
RepositoryException
QueryEvaluationException
IOException

rollback

public void rollback()
              throws RepositoryException
Throws:
RepositoryException

commit

public void commit()
            throws IOException,
                   RepositoryException
Throws:
IOException
RepositoryException

close

public void close()
           throws RepositoryException,
                  IOException
Overrides:
close in class Request
Throws:
RepositoryException
IOException

getBody

public BodyEntity getBody()
                   throws MimeTypeParseException
Throws:
MimeTypeParseException

getContentType

public String getContentType(Method method)
                      throws MimeTypeParseException
Throws:
MimeTypeParseException

getFile

public File getFile()

getObjectConnection

public ObjectConnection getObjectConnection()

getOperation

public String getOperation()

getHeader

public Entity getHeader(String[] mediaTypes,
                        String... names)

getParameter

public Entity getParameter(String[] mediaTypes,
                           String... names)

getQueryString

public Entity getQueryString(String[] mediaTypes)

getRequestedResource

public RDFObject getRequestedResource()

getRevision

public Transaction getRevision()

revisionTag

public String revisionTag(int code)

variantTag

public String variantTag(String mediaType,
                         int code)

getAcceptable

public SortedSet<? extends MimeType> getAcceptable()
                                            throws MimeTypeParseException
Throws:
MimeTypeParseException

isAcceptable

public boolean isAcceptable(Class<?> type,
                            Type genericType)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

isAcceptable

public boolean isAcceptable(String mediaType)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

isAcceptable

public boolean isAcceptable(String mediaType,
                            Class<?> type,
                            Type genericType)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

isQueryStringPresent

public boolean isQueryStringPresent()


Copyright © 2004-2010 James Leigh Services Inc.. All Rights Reserved.