|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openxri.config.impl.AbstractComponent
org.openxri.server.impl.AbstractServer
public abstract class AbstractServer
Provides a starting point for Server implementations. Subclasses are relieved from the task of looking up authorities and retrieving information from the store. They only have to adjust the individual XRDs as well as the final XRDS descriptor by implementing initXRDS(), initXRD(), finishXRD() and finishXRDS() Subclasses are expected to add 'non-static' descriptor features that are not in the store, such as Expires and Status elements.
BasicServer
,
Serialized FormField Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
|
protected Store |
store
|
Fields inherited from class org.openxri.config.impl.AbstractComponent |
---|
properties |
Constructor Summary | |
---|---|
AbstractServer(java.util.Properties properties)
|
Method Summary | |
---|---|
protected abstract void |
finishXRD(XRD xrd,
Authority parent,
SubSegment subSegment,
Authority authority,
boolean signed)
Called before the server adds the XRD to the XRDS and moves on to the next authority. |
protected abstract void |
finishXRDS(XRDS xrds,
java.lang.String query,
boolean signed)
Called before the XRDS is sent out by the server. |
void |
init()
Initialize base-class attributes from configuration. |
protected abstract boolean |
initXRD(XRD xrd,
Authority parent,
java.lang.String subSegmentName,
boolean signed)
Called before anything is added to a fresh XRD. |
protected abstract boolean |
initXRDS(XRDS xrds,
java.lang.String query,
boolean signed)
Called before the server starts processing the request. |
XRDS |
lookupByNamespace(java.lang.String namespace,
java.lang.String query,
boolean signed)
Obtains an XRDS for an XRI segment. |
XRDS |
lookupByPath(java.lang.String path,
boolean signed)
Obtains an XRDS for a path. |
XRDS |
lookupSelfDescribing(java.lang.String namespace,
boolean signed)
Obtains a self-describing XRDS for a root namespace. |
static XRD |
makeExceptionXrd(java.lang.String subSegmentName,
java.lang.Exception ex)
|
static XRD |
makeNotFoundXrd(java.lang.String subSegmentName)
|
Methods inherited from class org.openxri.config.impl.AbstractComponent |
---|
getProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.openxri.config.Component |
---|
getProperties |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected Store store
Constructor Detail |
---|
public AbstractServer(java.util.Properties properties)
Method Detail |
---|
public void init()
init
in interface Component
oConfig
- The server configuration interface to initialize withpublic XRDS lookupSelfDescribing(java.lang.String namespace, boolean signed) throws ServerException
Server
lookupSelfDescribing
in interface Server
namespace
- The root namespace.signed
- Whether or not a signed descriptor is requested.
ServerException
public XRDS lookupByNamespace(java.lang.String namespace, java.lang.String query, boolean signed) throws ServerException
Server
lookupByNamespace
in interface Server
namespace
- The root namespace of the segment.query
- The segment to resolve.signed
- Whether or not a signed descriptor is requested.
ServerException
public XRDS lookupByPath(java.lang.String path, boolean signed) throws ServerException
Server
lookupByPath
in interface Server
path
- The HTTP path of the request.signed
- Whether or not a signed descriptor is requested.
ServerException
public static XRD makeNotFoundXrd(java.lang.String subSegmentName)
public static XRD makeExceptionXrd(java.lang.String subSegmentName, java.lang.Exception ex)
protected abstract boolean initXRDS(XRDS xrds, java.lang.String query, boolean signed) throws ServerInternalException
xrds
- - A blank XRDS which we will complete.query
- - The original XRI segment for which the request was made.signed
- - Whether we are expected to return a signed descriptor.
ServerInternalException
protected abstract void finishXRDS(XRDS xrds, java.lang.String query, boolean signed) throws ServerInternalException
xrds
- - The XRDS filled with all XRDs.query
- - The original XRI segment for which the request was made.signed
- - Whether we are expected to return a signed descriptor.
ServerInternalException
protected abstract boolean initXRD(XRD xrd, Authority parent, java.lang.String subSegmentName, boolean signed) throws ServerInternalException
xrd
- - A blank XRD which we will fill.parent
- - The authority describing this XRD.subSegmentName
- - The name of the subsegment to be resolved.signed
- - Whether we are expected to return a signed descriptor.
ServerInternalException
protected abstract void finishXRD(XRD xrd, Authority parent, SubSegment subSegment, Authority authority, boolean signed) throws ServerInternalException
xrd
- - A filled XRD ready to be appended to the XRDS.parent
- - The authority describing this XRD.subSegment
- - The subsegment leading to this XRD.authority
- - The authority described by this XRD.signed
- - Whether we are expected to return a signed descriptor.
ServerInternalException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |