sdlip.examples
Class SwitchBoardLSP
java.lang.Object
|
+--sdlip.examples.SwitchBoardLSP
- public class SwitchBoardLSP
- extends java.lang.Object
- implements Search, ResultAccess, Metadata, Timeoutable
This is an example application included in the SDLIP distribution.
Usage: java sdlip.examples.SwitchBoardLSP <port>
Implements a stateful LSP for the Web site switchboard.com.
This LSP runs on a specified port and accepts a
DAV:basicsearch query containing a DAV:contains operator. The query must contain a last name of the
person to search for and may optionally be preceded by the person's first name. For every query, all available
properties are returned which include the full name, address and phone number.
This LSP implements all currently defined SDLIP interfaces and methods. SwitchBoardLSP can be queried using
the Client example application. It demonstrates the usage of RangeEnumerator and Timer utilities described in
previous section. The LSP maintains state for maximum 10 minutes unless the extendStateTimeout method is
called by the client.
Method Summary |
void |
cancelRequest(int serverSID,
int reqID)
|
void |
extendStateTimeout(int serverSID,
int additionalTime,
IntHolder timeAllotted)
|
void |
getDocs(int serverSID,
int reqID,
XMLObject docPropList,
java.lang.String docsToGet,
XMLObject res)
|
void |
getInterface(XMLObject version)
|
void |
getPropertyInfo(java.lang.String subcolName,
XMLObject propInfo)
|
void |
getSessionInfo(int serverSID,
IntHolder expectedTotal,
IntHolder stateTimeout)
|
void |
getSubcollectionInfo(XMLObject subcolInfo)
|
static void |
main(java.lang.String[] args)
|
void |
search(int clientSID,
XMLObject subcollections,
XMLObject query,
int numDocs,
XMLObject docProps,
int stateTimeoutReq,
XMLObject queryOptions,
IntHolder expectedTotal,
IntHolder stateTimeout,
IntHolder serverSID,
XMLObject serverDelegate,
XMLObject result)
|
void |
setDBG(DBG dbg)
|
void |
timeout(java.lang.Object handle)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
SwitchBoardLSP
public SwitchBoardLSP()
setDBG
public void setDBG(DBG dbg)
search
public void search(int clientSID,
XMLObject subcollections,
XMLObject query,
int numDocs,
XMLObject docProps,
int stateTimeoutReq,
XMLObject queryOptions,
IntHolder expectedTotal,
IntHolder stateTimeout,
IntHolder serverSID,
XMLObject serverDelegate,
XMLObject result)
throws SDLIPException
- Specified by:
- search in interface Search
timeout
public void timeout(java.lang.Object handle)
- Specified by:
- timeout in interface Timeoutable
getInterface
public void getInterface(XMLObject version)
throws SDLIPException
- Specified by:
- getInterface in interface Metadata
getSubcollectionInfo
public void getSubcollectionInfo(XMLObject subcolInfo)
throws SDLIPException
- Specified by:
- getSubcollectionInfo in interface Metadata
getPropertyInfo
public void getPropertyInfo(java.lang.String subcolName,
XMLObject propInfo)
throws SDLIPException
- Specified by:
- getPropertyInfo in interface Metadata
cancelRequest
public void cancelRequest(int serverSID,
int reqID)
throws SDLIPException
- Specified by:
- cancelRequest in interface ResultAccess
getSessionInfo
public void getSessionInfo(int serverSID,
IntHolder expectedTotal,
IntHolder stateTimeout)
throws SDLIPException
- Specified by:
- getSessionInfo in interface ResultAccess
getDocs
public void getDocs(int serverSID,
int reqID,
XMLObject docPropList,
java.lang.String docsToGet,
XMLObject res)
throws SDLIPException
- Specified by:
- getDocs in interface ResultAccess
extendStateTimeout
public void extendStateTimeout(int serverSID,
int additionalTime,
IntHolder timeAllotted)
throws SDLIPException
- Specified by:
- extendStateTimeout in interface ResultAccess
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
main
public static void main(java.lang.String[] args)
throws java.lang.Exception