LaColla.Api
Class ApiImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by LaColla.Api.ApiImpl
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, Api

public class ApiImpl
extends java.rmi.server.UnicastRemoteObject
implements Api

Author:
Xavier Created on 23-feb-2005 by Xavier into LaColla.Api
See Also:
Serialized Form

Constructor Summary
ApiImpl(UA UA_)
           
 
Method Summary
 void acquire(int type)
           
 java.lang.String addGroup(java.lang.String userId, java.lang.String groupId, GroupInfo groupInfo)
           
 java.lang.String addMember(java.lang.String memberId, java.lang.String groupId, ObjectLaCOLLA memberInfo, java.lang.String role, java.lang.String username, java.lang.String password, java.lang.String emailAddress)
           
 void disseminateEvent(java.lang.String groupId, Event evt)
           
 void disseminateEvent(java.lang.String groupId, Event evt)
           
 java.util.ArrayList eventsRelatedTo(java.lang.String groupId, java.lang.String objectId)
           
 java.util.ArrayList getEventsRelatedTo()
           
 GroupInfo getInfoGroup()
           
 GroupInfo getInfoGroup(java.lang.String userId, java.lang.String groupId, java.lang.String aplicId)
           
 void getInfoMember(ObjectLaCOLLA obj, java.lang.String localPath)
           
 ObjectLaCOLLA getInfoMember(java.lang.String memberId, java.lang.String groupId, java.lang.String localPath)
           
 void getInfoObject(java.lang.String groupId, java.lang.String objectId)
           
 void getObject(ObjectLaCOLLA obj, java.lang.String localPath)
           
 void getObject(ObjectLaCOLLA obj, java.lang.String localPath)
           
 java.lang.String getObjectLaCOLLAInfoMemeberId()
           
 void getTaskState(java.lang.String idTask, java.lang.String groupId)
           
 java.lang.String login(java.lang.String groupId, java.lang.String userId, java.lang.String pswd)
           
 java.lang.String login(java.lang.String groupId, java.lang.String username, java.lang.String pswd, java.lang.String GapaAdress, int GapaPort, java.lang.String aplicHost_, int aplicPort_)
           
 java.lang.String login(java.lang.String groupId, java.lang.String username, java.lang.String pswd, java.lang.String GapaHost, int GapaPort, java.lang.String appHost, int appPort, TimestampSummary eventSummary)
           
 void logout(java.lang.String groupId, java.lang.String userId, java.lang.String aplicName)
           
 ObjectLaCOLLA putObject(ObjectLaCOLLA obj)
           
 ObjectLaCOLLA putObject(ObjectLaCOLLA obj)
           
 void release(int type)
           
 void removeGroup(java.lang.String userId, java.lang.String groupId)
           
 void removeObject(java.lang.String groupId, java.lang.String objectId)
           
 void sendInstantMessage(java.lang.String userId, java.lang.String groupId, java.lang.Object message, java.util.ArrayList targetList)
           
 void setAplicationId(java.lang.String aid_)
           
 void setEventsRelatedTo(java.util.ArrayList list)
           
 void setInfoGroup(GroupInfo infoGroup)
           
 void setNewGroupId(java.lang.String newGroupId)
           
 void setObjectLaCOLLA(ObjectLaCOLLA obj)
           
 void setObjectLaCOLLAInfoMemeberId(java.lang.String objectLaCOLLAInfoMemeberId)
           
 void stopTask(java.lang.String idTask, java.lang.String groupId)
           
 java.lang.String submitTask(byte[] xml, java.lang.String groupId)
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApiImpl

public ApiImpl(UA UA_)
        throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

login

public java.lang.String login(java.lang.String groupId,
                              java.lang.String userId,
                              java.lang.String pswd)
                       throws java.rmi.RemoteException
Specified by:
login in interface Api
Parameters:
groupId - - the groupId
userId - - Username
pswd - - Password
Returns:
String appId - the application id provided by LaCOLLA
Throws:
java.rmi.RemoteException

login

public java.lang.String login(java.lang.String groupId,
                              java.lang.String username,
                              java.lang.String pswd,
                              java.lang.String GapaAdress,
                              int GapaPort,
                              java.lang.String aplicHost_,
                              int aplicPort_)
                       throws java.rmi.RemoteException
Specified by:
login in interface Api
Parameters:
groupId - the group name (can be an string or the ID generated by tyrex)
username - User name (the nick, not the tyrex ID)
pswd - Password
GapaAdress - the GAPA host
GapaPort - the GAPA port
aplicHost_ - the Application host
aplicPort_ - the Application port
Returns:
applicationID
Throws:
java.rmi.RemoteException

login

public java.lang.String login(java.lang.String groupId,
                              java.lang.String username,
                              java.lang.String pswd,
                              java.lang.String GapaHost,
                              int GapaPort,
                              java.lang.String appHost,
                              int appPort,
                              TimestampSummary eventSummary)
                       throws java.rmi.RemoteException
Specified by:
login in interface Api
Parameters:
groupId - the group name (can be an string or the ID generated by tyrex)
username - User name (the nick, not the tyrex ID)
pswd - Password
GapaHost - the GAPA host
GapaPort - the GAPA port
appHost - the Application host
appPort - the Application port
eventSummary - the summary of events received
Returns:
applicationID
Throws:
java.rmi.RemoteException

putObject

public ObjectLaCOLLA putObject(ObjectLaCOLLA obj)
                        throws java.rmi.RemoteException
Specified by:
putObject in interface Api
Parameters:
obj - - the ObjectLaCOLLA to be stored
Returns:
ObjectLaCOLLA - the obj descriptor. Includes the objectId
Throws:
java.rmi.RemoteException

putObject

public ObjectLaCOLLA putObject(ObjectLaCOLLA obj)
                        throws java.rmi.RemoteException
Specified by:
putObject in interface Api
Parameters:
obj - - the ObjectLaCOLLA to be stored
Returns:
ObjectLaCOLLA - the obj descriptor. Includes the objectId
Throws:
java.rmi.RemoteException

getObject

public void getObject(ObjectLaCOLLA obj,
                      java.lang.String localPath)
               throws java.rmi.RemoteException
Specified by:
getObject in interface Api
Parameters:
obj - - the ObjectLaCOLLA to obtain
Throws:
java.rmi.RemoteException

getObject

public void getObject(ObjectLaCOLLA obj,
                      java.lang.String localPath)
               throws java.rmi.RemoteException
Specified by:
getObject in interface Api
Parameters:
obj - - the ObjectLaCOLLA to obtain. This object must be filled with the objectId and group Id.
localPath - - the qualified filename where LaCOLLA will store the file bytes
Throws:
java.rmi.RemoteException - Status: working

getInfoObject

public void getInfoObject(java.lang.String groupId,
                          java.lang.String objectId)
                   throws java.rmi.RemoteException
Specified by:
getInfoObject in interface Api
Parameters:
groupId - - the groupId
objectId - - the objectId
Throws:
java.rmi.RemoteException

removeObject

public void removeObject(java.lang.String groupId,
                         java.lang.String objectId)
                  throws java.rmi.RemoteException
Specified by:
removeObject in interface Api
Parameters:
groupId - - the groupId
objectId - - the objectId
Throws:
java.rmi.RemoteException

logout

public void logout(java.lang.String groupId,
                   java.lang.String userId,
                   java.lang.String aplicName)
            throws java.rmi.RemoteException
Specified by:
logout in interface Api
Parameters:
groupId - - the groupId
userId - - Username
aplicName - - the application id provided by LaCOLLA
Throws:
java.rmi.RemoteException

disseminateEvent

public void disseminateEvent(java.lang.String groupId,
                             Event evt)
                      throws java.rmi.RemoteException
Specified by:
disseminateEvent in interface Api
Parameters:
groupId - - the groupId
evt - - the event to disseminate
Throws:
java.rmi.RemoteException

disseminateEvent

public void disseminateEvent(java.lang.String groupId,
                             Event evt)
                      throws java.rmi.RemoteException
Specified by:
disseminateEvent in interface Api
Parameters:
groupId - - the groupId
evt - - the event to disseminate
Throws:
java.rmi.RemoteException

eventsRelatedTo

public java.util.ArrayList eventsRelatedTo(java.lang.String groupId,
                                           java.lang.String objectId)
                                    throws java.rmi.RemoteException
Specified by:
eventsRelatedTo in interface Api
Parameters:
groupId - - the groupId
objectId - - the objectId
Returns:
ArrayList - list of events related to the objectId
Throws:
java.rmi.RemoteException

addGroup

public java.lang.String addGroup(java.lang.String userId,
                                 java.lang.String groupId,
                                 GroupInfo groupInfo)
                          throws java.rmi.RemoteException
Specified by:
addGroup in interface Api
Parameters:
userId - - the userID provided by LaCOLLA.
groupId - - the new groupId (short version)
groupInfo - - the new groupInfo
Returns:
String - the new groupId (tyrex id + groupId)
Throws:
java.rmi.RemoteException

getInfoGroup

public GroupInfo getInfoGroup(java.lang.String userId,
                              java.lang.String groupId,
                              java.lang.String aplicId)
Specified by:
getInfoGroup in interface Api
Parameters:
userId - - the userID provided by LaCOLLA.
groupId - - the groupId
aplicId - - the application ID
Returns:
GroupInfo

addMember

public java.lang.String addMember(java.lang.String memberId,
                                  java.lang.String groupId,
                                  ObjectLaCOLLA memberInfo,
                                  java.lang.String role,
                                  java.lang.String username,
                                  java.lang.String password,
                                  java.lang.String emailAddress)
                           throws java.rmi.RemoteException
Specified by:
addMember in interface Api
Parameters:
memberId - - the userID provided by LaCOLLA.
groupId - - the groupId
memberInfo - - an ObjectLaCOLLA associated with a member information file. This file will not be read by LaCOLLA; it contains information useful for the application only.
role - - the role of the member in the group {ROOT,USER,...}
username - - the username
password - - the password
emailAddress - - the email address of the new member
Returns:
String - the new memberID
Throws:
java.rmi.RemoteException

getInfoMember

public ObjectLaCOLLA getInfoMember(java.lang.String memberId,
                                   java.lang.String groupId,
                                   java.lang.String localPath)
                            throws java.rmi.RemoteException
Specified by:
getInfoMember in interface Api
Parameters:
localpath: - Path where LaColla will store the obtained file.
Returns:
an ObjectLaCOLLA
Throws:
java.rmi.RemoteException
See Also:
Api.getInfoMember(java.lang.String, java.lang.String, java.lang.String)

getInfoMember

public void getInfoMember(ObjectLaCOLLA obj,
                          java.lang.String localPath)
                   throws java.rmi.RemoteException
Specified by:
getInfoMember in interface Api
Throws:
java.rmi.RemoteException

sendInstantMessage

public void sendInstantMessage(java.lang.String userId,
                               java.lang.String groupId,
                               java.lang.Object message,
                               java.util.ArrayList targetList)
                        throws java.rmi.RemoteException
Specified by:
sendInstantMessage in interface Api
Parameters:
userId - - the member identifier
groupId - - the groupId
message - - the message to be send
targetList - - the list of members to send the message to.
Throws:
java.rmi.RemoteException

acquire

public void acquire(int type)

release

public void release(int type)

setAplicationId

public void setAplicationId(java.lang.String aid_)

getObjectLaCOLLAInfoMemeberId

public java.lang.String getObjectLaCOLLAInfoMemeberId()

setObjectLaCOLLAInfoMemeberId

public void setObjectLaCOLLAInfoMemeberId(java.lang.String objectLaCOLLAInfoMemeberId)

removeGroup

public void removeGroup(java.lang.String userId,
                        java.lang.String groupId)
Specified by:
removeGroup in interface Api
Parameters:
userId - - the userID provided by LaCOLLA.
groupId - - the groupId

submitTask

public java.lang.String submitTask(byte[] xml,
                                   java.lang.String groupId)
                            throws java.rmi.RemoteException
Specified by:
submitTask in interface Api
Parameters:
xml - - the task information
groupId - - the groupId
Returns:
String - the taskId
Throws:
java.rmi.RemoteException

stopTask

public void stopTask(java.lang.String idTask,
                     java.lang.String groupId)
              throws java.rmi.RemoteException
Specified by:
stopTask in interface Api
Parameters:
idTask - - the task identifier
groupId - - the groupId
Throws:
java.rmi.RemoteException

getTaskState

public void getTaskState(java.lang.String idTask,
                         java.lang.String groupId)
                  throws java.rmi.RemoteException
Specified by:
getTaskState in interface Api
Parameters:
idTask - - the task identifier
groupId - - the groupId
Throws:
java.rmi.RemoteException

setObjectLaCOLLA

public void setObjectLaCOLLA(ObjectLaCOLLA obj)
Parameters:
obj -

setNewGroupId

public void setNewGroupId(java.lang.String newGroupId)

setEventsRelatedTo

public void setEventsRelatedTo(java.util.ArrayList list)

getEventsRelatedTo

public java.util.ArrayList getEventsRelatedTo()

setInfoGroup

public void setInfoGroup(GroupInfo infoGroup)

getInfoGroup

public GroupInfo getInfoGroup()