|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tools.resources.AttributeHolder org.w3c.tools.resources.Resource org.w3c.tools.resources.FramedResource org.w3c.tools.resources.ResourceFrame org.w3c.tools.resources.ProtocolFrame org.w3c.jigsaw.frames.HTTPFrame org.w3c.jigsaw.frames.NegotiatedFrame
public class NegotiatedFrame
Content negotiation.
Field Summary | |
---|---|
protected static int |
ATTR_PARANOID_VARIANT_CHECK
Attribute index - Should the variants to be strictly checked? the variants should NEVER contain negotiated resources! |
protected static int |
ATTR_PUT_POLICY
Attribute index - Should the PUT needs to be strictly checked? |
protected static int |
ATTR_VARIANTS
Attribute index - The set of names of variants. |
static java.lang.String |
DEFAULT_NEGOTIATED_ICON
Our default Icon |
static java.lang.String |
NEGOTIATED_ICON_P
Our Icon property. |
protected static java.lang.String |
STATE_NEG
our state |
protected HttpTokenList |
vary
The Vary header field for this resource |
Fields inherited from class org.w3c.jigsaw.frames.HTTPFrame |
---|
acceptRanges, allowed, ATTR_ALLOW_DEL, ATTR_BROWSABLE, ATTR_CHARSET, ATTR_CONTENT_ENCODING, ATTR_CONTENT_LANGUAGE, ATTR_CONTENT_LENGTH, ATTR_CONTENT_TYPE, ATTR_ICON, ATTR_ICONDIR, ATTR_INDEX, ATTR_INDEXES, ATTR_MAXAGE, ATTR_MD5, ATTR_PUTABLE, ATTR_QUALITY, ATTR_RELOCATE, ATTR_STYLE_LINK, ATTR_TITLE, browsetype, COND_FAILED, COND_OK, COND_WEAK, dresource, fresource, listing, listing_stamp, STATE_CONTENT_LOCATION |
Fields inherited from class org.w3c.tools.resources.ResourceFrame |
---|
filterClass, frameListener, resource |
Fields inherited from class org.w3c.tools.resources.FramedResource |
---|
ATTR_OID, attrListener, debugEvent, event_disabled, framesRef, structListener |
Fields inherited from class org.w3c.tools.resources.Resource |
---|
ATTR_CONTEXT, ATTR_HELP_URL, ATTR_IDENTIFIER, ATTR_LAST_MODIFIED, ATTR_PARENT, ATTR_RESOURCE_FRAMES, ATTR_STORE_ENTRY, ATTR_URL, co, id |
Fields inherited from class org.w3c.tools.resources.AttributeHolder |
---|
attributes, values |
Constructor Summary | |
---|---|
NegotiatedFrame()
|
Method Summary | |
---|---|
protected java.lang.String[] |
checkVariants(java.lang.String[] variants)
|
java.lang.String |
getIcon()
Get this resource's icon. |
boolean |
getParanoidVariantCheck()
get the variant checking policy |
boolean |
getPutPolicy()
get the "strictness" of the PUT checking |
java.lang.String[] |
getVariantNames()
Get the variant names. |
ResourceReference[] |
getVariantResources()
Get the variant resources. |
boolean |
lookup(LookupState ls,
LookupResult lr)
Lookup the target resource. |
protected ResourceReference |
negotiate(Request request)
Negotiate among the various variants for the Resource. |
protected boolean |
negotiateCharsetQuality(java.util.Vector states,
Request request)
Negotiate on charsets. |
protected boolean |
negotiateContentEncoding(java.util.Vector states,
Request request)
Negotiate among content encodings. |
protected boolean |
negotiateContentType(java.util.Vector states,
Request request)
Negotiate among content types. |
protected boolean |
negotiateLanguageQuality(java.util.Vector states,
Request request)
Negotiate among language qualities. |
protected ResourceReference |
negotiatePut(Request request)
"negotiate" for a PUT, the negotiation of a PUT should be different as we just want to match the desciption of the entity and the available variants |
ReplyInterface |
perform(RequestInterface req)
Perform an HTTP request. |
protected void |
printNegotiationState(java.lang.String header,
java.util.Vector states)
Print the current negotiation state. |
void |
registerResource(FramedResource resource)
Register this frame to the given resource. |
void |
setParanoidVariantCheck(boolean strict)
|
void |
setPutPolicy(boolean strict)
|
void |
setPutPolicy(java.lang.Boolean strict)
|
void |
setValue(int idx,
java.lang.Object value)
Catch setValue, to maintain cached header values correctness. |
void |
setVariants(java.lang.String[] variants)
|
Methods inherited from class org.w3c.tools.resources.ResourceFrame |
---|
addFrameEventListener, eventDisabled, fireFrameEvent, frameModified, getFilters, getFilters, getFrameReference, getResource, getResourceReference, getSpaceEntry, getURLPath, lookupFilters, lookupFrames, postFrameEvent, processEvent, removeFrameEventListener, unregisterResource, updateDefaultChildAttributes |
Methods inherited from class org.w3c.tools.resources.Resource |
---|
acceptUnload, checkMultipleLock, collectFrames, getContext, getFrame, getFrames, getIdentifier, getLastModified, getParent, getServer, getSpace, getStoreEntry, getValue, getValue, isInitialized, isUnloaded, setContext, setContext, setValue, unsafeGetContext, unsafeGetFrame, unsafeGetFrames, unsafeGetIdentifier, unsafeGetResourceReference, unsafeGetURLPath, unsafeGetValue, updateAttributes |
Methods inherited from class org.w3c.tools.resources.AttributeHolder |
---|
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String NEGOTIATED_ICON_P
public static java.lang.String DEFAULT_NEGOTIATED_ICON
protected static java.lang.String STATE_NEG
protected HttpTokenList vary
protected static int ATTR_VARIANTS
protected static int ATTR_PUT_POLICY
protected static int ATTR_PARANOID_VARIANT_CHECK
Constructor Detail |
---|
public NegotiatedFrame()
Method Detail |
---|
public void setValue(int idx, java.lang.Object value)
HTTPFrame
setValue
in class HTTPFrame
idx
- The index of the attribute to be set.value
- The new value for the attribute.public java.lang.String getIcon()
HTTPFrame
getIcon
in class HTTPFrame
public java.lang.String[] getVariantNames()
protected java.lang.String[] checkVariants(java.lang.String[] variants)
public void setVariants(java.lang.String[] variants)
public boolean getPutPolicy()
public void setPutPolicy(java.lang.Boolean strict)
public void setPutPolicy(boolean strict)
public boolean getParanoidVariantCheck()
public void setParanoidVariantCheck(boolean strict)
public ResourceReference[] getVariantResources() throws ProtocolException
ProtocolException
- If one of the variants doesn't exist.protected void printNegotiationState(java.lang.String header, java.util.Vector states)
header
- The header to print first.states
- The current negotiation states.protected boolean negotiateContentEncoding(java.util.Vector states, Request request) throws ProtocolException
BUG: This will work only for single encoded variants.
states
- The current negotiation states.request
- The request to handle.
ProtocolException
- If one of the variants doesn't exist.protected boolean negotiateCharsetQuality(java.util.Vector states, Request request)
states
- The current states of negotiation.request
- The request to handle.protected boolean negotiateLanguageQuality(java.util.Vector states, Request request) throws ProtocolException
BUG: This will only work for variants that have one language tag.
states
- The current states of negotiation.request
- The request to handle.
ProtocolException
- If one of the variants doesn't exist.protected boolean negotiateContentType(java.util.Vector states, Request request) throws ProtocolException
states
- The current states of negotiation.request
- The request to handle.
ProtocolException
- If one of the variants doesn't exist.protected ResourceReference negotiate(Request request) throws ProtocolException
request
- the incomming request.
ProtocolException
- If one of the variants doesn't exist.protected ResourceReference negotiatePut(Request request) throws ProtocolException, ResourceException
request,
- the request to handle
ProtocolException
- If negotiating among the resource variants
failed.
ResourceException
- If the resource got a fatal error.public void registerResource(FramedResource resource)
HTTPFrame
registerResource
in class HTTPFrame
resource
- The resource associated with this frame.public boolean lookup(LookupState ls, LookupResult lr) throws ProtocolException
lookup
in class HTTPFrame
ls
- The current lookup statelr
- The result
ProtocolException
- If an error relative to the protocol occursResourceFrame.lookupFilters(org.w3c.tools.resources.LookupState, org.w3c.tools.resources.LookupResult)
,
HTTPFrame.lookupResource(org.w3c.tools.resources.LookupState, org.w3c.tools.resources.LookupResult)
public ReplyInterface perform(RequestInterface req) throws ProtocolException, ResourceException
perform
in class HTTPFrame
request
- The request to handle.
ProtocolException
- If negotiating among the resource variants
failed.
ResourceException
- If the resource got a fatal error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |