c408h008.server.service
Interface OmniEditorService

All Superinterfaces:
java.rmi.Remote

public interface OmniEditorService
extends java.rmi.Remote

Author:
vivekl TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Method Summary
 OEMessage[] delete(OEMessage in0)
          Delete the given block of text at the current cursor position.
 OEMessage[] download(OEMessage in0)
          Sends the current state of the buffer to the requesting client.
 OEMessage[] guard(OEMessage in0)
          Guard a block of text to prevent others from editting or modifying it.
 OEMessage[] insert(OEMessage in0)
          Inserts a block of text at the current cursor position.
 java.lang.String[] listChannels()
          Returns the channelIDs associated with channels hosted by the server.
 OEMessage[] mark(OEMessage in0)
          Creates a mark at the current cursor position.
 OEMessage[] move(OEMessage in0)
          Moves the client cursor to the specified position.
 OEMessage[] removeGuard(OEMessage in0)
          Removes the guard currently placed on the channel.
 OEMessage[] removeMark(OEMessage in0)
          Removes a client's mark.
 OEMessage[] select(OEMessage in0)
          Selects a block of text from the closest mark to the current cursor position.
 OEMessage[] upload(OEMessage[] in0)
          Merges all the commands encapsulated by an array of OEMessage objects into the server buffer.
 

Method Detail

upload

public OEMessage[] upload(OEMessage[] in0)
                   throws java.rmi.RemoteException,
                          InvalidChannelException,
                          InvalidClientException,
                          ConflictException,
                          BufferOutOfRangeException,
                          NameInUseException,
                          ClientNameInUseException
Merges all the commands encapsulated by an array of OEMessage objects into the server buffer.
The array of OEMessage objects represents all the changes (ie insertions, deletions, cursor-move) which the client requires to merge with the server buffer. If the specified clientIDs or channelIDs do not exist then they are automatically created.

Parameters:
in0 - An array of valid OEMessage objects. A valid OEMessage object is one that encapsulates one or more of the following commands:
  • INSERT
  • DELETE
  • MOVE
  • GUARD
  • SELECT
  • MARK
  • REMOVEMARK
  • REMOVEGUARD
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection. This includes the changes which the client "sent-up" to the server
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null
ConflictException - If the requested change conflicts with the current Server state.
InvalidClientException - If the Client name is null
BufferOutOfRangeException - If a requested command operates outside of the server buffer range (e.g. Inserting a string at position 10 if the max buffer position is 2).
NameInUseException - When attempting to create a previously existingxisting channel or mark.
ClientNameInUseException - When attempting to create a previously existingxisting client.

download

public OEMessage[] download(OEMessage in0)
                     throws java.rmi.RemoteException,
                            InvalidChannelException,
                            InvalidClientException,
                            ClientNameInUseException
Sends the current state of the buffer to the requesting client. The message contains either the contents of the entire buffer (if client is not connected) or a sequence of differential changes (if the client is connected). If the specified clientIDs or channelIDs do not exist then they are automatically created.

Parameters:
in0 - A OEMessage object which specifies clientID and channelID fields.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection. If it is the first dowload (ie one the required the creation of either of channelID or clientID), it will send back the contents of the full buffer as two commands: MOVE command to move cursor to position 0, and an INSERT command specifing the full buffer.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null
ConflictException - If the requested change conflicts with the current Server state (Should not be thrown).
InvalidClientException - If the Client name is null
BufferOutOfRangeException - If a requested command operates outside of the server buffer range (e.g. Inserting a string at position 10 if the max buffer position is 2).
NameInUseException - When attempting to create a previously existingxisting channel or mark.
ClientNameInUseException - When attempting to create a previously existingxisting client.

move

public OEMessage[] move(OEMessage in0)
                 throws java.rmi.RemoteException,
                        InvalidChannelException,
                        BufferOutOfRangeException,
                        InvalidClientException,
                        ClientNameInUseException
Moves the client cursor to the specified position.

Parameters:
in0 - A OEMessage object which specifies clientID and channelID fields as well as OECommandMove command specifing position for cursor to move to.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null, or if channel is non-existent
InvalidClientException - If the Client name is null, expired (after 10 mins), or non-existent.
BufferOutOfRangeException - If a requested command operates outside of the server buffer range (e.g. Inserting a string at position 10 if the max buffer position is 2).
ClientNameInUseException - When attempting to create a previously existingxisting client (should not be thrown).

mark

public OEMessage[] mark(OEMessage in0)
                 throws java.rmi.RemoteException,
                        InvalidChannelException,
                        BufferOutOfRangeException,
                        InvalidClientException,
                        NameInUseException,
                        ClientNameInUseException
Creates a mark at the current cursor position. There can only be one mark per client in any given channel. If client specifies another mark, his previous marks get overwritten.

Parameters:
in0 - A OEMessage object which specifies clientID and channelID fields as well as OECommandMark command specifing mark name.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null, or if channel is non-existent
InvalidClientException - If the Client name is null, expired (after 10 mins), or non-existent.
BufferOutOfRangeException - If a requested command operates outside of the server buffer range (e.g. Inserting a string at position 10 if the max buffer position is 2).
ClientNameInUseException - When attempting to create a previously existingxisting client (should not be thrown).
NameInUseException - If the mark already exists.

removeMark

public OEMessage[] removeMark(OEMessage in0)
                       throws java.rmi.RemoteException,
                              InvalidChannelException,
                              InvalidClientException,
                              ClientNameInUseException
Removes a client's mark. A client can only remove a mark belonging to him.

Parameters:
in0 - A OEMessage object which specifies clientID and channelID fields as well as OECommandRemoveMark command specifing clientID.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null, or if channel is non-existent
InvalidClientException - If the Client name is null, expired (after 10 mins), or non-existent.
ClientNameInUseException - When attempting to create a previously existingxisting client (should not be thrown).

select

public OEMessage[] select(OEMessage in0)
                   throws java.rmi.RemoteException,
                          InvalidChannelException,
                          InvalidClientException,
                          ClientNameInUseException
Selects a block of text from the closest mark to the current cursor position. If mark is non-existent or there are no marks before cursor position than the character at cursor position is selected.

Parameters:
in0 - AOEMessage object which specifies clientID and channelID fields as well as OECommandSelect command specifing clientID.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null, or if channel is non-existent
InvalidClientException - If the Client name is null, expired (after 10 mins), or non-existent.
ClientNameInUseException - When attempting to create a previously existingxisting client (should not be thrown).

insert

public OEMessage[] insert(OEMessage in0)
                   throws java.rmi.RemoteException,
                          InvalidChannelException,
                          InvalidClientException,
                          ConflictException,
                          ClientNameInUseException
Inserts a block of text at the current cursor position.

Parameters:
in0 - A OEMessage object which specifies clientID and channelID fields as well as OECommandInsert command specifing block of text to be inserted.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null, or if channel is non-existent
InvalidClientException - If the Client name is null, expired (after 10 mins), or non-existent.
ClientNameInUseException - When attempting to create a previously existingxisting client (should not be thrown).
ConflictException - If the requested change conflicts with the current Server state.

delete

public OEMessage[] delete(OEMessage in0)
                   throws java.rmi.RemoteException,
                          InvalidChannelException,
                          InvalidClientException,
                          ConflictException,
                          ClientNameInUseException
Delete the given block of text at the current cursor position.

Parameters:
in0 - A OEMessage object which specifies clientID and channelID fields as well as OECommandDelete command specifing block of text to be deleted.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null, or if channel is non-existent
InvalidClientException - If the Client name is null, expired (after 10 mins), or non-existent.
ClientNameInUseException - When attempting to create a previously existingxisting client (should not be thrown).
ConflictException - If the requested change conflicts with the current Server state.

guard

public OEMessage[] guard(OEMessage in0)
                  throws java.rmi.RemoteException,
                         InvalidChannelException,
                         InvalidClientException,
                         ConflictException,
                         ClientNameInUseException
Guard a block of text to prevent others from editting or modifying it. You can only have ONE guard per channel.

Parameters:
in0 - A OEMessage object which specifies clientID and channelID fields as well as OECommandGuard command specifing beginning and ending offset to be guarded.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null, or if channel is non-existent
InvalidClientException - If the Client name is null, expired (after 10 mins), or non-existent.
ClientNameInUseException - When attempting to create a previously existingxisting client (should not be thrown).
ConflictException - If the requested change conflicts with the current Server state.

removeGuard

public OEMessage[] removeGuard(OEMessage in0)
                        throws java.rmi.RemoteException,
                               InvalidChannelException,
                               InvalidClientException,
                               ClientNameInUseException
Removes the guard currently placed on the channel. Note that only the user who set the guard can remove it.

Parameters:
in0 - A OEMessage object which specifies clientID and channelID fields as well as OECommandRemoveGuard command specifing the clientID.
Returns:
An array of OEMessage objects denoting the changes made to the server since the client's last connection.
Throws:
java.rmi.RemoteException
InvalidChannelException - If the Client name is null, or if channel is non-existent
InvalidClientException - If the Client name is null, expired (after 10 mins), or non-existent.
ClientNameInUseException - When attempting to create a previously existingxisting client (should not be thrown).
ConflictException - If the requested change conflicts with the current Server state.

listChannels

public java.lang.String[] listChannels()
Returns the channelIDs associated with channels hosted by the server.

Returns:
An array of String containing channelIDs of channels hosted by the server.