|
Copyright © Rasmus Sten and contributors, 1997-2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--nu.dll.lyskom.Session
This is the main interface to the LysKOM server and the LatteKOM library.
An instance of the Session class represents a single connection to a LysKOM server. Access methods are provided for both asynchronous and synchronous operations with the LysKOM server.
All methods starting with do... are asynchronous methods that takes care of constructing the RPC call, putting it on the send queue, and then returns immediately. The call will be written to the server by another thread.
An application may register itself as an RpcEventListener, and send commands to the server by calling the do...() methods. LatteKOM will then call the the rpcEvent(RpcEvent) method when a reply arrives from the server. The application may also use the waitFor(int), which will cause the thread to block until a reply has been received with the supplied reference number (an RPC call's reference is automatically assigned by LatteKOM in the do...() methods, and can be retreived by the getId() method in an RpcCall object).
LatteKOM also provides synchronous method for all RPC calls. The synchronous methods have the same names as the asynchronous methods, but without the "do" prefix. They also add the extra convenience of interpreting the RPC reply and returning objects that are easier to deal with. For example, the whoIsOnDynamic(boolean, boolean, boolean) returns an array of DynamicSessionInfo objects containing all the information returned by the server. If a synchronous call fails, a RpcFailure exception should be thrown containing information about the error that occured.
Asynchronous messages can be received by clients by registering AsynchMessageReceiver objects with the addAsynchMessageReceiver method. The objects' asynchMessage() method will be called by the network read thread at the moment a message has been received and parsed into an AsynchMessage object. As the asynchMessage() method will be executed by the thread responsible for reading server messages, no server messages will be read during the execution of the receiver's method. Most notably, the receiving method must not send an RPC call and then call the waitFor() method to wait for the reply (this will cause an IOException to be thrown by the waitFor() method).
The LatteKOM library keeps caches of texts, conferences, persons and membership information. The caches are refreshed or purged when the server indicates that it might be needed. At the moment, much of that functionality is still in development and might therefore be inefficient, incomplete or buggy (that goes for large parts of LatteKOM in general).
A very simple program to login and read a specific LysKOM text could look like this:
// Invoke with command: "java SimpleSample serverHost userName password textNo" import nu.dll.lyskom.Session; import nu.dll.lyskom.Text; Import nu.dll.lyskom.ConfInfo; class SimpleSample { public static void main(String[] argv) throws Exception { Session session = new Session(); session.connect(argv[0], 4894); System.out.println("Connected."); ConfInfo[] names = session.lookupName(argv[1], true, false); session.login(names[0].getNo(), argv[2], false); System.out.println("Logged in."); Text t = session.getText(Integer.parseInt(argv[3])); System.out.println("Retreived text " + argv[3]); System.out.println("Subject: " + new String(t.getSubject())); System.out.println("Text body:"); System.out.println(new String(t.getBody())); } }
addRpcEventListener(RpcEventListener)
,
RpcEvent
,
RpcCall
,
RpcFailure
,
waitFor(int)
,
addAsynchMessageReceiver(AsynchMessageReceiver)
,
AsynchMessage
Field Summary | |
static int |
defaultBigTextHead
|
static int |
defaultBigTextLimit
|
static boolean |
defaultEnabledBigText
|
static java.lang.String |
defaultServerEncoding
The encoding used by the LysKOM server. |
static int |
rpcSoftTimeout
This is the "soft" timeout, in milliseconds. |
static int |
rpcTimeout
Time-out used by the waitFor() method in milliseconds. |
static int |
STATE_CONNECTED
Connected to a LysKOM server, but not logged in. |
static int |
STATE_DISCONNECTED
Not connected to a LysKOM server |
static int |
STATE_LOGIN
Connected, and logged in as a specific user |
Constructor Summary | |
Session()
|
Method Summary | |
void |
addAsynchMessageReceiver(nu.dll.lyskom.AsynchMessageReceiver a)
Adds a listener for asynchronous messages. |
void |
addMember(int confNo,
int persNo,
int prio,
int listPos,
boolean invitation,
boolean passive,
boolean secret)
Adds a conference to a person's membership. |
void |
addRpcEventListener(nu.dll.lyskom.RpcEventListener l)
Adds RPC reply listeners. |
void |
asynchMessage(nu.dll.lyskom.AsynchMessage m)
Receiver of asynchronous messages. |
void |
changeConference(int confNo)
Changes the user's current conference. |
void |
changeName(int confNo,
java.lang.String newName)
Changes the name of a conference or a person. |
void |
changeWhatIAmDoing(java.lang.String s)
|
boolean |
connect(java.lang.String server)
Connect to specified server on the default port (4894) and do initial handshake |
boolean |
connect(java.lang.String server,
int port)
Connect to specified server/port number and do initial handshake |
int |
count()
Returns the next RPC reference number to use and increments the RPC reference counter. |
int |
createConf(java.lang.String name,
boolean readProt,
boolean original,
boolean secret)
Ask the server to create a new conference |
int |
createPerson(java.lang.String name,
java.lang.String password,
nu.dll.lyskom.Bitstring flags,
nu.dll.lyskom.AuxItem[] auxItems)
Asks the server to create a new person. |
int |
createText(nu.dll.lyskom.Text t)
Creates a text on the server, then returns the number of the newly created text. |
void |
deleteText(int textNo)
Deletes a text on the server. |
void |
disconnect(boolean force)
Disconnects from the server |
void |
disconnect(int sessionNo)
|
nu.dll.lyskom.RpcCall |
doAddMember(int confNo,
int persNo,
int prio,
int listPos,
nu.dll.lyskom.Bitstring type)
Sends the RPC call add-member to the server. |
nu.dll.lyskom.RpcCall |
doChangeConference(int confNo)
Sends the RPC call change-conference to the server. |
nu.dll.lyskom.RpcCall |
doChangeName(int confNo,
java.lang.String newName)
Sends the RPC call change-name to the server. |
nu.dll.lyskom.RpcCall |
doChangeWhatIAmDoing(java.lang.String s)
Sends the RPC call change-what-i-am-doing to the server. |
nu.dll.lyskom.RpcCall |
doCreateConf(java.lang.String name,
nu.dll.lyskom.Bitstring type,
nu.dll.lyskom.AuxItem[] auxItems)
Sends the RPC call create-conf to the server. |
nu.dll.lyskom.RpcCall |
doCreatePerson(java.lang.String name,
java.lang.String password,
nu.dll.lyskom.Bitstring flags,
nu.dll.lyskom.AuxItem[] auxItems)
Sends the RPC call create-person to the server. |
nu.dll.lyskom.RpcCall |
doCreateText(byte[] text,
java.util.List miscInfo,
nu.dll.lyskom.AuxItem[] auxItems)
Sends the RPC call create-text to the server. |
nu.dll.lyskom.RpcCall |
doCreateText(nu.dll.lyskom.Text t)
Sends the RPC call create-text to the server. |
nu.dll.lyskom.RpcCall |
doDeleteText(int textNo)
Sends the RPC call delete-text to the server. |
nu.dll.lyskom.RpcCall |
doDisconnect(int sessionNo,
boolean discardReply)
|
nu.dll.lyskom.RpcCall |
doGetClientName(int sessionNo)
Sends the RPC call get-client-name to the server. |
nu.dll.lyskom.RpcCall |
doGetClientVersion(int sessionNo)
Sends the RPC call get-client-version to the server. |
nu.dll.lyskom.RpcCall |
doGetConfStat(int confNo)
Sends the RPC call get-conf-stat to the server. |
nu.dll.lyskom.RpcCall |
doGetInfo()
|
nu.dll.lyskom.RpcCall |
doGetMarks()
Sends the RPC call get-marks to the server. |
nu.dll.lyskom.RpcCall |
doGetMembership(int persNo)
Equal to doGetMembership(persNo, 0, 1000, new Bitstring("0")). |
nu.dll.lyskom.RpcCall |
doGetMembership(int persNo,
int first,
int no,
nu.dll.lyskom.Bitstring mask)
Sends the RPC call get-membership to the server. |
nu.dll.lyskom.RpcCall |
doGetPersonStat(int persNo)
Sends the RPC call get-person-stat to the server. |
nu.dll.lyskom.RpcCall |
doGetStaticSessionInfo(int sessionNo)
Sends the RPC call get-static-session-info to the server. |
nu.dll.lyskom.RpcCall |
doGetTextStat(int textNo)
Sends the RPC call get-text-stat to the server. |
nu.dll.lyskom.RpcCall |
doGetTime()
|
nu.dll.lyskom.RpcCall |
doGetUConfStat(int confNo)
Sends the RPC call get-uconf-stat to the server. |
nu.dll.lyskom.RpcCall |
doGetUnreadConfs(int persNo)
Sends the RPC call get-unread-confs to the server. |
nu.dll.lyskom.RpcCall |
doLocalToGlobal(int confNo,
int firstLocalNo,
int noOfExistingTexts)
Sends the RPC call local-to-global to the server. |
nu.dll.lyskom.RpcCall |
doMarkAsRead(int confNo,
int[] localTextNo)
Sends the RPC call mark-as-read to the server. |
nu.dll.lyskom.RpcCall |
doMarkText(int textNo,
int markType)
Sends the RPC call mark-text to the server. |
nu.dll.lyskom.RpcCall |
doModifyAuxInfo(boolean isConf,
int objNo,
int[] delAuxNo,
nu.dll.lyskom.AuxItem[] addAux)
Sends the RPC call modify-conf-info or modify-text-info to the server. |
nu.dll.lyskom.RpcCall |
doQueryReadTexts(int persNo,
int confNo)
Sends the RPC call query-read-texts to the server. |
nu.dll.lyskom.RpcCall |
doReLookup(java.lang.String regexp,
boolean wantPersons,
boolean wantConfs)
Lookup names of persons or conferences using regular expressions |
nu.dll.lyskom.RpcCall |
doSetClientVersion(java.lang.String clientName,
java.lang.String clientVersion)
Sends the RPC call set-client-version to the server. |
nu.dll.lyskom.RpcCall |
doSetLastRead(int confNo,
int textNo)
Sends the RPC call set-last-read to the server. |
nu.dll.lyskom.RpcCall |
doSetPresentation(int confNo,
int textNo)
Sends the RPC call set-presentation to the server. |
nu.dll.lyskom.RpcCall |
doSubMember(int confNo,
int persNo)
Sends the RPC call sub-member to the server. |
nu.dll.lyskom.RpcCall |
doUnmarkText(int textNo)
Sends the RPC call mark-text to the server. |
nu.dll.lyskom.RpcCall |
doUserActive()
Sends the RPC call user-active to the server. |
nu.dll.lyskom.RpcCall |
doWhoAmI()
|
nu.dll.lyskom.RpcCall |
doWhoIsOnDynamic(boolean wantVisible,
boolean wantInvisible,
int activeLast)
Sends the RPC call who-is-on-dynamic to the server. |
void |
endast(int no)
Sets the maximum number of unread texts in the current conference. |
void |
endast(int confNo,
int no)
Sets the maximum number of unread texts in a conference. |
void |
finalize()
|
byte[] |
getClientName(int sessionNo)
Returns the client name (as a byte array) for a given session. |
byte[] |
getClientVersion(int sessionNo)
Returns the client version (as a byte array) for a given session. |
byte[] |
getConfName(int confNo)
Returns a byte-array containing the name for a conference, or null if the conference doesn't exist. |
nu.dll.lyskom.Conference |
getConfStat(int confNo)
Returns a Conference object containing information about a given conference. |
nu.dll.lyskom.Conference |
getConfStat(int confNo,
boolean refreshCache)
Returns a Conference object containing information about a given conference. |
boolean |
getConnected()
Return true if connected to a LysKOM server. |
int |
getCurrentConference()
Returns the current conference (as entered by changeConference()) |
int[] |
getGlobalUnreadInConf(int conf)
Deprecated. Follow the standard LysKOM convention to get unreads or use nextUnreadText()/nextUnreadConference() |
java.util.Map |
getInfo()
|
boolean |
getLoggedIn()
Returns true if a user is currently logged in in this session. |
nu.dll.lyskom.Mark[] |
getMarks()
Returns an array of Mark objects with all text-marks for this user. |
nu.dll.lyskom.Membership[] |
getMembership(int persNo)
Returns an array of Membership objects for a given person, representing the persons full membership list. |
nu.dll.lyskom.Membership[] |
getMembership(int persNo,
int first,
int no,
nu.dll.lyskom.Bitstring mask)
Returns an array of Membership objects representing the membership information for a given person. |
java.util.List |
getMembershipList(int persNo,
int first,
int no,
nu.dll.lyskom.Bitstring mask)
Returns a List of Membership objects representing the membership information for a given person. |
java.util.List |
getMyMembershipList()
Equal to getMembershipList(myPerson.getNo(), 0, myPerson.noOfConfs+1, new Bitstring("0")) |
nu.dll.lyskom.Person |
getMyPerson()
Returns the Person object of the currently registered user. |
nu.dll.lyskom.Person |
getPersonStat(int persNo)
Returns a Person object containing information about a given person. |
nu.dll.lyskom.Person |
getPersonStat(int persNo,
boolean refreshCache)
Returns a Person object containing information about a given person. |
int |
getPort()
|
nu.dll.lyskom.ReadTextsMap |
getReadTexts()
Returns a ReadTextsMap object. |
java.lang.String |
getServer()
|
java.lang.String |
getServerEncoding()
|
int |
getState()
Returns the state of this connection. |
nu.dll.lyskom.SessionInfo |
getStaticSessionInfo(int sessionNo)
Returns static session information for a given session number. |
nu.dll.lyskom.Text |
getText(int textNo)
Returns a Text object corresponding to the specified global text number. |
nu.dll.lyskom.Text |
getText(int textNo,
boolean refreshCache)
Returns a Text object corresponding to the specified global text number. |
nu.dll.lyskom.TextStat |
getTextStat(int textNo)
Returns a TextStat object containing information about a given text. |
nu.dll.lyskom.TextStat |
getTextStat(int textNo,
boolean refreshCache)
Returns a TextStat object for a given text number, or null if the text doesn't exist or is inaccessible. |
nu.dll.lyskom.HollerithStream |
getTextStream(int textNo,
int startChar,
int endChar)
Returns a text's contents as a HollerithStream. |
nu.dll.lyskom.KomTime |
getTime()
|
nu.dll.lyskom.UConference |
getUConfStat(int confNo)
Returns an UConference object containing information about a specific conference. |
nu.dll.lyskom.UConference |
getUConfStat(int confNo,
boolean refreshCache)
Returns an UConference object containing information about a specific conference. |
int[] |
getUnreadConfs(int persNo)
Returns an int array containing all conferences which may contain unread texts. |
java.util.List |
getUnreadConfsList(int persNo)
Returns a List containing all conferences which may contain unread texts. |
java.util.List |
getUnreadConfsListCached()
Testing, testning. |
int |
getUnreadCount(int confNo)
Returns the highest possible number of unreads for a specific conference. |
nu.dll.lyskom.Membership[] |
getUnreadMembership()
Returns an array of Membership objects, representing the conferences in which the currently logged in person might have unread texts. |
nu.dll.lyskom.TextMapping[] |
getUnreadTexts()
return array of unread texts (in TextMapping for) for all conferences. |
boolean |
isMemberOf(int confNo)
Returns true if the current user is a member of confNo, otherwise false. |
void |
joinConference(int confNo)
Adds a conference with priority 100 at the last position of the currently logged in person's membership list. |
nu.dll.lyskom.TextMapping |
localToGlobal(int confNo,
int firstLocalNo,
int noOfExistingTexts)
Returns a TextMapping that can be used to convert local text number in a conference to global text numbers. |
boolean |
login(int id,
java.lang.String password,
boolean hidden)
|
boolean |
login(int id,
java.lang.String password,
boolean hidden,
boolean getMembership)
Logs on to the LysKOM server. |
void |
logout(boolean block)
Logs out the currently logged in user. |
nu.dll.lyskom.ConfInfo[] |
lookupName(java.lang.String name,
boolean wantPersons,
boolean wantConfs)
Lookup names of persons/conferences. |
void |
markAsRead(int textNo)
Marks the text as read in all recipient conferences which the user is a member of. |
void |
markAsRead(int confNo,
int[] localTextNo)
Marks a text as read on the LysKOM server. |
void |
markText(int textNo,
int markType)
Place a personal mark on a LysKOM text. |
void |
modifyAuxInfo(boolean isConf,
int objNo,
int[] delAuxNo,
nu.dll.lyskom.AuxItem[] addAux)
Modifies Aux-Info for a conference or a text. |
int |
nextUnreadConference(boolean change)
Returns the conference number of the next conference that _may_ contain an unread text, or -1 if no unread conference is found. |
int |
nextUnreadText(boolean updateUnread)
Same as nextUnreadText(session.getCurrentConference(), updateUnread). |
int |
nextUnreadText(int conference,
boolean updateUnread)
Returns the global text number of the next unread text in the current conference. |
void |
purgeTextCache(int textNo)
Removes any evidence of the given text in the caches (Text cache and Text-Stat cache) |
nu.dll.lyskom.Membership |
queryReadTexts(int persNo,
int confNo)
Returns a Membership object containing information about read/unread texts for a given person in a given conference. |
nu.dll.lyskom.Membership |
queryReadTexts(int persNo,
int confNo,
boolean refresh)
Returns a Membership object containing information about read/unread texts for a given person in a given conference. |
nu.dll.lyskom.Membership |
queryReadTextsCached(int confNo)
|
nu.dll.lyskom.ConfInfo[] |
reLookup(java.lang.String regexp,
boolean wantPersons,
boolean wantConfs)
|
void |
removeAsynchMessageReceiver(nu.dll.lyskom.AsynchMessageReceiver a)
Removes an AsyncMessageReceiver. |
void |
removeRpcEventListener(nu.dll.lyskom.RpcEventListener l)
Removes an RPC reply listener. |
int |
reply(int textNo,
nu.dll.lyskom.Text t)
Very simple reply function. |
void |
rpcEvent(nu.dll.lyskom.RpcEvent e)
Receiver of RPC events. |
void |
rpcReply(nu.dll.lyskom.RpcReply r)
Receiver of RPC replies. |
boolean |
sendMessage(int recipient,
java.lang.String message)
Sends an asynchronous message with the send-message call. |
boolean |
sendMessage(int recipient,
java.lang.String message,
boolean block)
Sends an asynchronous message with the send-message call. |
void |
setClientHost(java.lang.String s)
Sets the client host name that is reported during the initial connection handshake with the LysKOM server. |
void |
setClientUser(java.lang.String s)
Sets the client user name that is reportedduring the intial handshake. |
void |
setClientVersion(java.lang.String clientName,
java.lang.String clientVersion)
Reports the name and version of this client to the server. |
void |
setLastRead(int confNo,
int textNo)
Sets the highest local text number that has been read in a given conference. |
void |
setLatteVersion(java.lang.String clientName,
java.lang.String clientVersion)
Sets client name and version, prepending the supplied strings with a slash and the name and version of the LatteKOM library, respectively. |
void |
setPresentation(int confNo,
int textNo)
Sets the text number that contains a conference's or a person's presentation. |
void |
shutdown()
Forcibly logout, disconnect, and finish all threads |
void |
subMember(int confNo,
int persNo)
Removes the person persNo from conference confNo. |
byte[] |
toByteArray(java.lang.String s)
|
java.lang.String |
toString(byte[] buf)
|
void |
unmarkText(int textNo)
Unmarks a text. |
void |
updateUnreads()
Updates the unreadMembership array with Membership objects for conferences that _may_ contain unreads. |
nu.dll.lyskom.RpcReply |
waitFor(int id)
This methods provides a synchronous way of waiting for RPC replies. |
nu.dll.lyskom.RpcReply |
waitFor(nu.dll.lyskom.RpcCall r)
Convenience wrapper for waitFor(int). |
int |
whoAmI()
|
nu.dll.lyskom.DynamicSessionInfo[] |
whoIsOnDynamic(boolean wantVisible,
boolean wantInvisible,
int activeLast)
Returns an array of DynamicSessionInfo objects containing information about online sessions |
void |
writeRaw(int id,
java.lang.String s)
Writes a raw (custom) RPC call to the server. |
nu.dll.lyskom.RpcCall |
writeRpcCall(nu.dll.lyskom.RpcCall c)
Writes an RPC call constructed from an RpcCall object to the network output stream and add it to the RPC call storage. |
nu.dll.lyskom.RpcCall |
writeRpcCall(nu.dll.lyskom.RpcCall c,
boolean store)
Writes an RPC call constructed from an RpcCall object to the network output stream. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int rpcTimeout
public static int rpcSoftTimeout
public static java.lang.String defaultServerEncoding
public static boolean defaultEnabledBigText
public static int defaultBigTextLimit
public static int defaultBigTextHead
public static final int STATE_DISCONNECTED
public static final int STATE_CONNECTED
public static final int STATE_LOGIN
Constructor Detail |
public Session()
Method Detail |
public void purgeTextCache(int textNo)
public void setClientHost(java.lang.String s)
connect(String, int)
public void setClientUser(java.lang.String s)
public void addRpcEventListener(nu.dll.lyskom.RpcEventListener l)
RpcEventListener
,
RpcEvent
public void removeRpcEventListener(nu.dll.lyskom.RpcEventListener l)
public nu.dll.lyskom.RpcCall doDisconnect(int sessionNo, boolean discardReply) throws java.io.IOException
java.io.IOException
public void disconnect(int sessionNo) throws java.io.IOException, RpcFailure
java.io.IOException
RpcFailure
public void disconnect(boolean force) throws java.io.IOException
force
- This parameter has no effect (currently)
java.io.IOException
public void finalize()
finalize
in class java.lang.Object
public boolean connect(java.lang.String server, int port) throws java.io.IOException, java.net.ProtocolException
server
- The host name of the serverport
- Port number to use (normally 4894)
java.io.IOException
java.net.ProtocolException
connect(String)
public java.lang.String toString(byte[] buf) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public byte[] toByteArray(java.lang.String s) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public java.lang.String getServerEncoding()
public java.lang.String getServer()
public int getPort()
public boolean connect(java.lang.String server) throws java.io.IOException, java.net.ProtocolException
server
- The host name of the server
java.io.IOException
java.net.ProtocolException
connect(String, int)
public void addAsynchMessageReceiver(nu.dll.lyskom.AsynchMessageReceiver a)
AsynchMessageReceiver
public void removeAsynchMessageReceiver(nu.dll.lyskom.AsynchMessageReceiver a)
addAsynchMessageReceiver(AsynchMessageReceiver)
public boolean getConnected()
public int[] getGlobalUnreadInConf(int conf) throws java.io.IOException
java.io.IOException
nextUnreadText(boolean)
public boolean login(int id, java.lang.String password, boolean hidden) throws java.io.IOException
java.io.IOException
public boolean login(int id, java.lang.String password, boolean hidden, boolean getMembership) throws java.io.IOException
id
- ID number of the person to log in aspassword
- corresponding passwordhidden
- if true, session will not be broadcasted on LysKOM
java.io.IOException
public nu.dll.lyskom.Person getMyPerson()
public java.util.List getUnreadConfsListCached()
public nu.dll.lyskom.Membership queryReadTextsCached(int confNo)
public void updateUnreads() throws java.io.IOException
java.io.IOException
public void markAsRead(int textNo) throws java.io.IOException, RpcFailure
java.io.IOException
RpcFailure
public int getCurrentConference()
public int nextUnreadConference(boolean change) throws java.io.IOException
change
- if true, this method also calls changeConference()
java.io.IOException
public int nextUnreadText(int conference, boolean updateUnread) throws java.io.IOException
updateUnread
- if true, also marks the returned text as read
java.io.IOException
nextUnreadText(boolean)
public int nextUnreadText(boolean updateUnread) throws java.io.IOException
updateUnread
- if true, marks the returned text as unread
java.io.IOException
nextUnreadText(int, boolean)
public boolean isMemberOf(int confNo)
confNo
- Conference numberpublic int getUnreadCount(int confNo) throws java.io.IOException
confNo
- Conference number
java.io.IOException
public nu.dll.lyskom.ReadTextsMap getReadTexts()
public void markAsRead(int confNo, int[] localTextNo) throws java.io.IOException
confNo
- conference numberlocalTextNo
- local text number
LysKOM call: mark-as-read
java.io.IOException
public byte[] getClientVersion(int sessionNo) throws java.io.IOException, RpcFailure
sessionNo
- The session for which to retreive the client version.
java.io.IOException
RpcFailure
getClientName(int)
public nu.dll.lyskom.RpcCall doGetClientVersion(int sessionNo) throws java.io.IOException
sessionNo
- The session for which to retreive the client version.
java.io.IOException
getClientVersion(int)
public byte[] getClientName(int sessionNo) throws java.io.IOException, RpcFailure
sessionNo
- The session for which to retreive the client name.
java.io.IOException
RpcFailure
getClientVersion(int)
public nu.dll.lyskom.RpcCall doGetClientName(int sessionNo) throws java.io.IOException
sessionNo
- The session for which to retreive the client name.
java.io.IOException
getClientName(int)
public java.util.Map getInfo() throws java.io.IOException, RpcFailure
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall doGetInfo() throws java.io.IOException
java.io.IOException
public nu.dll.lyskom.SessionInfo getStaticSessionInfo(int sessionNo) throws java.io.IOException, RpcFailure
sessionNo
- The session for which to retreive information
java.io.IOException
RpcFailure
SessionInfo
public nu.dll.lyskom.RpcCall doGetStaticSessionInfo(int sessionNo) throws java.io.IOException
sessionNo
- The session for which to retreive information
java.io.IOException
public void setLatteVersion(java.lang.String clientName, java.lang.String clientVersion) throws java.io.IOException, RpcFailure
clientName
- The name of the LysKOM clientclientVersion
- The version of the LysKOM client
java.io.IOException
RpcFailure
setClientVersion(String, String)
public void setClientVersion(java.lang.String clientName, java.lang.String clientVersion) throws java.io.IOException, RpcFailure
clientName
- The name of the LysKOM clientclientVersion
- The version of the LysKOM client
java.io.IOException
RpcFailure
setLatteVersion(String, String)
public nu.dll.lyskom.RpcCall doSetClientVersion(java.lang.String clientName, java.lang.String clientVersion) throws java.io.IOException
clientName
- The name of the LysKOM clientclientVersion
- The version of the LysKOM client
java.io.IOException
public nu.dll.lyskom.RpcCall doMarkAsRead(int confNo, int[] localTextNo) throws java.io.IOException
confNo
- the conference in which to mark texts as readlocalTextNo
- an int array containing the local text numbers to mark as read
java.io.IOException
public nu.dll.lyskom.RpcCall doGetTime() throws java.io.IOException
java.io.IOException
public nu.dll.lyskom.KomTime getTime() throws java.io.IOException
java.io.IOException
public nu.dll.lyskom.Text getText(int textNo) throws java.io.IOException, RpcFailure
textNo
- Global text number
java.io.IOException
RpcFailure
getText(int, boolean)
public nu.dll.lyskom.Text getText(int textNo, boolean refreshCache) throws java.io.IOException, RpcFailure
textNo
- Global text numberrefreshCache
- If true, this call will never return a cached copy of a text.
java.io.IOException
RpcFailure
getText(int)
public nu.dll.lyskom.HollerithStream getTextStream(int textNo, int startChar, int endChar) throws java.io.IOException, RpcFailure
java.io.IOException
RpcFailure
HollerithStream
public nu.dll.lyskom.RpcCall doMarkText(int textNo, int markType) throws java.io.IOException
textNo
- the text number to markmarkType
- the type of mark to set
java.io.IOException
public void markText(int textNo, int markType) throws java.io.IOException, RpcFailure
textNo
- the text number to markmarkType
- the type of mark to set
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall doUnmarkText(int textNo) throws java.io.IOException
textNo
- the text number to unmark
java.io.IOException
public void unmarkText(int textNo) throws java.io.IOException, RpcFailure
textNo
- the text number to unmark
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall doGetMarks() throws java.io.IOException, RpcFailure
java.io.IOException
RpcFailure
public nu.dll.lyskom.Mark[] getMarks() throws java.io.IOException, RpcFailure
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall doLocalToGlobal(int confNo, int firstLocalNo, int noOfExistingTexts) throws java.io.IOException
confNo
- The conference number in which to map text numbersfirstLocalNo
- The first local number to mapnoOfExistingTexts
- The maximum number of texts that the returned mappnig should contain
java.io.IOException
public nu.dll.lyskom.TextMapping localToGlobal(int confNo, int firstLocalNo, int noOfExistingTexts) throws java.io.IOException, RpcFailure
confNo
- The conference number in which to map text numbersfirstLocalNo
- The first local number to mapnoOfExistingTexts
- The maximum number of texts that the returned mappnig should contain
java.io.IOException
RpcFailure
doLocalToGlobal(int, int, int)
public nu.dll.lyskom.RpcCall doQueryReadTexts(int persNo, int confNo) throws java.io.IOException
persNo
- The person number for which to query informationconfNo
- The conference number in which to query information about read texts
java.io.IOException
public nu.dll.lyskom.Membership queryReadTexts(int persNo, int confNo) throws java.io.IOException
persNo
- The person number for which to query informationconfNo
- The conference number in which to query information about read texts
java.io.IOException
Membership
,
queryReadTexts(int, int, boolean)
public nu.dll.lyskom.Membership queryReadTexts(int persNo, int confNo, boolean refresh) throws java.io.IOException
persNo
- The person number for which to query informationconfNo
- The conference number in which to query information about read textsrefresh
- If true, the membership cache will be refreshed
java.io.IOException
Membership
,
queryReadTexts(int, int, boolean)
public nu.dll.lyskom.RpcCall doGetUnreadConfs(int persNo) throws java.io.IOException
persNo
- The person number for which to query information
java.io.IOException
getUnreadConfsList(int)
,
getUnreadConfs(int)
public java.util.List getUnreadConfsList(int persNo) throws java.io.IOException
persNo
- The person number for which to query information
java.io.IOException
getUnreadConfs(int)
public int[] getUnreadConfs(int persNo) throws java.io.IOException
persNo
- The person number for which to query information
java.io.IOException
getUnreadConfsList(int)
public nu.dll.lyskom.RpcCall doGetMembership(int persNo, int first, int no, nu.dll.lyskom.Bitstring mask) throws java.io.IOException
persNo
- The person number for which to query informationfirst
- The first membership position in list to retreiveno
- The number of conferences to retreivemask
- If the first bit is set, the server will not return a read-texts array with the membership information
java.io.IOException
public nu.dll.lyskom.RpcCall doGetMembership(int persNo) throws java.io.IOException
java.io.IOException
doGetMembership(int, int, int, Bitstring)
public java.util.List getMyMembershipList() throws java.io.IOException
java.io.IOException
getMembershipList(int, int, int, Bitstring)
public java.util.List getMembershipList(int persNo, int first, int no, nu.dll.lyskom.Bitstring mask) throws java.io.IOException
persNo
- The person number for which to query informationfirst
- The first membership position in list to retreiveno
- The number of conferences to retreivemask
- If the first bit is set, the server will not return a read-texts array with the membership information
java.io.IOException
public nu.dll.lyskom.Membership[] getMembership(int persNo, int first, int no, nu.dll.lyskom.Bitstring mask) throws java.io.IOException
persNo
- The person number for which to query informationfirst
- The first membership position in list to retreiveno
- The number of conferences to retreivemask
- If the first bit is set, the server will not return a read-texts array with the membership information
java.io.IOException
public nu.dll.lyskom.RpcCall doCreatePerson(java.lang.String name, java.lang.String password, nu.dll.lyskom.Bitstring flags, nu.dll.lyskom.AuxItem[] auxItems) throws java.io.IOException
name
- The requested name of the personpassword
- The requested password for this new personflags
- A Bitstring of flagsauxItems
- an array of AuxItem objects that should be set for this person
java.io.IOException
createPerson(String, String, Bitstring, AuxItem[])
public int createPerson(java.lang.String name, java.lang.String password, nu.dll.lyskom.Bitstring flags, nu.dll.lyskom.AuxItem[] auxItems) throws java.io.IOException, RpcFailure
name
- The requested name of the personpassword
- The requested password for this new personflags
- A Bitstring of flagsauxItems
- an array of AuxItem objects that should be set for this person
java.io.IOException
RpcFailure
createPerson(String, String, Bitstring, AuxItem[])
public nu.dll.lyskom.RpcCall doCreateConf(java.lang.String name, nu.dll.lyskom.Bitstring type, nu.dll.lyskom.AuxItem[] auxItems) throws java.io.IOException
name
- The requested name of the conferneceauxItems
- an array of AuxItem objects that should be set for this conference
java.io.IOException
createConf(String, boolean, boolean, boolean)
public int createConf(java.lang.String name, boolean readProt, boolean original, boolean secret) throws java.io.IOException
name
- The requested name of the conferencereadProt
- if true, the new conference should be read protectedoriginal
- if true, the new conference should not allow commentssecret
- if true, the new conference should be secret
java.io.IOException
public nu.dll.lyskom.Membership[] getMembership(int persNo) throws java.io.IOException
persNo
- The person for which to request membership information
java.io.IOException
doGetMembership(int)
public nu.dll.lyskom.Membership[] getUnreadMembership()
public nu.dll.lyskom.TextMapping[] getUnreadTexts()
public nu.dll.lyskom.RpcCall doGetUConfStat(int confNo) throws java.io.IOException
confNo
- The conference to request information about
java.io.IOException
getUConfStat(int)
public nu.dll.lyskom.UConference getUConfStat(int confNo, boolean refreshCache) throws java.io.IOException, RpcFailure
confNo
- The conference to request information aboutrefreshCache
- if true, don't look in the cache
java.io.IOException
RpcFailure
UConference
public nu.dll.lyskom.UConference getUConfStat(int confNo) throws java.io.IOException, RpcFailure
confNo
- The conference to request information about
java.io.IOException
RpcFailure
UConference
public void endast(int no) throws java.io.IOException, RpcFailure
no
- The number of unread texts to request
java.io.IOException
RpcFailure
endast(int, int)
public void endast(int confNo, int no) throws java.io.IOException, RpcFailure
confNo
- The conference in which to set the number of unread textsno
- The number of unread texts to request
java.io.IOException
RpcFailure
endast(int)
public nu.dll.lyskom.RpcCall doSetLastRead(int confNo, int textNo) throws java.io.IOException
confNo
- The conference to set last-read information intextNo
- the text number to be the highest read text
java.io.IOException
endast(int, int)
public void setLastRead(int confNo, int textNo) throws java.io.IOException
confNo
- The conference to set last-read information intextNo
- the text number to be the highest read text
java.io.IOException
endast(int, int)
public nu.dll.lyskom.RpcCall doGetConfStat(int confNo) throws java.io.IOException
confNo
- The conference to retreive conf-stat information about
java.io.IOException
public nu.dll.lyskom.Conference getConfStat(int confNo) throws java.io.IOException, RpcFailure
confNo
- The confernece to retreive information about
java.io.IOException
RpcFailure
Session
public nu.dll.lyskom.Conference getConfStat(int confNo, boolean refreshCache) throws java.io.IOException, RpcFailure
confNo
- The confernece to retreive information aboutrefreshCache
- If true, don't go look into the cache before asking server
java.io.IOException
RpcFailure
Session
public void changeConference(int confNo) throws java.io.IOException, RpcFailure
confNo
- The conference to change to
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall doChangeConference(int confNo) throws java.io.IOException
confNo
- The conference to change to
java.io.IOException
public nu.dll.lyskom.RpcCall doSubMember(int confNo, int persNo) throws java.io.IOException
confNo
- The conference to remove a member frompersNo
- The person to be removed from a converence
java.io.IOException
public void subMember(int confNo, int persNo) throws RpcFailure, java.io.IOException
confNo
- The conference to remove a member frompersNo
- The person to be removed from a converence
RpcFailure
java.io.IOException
public nu.dll.lyskom.RpcCall doAddMember(int confNo, int persNo, int prio, int listPos, nu.dll.lyskom.Bitstring type) throws java.io.IOException
confNo
- The conference to add to the membership listpersNo
- The person who's membership list will be updatedprio
- The priority of the membershiplistPos
- The position of this conference in the membership listtype
- A Bitstring containing the membership type information
java.io.IOException
public void addMember(int confNo, int persNo, int prio, int listPos, boolean invitation, boolean passive, boolean secret) throws java.io.IOException, RpcFailure
confNo
- The conference to add to the membership listpersNo
- The person who's membership list will be updatedprio
- The priority of the membershiplistPos
- The position of this conference in the membership listpassive
- If true, this membership is passivesecret
- If true, this membership is secret
java.io.IOException
RpcFailure
joinConference(int)
public nu.dll.lyskom.RpcCall doChangeName(int confNo, java.lang.String newName) throws java.io.IOException
confNo
- The conference (or letterbox/person) to change the name ofnewName
- The new name of the conference
java.io.IOException
public void changeName(int confNo, java.lang.String newName) throws java.io.IOException, RpcFailure
confNo
- The conference (or letterbox/person) to change the name ofnewName
- The new name of the conference
java.io.IOException
RpcFailure
public void setPresentation(int confNo, int textNo) throws java.io.IOException, RpcFailure
confNo
- The conference for which to set the presentationtextNo
- The global text number containing the presentation
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall doSetPresentation(int confNo, int textNo) throws java.io.IOException
confNo
- The conference for which to set the presentationtextNo
- The global text number containing the presentation
java.io.IOException
public void joinConference(int confNo) throws java.io.IOException, RpcFailure
confNo
- The conference to join
java.io.IOException
RpcFailure
addMember(int, int, int, int, boolean, boolean, boolean)
public nu.dll.lyskom.RpcCall doGetPersonStat(int persNo) throws java.io.IOException
persNo
- The person to request information about
java.io.IOException
public nu.dll.lyskom.Person getPersonStat(int persNo) throws java.io.IOException, RpcFailure
persNo
- The person to request information about
java.io.IOException
RpcFailure
Person
public nu.dll.lyskom.Person getPersonStat(int persNo, boolean refreshCache) throws java.io.IOException, RpcFailure
persNo
- The person to request information aboutrefreshCache
- If true don't look in the cache first.
java.io.IOException
RpcFailure
Person
public byte[] getConfName(int confNo) throws java.io.IOException, RpcFailure
confNo
- conference number to retreive the name for
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall doGetTextStat(int textNo) throws java.io.IOException
textNo
- The text number to request information about
java.io.IOException
public nu.dll.lyskom.TextStat getTextStat(int textNo) throws java.io.IOException
textNo
- The text number to request information about
java.io.IOException
TextStat
public nu.dll.lyskom.TextStat getTextStat(int textNo, boolean refreshCache) throws java.io.IOException, RpcFailure
textNo
- The text number to request information aboutrefreshCache
- If true, a cached copy will not be returned
java.io.IOException
RpcFailure
TextStat
public nu.dll.lyskom.RpcCall doUserActive() throws java.io.IOException
java.io.IOException
public nu.dll.lyskom.RpcCall doWhoAmI() throws java.io.IOException
java.io.IOException
public int whoAmI() throws java.io.IOException, RpcFailure
java.io.IOException
RpcFailure
public boolean getLoggedIn()
public void logout(boolean block) throws java.io.IOException, RpcFailure
block
- If true, this method block until the server has confirmed the call
java.io.IOException
RpcFailure
public int getState()
public void shutdown()
public void writeRaw(int id, java.lang.String s) throws java.io.IOException
id
- The protocol request number to send to the servers
- A String containing the parameters to this call
java.io.IOException
public int count()
public nu.dll.lyskom.RpcCall doCreateText(nu.dll.lyskom.Text t) throws java.io.IOException
t
- A Text object containing the information needed to construct the RPC call
java.io.IOException
Text
public int reply(int textNo, nu.dll.lyskom.Text t) throws java.io.IOException
java.io.IOException
public nu.dll.lyskom.RpcCall doCreateText(byte[] text, java.util.List miscInfo, nu.dll.lyskom.AuxItem[] auxItems) throws java.io.IOException
text
- byte-array containing the article subject and textmiscInfo
- List of Selections with Misc-Info stuff (recipients, etc)auxItems
- Auxiallry items (Aux-Item) attached to this article
java.io.IOException
public int createText(nu.dll.lyskom.Text t) throws java.io.IOException
t
- A Text object containing the information needed to create the text
java.io.IOException
Text
public nu.dll.lyskom.RpcCall doModifyAuxInfo(boolean isConf, int objNo, int[] delAuxNo, nu.dll.lyskom.AuxItem[] addAux) throws java.io.IOException, RpcFailure
isConf
- If true, the refered object is a conference, otherwise a textobjNo
- If isConf is true: the conference to modify, otherwise the text number to modifydelAuxNo
- An array containing Aux-Info numbers to deleteaddAux
- An array containing AuxItem objects to add
java.io.IOException
RpcFailure
AuxItem
public void modifyAuxInfo(boolean isConf, int objNo, int[] delAuxNo, nu.dll.lyskom.AuxItem[] addAux) throws java.io.IOException, RpcFailure
isConf
- If true, the refered object is a conference, otherwise a textobjNo
- If isConf is true: the conference to modify, otherwise the text number to modifydelAuxNo
- An array containing Aux-Info numbers to deleteaddAux
- An array containing AuxItem objects to add
java.io.IOException
RpcFailure
AuxItem
public nu.dll.lyskom.RpcCall doChangeWhatIAmDoing(java.lang.String s) throws java.io.IOException
s
- A String telling the server what you are doing
java.io.IOException
public void changeWhatIAmDoing(java.lang.String s) throws java.io.IOException
java.io.IOException
public nu.dll.lyskom.RpcCall doWhoIsOnDynamic(boolean wantVisible, boolean wantInvisible, int activeLast) throws java.io.IOException
wantVisible
- If true, the server will return sessions marked as visiblewantInvisible
- If true, the server will return sessions marked as invisibleactiveLast
- Do not return sessions that has been idle for more than activeLast seconds
java.io.IOException
public nu.dll.lyskom.DynamicSessionInfo[] whoIsOnDynamic(boolean wantVisible, boolean wantInvisible, int activeLast) throws java.io.IOException
wantVisible
- If true, the server will return sessions marked as visiblewantInvisible
- If true, the server will return sessions marked as invisibleactiveLast
- Do not return sessions that has been idle for more than activeLast seconds
java.io.IOException
DynamicSessionInfo
public nu.dll.lyskom.RpcCall doDeleteText(int textNo) throws java.io.IOException
textNo
- The number of the text to delete
java.io.IOException
public void deleteText(int textNo) throws java.io.IOException, RpcFailure
textNo
- The number of the text to delete
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall doReLookup(java.lang.String regexp, boolean wantPersons, boolean wantConfs) throws java.io.IOException
regexp
- A string containing the regexp that will be used for searchwantPersons
- Return persons matching namewantConfs
- Return conferences matching name
java.io.IOException
lookupName(String, boolean, boolean)
public nu.dll.lyskom.ConfInfo[] reLookup(java.lang.String regexp, boolean wantPersons, boolean wantConfs) throws java.io.IOException, RpcFailure
java.io.IOException
RpcFailure
public nu.dll.lyskom.ConfInfo[] lookupName(java.lang.String name, boolean wantPersons, boolean wantConfs) throws java.io.IOException, RpcFailure
name
- (sub)string naming the person(s)/conference(s)wantPersons
- Return persons matching namewantConfs
- Return conferences matching name
java.io.IOException
RpcFailure
ConfInfo
public boolean sendMessage(int recipient, java.lang.String message) throws java.io.IOException, RpcFailure
recipient
- The recipient conference, or 0 if it is a broadcast messagemessage
- The message to be sent to the server
java.io.IOException
RpcFailure
public boolean sendMessage(int recipient, java.lang.String message, boolean block) throws java.io.IOException, RpcFailure
recipient
- The recipient conference, or 0 if it is a broadcast messagemessage
- The message to be sent to the serverblock
- If true, wait until the server has replied to the RPC call
java.io.IOException
RpcFailure
public nu.dll.lyskom.RpcCall writeRpcCall(nu.dll.lyskom.RpcCall c, boolean store) throws java.io.IOException
c
- RpcCall object to be sent to the serverstore
- if true, add it to the RPC call storage. This is
required in order to use waitFor() etc
java.io.IOException
public nu.dll.lyskom.RpcCall writeRpcCall(nu.dll.lyskom.RpcCall c) throws java.io.IOException
c
- RpcCall object to be sent to the server
java.io.IOException
public nu.dll.lyskom.RpcReply waitFor(int id) throws java.io.IOException
id
- The RPC call reference number to wait for
java.io.IOException
rpcTimeout
public nu.dll.lyskom.RpcReply waitFor(nu.dll.lyskom.RpcCall r) throws java.io.IOException
java.io.IOException
waitFor(int)
public void rpcEvent(nu.dll.lyskom.RpcEvent e)
rpcEvent
in interface RpcEventListener
RpcEvent
,
RpcReply
,
RpcCall
public void rpcReply(nu.dll.lyskom.RpcReply r)
rpcReply
in interface nu.dll.lyskom.RpcReplyReceiver
RpcReplyReceiver
public void asynchMessage(nu.dll.lyskom.AsynchMessage m)
asynchMessage
in interface AsynchMessageReceiver
m
- The parsed asynch message.AsynchMessageReceiver
|
Copyright © Rasmus Sten and contributors, 1997-2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |