java.lang.Objectorg.mozilla.javascript.ScriptableObject
org.wso2.mashup.hostobjects.im.IM
public class IM
The IM host object is a generic host object designed to send Instant Messages (IM) using various IM protocols. The underlying protocol implementation is kept transparent. MSN, Yahoo, AIM, ICQ and Jabber are the supporetd protocols. Notes: 1. When instantiating a IM object, the user is expected to pass in the IM protocol expected to be used.Valid values are msn, yahoo, aim, icq and jabber 2. When the jabber protocol is used the userID should be of the form username@server e.g. username@gmail.com 3. The login function can be called with or without user credentials. If its called with credentials they are used to authenticate the user. If the function is called without credentials the details are taken from the server.xml found under conf directory where the mashup server is located. So if you wish to keep the credentials in server.xml please update it with the needed usernames and passwords. The section that corresponds to this is as follows.
eg:
//Sending an IM using MSN.
function sendIM(){
var im = new IM("msn");
im.login("username","password");
im.sendMessage("yourFriendsID","hi! This IM was sent using the WSO2 Mashup Server");
im.disconnect();
}
| Field Summary |
|---|
| Fields inherited from class org.mozilla.javascript.ScriptableObject |
|---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
| Fields inherited from interface org.mozilla.javascript.Scriptable |
|---|
NOT_FOUND |
| Constructor Summary | |
|---|---|
IM()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getClassName()
Return the name of the class. |
static org.mozilla.javascript.Scriptable |
jsConstructor(org.mozilla.javascript.Context cx,
java.lang.Object[] args,
org.mozilla.javascript.Function ctorObj,
boolean inNewExpr)
|
void |
jsFunction_disconnect()
|
static void |
jsFunction_login(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] args,
org.mozilla.javascript.Function funObj)
|
void |
jsFunction_sendMessage(java.lang.String to,
java.lang.String message)
|
| Methods inherited from class org.mozilla.javascript.ScriptableObject |
|---|
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IM()
| Method Detail |
|---|
public static org.mozilla.javascript.Scriptable jsConstructor(org.mozilla.javascript.Context cx,
java.lang.Object[] args,
org.mozilla.javascript.Function ctorObj,
boolean inNewExpr)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getClassName()
getClassName in interface org.mozilla.javascript.ScriptablegetClassName in class org.mozilla.javascript.ScriptableObject
public static void jsFunction_login(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] args,
org.mozilla.javascript.Function funObj)
throws org.wso2.imwrapper.core.IMException,
org.wso2.mashup.MashupFault
org.wso2.imwrapper.core.IMException
org.wso2.mashup.MashupFault
public void jsFunction_sendMessage(java.lang.String to,
java.lang.String message)
throws org.wso2.imwrapper.core.IMException
org.wso2.imwrapper.core.IMException
public void jsFunction_disconnect()
throws org.wso2.imwrapper.core.IMException
org.wso2.imwrapper.core.IMException