diff --git a/2.2.1.VERSION b/3.0.0.VERSION similarity index 100% rename from 2.2.1.VERSION rename to 3.0.0.VERSION diff --git a/CIMFlashBridge/.actionScriptProperties b/CIMFlashBridge/.actionScriptProperties deleted file mode 100644 index 1e68ca0..0000000 --- a/CIMFlashBridge/.actionScriptProperties +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CIMFlashBridge/.project b/CIMFlashBridge/.project deleted file mode 100644 index 0c454b5..0000000 --- a/CIMFlashBridge/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - CIMFlashBridge - - - - - - com.adobe.flexbuilder.project.flexbuilder - - - - - - com.adobe.flexbuilder.project.actionscriptnature - - diff --git a/CIMFlashBridge/.settings/org.eclipse.core.resources.prefs b/CIMFlashBridge/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index dde0dac..0000000 --- a/CIMFlashBridge/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Mon Sep 22 14:10:44 CST 2014 -eclipse.preferences.version=1 -encoding/=utf-8 diff --git a/CIMFlashBridge/bin-debug/CIMBridge.html b/CIMFlashBridge/bin-debug/CIMBridge.html deleted file mode 100644 index 5ba81ab..0000000 --- a/CIMFlashBridge/bin-debug/CIMBridge.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
-

- To view this page ensure that Adobe Flash Player version - 11.4.0 or greater is installed. -

- -
- - - - diff --git a/CIMFlashBridge/bin-debug/CIMBridge.swf b/CIMFlashBridge/bin-debug/CIMBridge.swf deleted file mode 100644 index 8362aaa..0000000 Binary files a/CIMFlashBridge/bin-debug/CIMBridge.swf and /dev/null differ diff --git a/CIMFlashBridge/bin-debug/cim.html b/CIMFlashBridge/bin-debug/cim.html deleted file mode 100644 index a521838..0000000 --- a/CIMFlashBridge/bin-debug/cim.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
-

- To view this page ensure that Adobe Flash Player version - 11.4.0 or greater is installed. -

- -
- - - - diff --git a/CIMFlashBridge/bin-debug/cim.swf b/CIMFlashBridge/bin-debug/cim.swf deleted file mode 100644 index cd66f49..0000000 Binary files a/CIMFlashBridge/bin-debug/cim.swf and /dev/null differ diff --git a/CIMFlashBridge/bin-debug/history/history.css b/CIMFlashBridge/bin-debug/history/history.css deleted file mode 100644 index dbc47c6..0000000 --- a/CIMFlashBridge/bin-debug/history/history.css +++ /dev/null @@ -1,6 +0,0 @@ -/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */ - -#ie_historyFrame { width: 0px; height: 0px; display:none } -#firefox_anchorDiv { width: 0px; height: 0px; display:none } -#safari_formDiv { width: 0px; height: 0px; display:none } -#safari_rememberDiv { width: 0px; height: 0px; display:none } diff --git a/CIMFlashBridge/bin-debug/history/history.js b/CIMFlashBridge/bin-debug/history/history.js deleted file mode 100644 index 00a8bfe..0000000 --- a/CIMFlashBridge/bin-debug/history/history.js +++ /dev/null @@ -1,678 +0,0 @@ -BrowserHistoryUtils = { - addEvent: function(elm, evType, fn, useCapture) { - useCapture = useCapture || false; - if (elm.addEventListener) { - elm.addEventListener(evType, fn, useCapture); - return true; - } - else if (elm.attachEvent) { - var r = elm.attachEvent('on' + evType, fn); - return r; - } - else { - elm['on' + evType] = fn; - } - } -} - -BrowserHistory = (function() { - // type of browser - var browser = { - ie: false, - ie8: false, - firefox: false, - safari: false, - opera: false, - version: -1 - }; - - // Default app state URL to use when no fragment ID present - var defaultHash = ''; - - // Last-known app state URL - var currentHref = document.location.href; - - // Initial URL (used only by IE) - var initialHref = document.location.href; - - // Initial URL (used only by IE) - var initialHash = document.location.hash; - - // History frame source URL prefix (used only by IE) - var historyFrameSourcePrefix = 'history/historyFrame.html?'; - - // History maintenance (used only by Safari) - var currentHistoryLength = -1; - - // Flag to denote the existence of onhashchange - var browserHasHashChange = false; - - var historyHash = []; - - var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash); - - var backStack = []; - var forwardStack = []; - - var currentObjectId = null; - - //UserAgent detection - var useragent = navigator.userAgent.toLowerCase(); - - if (useragent.indexOf("opera") != -1) { - browser.opera = true; - } else if (useragent.indexOf("msie") != -1) { - browser.ie = true; - browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4)); - if (browser.version == 8) - { - browser.ie = false; - browser.ie8 = true; - } - } else if (useragent.indexOf("safari") != -1) { - browser.safari = true; - browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7)); - } else if (useragent.indexOf("gecko") != -1) { - browser.firefox = true; - } - - if (browser.ie == true && browser.version == 7) { - window["_ie_firstload"] = false; - } - - function hashChangeHandler() - { - currentHref = document.location.href; - var flexAppUrl = getHash(); - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - } - - // Accessor functions for obtaining specific elements of the page. - function getHistoryFrame() - { - return document.getElementById('ie_historyFrame'); - } - - function getFormElement() - { - return document.getElementById('safari_formDiv'); - } - - function getRememberElement() - { - return document.getElementById("safari_remember_field"); - } - - // Get the Flash player object for performing ExternalInterface callbacks. - // Updated for changes to SWFObject2. - function getPlayer(id) { - var i; - - if (id && document.getElementById(id)) { - var r = document.getElementById(id); - if (typeof r.SetVariable != "undefined") { - return r; - } - else { - var o = r.getElementsByTagName("object"); - var e = r.getElementsByTagName("embed"); - for (i = 0; i < o.length; i++) { - if (typeof o[i].browserURLChange != "undefined") - return o[i]; - } - for (i = 0; i < e.length; i++) { - if (typeof e[i].browserURLChange != "undefined") - return e[i]; - } - } - } - else { - var o = document.getElementsByTagName("object"); - var e = document.getElementsByTagName("embed"); - for (i = 0; i < e.length; i++) { - if (typeof e[i].browserURLChange != "undefined") - { - return e[i]; - } - } - for (i = 0; i < o.length; i++) { - if (typeof o[i].browserURLChange != "undefined") - { - return o[i]; - } - } - } - return undefined; - } - - function getPlayers() { - var i; - var players = []; - if (players.length == 0) { - var tmp = document.getElementsByTagName('object'); - for (i = 0; i < tmp.length; i++) - { - if (typeof tmp[i].browserURLChange != "undefined") - players.push(tmp[i]); - } - } - if (players.length == 0 || players[0].object == null) { - var tmp = document.getElementsByTagName('embed'); - for (i = 0; i < tmp.length; i++) - { - if (typeof tmp[i].browserURLChange != "undefined") - players.push(tmp[i]); - } - } - return players; - } - - function getIframeHash() { - var doc = getHistoryFrame().contentWindow.document; - var hash = String(doc.location.search); - if (hash.length == 1 && hash.charAt(0) == "?") { - hash = ""; - } - else if (hash.length >= 2 && hash.charAt(0) == "?") { - hash = hash.substring(1); - } - return hash; - } - - /* Get the current location hash excluding the '#' symbol. */ - function getHash() { - // It would be nice if we could use document.location.hash here, - // but it's faulty sometimes. - var idx = document.location.href.indexOf('#'); - return (idx >= 0) ? document.location.href.substr(idx+1) : ''; - } - - /* Get the current location hash excluding the '#' symbol. */ - function setHash(hash) { - // It would be nice if we could use document.location.hash here, - // but it's faulty sometimes. - if (hash == '') hash = '#' - document.location.hash = hash; - } - - function createState(baseUrl, newUrl, flexAppUrl) { - return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null }; - } - - /* Add a history entry to the browser. - * baseUrl: the portion of the location prior to the '#' - * newUrl: the entire new URL, including '#' and following fragment - * flexAppUrl: the portion of the location following the '#' only - */ - function addHistoryEntry(baseUrl, newUrl, flexAppUrl) { - - //delete all the history entries - forwardStack = []; - - if (browser.ie) { - //Check to see if we are being asked to do a navigate for the first - //history entry, and if so ignore, because it's coming from the creation - //of the history iframe - if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) { - currentHref = initialHref; - return; - } - if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) { - newUrl = baseUrl + '#' + defaultHash; - flexAppUrl = defaultHash; - } else { - // for IE, tell the history frame to go somewhere without a '#' - // in order to get this entry into the browser history. - getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl; - } - setHash(flexAppUrl); - } else { - - //ADR - if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) { - initialState = createState(baseUrl, newUrl, flexAppUrl); - } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) { - backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl); - } - - if (browser.safari && !browserHasHashChange) { - // for Safari, submit a form whose action points to the desired URL - if (browser.version <= 419.3) { - var file = window.location.pathname.toString(); - file = file.substring(file.lastIndexOf("/")+1); - getFormElement().innerHTML = '
'; - //get the current elements and add them to the form - var qs = window.location.search.substring(1); - var qs_arr = qs.split("&"); - for (var i = 0; i < qs_arr.length; i++) { - var tmp = qs_arr[i].split("="); - var elem = document.createElement("input"); - elem.type = "hidden"; - elem.name = tmp[0]; - elem.value = tmp[1]; - document.forms.historyForm.appendChild(elem); - } - document.forms.historyForm.submit(); - } else { - top.location.hash = flexAppUrl; - } - // We also have to maintain the history by hand for Safari - historyHash[history.length] = flexAppUrl; - _storeStates(); - } else { - // Otherwise, just tell the browser to go there - setHash(flexAppUrl); - } - } - backStack.push(createState(baseUrl, newUrl, flexAppUrl)); - } - - function _storeStates() { - if (browser.safari) { - getRememberElement().value = historyHash.join(","); - } - } - - function handleBackButton() { - //The "current" page is always at the top of the history stack. - var current = backStack.pop(); - if (!current) { return; } - var last = backStack[backStack.length - 1]; - if (!last && backStack.length == 0){ - last = initialState; - } - forwardStack.push(current); - } - - function handleForwardButton() { - //summary: private method. Do not call this directly. - - var last = forwardStack.pop(); - if (!last) { return; } - backStack.push(last); - } - - function handleArbitraryUrl() { - //delete all the history entries - forwardStack = []; - } - - /* Called periodically to poll to see if we need to detect navigation that has occurred */ - function checkForUrlChange() { - - if (browser.ie) { - if (currentHref != document.location.href && currentHref + '#' != document.location.href) { - //This occurs when the user has navigated to a specific URL - //within the app, and didn't use browser back/forward - //IE seems to have a bug where it stops updating the URL it - //shows the end-user at this point, but programatically it - //appears to be correct. Do a full app reload to get around - //this issue. - if (browser.version < 7) { - currentHref = document.location.href; - document.location.reload(); - } else { - if (getHash() != getIframeHash()) { - // this.iframe.src = this.blankURL + hash; - var sourceToSet = historyFrameSourcePrefix + getHash(); - getHistoryFrame().src = sourceToSet; - currentHref = document.location.href; - } - } - } - } - - if (browser.safari && !browserHasHashChange) { - // For Safari, we have to check to see if history.length changed. - if (currentHistoryLength >= 0 && history.length != currentHistoryLength) { - //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|")); - var flexAppUrl = getHash(); - if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */) - { - // If it did change and we're running Safari 3.x or earlier, - // then we have to look the old state up in our hand-maintained - // array since document.location.hash won't have changed, - // then call back into BrowserManager. - currentHistoryLength = history.length; - flexAppUrl = historyHash[currentHistoryLength]; - } - - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - _storeStates(); - } - } - if (browser.firefox && !browserHasHashChange) { - if (currentHref != document.location.href) { - var bsl = backStack.length; - - var urlActions = { - back: false, - forward: false, - set: false - } - - if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) { - urlActions.back = true; - // FIXME: could this ever be a forward button? - // we can't clear it because we still need to check for forwards. Ugg. - // clearInterval(this.locationTimer); - handleBackButton(); - } - - // first check to see if we could have gone forward. We always halt on - // a no-hash item. - if (forwardStack.length > 0) { - if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) { - urlActions.forward = true; - handleForwardButton(); - } - } - - // ok, that didn't work, try someplace back in the history stack - if ((bsl >= 2) && (backStack[bsl - 2])) { - if (backStack[bsl - 2].flexAppUrl == getHash()) { - urlActions.back = true; - handleBackButton(); - } - } - - if (!urlActions.back && !urlActions.forward) { - var foundInStacks = { - back: -1, - forward: -1 - } - - for (var i = 0; i < backStack.length; i++) { - if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { - arbitraryUrl = true; - foundInStacks.back = i; - } - } - for (var i = 0; i < forwardStack.length; i++) { - if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { - arbitraryUrl = true; - foundInStacks.forward = i; - } - } - handleArbitraryUrl(); - } - - // Firefox changed; do a callback into BrowserManager to tell it. - currentHref = document.location.href; - var flexAppUrl = getHash(); - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - } - } - } - - var _initialize = function () { - - browserHasHashChange = ("onhashchange" in document.body); - - if (browser.ie) - { - var scripts = document.getElementsByTagName('script'); - for (var i = 0, s; s = scripts[i]; i++) { - if (s.src.indexOf("history.js") > -1) { - var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html"); - } - } - historyFrameSourcePrefix = iframe_location + "?"; - var src = historyFrameSourcePrefix; - - var iframe = document.createElement("iframe"); - iframe.id = 'ie_historyFrame'; - iframe.name = 'ie_historyFrame'; - iframe.src = 'javascript:false;'; - - try { - document.body.appendChild(iframe); - } catch(e) { - setTimeout(function() { - document.body.appendChild(iframe); - }, 0); - } - } - - if (browser.safari && !browserHasHashChange) - { - var rememberDiv = document.createElement("div"); - rememberDiv.id = 'safari_rememberDiv'; - document.body.appendChild(rememberDiv); - rememberDiv.innerHTML = ''; - - var formDiv = document.createElement("div"); - formDiv.id = 'safari_formDiv'; - document.body.appendChild(formDiv); - - var reloader_content = document.createElement('div'); - reloader_content.id = 'safarireloader'; - var scripts = document.getElementsByTagName('script'); - for (var i = 0, s; s = scripts[i]; i++) { - if (s.src.indexOf("history.js") > -1) { - html = (new String(s.src)).replace(".js", ".html"); - } - } - reloader_content.innerHTML = ''; - document.body.appendChild(reloader_content); - reloader_content.style.position = 'absolute'; - reloader_content.style.left = reloader_content.style.top = '-9999px'; - iframe = reloader_content.getElementsByTagName('iframe')[0]; - - if (document.getElementById("safari_remember_field").value != "" ) { - historyHash = document.getElementById("safari_remember_field").value.split(","); - } - } - - if (browserHasHashChange) - document.body.onhashchange = hashChangeHandler; - } - - return { - historyHash: historyHash, - backStack: function() { return backStack; }, - forwardStack: function() { return forwardStack }, - getPlayer: getPlayer, - initialize: function(src) { - _initialize(src); - }, - setURL: function(url) { - document.location.href = url; - }, - getURL: function() { - return document.location.href; - }, - getTitle: function() { - return document.title; - }, - setTitle: function(title) { - try { - backStack[backStack.length - 1].title = title; - } catch(e) { } - //if on safari, set the title to be the empty string. - if (browser.safari) { - if (title == "") { - try { - var tmp = window.location.href.toString(); - title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#")); - } catch(e) { - title = ""; - } - } - } - document.title = title; - }, - setDefaultURL: function(def) - { - defaultHash = def; - def = getHash(); - //trailing ? is important else an extra frame gets added to the history - //when navigating back to the first page. Alternatively could check - //in history frame navigation to compare # and ?. - if (browser.ie) - { - window['_ie_firstload'] = true; - var sourceToSet = historyFrameSourcePrefix + def; - var func = function() { - getHistoryFrame().src = sourceToSet; - window.location.replace("#" + def); - setInterval(checkForUrlChange, 50); - } - try { - func(); - } catch(e) { - window.setTimeout(function() { func(); }, 0); - } - } - - if (browser.safari) - { - currentHistoryLength = history.length; - if (historyHash.length == 0) { - historyHash[currentHistoryLength] = def; - var newloc = "#" + def; - window.location.replace(newloc); - } else { - //alert(historyHash[historyHash.length-1]); - } - setInterval(checkForUrlChange, 50); - } - - - if (browser.firefox || browser.opera) - { - var reg = new RegExp("#" + def + "$"); - if (window.location.toString().match(reg)) { - } else { - var newloc ="#" + def; - window.location.replace(newloc); - } - setInterval(checkForUrlChange, 50); - } - - }, - - /* Set the current browser URL; called from inside BrowserManager to propagate - * the application state out to the container. - */ - setBrowserURL: function(flexAppUrl, objectId) { - if (browser.ie && typeof objectId != "undefined") { - currentObjectId = objectId; - } - //fromIframe = fromIframe || false; - //fromFlex = fromFlex || false; - //alert("setBrowserURL: " + flexAppUrl); - //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ; - - var pos = document.location.href.indexOf('#'); - var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href; - var newUrl = baseUrl + '#' + flexAppUrl; - - if (document.location.href != newUrl && document.location.href + '#' != newUrl) { - currentHref = newUrl; - addHistoryEntry(baseUrl, newUrl, flexAppUrl); - currentHistoryLength = history.length; - } - }, - - browserURLChange: function(flexAppUrl) { - var objectId = null; - if (browser.ie && currentObjectId != null) { - objectId = currentObjectId; - } - - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - try { - pl[i].browserURLChange(flexAppUrl); - } catch(e) { } - } - } else { - try { - getPlayer(objectId).browserURLChange(flexAppUrl); - } catch(e) { } - } - - currentObjectId = null; - }, - getUserAgent: function() { - return navigator.userAgent; - }, - getPlatform: function() { - return navigator.platform; - } - - } - -})(); - -// Initialization - -// Automated unit testing and other diagnostics - -function setURL(url) -{ - document.location.href = url; -} - -function backButton() -{ - history.back(); -} - -function forwardButton() -{ - history.forward(); -} - -function goForwardOrBackInHistory(step) -{ - history.go(step); -} - -//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); }); -(function(i) { - var u =navigator.userAgent;var e=/*@cc_on!@*/false; - var st = setTimeout; - if(/webkit/i.test(u)){ - st(function(){ - var dr=document.readyState; - if(dr=="loaded"||dr=="complete"){i()} - else{st(arguments.callee,10);}},10); - } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){ - document.addEventListener("DOMContentLoaded",i,false); - } else if(e){ - (function(){ - var t=document.createElement('doc:rdy'); - try{t.doScroll('left'); - i();t=null; - }catch(e){st(arguments.callee,0);}})(); - } else{ - window.onload=i; - } -})( function() {BrowserHistory.initialize();} ); diff --git a/CIMFlashBridge/bin-debug/history/historyFrame.html b/CIMFlashBridge/bin-debug/history/historyFrame.html deleted file mode 100644 index 07e3806..0000000 --- a/CIMFlashBridge/bin-debug/history/historyFrame.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - Hidden frame for Browser History support. - - diff --git a/CIMFlashBridge/bin-debug/playerProductInstall.swf b/CIMFlashBridge/bin-debug/playerProductInstall.swf deleted file mode 100644 index bdc3437..0000000 Binary files a/CIMFlashBridge/bin-debug/playerProductInstall.swf and /dev/null differ diff --git a/CIMFlashBridge/bin-debug/swfobject.js b/CIMFlashBridge/bin-debug/swfobject.js deleted file mode 100644 index bf35c07..0000000 --- a/CIMFlashBridge/bin-debug/swfobject.js +++ /dev/null @@ -1,777 +0,0 @@ -/*! SWFObject v2.2 - is released under the MIT License -*/ - -var swfobject = function() { - - var UNDEF = "undefined", - OBJECT = "object", - SHOCKWAVE_FLASH = "Shockwave Flash", - SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", - FLASH_MIME_TYPE = "application/x-shockwave-flash", - EXPRESS_INSTALL_ID = "SWFObjectExprInst", - ON_READY_STATE_CHANGE = "onreadystatechange", - - win = window, - doc = document, - nav = navigator, - - plugin = false, - domLoadFnArr = [main], - regObjArr = [], - objIdArr = [], - listenersArr = [], - storedAltContent, - storedAltContentId, - storedCallbackFn, - storedCallbackObj, - isDomLoaded = false, - isExpressInstallActive = false, - dynamicStylesheet, - dynamicStylesheetMedia, - autoHideShow = true, - - /* Centralized function for browser feature detection - - User agent string detection is only used when no good alternative is possible - - Is executed directly for optimal performance - */ - ua = function() { - var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, - u = nav.userAgent.toLowerCase(), - p = nav.platform.toLowerCase(), - windows = p ? /win/.test(p) : /win/.test(u), - mac = p ? /mac/.test(p) : /mac/.test(u), - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html - playerVersion = [0,0,0], - d = null; - if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { - d = nav.plugins[SHOCKWAVE_FLASH].description; - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ - plugin = true; - ie = false; // cascaded feature detection for Internet Explorer - d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); - playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); - playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); - playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; - } - } - else if (typeof win.ActiveXObject != UNDEF) { - try { - var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); - if (a) { // a will return null when ActiveX is disabled - d = a.GetVariable("$version"); - if (d) { - ie = true; // cascaded feature detection for Internet Explorer - d = d.split(" ")[1].split(","); - playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - } - catch(e) {} - } - return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; - }(), - - /* Cross-browser onDomLoad - - Will fire an event as soon as the DOM of a web page is loaded - - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ - - Regular onload serves as fallback - */ - onDomLoad = function() { - if (!ua.w3) { return; } - if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically - callDomLoadFunctions(); - } - if (!isDomLoaded) { - if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); - } - if (ua.ie && ua.win) { - doc.attachEvent(ON_READY_STATE_CHANGE, function() { - if (doc.readyState == "complete") { - doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); - callDomLoadFunctions(); - } - }); - if (win == top) { // if not inside an iframe - (function(){ - if (isDomLoaded) { return; } - try { - doc.documentElement.doScroll("left"); - } - catch(e) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - } - if (ua.wk) { - (function(){ - if (isDomLoaded) { return; } - if (!/loaded|complete/.test(doc.readyState)) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - addLoadEvent(callDomLoadFunctions); - } - }(); - - function callDomLoadFunctions() { - if (isDomLoaded) { return; } - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early - var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); - t.parentNode.removeChild(t); - } - catch (e) { return; } - isDomLoaded = true; - var dl = domLoadFnArr.length; - for (var i = 0; i < dl; i++) { - domLoadFnArr[i](); - } - } - - function addDomLoadEvent(fn) { - if (isDomLoaded) { - fn(); - } - else { - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ - } - } - - /* Cross-browser onload - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - - Will fire an event as soon as a web page including all of its assets are loaded - */ - function addLoadEvent(fn) { - if (typeof win.addEventListener != UNDEF) { - win.addEventListener("load", fn, false); - } - else if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("load", fn, false); - } - else if (typeof win.attachEvent != UNDEF) { - addListener(win, "onload", fn); - } - else if (typeof win.onload == "function") { - var fnOld = win.onload; - win.onload = function() { - fnOld(); - fn(); - }; - } - else { - win.onload = fn; - } - } - - /* Main function - - Will preferably execute onDomLoad, otherwise onload (as a fallback) - */ - function main() { - if (plugin) { - testPlayerVersion(); - } - else { - matchVersions(); - } - } - - /* Detect the Flash Player version for non-Internet Explorer browsers - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: - a. Both release and build numbers can be detected - b. Avoid wrong descriptions by corrupt installers provided by Adobe - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available - */ - function testPlayerVersion() { - var b = doc.getElementsByTagName("body")[0]; - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - var t = b.appendChild(o); - if (t) { - var counter = 0; - (function(){ - if (typeof t.GetVariable != UNDEF) { - var d = t.GetVariable("$version"); - if (d) { - d = d.split(" ")[1].split(","); - ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - else if (counter < 10) { - counter++; - setTimeout(arguments.callee, 10); - return; - } - b.removeChild(o); - t = null; - matchVersions(); - })(); - } - else { - matchVersions(); - } - } - - /* Perform Flash Player and SWF version matching; static publishing only - */ - function matchVersions() { - var rl = regObjArr.length; - if (rl > 0) { - for (var i = 0; i < rl; i++) { // for each registered object element - var id = regObjArr[i].id; - var cb = regObjArr[i].callbackFn; - var cbObj = {success:false, id:id}; - if (ua.pv[0] > 0) { - var obj = getElementById(id); - if (obj) { - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! - setVisibility(id, true); - if (cb) { - cbObj.success = true; - cbObj.ref = getObjectById(id); - cb(cbObj); - } - } - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported - var att = {}; - att.data = regObjArr[i].expressInstall; - att.width = obj.getAttribute("width") || "0"; - att.height = obj.getAttribute("height") || "0"; - if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } - if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } - // parse HTML object param element's name-value pairs - var par = {}; - var p = obj.getElementsByTagName("param"); - var pl = p.length; - for (var j = 0; j < pl; j++) { - if (p[j].getAttribute("name").toLowerCase() != "movie") { - par[p[j].getAttribute("name")] = p[j].getAttribute("value"); - } - } - showExpressInstall(att, par, id, cb); - } - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF - displayAltContent(obj); - if (cb) { cb(cbObj); } - } - } - } - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) - setVisibility(id, true); - if (cb) { - var o = getObjectById(id); // test whether there is an HTML object element or not - if (o && typeof o.SetVariable != UNDEF) { - cbObj.success = true; - cbObj.ref = o; - } - cb(cbObj); - } - } - } - } - } - - function getObjectById(objectIdStr) { - var r = null; - var o = getElementById(objectIdStr); - if (o && o.nodeName == "OBJECT") { - if (typeof o.SetVariable != UNDEF) { - r = o; - } - else { - var n = o.getElementsByTagName(OBJECT)[0]; - if (n) { - r = n; - } - } - } - return r; - } - - /* Requirements for Adobe Express Install - - only one instance can be active at a time - - fp 6.0.65 or higher - - Win/Mac OS only - - no Webkit engines older than version 312 - */ - function canExpressInstall() { - return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); - } - - /* Show the Adobe Express Install dialog - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 - */ - function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { - isExpressInstallActive = true; - storedCallbackFn = callbackFn || null; - storedCallbackObj = {success:false, id:replaceElemIdStr}; - var obj = getElementById(replaceElemIdStr); - if (obj) { - if (obj.nodeName == "OBJECT") { // static publishing - storedAltContent = abstractAltContent(obj); - storedAltContentId = null; - } - else { // dynamic publishing - storedAltContent = obj; - storedAltContentId = replaceElemIdStr; - } - att.id = EXPRESS_INSTALL_ID; - if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } - if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } - doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; - var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", - fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + fv; - } - else { - par.flashvars = fv; - } - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - if (ua.ie && ua.win && obj.readyState != 4) { - var newObj = createElement("div"); - replaceElemIdStr += "SWFObjectNew"; - newObj.setAttribute("id", replaceElemIdStr); - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - createSWF(att, par, replaceElemIdStr); - } - } - - /* Functions to abstract and display alternative content - */ - function displayAltContent(obj) { - if (ua.ie && ua.win && obj.readyState != 4) { - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - var el = createElement("div"); - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content - el.parentNode.replaceChild(abstractAltContent(obj), el); - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.replaceChild(abstractAltContent(obj), obj); - } - } - - function abstractAltContent(obj) { - var ac = createElement("div"); - if (ua.win && ua.ie) { - ac.innerHTML = obj.innerHTML; - } - else { - var nestedObj = obj.getElementsByTagName(OBJECT)[0]; - if (nestedObj) { - var c = nestedObj.childNodes; - if (c) { - var cl = c.length; - for (var i = 0; i < cl; i++) { - if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { - ac.appendChild(c[i].cloneNode(true)); - } - } - } - } - } - return ac; - } - - /* Cross-browser dynamic SWF creation - */ - function createSWF(attObj, parObj, id) { - var r, el = getElementById(id); - if (ua.wk && ua.wk < 312) { return r; } - if (el) { - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content - attObj.id = id; - } - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML - var att = ""; - for (var i in attObj) { - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries - if (i.toLowerCase() == "data") { - parObj.movie = attObj[i]; - } - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - att += ' class="' + attObj[i] + '"'; - } - else if (i.toLowerCase() != "classid") { - att += ' ' + i + '="' + attObj[i] + '"'; - } - } - } - var par = ""; - for (var j in parObj) { - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries - par += ''; - } - } - el.outerHTML = '' + par + ''; - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) - r = getElementById(attObj.id); - } - else { // well-behaving browsers - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - for (var m in attObj) { - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - o.setAttribute("class", attObj[m]); - } - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute - o.setAttribute(m, attObj[m]); - } - } - } - for (var n in parObj) { - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element - createObjParam(o, n, parObj[n]); - } - } - el.parentNode.replaceChild(o, el); - r = o; - } - } - return r; - } - - function createObjParam(el, pName, pValue) { - var p = createElement("param"); - p.setAttribute("name", pName); - p.setAttribute("value", pValue); - el.appendChild(p); - } - - /* Cross-browser SWF removal - - Especially needed to safely and completely remove a SWF in Internet Explorer - */ - function removeSWF(id) { - var obj = getElementById(id); - if (obj && obj.nodeName == "OBJECT") { - if (ua.ie && ua.win) { - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - removeObjectInIE(id); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.removeChild(obj); - } - } - } - - function removeObjectInIE(id) { - var obj = getElementById(id); - if (obj) { - for (var i in obj) { - if (typeof obj[i] == "function") { - obj[i] = null; - } - } - obj.parentNode.removeChild(obj); - } - } - - /* Functions to optimize JavaScript compression - */ - function getElementById(id) { - var el = null; - try { - el = doc.getElementById(id); - } - catch (e) {} - return el; - } - - function createElement(el) { - return doc.createElement(el); - } - - /* Updated attachEvent function for Internet Explorer - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks - */ - function addListener(target, eventType, fn) { - target.attachEvent(eventType, fn); - listenersArr[listenersArr.length] = [target, eventType, fn]; - } - - /* Flash Player and SWF content version matching - */ - function hasPlayerVersion(rv) { - var pv = ua.pv, v = rv.split("."); - v[0] = parseInt(v[0], 10); - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" - v[2] = parseInt(v[2], 10) || 0; - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; - } - - /* Cross-browser dynamic CSS creation - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php - */ - function createCSS(sel, decl, media, newStyle) { - if (ua.ie && ua.mac) { return; } - var h = doc.getElementsByTagName("head")[0]; - if (!h) { return; } // to also support badly authored HTML pages that lack a head element - var m = (media && typeof media == "string") ? media : "screen"; - if (newStyle) { - dynamicStylesheet = null; - dynamicStylesheetMedia = null; - } - if (!dynamicStylesheet || dynamicStylesheetMedia != m) { - // create dynamic stylesheet + get a global reference to it - var s = createElement("style"); - s.setAttribute("type", "text/css"); - s.setAttribute("media", m); - dynamicStylesheet = h.appendChild(s); - if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { - dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; - } - dynamicStylesheetMedia = m; - } - // add style rule - if (ua.ie && ua.win) { - if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { - dynamicStylesheet.addRule(sel, decl); - } - } - else { - if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { - dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); - } - } - } - - function setVisibility(id, isVisible) { - if (!autoHideShow) { return; } - var v = isVisible ? "visible" : "hidden"; - if (isDomLoaded && getElementById(id)) { - getElementById(id).style.visibility = v; - } - else { - createCSS("#" + id, "visibility:" + v); - } - } - - /* Filter to avoid XSS attacks - */ - function urlEncodeIfNecessary(s) { - var regex = /[\\\"<>\.;]/; - var hasBadChars = regex.exec(s) != null; - return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; - } - - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) - */ - var cleanup = function() { - if (ua.ie && ua.win) { - window.attachEvent("onunload", function() { - // remove listeners to avoid memory leaks - var ll = listenersArr.length; - for (var i = 0; i < ll; i++) { - listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); - } - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect - var il = objIdArr.length; - for (var j = 0; j < il; j++) { - removeSWF(objIdArr[j]); - } - // cleanup library's main closures to avoid memory leaks - for (var k in ua) { - ua[k] = null; - } - ua = null; - for (var l in swfobject) { - swfobject[l] = null; - } - swfobject = null; - }); - } - }(); - - return { - /* Public API - - Reference: http://code.google.com/p/swfobject/wiki/documentation - */ - registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { - if (ua.w3 && objectIdStr && swfVersionStr) { - var regObj = {}; - regObj.id = objectIdStr; - regObj.swfVersion = swfVersionStr; - regObj.expressInstall = xiSwfUrlStr; - regObj.callbackFn = callbackFn; - regObjArr[regObjArr.length] = regObj; - setVisibility(objectIdStr, false); - } - else if (callbackFn) { - callbackFn({success:false, id:objectIdStr}); - } - }, - - getObjectById: function(objectIdStr) { - if (ua.w3) { - return getObjectById(objectIdStr); - } - }, - - embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { - var callbackObj = {success:false, id:replaceElemIdStr}; - if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { - setVisibility(replaceElemIdStr, false); - addDomLoadEvent(function() { - widthStr += ""; // auto-convert to string - heightStr += ""; - var att = {}; - if (attObj && typeof attObj === OBJECT) { - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs - att[i] = attObj[i]; - } - } - att.data = swfUrlStr; - att.width = widthStr; - att.height = heightStr; - var par = {}; - if (parObj && typeof parObj === OBJECT) { - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs - par[j] = parObj[j]; - } - } - if (flashvarsObj && typeof flashvarsObj === OBJECT) { - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + k + "=" + flashvarsObj[k]; - } - else { - par.flashvars = k + "=" + flashvarsObj[k]; - } - } - } - if (hasPlayerVersion(swfVersionStr)) { // create SWF - var obj = createSWF(att, par, replaceElemIdStr); - if (att.id == replaceElemIdStr) { - setVisibility(replaceElemIdStr, true); - } - callbackObj.success = true; - callbackObj.ref = obj; - } - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install - att.data = xiSwfUrlStr; - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - return; - } - else { // show alternative content - setVisibility(replaceElemIdStr, true); - } - if (callbackFn) { callbackFn(callbackObj); } - }); - } - else if (callbackFn) { callbackFn(callbackObj); } - }, - - switchOffAutoHideShow: function() { - autoHideShow = false; - }, - - ua: ua, - - getFlashPlayerVersion: function() { - return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; - }, - - hasFlashPlayerVersion: hasPlayerVersion, - - createSWF: function(attObj, parObj, replaceElemIdStr) { - if (ua.w3) { - return createSWF(attObj, parObj, replaceElemIdStr); - } - else { - return undefined; - } - }, - - showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { - if (ua.w3 && canExpressInstall()) { - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - } - }, - - removeSWF: function(objElemIdStr) { - if (ua.w3) { - removeSWF(objElemIdStr); - } - }, - - createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { - if (ua.w3) { - createCSS(selStr, declStr, mediaStr, newStyleBoolean); - } - }, - - addDomLoadEvent: addDomLoadEvent, - - addLoadEvent: addLoadEvent, - - getQueryParamValue: function(param) { - var q = doc.location.search || doc.location.hash; - if (q) { - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark - if (param == null) { - return urlEncodeIfNecessary(q); - } - var pairs = q.split("&"); - for (var i = 0; i < pairs.length; i++) { - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { - return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); - } - } - } - return ""; - }, - - // For internal usage only - expressInstallCallback: function() { - if (isExpressInstallActive) { - var obj = getElementById(EXPRESS_INSTALL_ID); - if (obj && storedAltContent) { - obj.parentNode.replaceChild(storedAltContent, obj); - if (storedAltContentId) { - setVisibility(storedAltContentId, true); - if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } - } - if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } - } - isExpressInstallActive = false; - } - } - }; -}(); diff --git a/CIMFlashBridge/bin-release/CIMBridge.html b/CIMFlashBridge/bin-release/CIMBridge.html deleted file mode 100644 index 5ba81ab..0000000 --- a/CIMFlashBridge/bin-release/CIMBridge.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
-

- To view this page ensure that Adobe Flash Player version - 11.4.0 or greater is installed. -

- -
- - - - diff --git a/CIMFlashBridge/bin-release/CIMBridge.swf b/CIMFlashBridge/bin-release/CIMBridge.swf deleted file mode 100644 index 624ae51..0000000 Binary files a/CIMFlashBridge/bin-release/CIMBridge.swf and /dev/null differ diff --git a/CIMFlashBridge/bin-release/history/history.css b/CIMFlashBridge/bin-release/history/history.css deleted file mode 100644 index dbc47c6..0000000 --- a/CIMFlashBridge/bin-release/history/history.css +++ /dev/null @@ -1,6 +0,0 @@ -/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */ - -#ie_historyFrame { width: 0px; height: 0px; display:none } -#firefox_anchorDiv { width: 0px; height: 0px; display:none } -#safari_formDiv { width: 0px; height: 0px; display:none } -#safari_rememberDiv { width: 0px; height: 0px; display:none } diff --git a/CIMFlashBridge/bin-release/history/history.js b/CIMFlashBridge/bin-release/history/history.js deleted file mode 100644 index 00a8bfe..0000000 --- a/CIMFlashBridge/bin-release/history/history.js +++ /dev/null @@ -1,678 +0,0 @@ -BrowserHistoryUtils = { - addEvent: function(elm, evType, fn, useCapture) { - useCapture = useCapture || false; - if (elm.addEventListener) { - elm.addEventListener(evType, fn, useCapture); - return true; - } - else if (elm.attachEvent) { - var r = elm.attachEvent('on' + evType, fn); - return r; - } - else { - elm['on' + evType] = fn; - } - } -} - -BrowserHistory = (function() { - // type of browser - var browser = { - ie: false, - ie8: false, - firefox: false, - safari: false, - opera: false, - version: -1 - }; - - // Default app state URL to use when no fragment ID present - var defaultHash = ''; - - // Last-known app state URL - var currentHref = document.location.href; - - // Initial URL (used only by IE) - var initialHref = document.location.href; - - // Initial URL (used only by IE) - var initialHash = document.location.hash; - - // History frame source URL prefix (used only by IE) - var historyFrameSourcePrefix = 'history/historyFrame.html?'; - - // History maintenance (used only by Safari) - var currentHistoryLength = -1; - - // Flag to denote the existence of onhashchange - var browserHasHashChange = false; - - var historyHash = []; - - var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash); - - var backStack = []; - var forwardStack = []; - - var currentObjectId = null; - - //UserAgent detection - var useragent = navigator.userAgent.toLowerCase(); - - if (useragent.indexOf("opera") != -1) { - browser.opera = true; - } else if (useragent.indexOf("msie") != -1) { - browser.ie = true; - browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4)); - if (browser.version == 8) - { - browser.ie = false; - browser.ie8 = true; - } - } else if (useragent.indexOf("safari") != -1) { - browser.safari = true; - browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7)); - } else if (useragent.indexOf("gecko") != -1) { - browser.firefox = true; - } - - if (browser.ie == true && browser.version == 7) { - window["_ie_firstload"] = false; - } - - function hashChangeHandler() - { - currentHref = document.location.href; - var flexAppUrl = getHash(); - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - } - - // Accessor functions for obtaining specific elements of the page. - function getHistoryFrame() - { - return document.getElementById('ie_historyFrame'); - } - - function getFormElement() - { - return document.getElementById('safari_formDiv'); - } - - function getRememberElement() - { - return document.getElementById("safari_remember_field"); - } - - // Get the Flash player object for performing ExternalInterface callbacks. - // Updated for changes to SWFObject2. - function getPlayer(id) { - var i; - - if (id && document.getElementById(id)) { - var r = document.getElementById(id); - if (typeof r.SetVariable != "undefined") { - return r; - } - else { - var o = r.getElementsByTagName("object"); - var e = r.getElementsByTagName("embed"); - for (i = 0; i < o.length; i++) { - if (typeof o[i].browserURLChange != "undefined") - return o[i]; - } - for (i = 0; i < e.length; i++) { - if (typeof e[i].browserURLChange != "undefined") - return e[i]; - } - } - } - else { - var o = document.getElementsByTagName("object"); - var e = document.getElementsByTagName("embed"); - for (i = 0; i < e.length; i++) { - if (typeof e[i].browserURLChange != "undefined") - { - return e[i]; - } - } - for (i = 0; i < o.length; i++) { - if (typeof o[i].browserURLChange != "undefined") - { - return o[i]; - } - } - } - return undefined; - } - - function getPlayers() { - var i; - var players = []; - if (players.length == 0) { - var tmp = document.getElementsByTagName('object'); - for (i = 0; i < tmp.length; i++) - { - if (typeof tmp[i].browserURLChange != "undefined") - players.push(tmp[i]); - } - } - if (players.length == 0 || players[0].object == null) { - var tmp = document.getElementsByTagName('embed'); - for (i = 0; i < tmp.length; i++) - { - if (typeof tmp[i].browserURLChange != "undefined") - players.push(tmp[i]); - } - } - return players; - } - - function getIframeHash() { - var doc = getHistoryFrame().contentWindow.document; - var hash = String(doc.location.search); - if (hash.length == 1 && hash.charAt(0) == "?") { - hash = ""; - } - else if (hash.length >= 2 && hash.charAt(0) == "?") { - hash = hash.substring(1); - } - return hash; - } - - /* Get the current location hash excluding the '#' symbol. */ - function getHash() { - // It would be nice if we could use document.location.hash here, - // but it's faulty sometimes. - var idx = document.location.href.indexOf('#'); - return (idx >= 0) ? document.location.href.substr(idx+1) : ''; - } - - /* Get the current location hash excluding the '#' symbol. */ - function setHash(hash) { - // It would be nice if we could use document.location.hash here, - // but it's faulty sometimes. - if (hash == '') hash = '#' - document.location.hash = hash; - } - - function createState(baseUrl, newUrl, flexAppUrl) { - return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null }; - } - - /* Add a history entry to the browser. - * baseUrl: the portion of the location prior to the '#' - * newUrl: the entire new URL, including '#' and following fragment - * flexAppUrl: the portion of the location following the '#' only - */ - function addHistoryEntry(baseUrl, newUrl, flexAppUrl) { - - //delete all the history entries - forwardStack = []; - - if (browser.ie) { - //Check to see if we are being asked to do a navigate for the first - //history entry, and if so ignore, because it's coming from the creation - //of the history iframe - if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) { - currentHref = initialHref; - return; - } - if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) { - newUrl = baseUrl + '#' + defaultHash; - flexAppUrl = defaultHash; - } else { - // for IE, tell the history frame to go somewhere without a '#' - // in order to get this entry into the browser history. - getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl; - } - setHash(flexAppUrl); - } else { - - //ADR - if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) { - initialState = createState(baseUrl, newUrl, flexAppUrl); - } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) { - backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl); - } - - if (browser.safari && !browserHasHashChange) { - // for Safari, submit a form whose action points to the desired URL - if (browser.version <= 419.3) { - var file = window.location.pathname.toString(); - file = file.substring(file.lastIndexOf("/")+1); - getFormElement().innerHTML = '
'; - //get the current elements and add them to the form - var qs = window.location.search.substring(1); - var qs_arr = qs.split("&"); - for (var i = 0; i < qs_arr.length; i++) { - var tmp = qs_arr[i].split("="); - var elem = document.createElement("input"); - elem.type = "hidden"; - elem.name = tmp[0]; - elem.value = tmp[1]; - document.forms.historyForm.appendChild(elem); - } - document.forms.historyForm.submit(); - } else { - top.location.hash = flexAppUrl; - } - // We also have to maintain the history by hand for Safari - historyHash[history.length] = flexAppUrl; - _storeStates(); - } else { - // Otherwise, just tell the browser to go there - setHash(flexAppUrl); - } - } - backStack.push(createState(baseUrl, newUrl, flexAppUrl)); - } - - function _storeStates() { - if (browser.safari) { - getRememberElement().value = historyHash.join(","); - } - } - - function handleBackButton() { - //The "current" page is always at the top of the history stack. - var current = backStack.pop(); - if (!current) { return; } - var last = backStack[backStack.length - 1]; - if (!last && backStack.length == 0){ - last = initialState; - } - forwardStack.push(current); - } - - function handleForwardButton() { - //summary: private method. Do not call this directly. - - var last = forwardStack.pop(); - if (!last) { return; } - backStack.push(last); - } - - function handleArbitraryUrl() { - //delete all the history entries - forwardStack = []; - } - - /* Called periodically to poll to see if we need to detect navigation that has occurred */ - function checkForUrlChange() { - - if (browser.ie) { - if (currentHref != document.location.href && currentHref + '#' != document.location.href) { - //This occurs when the user has navigated to a specific URL - //within the app, and didn't use browser back/forward - //IE seems to have a bug where it stops updating the URL it - //shows the end-user at this point, but programatically it - //appears to be correct. Do a full app reload to get around - //this issue. - if (browser.version < 7) { - currentHref = document.location.href; - document.location.reload(); - } else { - if (getHash() != getIframeHash()) { - // this.iframe.src = this.blankURL + hash; - var sourceToSet = historyFrameSourcePrefix + getHash(); - getHistoryFrame().src = sourceToSet; - currentHref = document.location.href; - } - } - } - } - - if (browser.safari && !browserHasHashChange) { - // For Safari, we have to check to see if history.length changed. - if (currentHistoryLength >= 0 && history.length != currentHistoryLength) { - //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|")); - var flexAppUrl = getHash(); - if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */) - { - // If it did change and we're running Safari 3.x or earlier, - // then we have to look the old state up in our hand-maintained - // array since document.location.hash won't have changed, - // then call back into BrowserManager. - currentHistoryLength = history.length; - flexAppUrl = historyHash[currentHistoryLength]; - } - - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - _storeStates(); - } - } - if (browser.firefox && !browserHasHashChange) { - if (currentHref != document.location.href) { - var bsl = backStack.length; - - var urlActions = { - back: false, - forward: false, - set: false - } - - if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) { - urlActions.back = true; - // FIXME: could this ever be a forward button? - // we can't clear it because we still need to check for forwards. Ugg. - // clearInterval(this.locationTimer); - handleBackButton(); - } - - // first check to see if we could have gone forward. We always halt on - // a no-hash item. - if (forwardStack.length > 0) { - if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) { - urlActions.forward = true; - handleForwardButton(); - } - } - - // ok, that didn't work, try someplace back in the history stack - if ((bsl >= 2) && (backStack[bsl - 2])) { - if (backStack[bsl - 2].flexAppUrl == getHash()) { - urlActions.back = true; - handleBackButton(); - } - } - - if (!urlActions.back && !urlActions.forward) { - var foundInStacks = { - back: -1, - forward: -1 - } - - for (var i = 0; i < backStack.length; i++) { - if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { - arbitraryUrl = true; - foundInStacks.back = i; - } - } - for (var i = 0; i < forwardStack.length; i++) { - if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { - arbitraryUrl = true; - foundInStacks.forward = i; - } - } - handleArbitraryUrl(); - } - - // Firefox changed; do a callback into BrowserManager to tell it. - currentHref = document.location.href; - var flexAppUrl = getHash(); - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - } - } - } - - var _initialize = function () { - - browserHasHashChange = ("onhashchange" in document.body); - - if (browser.ie) - { - var scripts = document.getElementsByTagName('script'); - for (var i = 0, s; s = scripts[i]; i++) { - if (s.src.indexOf("history.js") > -1) { - var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html"); - } - } - historyFrameSourcePrefix = iframe_location + "?"; - var src = historyFrameSourcePrefix; - - var iframe = document.createElement("iframe"); - iframe.id = 'ie_historyFrame'; - iframe.name = 'ie_historyFrame'; - iframe.src = 'javascript:false;'; - - try { - document.body.appendChild(iframe); - } catch(e) { - setTimeout(function() { - document.body.appendChild(iframe); - }, 0); - } - } - - if (browser.safari && !browserHasHashChange) - { - var rememberDiv = document.createElement("div"); - rememberDiv.id = 'safari_rememberDiv'; - document.body.appendChild(rememberDiv); - rememberDiv.innerHTML = ''; - - var formDiv = document.createElement("div"); - formDiv.id = 'safari_formDiv'; - document.body.appendChild(formDiv); - - var reloader_content = document.createElement('div'); - reloader_content.id = 'safarireloader'; - var scripts = document.getElementsByTagName('script'); - for (var i = 0, s; s = scripts[i]; i++) { - if (s.src.indexOf("history.js") > -1) { - html = (new String(s.src)).replace(".js", ".html"); - } - } - reloader_content.innerHTML = ''; - document.body.appendChild(reloader_content); - reloader_content.style.position = 'absolute'; - reloader_content.style.left = reloader_content.style.top = '-9999px'; - iframe = reloader_content.getElementsByTagName('iframe')[0]; - - if (document.getElementById("safari_remember_field").value != "" ) { - historyHash = document.getElementById("safari_remember_field").value.split(","); - } - } - - if (browserHasHashChange) - document.body.onhashchange = hashChangeHandler; - } - - return { - historyHash: historyHash, - backStack: function() { return backStack; }, - forwardStack: function() { return forwardStack }, - getPlayer: getPlayer, - initialize: function(src) { - _initialize(src); - }, - setURL: function(url) { - document.location.href = url; - }, - getURL: function() { - return document.location.href; - }, - getTitle: function() { - return document.title; - }, - setTitle: function(title) { - try { - backStack[backStack.length - 1].title = title; - } catch(e) { } - //if on safari, set the title to be the empty string. - if (browser.safari) { - if (title == "") { - try { - var tmp = window.location.href.toString(); - title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#")); - } catch(e) { - title = ""; - } - } - } - document.title = title; - }, - setDefaultURL: function(def) - { - defaultHash = def; - def = getHash(); - //trailing ? is important else an extra frame gets added to the history - //when navigating back to the first page. Alternatively could check - //in history frame navigation to compare # and ?. - if (browser.ie) - { - window['_ie_firstload'] = true; - var sourceToSet = historyFrameSourcePrefix + def; - var func = function() { - getHistoryFrame().src = sourceToSet; - window.location.replace("#" + def); - setInterval(checkForUrlChange, 50); - } - try { - func(); - } catch(e) { - window.setTimeout(function() { func(); }, 0); - } - } - - if (browser.safari) - { - currentHistoryLength = history.length; - if (historyHash.length == 0) { - historyHash[currentHistoryLength] = def; - var newloc = "#" + def; - window.location.replace(newloc); - } else { - //alert(historyHash[historyHash.length-1]); - } - setInterval(checkForUrlChange, 50); - } - - - if (browser.firefox || browser.opera) - { - var reg = new RegExp("#" + def + "$"); - if (window.location.toString().match(reg)) { - } else { - var newloc ="#" + def; - window.location.replace(newloc); - } - setInterval(checkForUrlChange, 50); - } - - }, - - /* Set the current browser URL; called from inside BrowserManager to propagate - * the application state out to the container. - */ - setBrowserURL: function(flexAppUrl, objectId) { - if (browser.ie && typeof objectId != "undefined") { - currentObjectId = objectId; - } - //fromIframe = fromIframe || false; - //fromFlex = fromFlex || false; - //alert("setBrowserURL: " + flexAppUrl); - //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ; - - var pos = document.location.href.indexOf('#'); - var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href; - var newUrl = baseUrl + '#' + flexAppUrl; - - if (document.location.href != newUrl && document.location.href + '#' != newUrl) { - currentHref = newUrl; - addHistoryEntry(baseUrl, newUrl, flexAppUrl); - currentHistoryLength = history.length; - } - }, - - browserURLChange: function(flexAppUrl) { - var objectId = null; - if (browser.ie && currentObjectId != null) { - objectId = currentObjectId; - } - - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - try { - pl[i].browserURLChange(flexAppUrl); - } catch(e) { } - } - } else { - try { - getPlayer(objectId).browserURLChange(flexAppUrl); - } catch(e) { } - } - - currentObjectId = null; - }, - getUserAgent: function() { - return navigator.userAgent; - }, - getPlatform: function() { - return navigator.platform; - } - - } - -})(); - -// Initialization - -// Automated unit testing and other diagnostics - -function setURL(url) -{ - document.location.href = url; -} - -function backButton() -{ - history.back(); -} - -function forwardButton() -{ - history.forward(); -} - -function goForwardOrBackInHistory(step) -{ - history.go(step); -} - -//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); }); -(function(i) { - var u =navigator.userAgent;var e=/*@cc_on!@*/false; - var st = setTimeout; - if(/webkit/i.test(u)){ - st(function(){ - var dr=document.readyState; - if(dr=="loaded"||dr=="complete"){i()} - else{st(arguments.callee,10);}},10); - } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){ - document.addEventListener("DOMContentLoaded",i,false); - } else if(e){ - (function(){ - var t=document.createElement('doc:rdy'); - try{t.doScroll('left'); - i();t=null; - }catch(e){st(arguments.callee,0);}})(); - } else{ - window.onload=i; - } -})( function() {BrowserHistory.initialize();} ); diff --git a/CIMFlashBridge/bin-release/history/historyFrame.html b/CIMFlashBridge/bin-release/history/historyFrame.html deleted file mode 100644 index 07e3806..0000000 --- a/CIMFlashBridge/bin-release/history/historyFrame.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - Hidden frame for Browser History support. - - diff --git a/CIMFlashBridge/bin-release/playerProductInstall.swf b/CIMFlashBridge/bin-release/playerProductInstall.swf deleted file mode 100644 index bdc3437..0000000 Binary files a/CIMFlashBridge/bin-release/playerProductInstall.swf and /dev/null differ diff --git a/CIMFlashBridge/bin-release/swfobject.js b/CIMFlashBridge/bin-release/swfobject.js deleted file mode 100644 index bf35c07..0000000 --- a/CIMFlashBridge/bin-release/swfobject.js +++ /dev/null @@ -1,777 +0,0 @@ -/*! SWFObject v2.2 - is released under the MIT License -*/ - -var swfobject = function() { - - var UNDEF = "undefined", - OBJECT = "object", - SHOCKWAVE_FLASH = "Shockwave Flash", - SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", - FLASH_MIME_TYPE = "application/x-shockwave-flash", - EXPRESS_INSTALL_ID = "SWFObjectExprInst", - ON_READY_STATE_CHANGE = "onreadystatechange", - - win = window, - doc = document, - nav = navigator, - - plugin = false, - domLoadFnArr = [main], - regObjArr = [], - objIdArr = [], - listenersArr = [], - storedAltContent, - storedAltContentId, - storedCallbackFn, - storedCallbackObj, - isDomLoaded = false, - isExpressInstallActive = false, - dynamicStylesheet, - dynamicStylesheetMedia, - autoHideShow = true, - - /* Centralized function for browser feature detection - - User agent string detection is only used when no good alternative is possible - - Is executed directly for optimal performance - */ - ua = function() { - var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, - u = nav.userAgent.toLowerCase(), - p = nav.platform.toLowerCase(), - windows = p ? /win/.test(p) : /win/.test(u), - mac = p ? /mac/.test(p) : /mac/.test(u), - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html - playerVersion = [0,0,0], - d = null; - if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { - d = nav.plugins[SHOCKWAVE_FLASH].description; - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ - plugin = true; - ie = false; // cascaded feature detection for Internet Explorer - d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); - playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); - playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); - playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; - } - } - else if (typeof win.ActiveXObject != UNDEF) { - try { - var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); - if (a) { // a will return null when ActiveX is disabled - d = a.GetVariable("$version"); - if (d) { - ie = true; // cascaded feature detection for Internet Explorer - d = d.split(" ")[1].split(","); - playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - } - catch(e) {} - } - return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; - }(), - - /* Cross-browser onDomLoad - - Will fire an event as soon as the DOM of a web page is loaded - - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ - - Regular onload serves as fallback - */ - onDomLoad = function() { - if (!ua.w3) { return; } - if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically - callDomLoadFunctions(); - } - if (!isDomLoaded) { - if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); - } - if (ua.ie && ua.win) { - doc.attachEvent(ON_READY_STATE_CHANGE, function() { - if (doc.readyState == "complete") { - doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); - callDomLoadFunctions(); - } - }); - if (win == top) { // if not inside an iframe - (function(){ - if (isDomLoaded) { return; } - try { - doc.documentElement.doScroll("left"); - } - catch(e) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - } - if (ua.wk) { - (function(){ - if (isDomLoaded) { return; } - if (!/loaded|complete/.test(doc.readyState)) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - addLoadEvent(callDomLoadFunctions); - } - }(); - - function callDomLoadFunctions() { - if (isDomLoaded) { return; } - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early - var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); - t.parentNode.removeChild(t); - } - catch (e) { return; } - isDomLoaded = true; - var dl = domLoadFnArr.length; - for (var i = 0; i < dl; i++) { - domLoadFnArr[i](); - } - } - - function addDomLoadEvent(fn) { - if (isDomLoaded) { - fn(); - } - else { - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ - } - } - - /* Cross-browser onload - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - - Will fire an event as soon as a web page including all of its assets are loaded - */ - function addLoadEvent(fn) { - if (typeof win.addEventListener != UNDEF) { - win.addEventListener("load", fn, false); - } - else if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("load", fn, false); - } - else if (typeof win.attachEvent != UNDEF) { - addListener(win, "onload", fn); - } - else if (typeof win.onload == "function") { - var fnOld = win.onload; - win.onload = function() { - fnOld(); - fn(); - }; - } - else { - win.onload = fn; - } - } - - /* Main function - - Will preferably execute onDomLoad, otherwise onload (as a fallback) - */ - function main() { - if (plugin) { - testPlayerVersion(); - } - else { - matchVersions(); - } - } - - /* Detect the Flash Player version for non-Internet Explorer browsers - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: - a. Both release and build numbers can be detected - b. Avoid wrong descriptions by corrupt installers provided by Adobe - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available - */ - function testPlayerVersion() { - var b = doc.getElementsByTagName("body")[0]; - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - var t = b.appendChild(o); - if (t) { - var counter = 0; - (function(){ - if (typeof t.GetVariable != UNDEF) { - var d = t.GetVariable("$version"); - if (d) { - d = d.split(" ")[1].split(","); - ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - else if (counter < 10) { - counter++; - setTimeout(arguments.callee, 10); - return; - } - b.removeChild(o); - t = null; - matchVersions(); - })(); - } - else { - matchVersions(); - } - } - - /* Perform Flash Player and SWF version matching; static publishing only - */ - function matchVersions() { - var rl = regObjArr.length; - if (rl > 0) { - for (var i = 0; i < rl; i++) { // for each registered object element - var id = regObjArr[i].id; - var cb = regObjArr[i].callbackFn; - var cbObj = {success:false, id:id}; - if (ua.pv[0] > 0) { - var obj = getElementById(id); - if (obj) { - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! - setVisibility(id, true); - if (cb) { - cbObj.success = true; - cbObj.ref = getObjectById(id); - cb(cbObj); - } - } - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported - var att = {}; - att.data = regObjArr[i].expressInstall; - att.width = obj.getAttribute("width") || "0"; - att.height = obj.getAttribute("height") || "0"; - if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } - if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } - // parse HTML object param element's name-value pairs - var par = {}; - var p = obj.getElementsByTagName("param"); - var pl = p.length; - for (var j = 0; j < pl; j++) { - if (p[j].getAttribute("name").toLowerCase() != "movie") { - par[p[j].getAttribute("name")] = p[j].getAttribute("value"); - } - } - showExpressInstall(att, par, id, cb); - } - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF - displayAltContent(obj); - if (cb) { cb(cbObj); } - } - } - } - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) - setVisibility(id, true); - if (cb) { - var o = getObjectById(id); // test whether there is an HTML object element or not - if (o && typeof o.SetVariable != UNDEF) { - cbObj.success = true; - cbObj.ref = o; - } - cb(cbObj); - } - } - } - } - } - - function getObjectById(objectIdStr) { - var r = null; - var o = getElementById(objectIdStr); - if (o && o.nodeName == "OBJECT") { - if (typeof o.SetVariable != UNDEF) { - r = o; - } - else { - var n = o.getElementsByTagName(OBJECT)[0]; - if (n) { - r = n; - } - } - } - return r; - } - - /* Requirements for Adobe Express Install - - only one instance can be active at a time - - fp 6.0.65 or higher - - Win/Mac OS only - - no Webkit engines older than version 312 - */ - function canExpressInstall() { - return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); - } - - /* Show the Adobe Express Install dialog - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 - */ - function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { - isExpressInstallActive = true; - storedCallbackFn = callbackFn || null; - storedCallbackObj = {success:false, id:replaceElemIdStr}; - var obj = getElementById(replaceElemIdStr); - if (obj) { - if (obj.nodeName == "OBJECT") { // static publishing - storedAltContent = abstractAltContent(obj); - storedAltContentId = null; - } - else { // dynamic publishing - storedAltContent = obj; - storedAltContentId = replaceElemIdStr; - } - att.id = EXPRESS_INSTALL_ID; - if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } - if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } - doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; - var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", - fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + fv; - } - else { - par.flashvars = fv; - } - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - if (ua.ie && ua.win && obj.readyState != 4) { - var newObj = createElement("div"); - replaceElemIdStr += "SWFObjectNew"; - newObj.setAttribute("id", replaceElemIdStr); - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - createSWF(att, par, replaceElemIdStr); - } - } - - /* Functions to abstract and display alternative content - */ - function displayAltContent(obj) { - if (ua.ie && ua.win && obj.readyState != 4) { - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - var el = createElement("div"); - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content - el.parentNode.replaceChild(abstractAltContent(obj), el); - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.replaceChild(abstractAltContent(obj), obj); - } - } - - function abstractAltContent(obj) { - var ac = createElement("div"); - if (ua.win && ua.ie) { - ac.innerHTML = obj.innerHTML; - } - else { - var nestedObj = obj.getElementsByTagName(OBJECT)[0]; - if (nestedObj) { - var c = nestedObj.childNodes; - if (c) { - var cl = c.length; - for (var i = 0; i < cl; i++) { - if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { - ac.appendChild(c[i].cloneNode(true)); - } - } - } - } - } - return ac; - } - - /* Cross-browser dynamic SWF creation - */ - function createSWF(attObj, parObj, id) { - var r, el = getElementById(id); - if (ua.wk && ua.wk < 312) { return r; } - if (el) { - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content - attObj.id = id; - } - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML - var att = ""; - for (var i in attObj) { - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries - if (i.toLowerCase() == "data") { - parObj.movie = attObj[i]; - } - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - att += ' class="' + attObj[i] + '"'; - } - else if (i.toLowerCase() != "classid") { - att += ' ' + i + '="' + attObj[i] + '"'; - } - } - } - var par = ""; - for (var j in parObj) { - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries - par += ''; - } - } - el.outerHTML = '' + par + ''; - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) - r = getElementById(attObj.id); - } - else { // well-behaving browsers - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - for (var m in attObj) { - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - o.setAttribute("class", attObj[m]); - } - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute - o.setAttribute(m, attObj[m]); - } - } - } - for (var n in parObj) { - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element - createObjParam(o, n, parObj[n]); - } - } - el.parentNode.replaceChild(o, el); - r = o; - } - } - return r; - } - - function createObjParam(el, pName, pValue) { - var p = createElement("param"); - p.setAttribute("name", pName); - p.setAttribute("value", pValue); - el.appendChild(p); - } - - /* Cross-browser SWF removal - - Especially needed to safely and completely remove a SWF in Internet Explorer - */ - function removeSWF(id) { - var obj = getElementById(id); - if (obj && obj.nodeName == "OBJECT") { - if (ua.ie && ua.win) { - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - removeObjectInIE(id); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.removeChild(obj); - } - } - } - - function removeObjectInIE(id) { - var obj = getElementById(id); - if (obj) { - for (var i in obj) { - if (typeof obj[i] == "function") { - obj[i] = null; - } - } - obj.parentNode.removeChild(obj); - } - } - - /* Functions to optimize JavaScript compression - */ - function getElementById(id) { - var el = null; - try { - el = doc.getElementById(id); - } - catch (e) {} - return el; - } - - function createElement(el) { - return doc.createElement(el); - } - - /* Updated attachEvent function for Internet Explorer - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks - */ - function addListener(target, eventType, fn) { - target.attachEvent(eventType, fn); - listenersArr[listenersArr.length] = [target, eventType, fn]; - } - - /* Flash Player and SWF content version matching - */ - function hasPlayerVersion(rv) { - var pv = ua.pv, v = rv.split("."); - v[0] = parseInt(v[0], 10); - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" - v[2] = parseInt(v[2], 10) || 0; - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; - } - - /* Cross-browser dynamic CSS creation - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php - */ - function createCSS(sel, decl, media, newStyle) { - if (ua.ie && ua.mac) { return; } - var h = doc.getElementsByTagName("head")[0]; - if (!h) { return; } // to also support badly authored HTML pages that lack a head element - var m = (media && typeof media == "string") ? media : "screen"; - if (newStyle) { - dynamicStylesheet = null; - dynamicStylesheetMedia = null; - } - if (!dynamicStylesheet || dynamicStylesheetMedia != m) { - // create dynamic stylesheet + get a global reference to it - var s = createElement("style"); - s.setAttribute("type", "text/css"); - s.setAttribute("media", m); - dynamicStylesheet = h.appendChild(s); - if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { - dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; - } - dynamicStylesheetMedia = m; - } - // add style rule - if (ua.ie && ua.win) { - if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { - dynamicStylesheet.addRule(sel, decl); - } - } - else { - if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { - dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); - } - } - } - - function setVisibility(id, isVisible) { - if (!autoHideShow) { return; } - var v = isVisible ? "visible" : "hidden"; - if (isDomLoaded && getElementById(id)) { - getElementById(id).style.visibility = v; - } - else { - createCSS("#" + id, "visibility:" + v); - } - } - - /* Filter to avoid XSS attacks - */ - function urlEncodeIfNecessary(s) { - var regex = /[\\\"<>\.;]/; - var hasBadChars = regex.exec(s) != null; - return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; - } - - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) - */ - var cleanup = function() { - if (ua.ie && ua.win) { - window.attachEvent("onunload", function() { - // remove listeners to avoid memory leaks - var ll = listenersArr.length; - for (var i = 0; i < ll; i++) { - listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); - } - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect - var il = objIdArr.length; - for (var j = 0; j < il; j++) { - removeSWF(objIdArr[j]); - } - // cleanup library's main closures to avoid memory leaks - for (var k in ua) { - ua[k] = null; - } - ua = null; - for (var l in swfobject) { - swfobject[l] = null; - } - swfobject = null; - }); - } - }(); - - return { - /* Public API - - Reference: http://code.google.com/p/swfobject/wiki/documentation - */ - registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { - if (ua.w3 && objectIdStr && swfVersionStr) { - var regObj = {}; - regObj.id = objectIdStr; - regObj.swfVersion = swfVersionStr; - regObj.expressInstall = xiSwfUrlStr; - regObj.callbackFn = callbackFn; - regObjArr[regObjArr.length] = regObj; - setVisibility(objectIdStr, false); - } - else if (callbackFn) { - callbackFn({success:false, id:objectIdStr}); - } - }, - - getObjectById: function(objectIdStr) { - if (ua.w3) { - return getObjectById(objectIdStr); - } - }, - - embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { - var callbackObj = {success:false, id:replaceElemIdStr}; - if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { - setVisibility(replaceElemIdStr, false); - addDomLoadEvent(function() { - widthStr += ""; // auto-convert to string - heightStr += ""; - var att = {}; - if (attObj && typeof attObj === OBJECT) { - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs - att[i] = attObj[i]; - } - } - att.data = swfUrlStr; - att.width = widthStr; - att.height = heightStr; - var par = {}; - if (parObj && typeof parObj === OBJECT) { - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs - par[j] = parObj[j]; - } - } - if (flashvarsObj && typeof flashvarsObj === OBJECT) { - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + k + "=" + flashvarsObj[k]; - } - else { - par.flashvars = k + "=" + flashvarsObj[k]; - } - } - } - if (hasPlayerVersion(swfVersionStr)) { // create SWF - var obj = createSWF(att, par, replaceElemIdStr); - if (att.id == replaceElemIdStr) { - setVisibility(replaceElemIdStr, true); - } - callbackObj.success = true; - callbackObj.ref = obj; - } - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install - att.data = xiSwfUrlStr; - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - return; - } - else { // show alternative content - setVisibility(replaceElemIdStr, true); - } - if (callbackFn) { callbackFn(callbackObj); } - }); - } - else if (callbackFn) { callbackFn(callbackObj); } - }, - - switchOffAutoHideShow: function() { - autoHideShow = false; - }, - - ua: ua, - - getFlashPlayerVersion: function() { - return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; - }, - - hasFlashPlayerVersion: hasPlayerVersion, - - createSWF: function(attObj, parObj, replaceElemIdStr) { - if (ua.w3) { - return createSWF(attObj, parObj, replaceElemIdStr); - } - else { - return undefined; - } - }, - - showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { - if (ua.w3 && canExpressInstall()) { - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - } - }, - - removeSWF: function(objElemIdStr) { - if (ua.w3) { - removeSWF(objElemIdStr); - } - }, - - createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { - if (ua.w3) { - createCSS(selStr, declStr, mediaStr, newStyleBoolean); - } - }, - - addDomLoadEvent: addDomLoadEvent, - - addLoadEvent: addLoadEvent, - - getQueryParamValue: function(param) { - var q = doc.location.search || doc.location.hash; - if (q) { - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark - if (param == null) { - return urlEncodeIfNecessary(q); - } - var pairs = q.split("&"); - for (var i = 0; i < pairs.length; i++) { - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { - return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); - } - } - } - return ""; - }, - - // For internal usage only - expressInstallCallback: function() { - if (isExpressInstallActive) { - var obj = getElementById(EXPRESS_INSTALL_ID); - if (obj && storedAltContent) { - obj.parentNode.replaceChild(storedAltContent, obj); - if (storedAltContentId) { - setVisibility(storedAltContentId, true); - if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } - } - if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } - } - isExpressInstallActive = false; - } - } - }; -}(); diff --git a/CIMFlashBridge/html-template/history/history.css b/CIMFlashBridge/html-template/history/history.css deleted file mode 100644 index dbc47c6..0000000 --- a/CIMFlashBridge/html-template/history/history.css +++ /dev/null @@ -1,6 +0,0 @@ -/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */ - -#ie_historyFrame { width: 0px; height: 0px; display:none } -#firefox_anchorDiv { width: 0px; height: 0px; display:none } -#safari_formDiv { width: 0px; height: 0px; display:none } -#safari_rememberDiv { width: 0px; height: 0px; display:none } diff --git a/CIMFlashBridge/html-template/history/history.js b/CIMFlashBridge/html-template/history/history.js deleted file mode 100644 index 00a8bfe..0000000 --- a/CIMFlashBridge/html-template/history/history.js +++ /dev/null @@ -1,678 +0,0 @@ -BrowserHistoryUtils = { - addEvent: function(elm, evType, fn, useCapture) { - useCapture = useCapture || false; - if (elm.addEventListener) { - elm.addEventListener(evType, fn, useCapture); - return true; - } - else if (elm.attachEvent) { - var r = elm.attachEvent('on' + evType, fn); - return r; - } - else { - elm['on' + evType] = fn; - } - } -} - -BrowserHistory = (function() { - // type of browser - var browser = { - ie: false, - ie8: false, - firefox: false, - safari: false, - opera: false, - version: -1 - }; - - // Default app state URL to use when no fragment ID present - var defaultHash = ''; - - // Last-known app state URL - var currentHref = document.location.href; - - // Initial URL (used only by IE) - var initialHref = document.location.href; - - // Initial URL (used only by IE) - var initialHash = document.location.hash; - - // History frame source URL prefix (used only by IE) - var historyFrameSourcePrefix = 'history/historyFrame.html?'; - - // History maintenance (used only by Safari) - var currentHistoryLength = -1; - - // Flag to denote the existence of onhashchange - var browserHasHashChange = false; - - var historyHash = []; - - var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash); - - var backStack = []; - var forwardStack = []; - - var currentObjectId = null; - - //UserAgent detection - var useragent = navigator.userAgent.toLowerCase(); - - if (useragent.indexOf("opera") != -1) { - browser.opera = true; - } else if (useragent.indexOf("msie") != -1) { - browser.ie = true; - browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4)); - if (browser.version == 8) - { - browser.ie = false; - browser.ie8 = true; - } - } else if (useragent.indexOf("safari") != -1) { - browser.safari = true; - browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7)); - } else if (useragent.indexOf("gecko") != -1) { - browser.firefox = true; - } - - if (browser.ie == true && browser.version == 7) { - window["_ie_firstload"] = false; - } - - function hashChangeHandler() - { - currentHref = document.location.href; - var flexAppUrl = getHash(); - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - } - - // Accessor functions for obtaining specific elements of the page. - function getHistoryFrame() - { - return document.getElementById('ie_historyFrame'); - } - - function getFormElement() - { - return document.getElementById('safari_formDiv'); - } - - function getRememberElement() - { - return document.getElementById("safari_remember_field"); - } - - // Get the Flash player object for performing ExternalInterface callbacks. - // Updated for changes to SWFObject2. - function getPlayer(id) { - var i; - - if (id && document.getElementById(id)) { - var r = document.getElementById(id); - if (typeof r.SetVariable != "undefined") { - return r; - } - else { - var o = r.getElementsByTagName("object"); - var e = r.getElementsByTagName("embed"); - for (i = 0; i < o.length; i++) { - if (typeof o[i].browserURLChange != "undefined") - return o[i]; - } - for (i = 0; i < e.length; i++) { - if (typeof e[i].browserURLChange != "undefined") - return e[i]; - } - } - } - else { - var o = document.getElementsByTagName("object"); - var e = document.getElementsByTagName("embed"); - for (i = 0; i < e.length; i++) { - if (typeof e[i].browserURLChange != "undefined") - { - return e[i]; - } - } - for (i = 0; i < o.length; i++) { - if (typeof o[i].browserURLChange != "undefined") - { - return o[i]; - } - } - } - return undefined; - } - - function getPlayers() { - var i; - var players = []; - if (players.length == 0) { - var tmp = document.getElementsByTagName('object'); - for (i = 0; i < tmp.length; i++) - { - if (typeof tmp[i].browserURLChange != "undefined") - players.push(tmp[i]); - } - } - if (players.length == 0 || players[0].object == null) { - var tmp = document.getElementsByTagName('embed'); - for (i = 0; i < tmp.length; i++) - { - if (typeof tmp[i].browserURLChange != "undefined") - players.push(tmp[i]); - } - } - return players; - } - - function getIframeHash() { - var doc = getHistoryFrame().contentWindow.document; - var hash = String(doc.location.search); - if (hash.length == 1 && hash.charAt(0) == "?") { - hash = ""; - } - else if (hash.length >= 2 && hash.charAt(0) == "?") { - hash = hash.substring(1); - } - return hash; - } - - /* Get the current location hash excluding the '#' symbol. */ - function getHash() { - // It would be nice if we could use document.location.hash here, - // but it's faulty sometimes. - var idx = document.location.href.indexOf('#'); - return (idx >= 0) ? document.location.href.substr(idx+1) : ''; - } - - /* Get the current location hash excluding the '#' symbol. */ - function setHash(hash) { - // It would be nice if we could use document.location.hash here, - // but it's faulty sometimes. - if (hash == '') hash = '#' - document.location.hash = hash; - } - - function createState(baseUrl, newUrl, flexAppUrl) { - return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null }; - } - - /* Add a history entry to the browser. - * baseUrl: the portion of the location prior to the '#' - * newUrl: the entire new URL, including '#' and following fragment - * flexAppUrl: the portion of the location following the '#' only - */ - function addHistoryEntry(baseUrl, newUrl, flexAppUrl) { - - //delete all the history entries - forwardStack = []; - - if (browser.ie) { - //Check to see if we are being asked to do a navigate for the first - //history entry, and if so ignore, because it's coming from the creation - //of the history iframe - if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) { - currentHref = initialHref; - return; - } - if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) { - newUrl = baseUrl + '#' + defaultHash; - flexAppUrl = defaultHash; - } else { - // for IE, tell the history frame to go somewhere without a '#' - // in order to get this entry into the browser history. - getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl; - } - setHash(flexAppUrl); - } else { - - //ADR - if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) { - initialState = createState(baseUrl, newUrl, flexAppUrl); - } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) { - backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl); - } - - if (browser.safari && !browserHasHashChange) { - // for Safari, submit a form whose action points to the desired URL - if (browser.version <= 419.3) { - var file = window.location.pathname.toString(); - file = file.substring(file.lastIndexOf("/")+1); - getFormElement().innerHTML = '
'; - //get the current elements and add them to the form - var qs = window.location.search.substring(1); - var qs_arr = qs.split("&"); - for (var i = 0; i < qs_arr.length; i++) { - var tmp = qs_arr[i].split("="); - var elem = document.createElement("input"); - elem.type = "hidden"; - elem.name = tmp[0]; - elem.value = tmp[1]; - document.forms.historyForm.appendChild(elem); - } - document.forms.historyForm.submit(); - } else { - top.location.hash = flexAppUrl; - } - // We also have to maintain the history by hand for Safari - historyHash[history.length] = flexAppUrl; - _storeStates(); - } else { - // Otherwise, just tell the browser to go there - setHash(flexAppUrl); - } - } - backStack.push(createState(baseUrl, newUrl, flexAppUrl)); - } - - function _storeStates() { - if (browser.safari) { - getRememberElement().value = historyHash.join(","); - } - } - - function handleBackButton() { - //The "current" page is always at the top of the history stack. - var current = backStack.pop(); - if (!current) { return; } - var last = backStack[backStack.length - 1]; - if (!last && backStack.length == 0){ - last = initialState; - } - forwardStack.push(current); - } - - function handleForwardButton() { - //summary: private method. Do not call this directly. - - var last = forwardStack.pop(); - if (!last) { return; } - backStack.push(last); - } - - function handleArbitraryUrl() { - //delete all the history entries - forwardStack = []; - } - - /* Called periodically to poll to see if we need to detect navigation that has occurred */ - function checkForUrlChange() { - - if (browser.ie) { - if (currentHref != document.location.href && currentHref + '#' != document.location.href) { - //This occurs when the user has navigated to a specific URL - //within the app, and didn't use browser back/forward - //IE seems to have a bug where it stops updating the URL it - //shows the end-user at this point, but programatically it - //appears to be correct. Do a full app reload to get around - //this issue. - if (browser.version < 7) { - currentHref = document.location.href; - document.location.reload(); - } else { - if (getHash() != getIframeHash()) { - // this.iframe.src = this.blankURL + hash; - var sourceToSet = historyFrameSourcePrefix + getHash(); - getHistoryFrame().src = sourceToSet; - currentHref = document.location.href; - } - } - } - } - - if (browser.safari && !browserHasHashChange) { - // For Safari, we have to check to see if history.length changed. - if (currentHistoryLength >= 0 && history.length != currentHistoryLength) { - //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|")); - var flexAppUrl = getHash(); - if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */) - { - // If it did change and we're running Safari 3.x or earlier, - // then we have to look the old state up in our hand-maintained - // array since document.location.hash won't have changed, - // then call back into BrowserManager. - currentHistoryLength = history.length; - flexAppUrl = historyHash[currentHistoryLength]; - } - - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - _storeStates(); - } - } - if (browser.firefox && !browserHasHashChange) { - if (currentHref != document.location.href) { - var bsl = backStack.length; - - var urlActions = { - back: false, - forward: false, - set: false - } - - if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) { - urlActions.back = true; - // FIXME: could this ever be a forward button? - // we can't clear it because we still need to check for forwards. Ugg. - // clearInterval(this.locationTimer); - handleBackButton(); - } - - // first check to see if we could have gone forward. We always halt on - // a no-hash item. - if (forwardStack.length > 0) { - if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) { - urlActions.forward = true; - handleForwardButton(); - } - } - - // ok, that didn't work, try someplace back in the history stack - if ((bsl >= 2) && (backStack[bsl - 2])) { - if (backStack[bsl - 2].flexAppUrl == getHash()) { - urlActions.back = true; - handleBackButton(); - } - } - - if (!urlActions.back && !urlActions.forward) { - var foundInStacks = { - back: -1, - forward: -1 - } - - for (var i = 0; i < backStack.length; i++) { - if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { - arbitraryUrl = true; - foundInStacks.back = i; - } - } - for (var i = 0; i < forwardStack.length; i++) { - if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) { - arbitraryUrl = true; - foundInStacks.forward = i; - } - } - handleArbitraryUrl(); - } - - // Firefox changed; do a callback into BrowserManager to tell it. - currentHref = document.location.href; - var flexAppUrl = getHash(); - //ADR: to fix multiple - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - pl[i].browserURLChange(flexAppUrl); - } - } else { - getPlayer().browserURLChange(flexAppUrl); - } - } - } - } - - var _initialize = function () { - - browserHasHashChange = ("onhashchange" in document.body); - - if (browser.ie) - { - var scripts = document.getElementsByTagName('script'); - for (var i = 0, s; s = scripts[i]; i++) { - if (s.src.indexOf("history.js") > -1) { - var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html"); - } - } - historyFrameSourcePrefix = iframe_location + "?"; - var src = historyFrameSourcePrefix; - - var iframe = document.createElement("iframe"); - iframe.id = 'ie_historyFrame'; - iframe.name = 'ie_historyFrame'; - iframe.src = 'javascript:false;'; - - try { - document.body.appendChild(iframe); - } catch(e) { - setTimeout(function() { - document.body.appendChild(iframe); - }, 0); - } - } - - if (browser.safari && !browserHasHashChange) - { - var rememberDiv = document.createElement("div"); - rememberDiv.id = 'safari_rememberDiv'; - document.body.appendChild(rememberDiv); - rememberDiv.innerHTML = ''; - - var formDiv = document.createElement("div"); - formDiv.id = 'safari_formDiv'; - document.body.appendChild(formDiv); - - var reloader_content = document.createElement('div'); - reloader_content.id = 'safarireloader'; - var scripts = document.getElementsByTagName('script'); - for (var i = 0, s; s = scripts[i]; i++) { - if (s.src.indexOf("history.js") > -1) { - html = (new String(s.src)).replace(".js", ".html"); - } - } - reloader_content.innerHTML = ''; - document.body.appendChild(reloader_content); - reloader_content.style.position = 'absolute'; - reloader_content.style.left = reloader_content.style.top = '-9999px'; - iframe = reloader_content.getElementsByTagName('iframe')[0]; - - if (document.getElementById("safari_remember_field").value != "" ) { - historyHash = document.getElementById("safari_remember_field").value.split(","); - } - } - - if (browserHasHashChange) - document.body.onhashchange = hashChangeHandler; - } - - return { - historyHash: historyHash, - backStack: function() { return backStack; }, - forwardStack: function() { return forwardStack }, - getPlayer: getPlayer, - initialize: function(src) { - _initialize(src); - }, - setURL: function(url) { - document.location.href = url; - }, - getURL: function() { - return document.location.href; - }, - getTitle: function() { - return document.title; - }, - setTitle: function(title) { - try { - backStack[backStack.length - 1].title = title; - } catch(e) { } - //if on safari, set the title to be the empty string. - if (browser.safari) { - if (title == "") { - try { - var tmp = window.location.href.toString(); - title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#")); - } catch(e) { - title = ""; - } - } - } - document.title = title; - }, - setDefaultURL: function(def) - { - defaultHash = def; - def = getHash(); - //trailing ? is important else an extra frame gets added to the history - //when navigating back to the first page. Alternatively could check - //in history frame navigation to compare # and ?. - if (browser.ie) - { - window['_ie_firstload'] = true; - var sourceToSet = historyFrameSourcePrefix + def; - var func = function() { - getHistoryFrame().src = sourceToSet; - window.location.replace("#" + def); - setInterval(checkForUrlChange, 50); - } - try { - func(); - } catch(e) { - window.setTimeout(function() { func(); }, 0); - } - } - - if (browser.safari) - { - currentHistoryLength = history.length; - if (historyHash.length == 0) { - historyHash[currentHistoryLength] = def; - var newloc = "#" + def; - window.location.replace(newloc); - } else { - //alert(historyHash[historyHash.length-1]); - } - setInterval(checkForUrlChange, 50); - } - - - if (browser.firefox || browser.opera) - { - var reg = new RegExp("#" + def + "$"); - if (window.location.toString().match(reg)) { - } else { - var newloc ="#" + def; - window.location.replace(newloc); - } - setInterval(checkForUrlChange, 50); - } - - }, - - /* Set the current browser URL; called from inside BrowserManager to propagate - * the application state out to the container. - */ - setBrowserURL: function(flexAppUrl, objectId) { - if (browser.ie && typeof objectId != "undefined") { - currentObjectId = objectId; - } - //fromIframe = fromIframe || false; - //fromFlex = fromFlex || false; - //alert("setBrowserURL: " + flexAppUrl); - //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ; - - var pos = document.location.href.indexOf('#'); - var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href; - var newUrl = baseUrl + '#' + flexAppUrl; - - if (document.location.href != newUrl && document.location.href + '#' != newUrl) { - currentHref = newUrl; - addHistoryEntry(baseUrl, newUrl, flexAppUrl); - currentHistoryLength = history.length; - } - }, - - browserURLChange: function(flexAppUrl) { - var objectId = null; - if (browser.ie && currentObjectId != null) { - objectId = currentObjectId; - } - - if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) { - var pl = getPlayers(); - for (var i = 0; i < pl.length; i++) { - try { - pl[i].browserURLChange(flexAppUrl); - } catch(e) { } - } - } else { - try { - getPlayer(objectId).browserURLChange(flexAppUrl); - } catch(e) { } - } - - currentObjectId = null; - }, - getUserAgent: function() { - return navigator.userAgent; - }, - getPlatform: function() { - return navigator.platform; - } - - } - -})(); - -// Initialization - -// Automated unit testing and other diagnostics - -function setURL(url) -{ - document.location.href = url; -} - -function backButton() -{ - history.back(); -} - -function forwardButton() -{ - history.forward(); -} - -function goForwardOrBackInHistory(step) -{ - history.go(step); -} - -//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); }); -(function(i) { - var u =navigator.userAgent;var e=/*@cc_on!@*/false; - var st = setTimeout; - if(/webkit/i.test(u)){ - st(function(){ - var dr=document.readyState; - if(dr=="loaded"||dr=="complete"){i()} - else{st(arguments.callee,10);}},10); - } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){ - document.addEventListener("DOMContentLoaded",i,false); - } else if(e){ - (function(){ - var t=document.createElement('doc:rdy'); - try{t.doScroll('left'); - i();t=null; - }catch(e){st(arguments.callee,0);}})(); - } else{ - window.onload=i; - } -})( function() {BrowserHistory.initialize();} ); diff --git a/CIMFlashBridge/html-template/history/historyFrame.html b/CIMFlashBridge/html-template/history/historyFrame.html deleted file mode 100644 index 07e3806..0000000 --- a/CIMFlashBridge/html-template/history/historyFrame.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - Hidden frame for Browser History support. - - diff --git a/CIMFlashBridge/html-template/index.template.html b/CIMFlashBridge/html-template/index.template.html deleted file mode 100644 index d327dad..0000000 --- a/CIMFlashBridge/html-template/index.template.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - ${title} - - - - - - - - - - - - - -
-

- To view this page ensure that Adobe Flash Player version - ${version_major}.${version_minor}.${version_revision} or greater is installed. -

- -
- - - - diff --git a/CIMFlashBridge/html-template/playerProductInstall.swf b/CIMFlashBridge/html-template/playerProductInstall.swf deleted file mode 100644 index bdc3437..0000000 Binary files a/CIMFlashBridge/html-template/playerProductInstall.swf and /dev/null differ diff --git a/CIMFlashBridge/html-template/swfobject.js b/CIMFlashBridge/html-template/swfobject.js deleted file mode 100644 index bf35c07..0000000 --- a/CIMFlashBridge/html-template/swfobject.js +++ /dev/null @@ -1,777 +0,0 @@ -/*! SWFObject v2.2 - is released under the MIT License -*/ - -var swfobject = function() { - - var UNDEF = "undefined", - OBJECT = "object", - SHOCKWAVE_FLASH = "Shockwave Flash", - SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", - FLASH_MIME_TYPE = "application/x-shockwave-flash", - EXPRESS_INSTALL_ID = "SWFObjectExprInst", - ON_READY_STATE_CHANGE = "onreadystatechange", - - win = window, - doc = document, - nav = navigator, - - plugin = false, - domLoadFnArr = [main], - regObjArr = [], - objIdArr = [], - listenersArr = [], - storedAltContent, - storedAltContentId, - storedCallbackFn, - storedCallbackObj, - isDomLoaded = false, - isExpressInstallActive = false, - dynamicStylesheet, - dynamicStylesheetMedia, - autoHideShow = true, - - /* Centralized function for browser feature detection - - User agent string detection is only used when no good alternative is possible - - Is executed directly for optimal performance - */ - ua = function() { - var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, - u = nav.userAgent.toLowerCase(), - p = nav.platform.toLowerCase(), - windows = p ? /win/.test(p) : /win/.test(u), - mac = p ? /mac/.test(p) : /mac/.test(u), - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html - playerVersion = [0,0,0], - d = null; - if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { - d = nav.plugins[SHOCKWAVE_FLASH].description; - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ - plugin = true; - ie = false; // cascaded feature detection for Internet Explorer - d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); - playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); - playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); - playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; - } - } - else if (typeof win.ActiveXObject != UNDEF) { - try { - var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); - if (a) { // a will return null when ActiveX is disabled - d = a.GetVariable("$version"); - if (d) { - ie = true; // cascaded feature detection for Internet Explorer - d = d.split(" ")[1].split(","); - playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - } - catch(e) {} - } - return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; - }(), - - /* Cross-browser onDomLoad - - Will fire an event as soon as the DOM of a web page is loaded - - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ - - Regular onload serves as fallback - */ - onDomLoad = function() { - if (!ua.w3) { return; } - if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically - callDomLoadFunctions(); - } - if (!isDomLoaded) { - if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); - } - if (ua.ie && ua.win) { - doc.attachEvent(ON_READY_STATE_CHANGE, function() { - if (doc.readyState == "complete") { - doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); - callDomLoadFunctions(); - } - }); - if (win == top) { // if not inside an iframe - (function(){ - if (isDomLoaded) { return; } - try { - doc.documentElement.doScroll("left"); - } - catch(e) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - } - if (ua.wk) { - (function(){ - if (isDomLoaded) { return; } - if (!/loaded|complete/.test(doc.readyState)) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - addLoadEvent(callDomLoadFunctions); - } - }(); - - function callDomLoadFunctions() { - if (isDomLoaded) { return; } - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early - var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); - t.parentNode.removeChild(t); - } - catch (e) { return; } - isDomLoaded = true; - var dl = domLoadFnArr.length; - for (var i = 0; i < dl; i++) { - domLoadFnArr[i](); - } - } - - function addDomLoadEvent(fn) { - if (isDomLoaded) { - fn(); - } - else { - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ - } - } - - /* Cross-browser onload - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - - Will fire an event as soon as a web page including all of its assets are loaded - */ - function addLoadEvent(fn) { - if (typeof win.addEventListener != UNDEF) { - win.addEventListener("load", fn, false); - } - else if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("load", fn, false); - } - else if (typeof win.attachEvent != UNDEF) { - addListener(win, "onload", fn); - } - else if (typeof win.onload == "function") { - var fnOld = win.onload; - win.onload = function() { - fnOld(); - fn(); - }; - } - else { - win.onload = fn; - } - } - - /* Main function - - Will preferably execute onDomLoad, otherwise onload (as a fallback) - */ - function main() { - if (plugin) { - testPlayerVersion(); - } - else { - matchVersions(); - } - } - - /* Detect the Flash Player version for non-Internet Explorer browsers - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: - a. Both release and build numbers can be detected - b. Avoid wrong descriptions by corrupt installers provided by Adobe - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available - */ - function testPlayerVersion() { - var b = doc.getElementsByTagName("body")[0]; - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - var t = b.appendChild(o); - if (t) { - var counter = 0; - (function(){ - if (typeof t.GetVariable != UNDEF) { - var d = t.GetVariable("$version"); - if (d) { - d = d.split(" ")[1].split(","); - ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - else if (counter < 10) { - counter++; - setTimeout(arguments.callee, 10); - return; - } - b.removeChild(o); - t = null; - matchVersions(); - })(); - } - else { - matchVersions(); - } - } - - /* Perform Flash Player and SWF version matching; static publishing only - */ - function matchVersions() { - var rl = regObjArr.length; - if (rl > 0) { - for (var i = 0; i < rl; i++) { // for each registered object element - var id = regObjArr[i].id; - var cb = regObjArr[i].callbackFn; - var cbObj = {success:false, id:id}; - if (ua.pv[0] > 0) { - var obj = getElementById(id); - if (obj) { - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! - setVisibility(id, true); - if (cb) { - cbObj.success = true; - cbObj.ref = getObjectById(id); - cb(cbObj); - } - } - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported - var att = {}; - att.data = regObjArr[i].expressInstall; - att.width = obj.getAttribute("width") || "0"; - att.height = obj.getAttribute("height") || "0"; - if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } - if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } - // parse HTML object param element's name-value pairs - var par = {}; - var p = obj.getElementsByTagName("param"); - var pl = p.length; - for (var j = 0; j < pl; j++) { - if (p[j].getAttribute("name").toLowerCase() != "movie") { - par[p[j].getAttribute("name")] = p[j].getAttribute("value"); - } - } - showExpressInstall(att, par, id, cb); - } - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF - displayAltContent(obj); - if (cb) { cb(cbObj); } - } - } - } - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) - setVisibility(id, true); - if (cb) { - var o = getObjectById(id); // test whether there is an HTML object element or not - if (o && typeof o.SetVariable != UNDEF) { - cbObj.success = true; - cbObj.ref = o; - } - cb(cbObj); - } - } - } - } - } - - function getObjectById(objectIdStr) { - var r = null; - var o = getElementById(objectIdStr); - if (o && o.nodeName == "OBJECT") { - if (typeof o.SetVariable != UNDEF) { - r = o; - } - else { - var n = o.getElementsByTagName(OBJECT)[0]; - if (n) { - r = n; - } - } - } - return r; - } - - /* Requirements for Adobe Express Install - - only one instance can be active at a time - - fp 6.0.65 or higher - - Win/Mac OS only - - no Webkit engines older than version 312 - */ - function canExpressInstall() { - return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); - } - - /* Show the Adobe Express Install dialog - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 - */ - function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { - isExpressInstallActive = true; - storedCallbackFn = callbackFn || null; - storedCallbackObj = {success:false, id:replaceElemIdStr}; - var obj = getElementById(replaceElemIdStr); - if (obj) { - if (obj.nodeName == "OBJECT") { // static publishing - storedAltContent = abstractAltContent(obj); - storedAltContentId = null; - } - else { // dynamic publishing - storedAltContent = obj; - storedAltContentId = replaceElemIdStr; - } - att.id = EXPRESS_INSTALL_ID; - if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } - if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } - doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; - var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", - fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + fv; - } - else { - par.flashvars = fv; - } - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - if (ua.ie && ua.win && obj.readyState != 4) { - var newObj = createElement("div"); - replaceElemIdStr += "SWFObjectNew"; - newObj.setAttribute("id", replaceElemIdStr); - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - createSWF(att, par, replaceElemIdStr); - } - } - - /* Functions to abstract and display alternative content - */ - function displayAltContent(obj) { - if (ua.ie && ua.win && obj.readyState != 4) { - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - var el = createElement("div"); - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content - el.parentNode.replaceChild(abstractAltContent(obj), el); - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.replaceChild(abstractAltContent(obj), obj); - } - } - - function abstractAltContent(obj) { - var ac = createElement("div"); - if (ua.win && ua.ie) { - ac.innerHTML = obj.innerHTML; - } - else { - var nestedObj = obj.getElementsByTagName(OBJECT)[0]; - if (nestedObj) { - var c = nestedObj.childNodes; - if (c) { - var cl = c.length; - for (var i = 0; i < cl; i++) { - if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { - ac.appendChild(c[i].cloneNode(true)); - } - } - } - } - } - return ac; - } - - /* Cross-browser dynamic SWF creation - */ - function createSWF(attObj, parObj, id) { - var r, el = getElementById(id); - if (ua.wk && ua.wk < 312) { return r; } - if (el) { - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content - attObj.id = id; - } - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML - var att = ""; - for (var i in attObj) { - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries - if (i.toLowerCase() == "data") { - parObj.movie = attObj[i]; - } - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - att += ' class="' + attObj[i] + '"'; - } - else if (i.toLowerCase() != "classid") { - att += ' ' + i + '="' + attObj[i] + '"'; - } - } - } - var par = ""; - for (var j in parObj) { - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries - par += ''; - } - } - el.outerHTML = '' + par + ''; - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) - r = getElementById(attObj.id); - } - else { // well-behaving browsers - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - for (var m in attObj) { - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - o.setAttribute("class", attObj[m]); - } - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute - o.setAttribute(m, attObj[m]); - } - } - } - for (var n in parObj) { - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element - createObjParam(o, n, parObj[n]); - } - } - el.parentNode.replaceChild(o, el); - r = o; - } - } - return r; - } - - function createObjParam(el, pName, pValue) { - var p = createElement("param"); - p.setAttribute("name", pName); - p.setAttribute("value", pValue); - el.appendChild(p); - } - - /* Cross-browser SWF removal - - Especially needed to safely and completely remove a SWF in Internet Explorer - */ - function removeSWF(id) { - var obj = getElementById(id); - if (obj && obj.nodeName == "OBJECT") { - if (ua.ie && ua.win) { - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - removeObjectInIE(id); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.removeChild(obj); - } - } - } - - function removeObjectInIE(id) { - var obj = getElementById(id); - if (obj) { - for (var i in obj) { - if (typeof obj[i] == "function") { - obj[i] = null; - } - } - obj.parentNode.removeChild(obj); - } - } - - /* Functions to optimize JavaScript compression - */ - function getElementById(id) { - var el = null; - try { - el = doc.getElementById(id); - } - catch (e) {} - return el; - } - - function createElement(el) { - return doc.createElement(el); - } - - /* Updated attachEvent function for Internet Explorer - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks - */ - function addListener(target, eventType, fn) { - target.attachEvent(eventType, fn); - listenersArr[listenersArr.length] = [target, eventType, fn]; - } - - /* Flash Player and SWF content version matching - */ - function hasPlayerVersion(rv) { - var pv = ua.pv, v = rv.split("."); - v[0] = parseInt(v[0], 10); - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" - v[2] = parseInt(v[2], 10) || 0; - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; - } - - /* Cross-browser dynamic CSS creation - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php - */ - function createCSS(sel, decl, media, newStyle) { - if (ua.ie && ua.mac) { return; } - var h = doc.getElementsByTagName("head")[0]; - if (!h) { return; } // to also support badly authored HTML pages that lack a head element - var m = (media && typeof media == "string") ? media : "screen"; - if (newStyle) { - dynamicStylesheet = null; - dynamicStylesheetMedia = null; - } - if (!dynamicStylesheet || dynamicStylesheetMedia != m) { - // create dynamic stylesheet + get a global reference to it - var s = createElement("style"); - s.setAttribute("type", "text/css"); - s.setAttribute("media", m); - dynamicStylesheet = h.appendChild(s); - if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { - dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; - } - dynamicStylesheetMedia = m; - } - // add style rule - if (ua.ie && ua.win) { - if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { - dynamicStylesheet.addRule(sel, decl); - } - } - else { - if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { - dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); - } - } - } - - function setVisibility(id, isVisible) { - if (!autoHideShow) { return; } - var v = isVisible ? "visible" : "hidden"; - if (isDomLoaded && getElementById(id)) { - getElementById(id).style.visibility = v; - } - else { - createCSS("#" + id, "visibility:" + v); - } - } - - /* Filter to avoid XSS attacks - */ - function urlEncodeIfNecessary(s) { - var regex = /[\\\"<>\.;]/; - var hasBadChars = regex.exec(s) != null; - return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; - } - - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) - */ - var cleanup = function() { - if (ua.ie && ua.win) { - window.attachEvent("onunload", function() { - // remove listeners to avoid memory leaks - var ll = listenersArr.length; - for (var i = 0; i < ll; i++) { - listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); - } - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect - var il = objIdArr.length; - for (var j = 0; j < il; j++) { - removeSWF(objIdArr[j]); - } - // cleanup library's main closures to avoid memory leaks - for (var k in ua) { - ua[k] = null; - } - ua = null; - for (var l in swfobject) { - swfobject[l] = null; - } - swfobject = null; - }); - } - }(); - - return { - /* Public API - - Reference: http://code.google.com/p/swfobject/wiki/documentation - */ - registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { - if (ua.w3 && objectIdStr && swfVersionStr) { - var regObj = {}; - regObj.id = objectIdStr; - regObj.swfVersion = swfVersionStr; - regObj.expressInstall = xiSwfUrlStr; - regObj.callbackFn = callbackFn; - regObjArr[regObjArr.length] = regObj; - setVisibility(objectIdStr, false); - } - else if (callbackFn) { - callbackFn({success:false, id:objectIdStr}); - } - }, - - getObjectById: function(objectIdStr) { - if (ua.w3) { - return getObjectById(objectIdStr); - } - }, - - embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { - var callbackObj = {success:false, id:replaceElemIdStr}; - if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { - setVisibility(replaceElemIdStr, false); - addDomLoadEvent(function() { - widthStr += ""; // auto-convert to string - heightStr += ""; - var att = {}; - if (attObj && typeof attObj === OBJECT) { - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs - att[i] = attObj[i]; - } - } - att.data = swfUrlStr; - att.width = widthStr; - att.height = heightStr; - var par = {}; - if (parObj && typeof parObj === OBJECT) { - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs - par[j] = parObj[j]; - } - } - if (flashvarsObj && typeof flashvarsObj === OBJECT) { - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + k + "=" + flashvarsObj[k]; - } - else { - par.flashvars = k + "=" + flashvarsObj[k]; - } - } - } - if (hasPlayerVersion(swfVersionStr)) { // create SWF - var obj = createSWF(att, par, replaceElemIdStr); - if (att.id == replaceElemIdStr) { - setVisibility(replaceElemIdStr, true); - } - callbackObj.success = true; - callbackObj.ref = obj; - } - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install - att.data = xiSwfUrlStr; - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - return; - } - else { // show alternative content - setVisibility(replaceElemIdStr, true); - } - if (callbackFn) { callbackFn(callbackObj); } - }); - } - else if (callbackFn) { callbackFn(callbackObj); } - }, - - switchOffAutoHideShow: function() { - autoHideShow = false; - }, - - ua: ua, - - getFlashPlayerVersion: function() { - return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; - }, - - hasFlashPlayerVersion: hasPlayerVersion, - - createSWF: function(attObj, parObj, replaceElemIdStr) { - if (ua.w3) { - return createSWF(attObj, parObj, replaceElemIdStr); - } - else { - return undefined; - } - }, - - showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { - if (ua.w3 && canExpressInstall()) { - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - } - }, - - removeSWF: function(objElemIdStr) { - if (ua.w3) { - removeSWF(objElemIdStr); - } - }, - - createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { - if (ua.w3) { - createCSS(selStr, declStr, mediaStr, newStyleBoolean); - } - }, - - addDomLoadEvent: addDomLoadEvent, - - addLoadEvent: addLoadEvent, - - getQueryParamValue: function(param) { - var q = doc.location.search || doc.location.hash; - if (q) { - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark - if (param == null) { - return urlEncodeIfNecessary(q); - } - var pairs = q.split("&"); - for (var i = 0; i < pairs.length; i++) { - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { - return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); - } - } - } - return ""; - }, - - // For internal usage only - expressInstallCallback: function() { - if (isExpressInstallActive) { - var obj = getElementById(EXPRESS_INSTALL_ID); - if (obj && storedAltContent) { - obj.parentNode.replaceChild(storedAltContent, obj); - if (storedAltContentId) { - setVisibility(storedAltContentId, true); - if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } - } - if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } - } - isExpressInstallActive = false; - } - } - }; -}(); diff --git a/CIMFlashBridge/libs/as3corelib.swc b/CIMFlashBridge/libs/as3corelib.swc deleted file mode 100644 index f2cabc6..0000000 Binary files a/CIMFlashBridge/libs/as3corelib.swc and /dev/null differ diff --git a/CIMFlashBridge/src/CIMBridge.as b/CIMFlashBridge/src/CIMBridge.as deleted file mode 100644 index 4a8653a..0000000 --- a/CIMFlashBridge/src/CIMBridge.as +++ /dev/null @@ -1,218 +0,0 @@ -package -{ - import flash.display.Sprite; - import flash.events.Event; - import flash.events.IOErrorEvent; - import flash.events.ProgressEvent; - import flash.events.TimerEvent; - import flash.external.ExternalInterface; - import flash.media.Sound; - import flash.net.Socket; - import flash.net.URLRequest; - import flash.system.Security; - import flash.utils.Timer; - - - public class CIMBridge extends Sprite - { - internal var CIM_HOST:String = "127.0.0.1"; - internal var CIM_PORT:Number = 23456; - internal const TIME_OUT :Number =10000; - internal const RE_CONNECT_TIME :Number = 20000; - internal var socket:Socket = new Socket(); - internal var froceOffline :Boolean = false; - internal const MESSAGE_SEPARATE :String = '\b'; - /** - * 服务端心跳请求命令 - */ - internal const CMD_HEARTBEAT_REQUEST:String="S_H_RQ"; - /** - * 客户端心跳响应命令 - */ - internal const CMD_HEARTBEAT_RESPONSE:String ="C_H_RS"; - - internal var mBuffer :String = ''; - - public function CIMBridge() - { - - ExternalInterface.addCallback("connect",connect); - ExternalInterface.addCallback("bindAccount",bindAccount); - ExternalInterface.addCallback("getOfflineMessage",getOfflineMessage); - ExternalInterface.addCallback("logout",logout); - ExternalInterface.addCallback("playSound",playSound); - - ExternalInterface.call("flashBridgeCreated"); - - } - public function connect(host:String,port:Number):void - { - - CIM_HOST = host; - CIM_PORT = port; - var policyfile:String="xmlsocket://"+CIM_HOST+":"+CIM_PORT; - Security.loadPolicyFile(policyfile);//加载安全策略文件,得到相应的返回才会创建连接 - socket.timeout = TIME_OUT; - socket.addEventListener(Event.CONNECT,sessionCreated);//监听是否连接上服务器 - socket.addEventListener(Event.CLOSE,sessionClosed);//监听套接字连接是否关闭 - socket.addEventListener(IOErrorEvent.IO_ERROR,sessionFailed);//监听套接字连接是否失败 - socket.addEventListener(ProgressEvent.SOCKET_DATA,messageReceived); //监听服务器消息 - socket.connect(CIM_HOST,CIM_PORT);//连接服务器 - - - var timer:Timer = new Timer(TIME_OUT, 1); - timer.addEventListener(TimerEvent.TIMER, function():void{ - if(socket.connected == false){ - sessionFailed(new IOErrorEvent("")); - } - }); - timer.start(); - - } - - public function bindAccount(account:String,deviceId:String):void - { - var xml:String=""; - xml+=""; - xml+="client_bind"; - xml+=""; - xml+=""+account+""; - xml+=""+deviceId+""; - xml+="browse"; - xml+="Flash"; - xml+="2.0.0"; - xml+=""+flash.system.Capabilities.os+""; - xml+=""; - xml+=""; - - send(xml); - - } - - public function getOfflineMessage(account:String):void - { - - var xml:String=""; - xml+=""; - xml+="client_get_offline_message"; - xml+=""; - xml+=""+account+""; - xml+=""; - xml+=""; - send(xml); - - } - - public function logout():void - { - - socket.close(); - - } - - private function sessionCreated(event:Event):void - { - - ExternalInterface.call("sessionCreated"); - froceOffline = false; - } - - - - private function sessionClosed(event:Event):void - { - ExternalInterface.call("sessionClosed"); - - if(!froceOffline) - { - reconnection(); - } - } - - private function sessionFailed(event:Event):void - { - //每隔20秒重新连接 - - ExternalInterface.call("sessionFailed"); - - reconnection(); - - } - - private function reconnection():void{ - var timer:Timer = new Timer(RE_CONNECT_TIME + Math.random() * 10, 1); - timer.addEventListener(TimerEvent.TIMER, function():void{ - connect(CIM_HOST,CIM_PORT); - }); - timer.start(); - - } - - - internal function handleMessage(message:String):void{ - - if(message.toUpperCase() == CMD_HEARTBEAT_REQUEST) - { - send(CMD_HEARTBEAT_RESPONSE); - return; - } - - - var xml:XML=XML(message); - if(xml.name()=="reply"){ - ExternalInterface.call("onReplyReceived",ReplyBody.mappingToJSON(xml)); - } - if(xml.name()=="message"){ - - - if(xml["type"]=="999") - { - froceOffline = true; - } - - ExternalInterface.call("onMessageReceived",Message.mappingToJSON(xml)); - } - } - - /**接受服务器信息*/ - internal function messageReceived(event:ProgressEvent):void - { - - mBuffer+=socket.readMultiByte(socket.bytesAvailable,"UTF-8");; - if(mBuffer.charAt(mBuffer.length-1)!=MESSAGE_SEPARATE){ - - return ; - - }else - { - var array:Array = mBuffer.split(MESSAGE_SEPARATE); - for each(var message:String in array) { - handleMessage(message); - } - - mBuffer = ""; - - } - - } - - - /**发送数据到服务器*/ - internal function send(msg:String):void - { - //新建一个ByteArray来存放数据 - socket.writeUTFBytes(msg+MESSAGE_SEPARATE); - //调用flush方法发送信息 - socket.flush(); - } - - public function playSound(name:String):void - { - internal var _sound:Sound = new Sound(new URLRequest(name)); - _sound.play(1); - } - - - - } -} \ No newline at end of file diff --git a/CIMFlashBridge/src/Message.as b/CIMFlashBridge/src/Message.as deleted file mode 100644 index 602ff31..0000000 --- a/CIMFlashBridge/src/Message.as +++ /dev/null @@ -1,77 +0,0 @@ - -package -{ - import com.adobe.serialization.json.JSON; - - public class Message - { - - - /** - * 消息类型,用户自定义消息类别 - */ - public var mid:String; - - - /** - * 消息类型,用户自定义消息类别 - */ - public var type:String; - /** - * 消息标题 - */ - public var title:String; - /** - * 消息类容,于type 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 - */ - public var content:String = ""; - - - /** - * 消息发送者账号 - */ - public var sender:String; - /** - * 消息发送者接收者 - */ - public var receiver:String; - - /** - * 文件 url - */ - public var file:String; - /** - * 文件类型 - */ - public var fileType:String; - - /** - * content 内容格式 - */ - public var format:String = "txt"; - - - public var timestamp:Number; - - public static function mappingToJSON(xml:XML):Object - { - var message:Message = new Message(); - message.mid = xml["mid"]; - message.type = xml["type"]; - message.title = xml["title"]; - message.sender = xml["sender"]; - message.receiver = xml["receiver"]; - message.file = xml["file"]; - message.fileType = xml["fileType"]; - message.timestamp = xml["timestamp"]; - message.content =xml["content"]; - return com.adobe.serialization.json.JSON.encode(message).toString(); - } - - - - } - - - -} \ No newline at end of file diff --git a/CIMFlashBridge/src/ReplyBody.as b/CIMFlashBridge/src/ReplyBody.as deleted file mode 100644 index 384ad2f..0000000 --- a/CIMFlashBridge/src/ReplyBody.as +++ /dev/null @@ -1,31 +0,0 @@ - -package -{ - import com.adobe.serialization.json.JSON; - - - public class ReplyBody - { - public var key:String; - public var code:String; - public var message:String; - public var data:Object = new Object(); - public var timestamp:Number; - - public static function mappingToJSON(xml:XML):String - { - var body:ReplyBody = new ReplyBody(); - body.key = xml["key"]; - body.code = xml["code"]; - body.timestamp = xml["timestamp"]; - var list:XMLList = xml.elements("data").children(); - for each(var item:XML in list) { - body.data[item.name().toString()] =item.toString(); - } - - return com.adobe.serialization.json.JSON.encode(body); - } - - } - -} \ No newline at end of file diff --git a/CIM客户端文档.doc b/CIM客户端文档.doc deleted file mode 100644 index f601bf3..0000000 Binary files a/CIM客户端文档.doc and /dev/null differ diff --git a/README.md b/README.md index fbf30a1..5e4e5a4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ #说明: 此开源版本为基础功能版本,只有消息推送的基础功能!netty版本,和mina版本结构和功能完全一致,大家可以选择自己喜欢的或者合适的版本学习或者使用! -#侣信专业版1.6.5版本发布 +#侣信专业版1.7.0版本发布 #[http://farsunset.com](http://farsunset.com) diff --git a/cim_for_mina/cim-android-sdk/.classpath b/cim_for_mina/cim-android-sdk/.classpath index 9375b42..7e9f666 100644 --- a/cim_for_mina/cim-android-sdk/.classpath +++ b/cim_for_mina/cim-android-sdk/.classpath @@ -2,7 +2,9 @@ - - + + + + diff --git a/cim_for_mina/cim-android-sdk/.settings/org.eclipse.jdt.core.prefs b/cim_for_mina/cim-android-sdk/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..d17b672 --- /dev/null +++ b/cim_for_mina/cim-android-sdk/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/cim_for_mina/cim-android-sdk/libs/log4j-1.2.17.jar b/cim_for_mina/cim-android-sdk/libs/log4j-1.2.17.jar new file mode 100644 index 0000000..068867e Binary files /dev/null and b/cim_for_mina/cim-android-sdk/libs/log4j-1.2.17.jar differ diff --git a/cim_for_mina/cim-android-sdk/libs/mina-core-2.0.16.jar b/cim_for_mina/cim-android-sdk/libs/mina-core-2.0.16.jar new file mode 100644 index 0000000..0e6d988 Binary files /dev/null and b/cim_for_mina/cim-android-sdk/libs/mina-core-2.0.16.jar differ diff --git a/cim_for_mina/cim-android-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_mina/cim-android-sdk/libs/protobuf-java-3.2.0.jar new file mode 100644 index 0000000..b1f9701 Binary files /dev/null and b/cim_for_mina/cim-android-sdk/libs/protobuf-java-3.2.0.jar differ diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMCacheToolkit.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMCacheToolkit.java index 967fffa..4557dab 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMCacheToolkit.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMCacheToolkit.java @@ -1,11 +1,27 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; +import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; @@ -14,15 +30,17 @@ import android.database.sqlite.SQLiteOpenHelper; class CIMCacheToolkit extends SQLiteOpenHelper { private static final String DATABASE_NAME = "CIM_CONFIG_INFO.db"; - private static final int DATABASE_VERSION = 20160416; + private static final int DATABASE_VERSION = 20160406; + private static final String TABLE_NAME = "T_CIM_CONFIG"; + private static CIMCacheToolkit toolkit; + + private static final String TABLE_SQL = "CREATE TABLE IF NOT EXISTS "+TABLE_NAME+" (KEY VARCHAR(64) PRIMARY KEY,VALUE TEXT)"; - private static final String TABLE_SQL = "CREATE TABLE IF NOT EXISTS T_CIM_CONFIG (KEY VARCHAR(64) PRIMARY KEY,VALUE TEXT)"; + private static final String DELETE_SQL = "DELETE FROM "+TABLE_NAME+" WHERE KEY = ?"; - private static final String DELETE_SQL = "DELETE FROM T_CIM_CONFIG WHERE KEY = ?"; + private static final String QUERY_SQL = "SELECT VALUE FROM "+TABLE_NAME+" WHERE KEY = ?"; - private static final String SAVE_SQL = "INSERT INTO T_CIM_CONFIG (KEY,VALUE) VALUES(?,?)"; - - private static final String QUERY_SQL = "SELECT VALUE FROM T_CIM_CONFIG WHERE KEY = ?"; + private SQLiteDatabase mSQLiteDatabase; public static final String CIM_CONFIG_INFO = "CIM_CONFIG_INFO"; @@ -37,16 +55,15 @@ class CIMCacheToolkit extends SQLiteOpenHelper { public static final String KEY_CIM_SERVIER_PORT = "KEY_CIM_SERVIER_PORT"; public static final String KEY_CIM_CONNECTION_STATE = "KEY_CIM_CONNECTION_STATE"; - - private static CIMCacheToolkit toolkit; - - private SQLiteDatabase mSQLiteDatabase; + public synchronized static CIMCacheToolkit getInstance(Context context){ - if (toolkit==null){ - toolkit = new CIMCacheToolkit(context); - } - return toolkit; + + if(toolkit==null){ + toolkit = new CIMCacheToolkit(context); + } + + return toolkit; } @@ -59,7 +76,6 @@ class CIMCacheToolkit extends SQLiteOpenHelper { } - public synchronized void remove(String key) { getSQLiteDatabase().execSQL(DELETE_SQL,new String[]{key}); @@ -68,8 +84,15 @@ class CIMCacheToolkit extends SQLiteOpenHelper { public synchronized void putString(String key,String value) { - getSQLiteDatabase().execSQL(DELETE_SQL,new String[]{key}); - getSQLiteDatabase().execSQL(SAVE_SQL, new String[]{key, value}); + + ContentValues values = new ContentValues(); + values.put("VALUE", value); + int result = getSQLiteDatabase().updateWithOnConflict(TABLE_NAME, values, "KEY=?",new String[]{key},SQLiteDatabase.CONFLICT_FAIL); + if(result<=0){ + + values.put("KEY", key); + getSQLiteDatabase().insert(TABLE_NAME, null, values); + } } @@ -77,14 +100,15 @@ class CIMCacheToolkit extends SQLiteOpenHelper { { String value = null; Cursor cursor = getSQLiteDatabase().rawQuery(QUERY_SQL, new String[]{key}); - if (cursor!=null&&cursor.moveToFirst()) + if (cursor!=null) { - value = cursor.getString(0); + if(cursor.moveToFirst()){ + value = cursor.getString(0); + } + cursor.close(); } - - - + return value; } @@ -123,6 +147,8 @@ class CIMCacheToolkit extends SQLiteOpenHelper { try{toolkit.close();}catch(Exception e){} } + toolkit = null; + } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMConnectorManager.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMConnectorManager.java index a871c71..80084c7 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMConnectorManager.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMConnectorManager.java @@ -1,15 +1,30 @@ -/** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import java.net.InetSocketAddress; +import java.util.Map; +import java.util.Random; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; import org.apache.mina.core.future.ConnectFuture; import org.apache.mina.core.future.WriteFuture; @@ -19,6 +34,7 @@ import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolCodecFilter; import org.apache.mina.filter.keepalive.KeepAliveFilter; import org.apache.mina.filter.keepalive.KeepAliveMessageFactory; +import org.apache.mina.filter.keepalive.KeepAliveRequestTimeoutHandler; import org.apache.mina.transport.socket.nio.NioSocketConnector; import android.content.Context; import android.content.Intent; @@ -27,10 +43,11 @@ import android.net.NetworkInfo; import android.util.Log; import com.farsunset.cim.sdk.android.constant.CIMConstant; -import com.farsunset.cim.sdk.android.exception.CIMSessionDisableException; -import com.farsunset.cim.sdk.android.exception.NetWorkDisableException; -import com.farsunset.cim.sdk.android.exception.WriteToClosedSessionException; +import com.farsunset.cim.sdk.android.exception.SessionDisconnectedException; +import com.farsunset.cim.sdk.android.exception.NetworkDisconnectedException; import com.farsunset.cim.sdk.android.filter.ClientMessageCodecFactory; +import com.farsunset.cim.sdk.android.model.HeartbeatRequest; +import com.farsunset.cim.sdk.android.model.HeartbeatResponse; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; import com.farsunset.cim.sdk.android.model.SentBody; @@ -40,65 +57,44 @@ import com.farsunset.cim.sdk.android.model.SentBody; * * @author 3979434@qq.com */ -class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFactory{ +class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFactory { - final static String TAG = CIMConnectorManager.class.getSimpleName(); - private NioSocketConnector connector; - private ConnectFuture connectFuture; + private final String TAG = CIMConnectorManager.class.getSimpleName(); + private final int READ_BUFFER_SIZE = 2048;//bit + private final int CONNECT_TIMEOUT = 10 * 1000;//秒 + private final int WRITE_TIMEOUT = 10 * 1000;//秒 - Context context; - - private final int BOTH_IDLE_TIME = 120;//秒 - - private final int HEARBEAT_TIME_OUT = 330 * 1000;// 收到服务端心跳请求超时时间 毫秒 - + private final int READ_IDLE_TIME = 120;//秒 + private final int HEARBEAT_TIME_OUT = (READ_IDLE_TIME + 20) * 1000;// 收到服务端心跳请求超时时间 毫秒 private final String KEY_LAST_HEART_TIME = "KEY_LAST_HEART_TIME" ; + + private NioSocketConnector connector; + private ConnectFuture connectFuture; + private ExecutorService executor = Executors.newFixedThreadPool(1); + private Context context; - static CIMConnectorManager manager; + private static CIMConnectorManager manager; - // 消息广播action - public static final String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; - // 发送sendbody失败广播 - public static final String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; - - // 发送sendbody成功广播 - public static final String ACTION_SENT_SUCCESSED = "com.farsunset.cim.SENT_SUCCESSED"; - // 链接意外关闭广播 - public static final String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; - // 链接失败广播 - public static final String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; - // 链接成功广播 - public static final String ACTION_CONNECTION_SUCCESSED = "com.farsunset.cim.CONNECTION_SUCCESSED"; - // 发送sendbody成功后获得replaybody回应广播 - public static final String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; - // 网络变化广播 - public static final String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; - - // 未知异常 - public static final String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; - //重试连接 - public final static String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; - - private ExecutorService executor; - private CIMConnectorManager(Context ctx) { + private CIMConnectorManager(Context ctx) { context = ctx; - executor = Executors.newCachedThreadPool(); connector = new NioSocketConnector(); - connector.setConnectTimeoutMillis(10 * 1000); + connector.setConnectTimeoutMillis(CONNECT_TIMEOUT); connector.getSessionConfig().setTcpNoDelay(true); - connector.getSessionConfig().setBothIdleTime(BOTH_IDLE_TIME); - connector.getSessionConfig().setReadBufferSize(2048); - connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ClientMessageCodecFactory())); + connector.getSessionConfig().setKeepAlive(true); + connector.getSessionConfig().setReadBufferSize(READ_BUFFER_SIZE); - KeepAliveFilter keepAliveaHandler = new KeepAliveFilter(this, IdleStatus.BOTH_IDLE); + KeepAliveFilter keepAliveaHandler = new KeepAliveFilter(this); + keepAliveaHandler.setRequestInterval(READ_IDLE_TIME); + keepAliveaHandler.setRequestTimeoutHandler(KeepAliveRequestTimeoutHandler.NOOP); keepAliveaHandler.setForwardEvent(true); - connector.getFilterChain().addLast("heartbeat", keepAliveaHandler); - connector.setHandler(this); - + connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ClientMessageCodecFactory())); + connector.getFilterChain().addLast("heartbeat", keepAliveaHandler); + + connector.setHandler(this); } @@ -110,118 +106,103 @@ class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFa } - private synchronized void syncConnection(final String cimServerHost,final int cimServerPort) { + private synchronized void syncConnection(final String host,final int port) { + + if(isConnected()){ + return ; + } + try { - if(isConnected()){ - return ; - } + Log.i(TAG, "****************CIM正在连接服务器 "+host+":"+port+"......"); CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_CONNECTION_STATE, false); - InetSocketAddress remoteSocketAddress = new InetSocketAddress(cimServerHost, cimServerPort); + InetSocketAddress remoteSocketAddress = new InetSocketAddress(host, port); connectFuture = connector.connect(remoteSocketAddress); connectFuture.awaitUninterruptibly(); connectFuture.getSession(); } catch (Exception e) { + long interval = CIMConstant.RECONN_INTERVAL_TIME - (5*1000 - new Random().nextInt(15*1000)); + Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_FAILED); - intent.putExtra("exception", e); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED); + intent.putExtra(Exception.class.getName(), e); + intent.putExtra("interval", interval); context.sendBroadcast(intent); - Log.e(TAG, "******************CIM连接服务器失败 "+cimServerHost+":"+cimServerPort); - - } + Log.e(TAG, "****************CIM连接服务器失败 "+host+":"+port+"......将在"+interval/1000+"秒后重新尝试连接"); + + } } - public void connect(final String cimServerHost, final int cimServerPort) { + public void connect(final String host, final int port) { - - if (!netWorkAvailable(context)) { + if (!isNetworkConnected(context)) { Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_FAILED); - intent.putExtra("exception", new NetWorkDisableException()); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED); + intent.putExtra(Exception.class.getName(), new NetworkDisconnectedException()); context.sendBroadcast(intent); return; } - - Future future = executor.submit(new Runnable() { - @Override - public void run() { - syncConnection(cimServerHost, cimServerPort); - } - }); - try { - if(future.get()!=null) + + executor.execute(new Runnable() { + public void run() { - connect(cimServerHost,cimServerPort); - } - } catch (Exception e) { - - connect(cimServerHost,cimServerPort); - e.printStackTrace(); - } - + syncConnection(host, port); + } + }); } - public void send(final SentBody body) { + public synchronized void send(SentBody body) { - - executor.execute(new Runnable() { - @Override - public void run() { - - IoSession session = getCurrentSession(); - if(session!=null && session.isConnected()) - { - WriteFuture wf = session.write(body); - // 消息发送超时 10秒 - wf.awaitUninterruptibly(10, TimeUnit.SECONDS); - - if (!wf.isWritten()) { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new WriteToClosedSessionException()); - intent.putExtra("sentBody", body); - context.sendBroadcast(intent); - } - }else - { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new CIMSessionDisableException()); - intent.putExtra("sentBody", body); - context.sendBroadcast(intent); - } - } - }); + boolean isSuccessed = false; + + Throwable exception = new SessionDisconnectedException(); + + IoSession session = getCurrentSession(); + if(session!=null && session.isConnected()) + { + WriteFuture wf = session.write(body); + // 消息发送超时 5秒 + wf.awaitUninterruptibly(WRITE_TIMEOUT); + isSuccessed = wf.isWritten(); + exception = wf.getException(); + } + + if(!isSuccessed){ + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_SENT_FAILED); + intent.putExtra(Exception.class.getName(),exception); + intent.putExtra(SentBody.class.getName(), body); + context.sendBroadcast(intent); + } + } public void destroy() { IoSession session = getCurrentSession(); if (session != null) { session.closeNow(); - session.removeAttribute("account"); } if (connector != null && !connector.isDisposed()) { connector.dispose(); } + + + CIMCacheToolkit.destroy(); + manager = null; } public boolean isConnected() { IoSession session = getCurrentSession(); - if (session == null ) { - return false; - } - return session.isConnected() ; + return session != null ; } @@ -237,50 +218,46 @@ class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFa public IoSession getCurrentSession() { - if(connector.getManagedSessionCount()>0) + Map sessions = connector.getManagedSessions(); + for(Long key:sessions.keySet()) { - for(Long key:connector.getManagedSessions().keySet()) - { - return connector.getManagedSessions().get(key); + IoSession session = sessions.get(key); + if(session.isConnected()){ + return session; } } - return null; } + @Override public void sessionCreated(IoSession session) throws Exception { - Log.i(TAG, "******************CIM连接服务器成功:"+session.getLocalAddress()); + Log.i(TAG, "****************CIM连接服务器成功:"+session.getLocalAddress()+" NID:"+session.getId()); setLastHeartbeatTime(session); Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_SUCCESSED); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_SUCCESSED); context.sendBroadcast(intent); } - + @Override - public void sessionOpened(IoSession session) throws Exception { - session.getConfig().setBothIdleTime(180); - } + public void sessionClosed(IoSession session) { - @Override - public void sessionClosed(IoSession session) throws Exception { - - Log.e(TAG, "******************CIM与服务器断开连接:"+session.getLocalAddress()); + Log.e(TAG, "****************CIM与服务器断开连接:"+session.getLocalAddress()+" NID:"+session.getId()); Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_CLOSED); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_CLOSED); context.sendBroadcast(intent); } @Override - public void sessionIdle(IoSession session, IdleStatus status)throws Exception { - Log.d(TAG, "******************CIM与服务器连接空闲:"+session.getLocalAddress() + " isActive:" + session.isActive()+ " isConnected:" + session.isConnected()); + public void sessionIdle(IoSession session, IdleStatus status) { + Log.d(TAG, "****************CIM "+status.toString().toUpperCase()+":"+session.getLocalAddress() +" NID:"+session.getId()+ " isConnected:" + session.isConnected()); /** * 用于解决,wifi情况下。偶而路由器与服务器断开连接时,客户端并没及时收到关闭事件 @@ -291,52 +268,57 @@ class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFa if(System.currentTimeMillis() - lastHeartbeatTime >= HEARBEAT_TIME_OUT) { session.closeNow(); + Log.e(TAG, "****************CIM心跳超时 ,即将重新连接......"+" NID:"+session.getId()); } } @Override - public void exceptionCaught(IoSession session, Throwable cause) - throws Exception { - + public void exceptionCaught(IoSession session, Throwable cause) { + + Log.e(TAG, "****************CIM连接出现未知异常:"+session.getLocalAddress()+" NID:"+session.getId()); + + if(cause!=null && cause.getMessage()!=null){ + Log.e(TAG, cause.getMessage()); + } + Intent intent = new Intent(); - intent.setAction(ACTION_UNCAUGHT_EXCEPTION); - intent.putExtra("exception", cause); + intent.setAction(CIMConstant.IntentAction.ACTION_UNCAUGHT_EXCEPTION); + intent.putExtra(Exception.class.getName(), cause); context.sendBroadcast(intent); } @Override - public void messageReceived(IoSession session, Object obj) - throws Exception { - + public void messageReceived(IoSession session, Object obj){ + if (obj instanceof Message) { Intent intent = new Intent(); - intent.setAction(ACTION_MESSAGE_RECEIVED); - intent.putExtra("message", (Message) obj); + intent.setAction(CIMConstant.IntentAction.ACTION_MESSAGE_RECEIVED); + intent.putExtra(Message.class.getName(), (Message) obj); context.sendBroadcast(intent); } if (obj instanceof ReplyBody) { - Intent intent = new Intent(); - intent.setAction(ACTION_REPLY_RECEIVED); - intent.putExtra("replyBody", (ReplyBody) obj); + intent.setAction(CIMConstant.IntentAction.ACTION_REPLY_RECEIVED); + intent.putExtra(ReplyBody.class.getName(), (ReplyBody) obj); context.sendBroadcast(intent); } } @Override - public void messageSent(IoSession session, Object message) throws Exception { + public void messageSent(IoSession session, Object message) { if(message instanceof SentBody) { Intent intent = new Intent(); - intent.setAction(ACTION_SENT_SUCCESSED); - intent.putExtra("sentBody", (SentBody) message); + intent.setAction(CIMConstant.IntentAction.ACTION_SENT_SUCCESSED); + intent.putExtra(SentBody.class.getName(), (SentBody) message); context.sendBroadcast(intent); } } + private void setLastHeartbeatTime(IoSession session) { session.setAttribute(KEY_LAST_HEART_TIME, System.currentTimeMillis()); @@ -345,14 +327,14 @@ class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFa private long getLastHeartbeatTime(IoSession session) { long time = 0; - Object value ; - if((value = session.getAttribute(KEY_LAST_HEART_TIME)) !=null){ + Object value = session.getAttribute(KEY_LAST_HEART_TIME); + if(value !=null){ time = Long.parseLong(value.toString()); } return time; } - public static boolean netWorkAvailable(Context context) { + public static boolean isNetworkConnected(Context context) { try { ConnectivityManager nw = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = nw.getActiveNetworkInfo(); @@ -362,14 +344,15 @@ class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFa return false; } + @Override public Object getRequest(IoSession arg0) { return null; } @Override - public Object getResponse(IoSession arg0, Object arg1) { - return CIMConstant.CMD_HEARTBEAT_RESPONSE; + public Object getResponse(IoSession session, Object arg1) { + return HeartbeatResponse.getInstance(); } @Override @@ -377,12 +360,11 @@ class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFa setLastHeartbeatTime(session); - return CIMConstant.CMD_HEARTBEAT_REQUEST.equalsIgnoreCase(data.toString()); + return data instanceof HeartbeatRequest; } @Override public boolean isResponse(IoSession arg0, Object arg1) { return false; } - -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java index d95d0de..596b8f2 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java @@ -1,14 +1,30 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; + import com.farsunset.cim.sdk.android.constant.CIMConstant; -import com.farsunset.cim.sdk.android.exception.CIMSessionDisableException; +import com.farsunset.cim.sdk.android.exception.SessionDisconnectedException; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; import com.farsunset.cim.sdk.android.model.SentBody; @@ -18,28 +34,24 @@ import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; -import android.os.Handler; /** * 消息入口,所有消息都会经过这里 */ -public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver implements CIMEventListener { +public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver{ - public Context context; + protected Context context; @Override - public void onReceive(Context ctx, Intent it) { + public void onReceive(Context ctx, Intent intent) { context = ctx; - - /* * 操作事件广播,用于提高service存活率 */ - if(it.getAction().equals(Intent.ACTION_USER_PRESENT) - ||it.getAction().equals(Intent.ACTION_POWER_CONNECTED) - ||it.getAction().equals(Intent.ACTION_POWER_DISCONNECTED) - ) + if(intent.getAction().equals(Intent.ACTION_USER_PRESENT) + ||intent.getAction().equals(Intent.ACTION_POWER_CONNECTED) + ||intent.getAction().equals(Intent.ACTION_POWER_DISCONNECTED)) { startPushService(); } @@ -48,17 +60,16 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl /* * 设备网络状态变化事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_NETWORK_CHANGED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED)) { ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); - android.net.NetworkInfo info = connectivityManager.getActiveNetworkInfo(); - onDevicesNetworkChanged(info); + onDevicesNetworkChanged(connectivityManager.getActiveNetworkInfo()); } /* * cim断开服务器事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_CLOSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_CLOSED)) { onInnerConnectionClosed(); } @@ -66,15 +77,16 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl /* * cim连接服务器失败事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_FAILED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED)) { - onInnerConnectionFailed((Exception) it.getSerializableExtra("exception")); + long interval = intent.getLongExtra("interval", CIMConstant.RECONN_INTERVAL_TIME); + onConnectionFailed((Exception) intent.getSerializableExtra(Exception.class.getName()),interval); } /* * cim连接服务器成功事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_SUCCESSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_SUCCESSED)) { onInnerConnectionSuccessed(); } @@ -82,94 +94,84 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl /* * 收到推送消息事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_MESSAGE_RECEIVED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_MESSAGE_RECEIVED)) { - onInnerMessageReceived((Message)it.getSerializableExtra("message")); + onInnerMessageReceived((Message)intent.getSerializableExtra(Message.class.getName()),intent); } /* * 获取收到replybody成功事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_REPLY_RECEIVED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_REPLY_RECEIVED)) { - onReplyReceived((ReplyBody)it.getSerializableExtra("replyBody")); + onReplyReceived((ReplyBody)intent.getSerializableExtra(ReplyBody.class.getName())); } /* * 获取sendbody发送失败事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_SENT_FAILED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_SENT_FAILED)) { - onSentFailed((Exception) it.getSerializableExtra("exception"),(SentBody)it.getSerializableExtra("sentBody")); + Exception exception = (Exception) intent.getSerializableExtra(Exception.class.getName()); + SentBody sentBody = (SentBody)intent.getSerializableExtra(SentBody.class.getName()); + onSentFailed(exception,sentBody); } /* * 获取sendbody发送成功事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_SENT_SUCCESSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_SENT_SUCCESSED)) { - onSentSucceed((SentBody)it.getSerializableExtra("sentBody")); + onSentSucceed((SentBody)intent.getSerializableExtra(SentBody.class.getName())); } /* * 获取cim数据传输异常事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_UNCAUGHT_EXCEPTION)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_UNCAUGHT_EXCEPTION)) { - onUncaughtException((Exception)it.getSerializableExtra("exception")); + onUncaughtException((Exception)intent.getSerializableExtra(Exception.class.getName())); } /* * 重新连接,如果断开的话 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_RECOVERY)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_RECOVERY)) { - CIMPushManager.connect(context); + CIMPushManager.connect(context,0); } } - private void startPushService() - { + private void startPushService(){ Intent intent = new Intent(context, CIMPushService.class); intent.setAction(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE); context.startService(intent); } + private void onInnerConnectionClosed(){ CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_CONNECTION_STATE, false); - if(CIMConnectorManager.netWorkAvailable(context)) + if(CIMConnectorManager.isNetworkConnected(context)) { - CIMPushManager.connect(context); + CIMPushManager.connect(context,0); } onConnectionClosed(); } - - Handler connectionHandler = new Handler(){ - @Override - public void handleMessage(android.os.Message message){ - CIMPushManager.connect(context); - } - }; - private void onInnerConnectionFailed(Exception e){ + private void onConnectionFailed(Exception e,long reinterval){ - if(CIMConnectorManager.netWorkAvailable(context)) + if(CIMConnectorManager.isNetworkConnected(context)) { - connectionHandler.sendEmptyMessageDelayed(0, CIMConstant.RECONN_INTERVAL_TIME); + onConnectionFailed(); + + CIMPushManager.connect(context,reinterval); } - - onConnectionFailed(e); } - - - - - private void onInnerConnectionSuccessed(){ CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_CONNECTION_STATE, true); @@ -179,34 +181,36 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl private void onUncaughtException(Throwable arg0) {} - - private void onDevicesNetworkChanged(NetworkInfo info) { if(info !=null) { - CIMPushManager.connect(context); + CIMPushManager.connect(context,0); } onNetworkChanged(info); } - private void onInnerMessageReceived(com.farsunset.cim.sdk.android.model.Message message) - { - if(CIMConstant.MessageType.TYPE_999.equals(message.getType())) + private void onInnerMessageReceived(com.farsunset.cim.sdk.android.model.Message message, Intent intent){ + if(isForceOfflineMessage(message.getAction())) { - CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_MANUAL_STOP,true); + CIMPushManager.stop(context); } - onMessageReceived(message); + onMessageReceived(message,intent); } - private void onSentFailed(Exception e, SentBody body){ + private boolean isForceOfflineMessage(String action) + { + return CIMConstant.MessageAction.ACTION_999.equals(action) || CIMConstant.MessageAction.ACTION_444.equals(action); + } + + private void onSentFailed(Exception e, SentBody body){ //与服务端端开链接,重新连接 - if(e instanceof CIMSessionDisableException) + if(e instanceof SessionDisconnectedException) { - CIMPushManager.connect(context); + CIMPushManager.connect(context,0); }else { //发送失败 重新发送 @@ -215,13 +219,32 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl } - private void onSentSucceed(SentBody body){} - @Override - public abstract void onMessageReceived(Message message); - @Override - public abstract void onReplyReceived(ReplyBody body); - public abstract void onNetworkChanged(NetworkInfo info); - public abstract void onConnectionFailed(Exception e); + + + public abstract void onMessageReceived(com.farsunset.cim.sdk.android.model.Message message,Intent intent); + + public void onNetworkChanged(NetworkInfo info) { + CIMListenerManager.notifyOnNetworkChanged(info); + } + + public void onConnectionSuccessed(boolean hasAutoBind) { + CIMListenerManager.notifyOnConnectionSuccessed(hasAutoBind); + } + + public void onConnectionClosed() { + CIMListenerManager.notifyOnConnectionClosed(); + } + + public void onConnectionFailed() { + CIMListenerManager.notifyOnConnectionFailed(); + } + + public void onReplyReceived(ReplyBody body) { + CIMListenerManager.notifyOnReplyReceived(body); + } + public void onSentSucceed(SentBody body){ + CIMListenerManager.notifyOnSentSucceed(body); + } } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventListener.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventListener.java index 18928e3..1bc8191 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventListener.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventListener.java @@ -1,15 +1,31 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import android.net.NetworkInfo; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.cim.sdk.android.model.SentBody; /** *CIM 主要事件接口 @@ -22,36 +38,49 @@ public interface CIMEventListener * 当收到服务端推送过来的消息时调用 * @param message */ - public abstract void onMessageReceived(Message message); + void onMessageReceived(Message message); /** * 当调用CIMPushManager.sendRequest()向服务端发送请求,获得相应时调用 * @param replybody */ - public abstract void onReplyReceived(ReplyBody replybody); + void onReplyReceived(ReplyBody replybody); + /** + * 当调用CIMPushManager.sendRequest()向服务端发送请求成功时 + * @param body + */ + void onSentSuccessed(SentBody body); + + /** * 当手机网络发生变化时调用 * @param networkinfo */ - public abstract void onNetworkChanged(NetworkInfo networkinfo); + void onNetworkChanged(NetworkInfo networkinfo); /** * 当连接服务器成功时回调 * @param hasAutoBind : true 已经自动绑定账号到服务器了,不需要再手动调用bindAccount */ - public abstract void onConnectionSuccessed(boolean hasAutoBind); + void onConnectionSuccessed(boolean hasAutoBind); /** * 当断开服务器连接的时候回调 - */ - public abstract void onConnectionClosed(); - - /** - * 当服务器连接失败的时候回调 * */ - public abstract void onConnectionFailed(Exception e); + void onConnectionClosed(); + + /** + * 当连接服务器失败的时候回调 + * + */ + void onConnectionFailed(); + + /** + * 监听器在容器里面的排序。值越大则越先接收 + */ + int getEventDispatchOrder(); } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMListenerManager.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMListenerManager.java index 1c9c845..0008d0d 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMListenerManager.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMListenerManager.java @@ -1,22 +1,33 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import com.farsunset.cim.sdk.android.constant.CIMConstant; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.cim.sdk.android.model.SentBody; -import android.app.Activity; -import android.content.Context; -import android.content.pm.ActivityInfo; -import android.content.pm.PackageManager; import android.net.NetworkInfo; import android.util.Log; @@ -27,15 +38,13 @@ import android.util.Log; public class CIMListenerManager { private static ArrayList cimListeners = new ArrayList(); + private static CIMMessageReceiveComparator comparator = new CIMMessageReceiveComparator(); - - - public static void registerMessageListener(CIMEventListener listener,Context mcontext) { + public static void registerMessageListener(CIMEventListener listener) { if (!cimListeners.contains(listener)) { cimListeners.add(listener); - // 按照接收顺序倒序 - Collections.sort(cimListeners, new CIMMessageReceiveComparator(mcontext)); + Collections.sort(cimListeners,comparator); } } @@ -73,6 +82,12 @@ public class CIMListenerManager { } } + public static void notifyOnConnectionFailed() { + for (CIMEventListener listener : cimListeners) { + listener.onConnectionFailed(); + } + } + public static void notifyOnReplyReceived(ReplyBody body) { for (CIMEventListener listener : cimListeners) { @@ -80,11 +95,12 @@ public class CIMListenerManager { } } - public static void notifyOnConnectionFailed(Exception e) { + public static void notifyOnSentSucceed(SentBody body) { for (CIMEventListener listener : cimListeners) { - listener.onConnectionFailed(e); + listener.onSentSuccessed(body); } } + public static void destory() { cimListeners.clear(); @@ -99,47 +115,17 @@ public class CIMListenerManager { /** * 消息接收activity的接收顺序排序,CIM_RECEIVE_ORDER倒序 */ - static class CIMMessageReceiveComparator implements Comparator{ + private static class CIMMessageReceiveComparator implements Comparator{ - Context mcontext; - public CIMMessageReceiveComparator(Context ctx) - { - mcontext = ctx; - } - @Override public int compare(CIMEventListener arg1, CIMEventListener arg2) { - Integer order1 = CIMConstant.CIM_DEFAULT_MESSAGE_ORDER; - Integer order2 = CIMConstant.CIM_DEFAULT_MESSAGE_ORDER; - ActivityInfo info; - if (arg1 instanceof Activity ) { - - try { - info = mcontext.getPackageManager() .getActivityInfo(((Activity)(arg1)).getComponentName(), PackageManager.GET_META_DATA); - if(info.metaData!=null) - { - order1 = info.metaData.getInt("CIM_RECEIVE_ORDER"); - } - - } catch (Exception e) {} - } - - if (arg1 instanceof Activity ) { - try { - info = mcontext.getPackageManager() .getActivityInfo(((Activity)(arg2)).getComponentName(), PackageManager.GET_META_DATA); - if(info.metaData!=null) - { - order2 = info.metaData.getInt("CIM_RECEIVE_ORDER"); - } - - } catch (Exception e) {} - } - - return order2.compareTo(order1); + int order1 = arg1.getEventDispatchOrder(); + int order2 = arg2.getEventDispatchOrder(); + return order2 - order1 ; } - } -} \ No newline at end of file + +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushManager.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushManager.java index c98c48f..6d27800 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushManager.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushManager.java @@ -1,9 +1,24 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import java.util.UUID; @@ -33,27 +48,20 @@ public class CIMPushManager { static String KEY_SEND_BODY ="KEY_SEND_BODY"; - static String KEY_CIM_CONNECTION_STATUS ="KEY_CIM_CONNECTION_STATUS"; - //被销毁的destroy() - public static final int STATE_DESTROYED = 0x0000DE; - //被销停止的 stop() - public static final int STATE_STOPED = 0x0000EE; - - public static final int STATE_NORMAL = 0x000000; /** * 初始化,连接服务端,在程序启动页或者 在Application里调用 * @param context * @param ip * @param port */ - public static void connect(Context context,String host,int port){ + public static void connect(Context context,String host,int port){ - connect(context,host,port,false); + connect(context,host,port,false,0); - } + } -private static void connect(Context context,String ip,int port,boolean autoBind){ + private static void connect(Context context,String ip,int port,boolean autoBind,long delayedTime){ CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED, false); CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_MANUAL_STOP, false); @@ -69,12 +77,13 @@ private static void connect(Context context,String ip,int port,boolean autoBind Intent serviceIntent = new Intent(context, CIMPushService.class); serviceIntent.putExtra(CIMCacheToolkit.KEY_CIM_SERVIER_HOST, ip); serviceIntent.putExtra(CIMCacheToolkit.KEY_CIM_SERVIER_PORT, port); + serviceIntent.putExtra(CIMPushService.KEY_DELAYED_TIME, delayedTime); serviceIntent.setAction(ACTION_CREATE_CIM_CONNECTION); context.startService(serviceIntent); - } + } - protected static void connect(Context context){ + protected static void connect(Context context,long delayedTime){ boolean isManualStop = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_MANUAL_STOP); boolean isManualDestory = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED); @@ -87,9 +96,9 @@ private static void connect(Context context,String ip,int port,boolean autoBind String host = CIMCacheToolkit.getInstance(context).getString( CIMCacheToolkit.KEY_CIM_SERVIER_HOST); int port =CIMCacheToolkit.getInstance(context).getInt( CIMCacheToolkit.KEY_CIM_SERVIER_PORT); - connect(context,host,port,true); + connect(context,host,port,true,delayedTime); - } + } /** @@ -104,6 +113,7 @@ private static void connect(Context context,String ip,int port,boolean autoBind { return ; } + sendBindRequest(context,account); } @@ -132,8 +142,7 @@ private static void connect(Context context,String ip,int port,boolean autoBind String account = CIMCacheToolkit.getInstance(context).getString(CIMCacheToolkit.KEY_ACCOUNT); boolean isManualDestory = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED); - boolean isManualStoped = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_MANUAL_STOP); - if( isManualStoped || account==null || account.trim().length()==0 || isManualDestory ) + if( account==null || account.trim().length()==0 || isManualDestory ) { return false; } @@ -195,7 +204,7 @@ private static void connect(Context context,String ip,int port,boolean autoBind CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED, true); - CIMCacheToolkit.getInstance(context).remove(CIMCacheToolkit.KEY_ACCOUNT); + CIMCacheToolkit.getInstance(context).putString(CIMCacheToolkit.KEY_ACCOUNT, null); Intent serviceIntent = new Intent(context, CIMPushService.class); serviceIntent.setAction(ACTION_DESTORY); @@ -205,9 +214,8 @@ private static void connect(Context context,String ip,int port,boolean autoBind /** - * 重新恢复接收推送,重新连接服务端,并登录当前账号如果aotuBind == true + * 重新恢复接收推送,重新连接服务端,并登录当前账号 * @param context - * @param aotuBind */ public static void resume(Context context){ @@ -223,19 +231,7 @@ private static void connect(Context context,String ip,int port,boolean autoBind return CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_CIM_CONNECTION_STATE); } - public static int getState(Context context){ - boolean isManualDestory = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED); - if(isManualDestory){ - return STATE_DESTROYED; - } - - boolean isManualStop = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_MANUAL_STOP); - if(isManualStop){ - return STATE_STOPED; - } - - return STATE_NORMAL; - } + private static String getVersionName(Context context) { String versionName = null; @@ -246,5 +242,5 @@ private static void connect(Context context,String ip,int port,boolean autoBind } return versionName; } - -} \ No newline at end of file + +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java index d52317d..9ae1cc7 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java @@ -1,54 +1,88 @@ - /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import android.app.Service; -import android.content.Context; import android.content.Intent; +import android.os.Handler; import android.os.IBinder; -import android.os.PowerManager; -import android.os.PowerManager.WakeLock; +import android.os.Message; import android.util.Log; - import com.farsunset.cim.sdk.android.model.SentBody; /** * 与服务端连接服务 + * @author 3979434 * */ public class CIMPushService extends Service { - final static String TAG = CIMPushService.class.getSimpleName(); - protected final static int DEF_CIM_PORT = 28888; - CIMConnectorManager manager; - WakeLock wakeLock; + private final String TAG = CIMPushService.class.getSimpleName(); + public final static String KEY_DELAYED_TIME ="KEY_DELAYED_TIME"; + private CIMConnectorManager manager; @Override public void onCreate() { manager = CIMConnectorManager.getManager(this.getApplicationContext()); - PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); - wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, CIMPushService.class.getName()); } + + Handler connectionHandler = new Handler(){ + @Override + public void handleMessage(android.os.Message message){ + + connectionHandler.removeMessages(0); + + String host = message.getData().getString(CIMCacheToolkit.KEY_CIM_SERVIER_HOST); + int port = message.getData().getInt(CIMCacheToolkit.KEY_CIM_SERVIER_PORT,0); + manager.connect(host, port); + } + }; + @Override public int onStartCommand(Intent intent,int flags, int startId) { - if(intent==null) - { - return START_STICKY; - } + + intent = (intent == null ? new Intent(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE) : intent); String action = intent.getAction(); if(CIMPushManager.ACTION_CREATE_CIM_CONNECTION.equals(action)) { - String host = CIMCacheToolkit.getInstance(this).getString(CIMCacheToolkit.KEY_CIM_SERVIER_HOST); - int port =CIMCacheToolkit.getInstance(this).getInt(CIMCacheToolkit.KEY_CIM_SERVIER_PORT); - manager.connect(host,port); + + long delayMillis = intent.getLongExtra(KEY_DELAYED_TIME,0); + if( delayMillis > 0){ + + Message msg = connectionHandler.obtainMessage(); + msg.what = 0; + msg.setData(intent.getExtras()); + connectionHandler.sendMessageDelayed(msg, delayMillis); + + }else + { + String host = intent.getStringExtra(CIMCacheToolkit.KEY_CIM_SERVIER_HOST); + int port = intent.getIntExtra(CIMCacheToolkit.KEY_CIM_SERVIER_PORT,0); + manager.connect(host,port); + } } if(CIMPushManager.ACTION_SEND_REQUEST_BODY.equals(action)) @@ -65,7 +99,6 @@ import com.farsunset.cim.sdk.android.model.SentBody; { manager.destroy(); this.stopSelf(); - android.os.Process.killProcess(android.os.Process.myPid()); } if(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE.equals(action) ) @@ -73,42 +106,23 @@ import com.farsunset.cim.sdk.android.model.SentBody; if(!manager.isConnected()){ boolean isManualStop = CIMCacheToolkit.getInstance(this).getBoolean(CIMCacheToolkit.KEY_MANUAL_STOP); - Log.i(TAG, "CIM.isConnected() == false, isManualStop == " + isManualStop); - CIMPushManager.connect(this); - + Log.w(TAG, "manager.isConnected() == false, isManualStop == " + isManualStop); + CIMPushManager.connect(this,0); + }else { - Log.i(TAG, "CIM.isConnected() == true"); + Log.i(TAG, "manager.isConnected() == true"); } } - try{ - if(!wakeLock.isHeld()) - { - this.wakeLock.acquire(); - } - }catch(Exception e){} - - + return START_STICKY; } - - - public void onDestroy() - { - super.onDestroy(); - if(wakeLock.isHeld()) - { - this.wakeLock.release(); - wakeLock = null; - } - } - @Override public IBinder onBind(Intent arg0) { return null; } - + } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java index c0a0438..8198c48 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java @@ -1,9 +1,24 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.constant; /** @@ -11,57 +26,90 @@ package com.farsunset.cim.sdk.android.constant; */ public interface CIMConstant { + long RECONN_INTERVAL_TIME= 30 * 1000; - public static String UTF8="UTF-8"; - - public static byte MESSAGE_SEPARATE='\b'; - - public static long RECONN_INTERVAL_TIME= 30 * 1000; - - public static int CIM_DEFAULT_MESSAGE_ORDER=1; - - public static class ReturnCode{ + //消息头长度为3个字节,第一个字节为消息类型,第二,第三字节 转换int后为消息长度 + int DATA_HEADER_LENGTH = 3; + public static interface ReturnCode{ - public static String CODE_404 ="404"; + String CODE_404 ="404"; - public static String CODE_403 ="403"; + String CODE_403 ="403"; - public static String CODE_405 ="405"; + String CODE_405 ="405"; - public static String CODE_200 ="200"; + String CODE_200 ="200"; - public static String CODE_206 ="206"; + String CODE_206 ="206"; - public static String CODE_500 ="500"; + String CODE_500 ="500"; } - - /** - * 服务端心跳请求命令 cmd_server_hb_request - */ - public static final String CMD_HEARTBEAT_REQUEST="S_H_RQ"; - /** - * 客户端心跳响应命令 cmd_client_hb_response - */ - public static final String CMD_HEARTBEAT_RESPONSE ="C_H_RS"; - - public static class RequestKey{ + + + public static interface ProtobufType{ + byte C_H_RS = 0; + byte S_H_RQ = 1; + byte MESSAGE = 2; + byte SENTBODY = 3; + byte REPLYBODY = 4; + } + + public static interface RequestKey{ - public static String CLIENT_BIND ="client_bind"; + String CLIENT_BIND ="client_bind"; - public static String CLIENT_OFFLINE_MESSAGE ="client_get_offline_message"; + String CLIENT_LOGOUT ="client_logout"; + + @Deprecated + String CLIENT_PULL_MESSAGE ="client_pull_message"; } - public static class MessageType{ + public static interface MessageAction{ - //用户会 踢出下线消息类型 - public static String TYPE_999 ="999"; - - } + //被其他设备登录挤下线消息 + String ACTION_999 ="999"; + //被系统禁用消息 + String ACTION_444 ="444"; + } -} \ No newline at end of file + + public static interface IntentAction{ + + // 消息广播action + String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; + + // 发送sendbody失败广播 + String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; + + // 发送sendbody成功广播 + String ACTION_SENT_SUCCESSED = "com.farsunset.cim.SENT_SUCCESSED"; + + // 链接意外关闭广播 + String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; + + // 链接失败广播 + String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; + + // 链接成功广播 + String ACTION_CONNECTION_SUCCESSED = "com.farsunset.cim.CONNECTION_SUCCESSED"; + + // 发送sendbody成功后获得replaybody回应广播 + String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; + + // 网络变化广播 + String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; + + // 未知异常 + String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; + + //重试连接 + String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; + } + +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/CIMSessionDisableException.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/CIMSessionDisableException.java deleted file mode 100644 index eb3a005..0000000 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/CIMSessionDisableException.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.android.exception; - - -public class CIMSessionDisableException extends Exception { - - private static final long serialVersionUID = 1L; - - public CIMSessionDisableException() { - super(); - } - - public CIMSessionDisableException(String s) { - super(s); - } -} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetWorkDisableException.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetWorkDisableException.java deleted file mode 100644 index d549e9f..0000000 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetWorkDisableException.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.android.exception; - - -public class NetWorkDisableException extends Exception { - - private static final long serialVersionUID = 1L; - - public NetWorkDisableException() { - super(); - } - - public NetWorkDisableException(String s) { - super(s); - } -} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetworkDisconnectedException.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetworkDisconnectedException.java new file mode 100644 index 0000000..151d878 --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetworkDisconnectedException.java @@ -0,0 +1,36 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.exception; + + +public class NetworkDisconnectedException extends Exception { + + private static final long serialVersionUID = 1L; + + public NetworkDisconnectedException() { + super(); + } + + public NetworkDisconnectedException(String s) { + super(s); + } +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/SessionDisconnectedException.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/SessionDisconnectedException.java new file mode 100644 index 0000000..149098d --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/SessionDisconnectedException.java @@ -0,0 +1,36 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.exception; + + +public class SessionDisconnectedException extends Exception { + + private static final long serialVersionUID = 1L; + + public SessionDisconnectedException() { + super(); + } + + public SessionDisconnectedException(String s) { + super(s); + } +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/WriteToClosedSessionException.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/WriteToClosedSessionException.java deleted file mode 100644 index 5c925a6..0000000 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/WriteToClosedSessionException.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.android.exception; - -import java.io.Serializable; - - -public class WriteToClosedSessionException extends Exception implements Serializable { - - private static final long serialVersionUID = 1L; - - public WriteToClosedSessionException() { - super(); - } - - public WriteToClosedSessionException(String s) { - super(s); - } -} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageCodecFactory.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageCodecFactory.java index dd86e15..7aab39b 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageCodecFactory.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageCodecFactory.java @@ -1,9 +1,24 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.filter; import org.apache.mina.core.session.IoSession; @@ -12,33 +27,28 @@ import org.apache.mina.filter.codec.ProtocolDecoder; import org.apache.mina.filter.codec.ProtocolEncoder; /** - * android客户端端消息 编码解码器, 可以在 - * 关于消息加密与加密, 可在 encoder时进行消息加密,在ServerMessageCodecFactory的 decoder时对消息解密 + * android客户端端消息 编码解码器 */ public class ClientMessageCodecFactory implements ProtocolCodecFactory { + /** + * 消息编码器 + */ private final ClientMessageEncoder encoder; - + /** + * 消息解码器 + */ private final ClientMessageDecoder decoder; - /** - * Constructor. - */ + public ClientMessageCodecFactory() { encoder = new ClientMessageEncoder(); decoder = new ClientMessageDecoder(); } - - /** - * Returns a new (or reusable) instance of ProtocolEncoder. - */ + public ProtocolEncoder getEncoder(IoSession session) throws Exception { return encoder; } - - /** - * Returns a new (or reusable) instance of ProtocolDecoder. - */ public ProtocolDecoder getDecoder(IoSession session) throws Exception { return decoder; } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java index dbff0d8..3da1a6c 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java @@ -1,29 +1,40 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.filter; -import java.io.ByteArrayInputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.CumulativeProtocolDecoder; import org.apache.mina.filter.codec.ProtocolDecoderOutput; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - import android.util.Log; import com.farsunset.cim.sdk.android.constant.CIMConstant; +import com.farsunset.cim.sdk.android.model.HeartbeatRequest; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.cim.sdk.android.model.proto.MessageProto; +import com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto; +import com.google.protobuf.InvalidProtocolBufferException; /** * 客户端消息解码 */ @@ -33,141 +44,100 @@ public class ClientMessageDecoder extends CumulativeProtocolDecoder { @Override - public boolean doDecode(IoSession iosession, IoBuffer iobuffer,ProtocolDecoderOutput out) throws Exception { - - boolean complete = false; - IoBuffer tBuffer = IoBuffer.allocate(320).setAutoExpand(true); - iobuffer.mark(); - - while (iobuffer.hasRemaining()) { - byte b = iobuffer.get(); - /** - * CIMConstant.MESSAGE_SEPARATE 为消息界限 - * 当一次收到多个消息时,以此分隔解析多个消息 - */ - if (b == CIMConstant.MESSAGE_SEPARATE) { + public boolean doDecode(IoSession iosession, IoBuffer iobuffer, + ProtocolDecoderOutput out) throws Exception { - complete = true; - break; - } else { - tBuffer.put(b); - } - } - - if (complete) { - tBuffer.flip(); - byte[] bytes = new byte[tBuffer.limit()]; - tBuffer.get(bytes); - String message = new String(bytes, CIMConstant.UTF8); - tBuffer.clear(); - - try - { - Object msg = mappingMessageObject(message); - out.write(msg); - }catch(Exception e) - { - e.printStackTrace(); - } - }else - { - iobuffer.reset();//如果消息没有接收完整,对buffer进行重置,下次继续读取 - } - - return complete; - } - - private Object mappingMessageObject(String message) throws Exception { - - - Log.i(TAG,message.toString()); - - if(CIMConstant.CMD_HEARTBEAT_REQUEST.equalsIgnoreCase(message)) - { - return message; - } - - - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = (Document) builder.parse(new ByteArrayInputStream(message.getBytes(CIMConstant.UTF8))); + /** + * 消息头3位 + */ + if(iobuffer.remaining() < CIMConstant.DATA_HEADER_LENGTH){ + return false; + } + + iobuffer.mark(); + + byte conetnType = iobuffer.get(); + + byte lv =iobuffer.get();//int 低位 + byte hv =iobuffer.get();//int 高位 + + int conetnLength = getContentLength(lv,hv); + + //如果消息体没有接收完整,则重置读取,等待下一次重新读取 + if(conetnLength > iobuffer.remaining()){ + iobuffer.reset(); + return false; + } + + byte[] dataBytes = new byte[conetnLength]; + iobuffer.get(dataBytes, 0, conetnLength); - String name = doc.getDocumentElement().getTagName(); - if (name.equals("reply")) { - ReplyBody reply = new ReplyBody(); - reply.setKey(doc.getElementsByTagName("key").item(0).getTextContent()); - reply.setCode(doc.getElementsByTagName("code").item(0).getTextContent()); - NodeList items = doc.getElementsByTagName("data").item(0).getChildNodes(); - for (int i = 0; i < items.getLength(); i++) { - Node node = items.item(i); - reply.put(node.getNodeName(), node.getTextContent()); - } - return reply; - } - if (name.equals("message")) { - - Message body = new Message(); - NodeList nodeList = doc.getElementsByTagName("message").item(0).getChildNodes(); - int count = nodeList.getLength(); - for(int i = 0;i < count; i++){ - Node node = nodeList.item(i); - - if(node.getNodeName().equals("mid")) - { - body.setMid(node.getTextContent()); - } - - if(node.getNodeName().equals("type")) - { - body.setType(node.getTextContent()); - } - - if(node.getNodeName().equals("content")) - { - body.setContent(node.getTextContent()); - } - - if(node.getNodeName().equals("file")) - { - body.setFile(node.getTextContent()); - } - - if(node.getNodeName().equals("fileType")) - { - body.setFileType(node.getTextContent()); - } - - if(node.getNodeName().equals("title")) - { - body.setTitle(node.getTextContent()); - } - - if(node.getNodeName().equals("sender")) - { - body.setSender(node.getTextContent()); - } - - if(node.getNodeName().equals("receiver")) - { - body.setReceiver(node.getTextContent()); - } - - if(node.getNodeName().equals("format")) - { - body.setFormat(node.getTextContent()); - } - - if(node.getNodeName().equals("timestamp")) - { - body.setTimestamp(Long.valueOf(node.getTextContent())); - } - } - - return body; - } - - return null; + Object message = mappingMessageObject(dataBytes,conetnType); + if(message!=null){ + out.write(message); + } + + return true; } + private Object mappingMessageObject(byte[] bytes,byte type) throws InvalidProtocolBufferException { + + + + if(CIMConstant.ProtobufType.S_H_RQ == type) + { + HeartbeatRequest request = HeartbeatRequest.getInstance(); + Log.i(TAG,request.toString()); + return request; + } + + if(CIMConstant.ProtobufType.REPLYBODY == type) + { + ReplyBodyProto.Model bodyProto = ReplyBodyProto.Model.parseFrom(bytes); + ReplyBody body = new ReplyBody(); + body.setKey(bodyProto.getKey()); + body.setTimestamp(bodyProto.getTimestamp()); + body.putAll(bodyProto.getDataMap()); + body.setCode(bodyProto.getCode()); + body.setMessage(bodyProto.getMessage()); + + Log.i(TAG,body.toString()); + + return body; + } + + if(CIMConstant.ProtobufType.MESSAGE == type) + { + MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bytes); + Message message = new Message(); + message.setMid(bodyProto.getMid()); + message.setAction(bodyProto.getAction()); + message.setContent(bodyProto.getContent()); + message.setSender(bodyProto.getSender()); + message.setReceiver(bodyProto.getReceiver()); + message.setTitle(bodyProto.getTitle()); + message.setExtra(bodyProto.getExtra()); + message.setTimestamp(bodyProto.getTimestamp()); + message.setFormat(bodyProto.getFormat()); + + Log.i(TAG,message.toString()); + return message; + } + + return null; + + } + + /** + * 解析消息体长度 + * @param type + * @param length + * @return + */ + private int getContentLength(byte lv,byte hv){ + int l = (lv & 0xff); + int h = (hv & 0xff); + return (l| (h <<= 8)); + } } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageEncoder.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageEncoder.java index d4c1acc..8aa1894 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageEncoder.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageEncoder.java @@ -1,40 +1,73 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.filter; - - import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolEncoderAdapter; import org.apache.mina.filter.codec.ProtocolEncoderOutput; - import android.util.Log; import com.farsunset.cim.sdk.android.constant.CIMConstant; +import com.farsunset.cim.sdk.android.model.Protobufable; /** - * 客户端消息发送前进行编码,可在此加密消息 + * 客户端消息发送前进行编码 */ public class ClientMessageEncoder extends ProtocolEncoderAdapter { final static String TAG = ClientMessageEncoder.class.getSimpleName(); @Override - public void encode(IoSession iosession, Object message, ProtocolEncoderOutput out) throws Exception { + public void encode(IoSession iosession, Object object, ProtocolEncoderOutput out) throws Exception { - IoBuffer buff = IoBuffer.allocate(320).setAutoExpand(true); - buff.put(message.toString().getBytes(CIMConstant.UTF8)); - buff.put(CIMConstant.MESSAGE_SEPARATE); - buff.flip(); - out.write(buff); - //打印出收到的消息 - Log.i(TAG,message.toString()); + if(object instanceof Protobufable){ + + Protobufable data = (Protobufable) object; + byte[] byteArray = data.getByteArray(); + + IoBuffer buff = IoBuffer.allocate(byteArray.length + CIMConstant.DATA_HEADER_LENGTH).setAutoExpand(true); + + buff.put(createHeader(data.getType(),byteArray.length)); + buff.put(byteArray); + + buff.flip(); + out.write(buff); + //打印出收到的消息 + Log.i(TAG,data.toString()); + } + } - - + /** + * 消息体最大为65535 + * @param type + * @param length + * @return + */ + private byte[] createHeader(byte type,int length){ + byte[] header = new byte[CIMConstant.DATA_HEADER_LENGTH]; + header[0] = type; + header[1] = (byte) (length & 0xff); + header[2] = (byte) ((length >> 8) & 0xff); + return header; + } } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatRequest.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatRequest.java new file mode 100644 index 0000000..ece6cfa --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.android.constant.CIMConstant; +/** + * 服务端心跳请求 + * + */ +public class HeartbeatRequest implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "SERVER_HEARTBEAT_REQUEST"; + private static final String CMD_HEARTBEAT_RESPONSE = "SR"; + + private static HeartbeatRequest object = new HeartbeatRequest(); + + private HeartbeatRequest(){ + + } + + public static HeartbeatRequest getInstance() { + return object; + } + + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + + @Override + public byte getType() { + return CIMConstant.ProtobufType.S_H_RQ; + } + +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatResponse.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatResponse.java new file mode 100644 index 0000000..5250fb0 --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatResponse.java @@ -0,0 +1,59 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.android.constant.CIMConstant; +/** + * 客户端心跳响应 + */ +public class HeartbeatResponse implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "CLIENT_HEARTBEAT_RESPONSE"; + private static final String CMD_HEARTBEAT_RESPONSE = "CR"; + + private static HeartbeatResponse object = new HeartbeatResponse(); + + private HeartbeatResponse(){ + + } + + public static HeartbeatResponse getInstance() { + return object; + } + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.C_H_RS; + } + +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java index e59786b..d8e46a7 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java @@ -1,12 +1,28 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.model; import java.io.Serializable; + /** * 消息对象 */ @@ -24,13 +40,13 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String type; + private String action; /** * 消息标题 */ private String title; /** - * 消息类容,于type 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 + * 消息类容,于action 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 */ private String content; @@ -43,21 +59,18 @@ public class Message implements Serializable { */ private String receiver; - /** - * 文件 url - */ - private String file; - /** - * 文件类型 - */ - private String fileType; - + + /** * content 内容格式 */ - private String format = "txt"; + private String format; + + /** + * 附加内容 内容 + */ + private String extra; - private long timestamp; @@ -73,14 +86,14 @@ public class Message implements Serializable { this.timestamp = timestamp; } - public String getType() { - return type; - } + - public void setType(String type) { - this.type = type; + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; } - public String getTitle() { return title; } @@ -113,22 +126,7 @@ public class Message implements Serializable { this.receiver = receiver; } - public String getFile() { - return file; - } - - public void setFile(String file) { - this.file = file; - } - - public String getFileType() { - return fileType; - } - - public void setFileType(String fileType) { - this.fileType = fileType; - } - + public String getFormat() { return format; } @@ -137,56 +135,30 @@ public class Message implements Serializable { this.format = format; } + + + public String getExtra() { + return extra; + } + public void setExtra(String extra) { + this.extra = extra; + } public String toString() { - + StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(mid).append(""); - - if (isNotEmpty(type)) { - buffer.append("").append(type).append(""); - } - - if (isNotEmpty(title)) { - buffer.append("").append(title).append(""); - } - if (isNotEmpty(content)) { - buffer.append(""); - } - - if (isNotEmpty(file)) { - buffer.append("").append(file).append(""); - } - - if (isNotEmpty(fileType)) { - buffer.append("").append(fileType).append(""); - } - - if (isNotEmpty(sender)) { - buffer.append("").append(sender).append(""); - } - - if (isNotEmpty(receiver)) { - buffer.append("").append(receiver).append(""); - } - - if (isNotEmpty(format)) { - buffer.append("").append(format).append(""); - } - - if (timestamp > 0) { - buffer.append("").append(timestamp).append(""); - } - - buffer.append(""); + buffer.append("#Message#").append("\n"); + buffer.append("mid:").append(mid).append("\n"); + buffer.append("action:").append(action).append("\n"); + buffer.append("title:").append(title).append("\n"); + buffer.append("content:").append(content).append("\n"); + buffer.append("extra:").append(extra).append("\n"); + buffer.append("sender:").append(sender).append("\n"); + buffer.append("receiver:").append(receiver).append("\n"); + buffer.append("format:").append(format).append("\n"); + buffer.append("timestamp:").append(timestamp); return buffer.toString(); } - - public String toXmlString() { - - return toString(); - } + public String getMid() { return mid; @@ -197,8 +169,8 @@ public class Message implements Serializable { } public boolean isNotEmpty(String txt) { - return txt != null && !txt.isEmpty(); + return txt != null && txt.trim().length()!=0; } - + } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Protobufable.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Protobufable.java new file mode 100644 index 0000000..d504891 --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Protobufable.java @@ -0,0 +1,31 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model; +/** + * 需要向另一端发送的结构体 + */ +public interface Protobufable { + + byte[] getByteArray(); + + byte getType(); +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/ReplyBody.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/ReplyBody.java index 9fa706e..3a834ce 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/ReplyBody.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/ReplyBody.java @@ -1,13 +1,30 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * 请求应答对象 * @@ -64,7 +81,9 @@ public class ReplyBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } } public String get(String k) { @@ -83,8 +102,12 @@ public class ReplyBody implements Serializable { this.message = message; } - public HashMap getData() { - return data; + public void putAll(Map map) { + data.putAll(map); + } + + public Set getKeySet() { + return data.keySet(); } public String getCode() { @@ -98,27 +121,22 @@ public class ReplyBody implements Serializable { public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(this.getKey()).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append("").append(code).append(""); - buffer.append(""); - for(String key:this.getData().keySet()) - { - buffer.append("<"+key+">").append(this.get(key)).append(""); + buffer.append("#ReplyBody#").append("\n"); + buffer.append("key:").append(this.getKey()).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + buffer.append("code:").append(code).append("\n"); + + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); + return buffer.toString(); } - - public String toXmlString() - { - - return toString(); - } } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/SentBody.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/SentBody.java index 61951f9..d73c444 100644 --- a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/SentBody.java +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/SentBody.java @@ -1,30 +1,48 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import com.farsunset.cim.sdk.android.constant.CIMConstant; +import com.farsunset.cim.sdk.android.model.proto.SentBodyProto; /** * java |android 客户端请求结构 * */ -public class SentBody implements Serializable { +public class SentBody implements Serializable,Protobufable { private static final long serialVersionUID = 1L; private String key; - private HashMap data; + private HashMap data = new HashMap();; private long timestamp; public SentBody() { - - data = new HashMap(); timestamp = System.currentTimeMillis(); } @@ -49,36 +67,54 @@ public class SentBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } + } + public void putAll(Map map) { + data.putAll(map); } + public Set getKeySet() { + return data.keySet(); + } + + public void remove(String k) { data.remove(k); } - public HashMap getData() { - return data; - } - @Override public String toString() { StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(key).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append(""); - for (String key : data.keySet()) { - buffer.append("<" + key + ">").append(data.get(key)).append( - ""); + buffer.append("#SentBody#").append("\n");; + buffer.append("key:").append(key).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); return buffer.toString(); } - - public String toXmlString() { - - return toString(); + + @Override + public byte[] getByteArray() { + SentBodyProto.Model.Builder builder = SentBodyProto.Model.newBuilder(); + builder.setKey(key); + builder.setTimestamp(timestamp); + if(!data.isEmpty()){ + builder.putAllData(data); + } + return builder.build().toByteArray(); } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.SENTBODY; + } + } diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto new file mode 100644 index 0000000..a5cb5ee --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="MessageProto"; +message Model { + string mid = 1; + string action = 2; + string content = 3; + string sender = 4; + string receiver = 5; + string extra = 6; + string title = 7; + string format = 8; + int64 timestamp = 9; +} + \ No newline at end of file diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java new file mode 100644 index 0000000..39d9167 --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java @@ -0,0 +1,1603 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model.proto; + +public final class MessageProto { + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string mid = 1; + */ + java.lang.String getMid(); + /** + * string mid = 1; + */ + com.google.protobuf.ByteString + getMidBytes(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + mid_ = ""; + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + mid_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.Builder.class); + } + + public static final int MID_FIELD_NUMBER = 1; + private volatile java.lang.Object mid_; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.android.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.android.model.proto.MessageProto.Model) obj; + + boolean result = true; + result = result && getMid() + .equals(other.getMid()); + result = result && getAction() + .equals(other.getAction()); + result = result && getContent() + .equals(other.getContent()); + result = result && getSender() + .equals(other.getSender()); + result = result && getReceiver() + .equals(other.getReceiver()); + result = result && getExtra() + .equals(other.getExtra()); + result = result && getTitle() + .equals(other.getTitle()); + result = result && getFormat() + .equals(other.getFormat()); + result = result && (getTimestamp() + == other.getTimestamp()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MID_FIELD_NUMBER; + hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.android.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) + com.farsunset.cim.sdk.android.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + mid_ = ""; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.android.model.proto.MessageProto.Model(this); + result.mid_ = mid_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.android.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.android.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.android.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (!other.getMid().isEmpty()) { + mid_ = other.mid_; + onChanged(); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.android.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object mid_ = ""; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mid = 1; + */ + public Builder setMid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mid_ = value; + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder clearMid() { + + mid_ = getDefaultInstance().getMid(); + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder setMidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mid_ = value; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) + private static final com.farsunset.cim.sdk.android.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.android.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022)com.farsunset.cim.sdk.a" + + "ndroid.model.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(" + + "\t\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006se" + + "nder\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 " + + "\001(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\tti" + + "mestamp\030\t \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor, + new java.lang.String[] { "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto new file mode 100644 index 0000000..db92900 --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="ReplyBodyProto"; + +message Model { + string key = 1; + string code = 2; + string message = 3; + int64 timestamp =4; + map data =5; + +} + \ No newline at end of file diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java new file mode 100644 index 0000000..d370594 --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java @@ -0,0 +1,1241 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model.proto; + +public final class ReplyBodyProto { + private ReplyBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string code = 2; + */ + java.lang.String getCode(); + /** + * string code = 2; + */ + com.google.protobuf.ByteString + getCodeBytes(); + + /** + * string message = 3; + */ + java.lang.String getMessage(); + /** + * string message = 3; + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + * int64 timestamp = 4; + */ + long getTimestamp(); + + /** + * map<string, string> data = 5; + */ + int getDataCount(); + /** + * map<string, string> data = 5; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 5; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + code_ = ""; + message_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + code_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 32: { + + timestamp_ = input.readInt64(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object code_; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 4; + private long timestamp_; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 5; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, code_); + } + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + if (timestamp_ != 0L) { + output.writeInt64(4, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 5); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!getCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, code_); + } + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model other = (com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && getCode() + .equals(other.getCode()); + result = result && getMessage() + .equals(other.getMessage()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + code_ = ""; + + message_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model build() { + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model result = new com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.code_ = code_; + result.message_ = message_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string code = 2; + */ + public Builder setCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value; + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder clearCode() { + + code_ = getDefaultInstance().getCode(); + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder setCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + code_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string message = 3; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 4; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 4; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 5; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) + private static final com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017ReplyBody.proto\022)com.farsunset.cim.sdk" + + ".android.model.proto\"\275\001\n\005Model\022\013\n\003key\030\001 " + + "\001(\t\022\014\n\004code\030\002 \001(\t\022\017\n\007message\030\003 \001(\t\022\021\n\tti" + + "mestamp\030\004 \001(\003\022H\n\004data\030\005 \003(\0132:.com.farsun" + + "set.cim.sdk.android.model.proto.Model.Da" + + "taEntry\032+\n\tDataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005val" + + "ue\030\002 \001(\t:\0028\001B\020B\016ReplyBodyProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Code", "Message", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBody.proto b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBody.proto new file mode 100644 index 0000000..20f0534 --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBody.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="SentBodyProto"; + +message Model { + string key = 1; + int64 timestamp =2; + map data =3; + +} + \ No newline at end of file diff --git a/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java new file mode 100644 index 0000000..a781e8b --- /dev/null +++ b/cim_for_mina/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java @@ -0,0 +1,967 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model.proto; + +public final class SentBodyProto { + private SentBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * int64 timestamp = 2; + */ + long getTimestamp(); + + /** + * map<string, string> data = 3; + */ + int getDataCount(); + /** + * map<string, string> data = 3; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 3; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 16: { + + timestamp_ = input.readInt64(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 3; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (timestamp_ != 0L) { + output.writeInt64(2, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 3); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model other = (com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model build() { + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model result = new com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 2; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 2; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 3; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) + private static final com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016SentBody.proto\022)com.farsunset.cim.sdk." + + "android.model.proto\"\236\001\n\005Model\022\013\n\003key\030\001 \001" + + "(\t\022\021\n\ttimestamp\030\002 \001(\003\022H\n\004data\030\003 \003(\0132:.co" + + "m.farsunset.cim.sdk.android.model.proto." + + "Model.DataEntry\032+\n\tDataEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001B\017B\rSentBodyProtob\006p" + + "roto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-client-android/.gitignore b/cim_for_mina/cim-client-android/.gitignore new file mode 100644 index 0000000..39fb081 --- /dev/null +++ b/cim_for_mina/cim-client-android/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/cim_for_mina/cim-client-android/.idea/misc.xml b/cim_for_mina/cim-client-android/.idea/misc.xml new file mode 100644 index 0000000..5e6e78a --- /dev/null +++ b/cim_for_mina/cim-client-android/.idea/misc.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + Android + + + Android > Lint > Correctness + + + Android > Lint > Internationalization + + + Android > Lint > Security + + + CorrectnessLintAndroid + + + Gradle + + + LintAndroid + + + Probable bugsGradle + + + + + Android + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + + \ No newline at end of file diff --git a/cim_for_mina/cim-client-android/app/.gitignore b/cim_for_mina/cim-client-android/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/cim_for_mina/cim-client-android/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/cim_for_mina/cim-client-android/app/build.gradle b/cim_for_mina/cim-client-android/app/build.gradle new file mode 100644 index 0000000..1f042fa --- /dev/null +++ b/cim_for_mina/cim-client-android/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 25 + buildToolsVersion "25.0.2" + defaultConfig { + applicationId "com.farsunset.ichat.example" + minSdkVersion 14 + targetSdkVersion 21 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + + + + lintOptions { + checkReleaseBuilds false + abortOnError false + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:25.1.0' + compile 'com.google.protobuf:protobuf-java:3.2.0' + compile 'org.apache.mina:mina-core:2.0.16' + compile 'org.slf4j:slf4j-api:1.7.24' + compile 'org.slf4j:slf4j-nop:1.7.24' +} diff --git a/cim_for_mina/cim-client-android/app/libs/cim-server-sdk-3.0.jar b/cim_for_mina/cim-client-android/app/libs/cim-server-sdk-3.0.jar new file mode 100644 index 0000000..c45d058 Binary files /dev/null and b/cim_for_mina/cim-client-android/app/libs/cim-server-sdk-3.0.jar differ diff --git a/cim_for_mina/cim-client-android/app/proguard-rules.pro b/cim_for_mina/cim-client-android/app/proguard-rules.pro new file mode 100644 index 0000000..0efbf97 --- /dev/null +++ b/cim_for_mina/cim-client-android/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in D:\Program Files (x86)\dev\android-sdk-windos/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/cim_for_mina/client-mchat-android/AndroidManifest.xml b/cim_for_mina/cim-client-android/app/src/main/AndroidManifest.xml similarity index 92% rename from cim_for_mina/client-mchat-android/AndroidManifest.xml rename to cim_for_mina/cim-client-android/app/src/main/AndroidManifest.xml index 2ed9424..913e67f 100644 --- a/cim_for_mina/client-mchat-android/AndroidManifest.xml +++ b/cim_for_mina/cim-client-android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="30" + android:versionName="3.0.0" > @@ -10,10 +10,6 @@ - - - + diff --git a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java new file mode 100644 index 0000000..3a88250 --- /dev/null +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java @@ -0,0 +1,38 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.adapter; + +import java.util.Comparator; + +import com.farsunset.cim.sdk.android.model.Message; + +public class MessageTimeDescComparator implements Comparator{ + + @Override + public int compare(Message arg0, Message arg1) { + + return (int) (arg1.getTimestamp() - arg0.getTimestamp()) ; + } + + + +} diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java similarity index 65% rename from cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java rename to cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java index 266b324..fe43a78 100644 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.ichat.example.adapter; import java.text.SimpleDateFormat; @@ -67,7 +82,7 @@ public class SystemMsgListViewAdapter extends BaseAdapter { ((TextView) chatItemView.findViewById(R.id.time)).setText(getDateTimeString(Long.valueOf(msg.getTimestamp()))); ((TextView) chatItemView.findViewById(R.id.content)).setText(msg.getContent() ); - ((ImageView) chatItemView.findViewById(R.id.headImageView)).setImageResource(R.drawable.icon_recent_sysmsg); + ((ImageView) chatItemView.findViewById(R.id.headImageView)).setImageResource(R.drawable.icon); return chatItemView; } diff --git a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CIMMonitorActivity.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CIMMonitorActivity.java new file mode 100644 index 0000000..4671678 --- /dev/null +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CIMMonitorActivity.java @@ -0,0 +1,118 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.app; + + +import com.farsunset.cim.sdk.android.CIMEventListener; +import com.farsunset.cim.sdk.android.CIMListenerManager; +import com.farsunset.cim.sdk.android.model.Message; +import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.cim.sdk.android.model.SentBody; + +import android.app.Activity; +import android.net.NetworkInfo; +import android.os.Bundle; + +public abstract class CIMMonitorActivity extends Activity implements CIMEventListener{ + + + CommonBaseControl commonBaseControl; + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + CIMListenerManager.registerMessageListener(this); + + commonBaseControl = new CommonBaseControl(this); + + + } + + @Override + public void finish() { + super.finish(); + CIMListenerManager.removeMessageListener(this); + + } + + @Override + public void onRestart() { + super.onRestart(); + CIMListenerManager.registerMessageListener(this); + } + + + public void showProgressDialog(String title,String content) + { + commonBaseControl.showProgressDialog(title, content); + } + + public void hideProgressDialog() + { + commonBaseControl.hideProgressDialog(); + } + + public void showToask(String hint){ + + commonBaseControl.showToask(hint); + } + + + + + @Override + public void onMessageReceived(Message arg0){}; + + @Override + public void onNetworkChanged(NetworkInfo info){} + + /** + * 与服务端断开连接时回调,不要在里面做连接服务端的操作 + */ + @Override + public void onConnectionClosed() {} + + @Override + public void onConnectionFailed() { + + } + + @Override + public int getEventDispatchOrder() { + return 0; + } + + /** + * 连接服务端成功时回调 + */ + + @Override + public void onConnectionSuccessed(boolean arg0) {} + + + @Override + public void onReplyReceived(ReplyBody arg0) {} + + @Override + public void onSentSuccessed(SentBody sentBody) { + + } +} diff --git a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CommonBaseControl.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CommonBaseControl.java new file mode 100644 index 0000000..49bd017 --- /dev/null +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CommonBaseControl.java @@ -0,0 +1,78 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.app; + + + +import android.app.ProgressDialog; +import android.content.Context; +import android.widget.Toast; + + +public class CommonBaseControl { + + private ProgressDialog progressDialog; + + Context mMontent; + + + public CommonBaseControl(Context content) + { + this.mMontent = content; + } + + + + public void showProgressDialog(String title,String message) + { + if(progressDialog==null) + { + + progressDialog = ProgressDialog.show(mMontent, title, message, true, true); + }else if(progressDialog.isShowing()) + { + progressDialog.setTitle(title); + progressDialog.setMessage(message); + } + + progressDialog.show(); + + } + + public void hideProgressDialog() + { + + if(progressDialog!=null&&progressDialog.isShowing()) + { + progressDialog.dismiss(); + } + + } + + public void showToask(String hint){ + + Toast toast=Toast.makeText(mMontent,hint,Toast.LENGTH_SHORT); + toast.show(); + } + + +} diff --git a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/Constant.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/Constant.java new file mode 100644 index 0000000..15b6ee8 --- /dev/null +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/Constant.java @@ -0,0 +1,53 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.app; + +public interface Constant { + + //服务端IP地址 + public static final String CIM_SERVER_HOST = "172.168.11.28"; + + + //注意,这里的端口不是tomcat的端口,CIM端口在服务端spring-cim.xml中配置的,没改动就使用默认的23456 + public static final int CIM_SERVER_PORT = 23456; + + public static interface MessageType{ + + + //用户之间的普通消息 + public static final String TYPE_0 = "0"; + + + //下线类型 + String TYPE_999 = "999"; + } + + + public static interface MessageStatus{ + + //消息未读 + public static final String STATUS_0 = "0"; + //消息已经读取 + public static final String STATUS_1 = "1"; + } + +} diff --git a/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/receiver/CIMPushManagerReceiver.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/receiver/CIMPushManagerReceiver.java new file mode 100644 index 0000000..b1832b6 --- /dev/null +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/receiver/CIMPushManagerReceiver.java @@ -0,0 +1,126 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.receiver; + + +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.net.NetworkInfo; +import android.support.v4.app.NotificationCompat; + +import com.farsunset.cim.sdk.android.CIMEventBroadcastReceiver; +import com.farsunset.cim.sdk.android.CIMListenerManager; +import com.farsunset.cim.sdk.android.model.Message; +import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.ichat.example.R; +import com.farsunset.ichat.example.ui.SystemMessageActivity; + +import static android.R.id.message; +import static com.farsunset.ichat.example.R.id.content; + +/** + * 消息入口,所有消息都会经过这里 + * @author 3979434 + * + */ +public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver { + + private NotificationManager notificationManager; + + //当收到消息时,会执行onMessageReceived,这里是消息第一入口 + + @Override + public void onMessageReceived(Message message, Intent intent) { + + //调用分发消息监听 + CIMListenerManager.notifyOnMessageReceived(message); + + //以开头的为动作消息,无须显示,如被强行下线消息Constant.TYPE_999 + if(message.getAction().startsWith("9")) + { + return ; + } + + showNotify(context,message); + } + + + + private void showNotify(Context context , Message msg) + { + + this.notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + String title = "系统消息"; + + PendingIntent contentIntent = PendingIntent.getActivity(context,1, new Intent(context,SystemMessageActivity.class), PendingIntent.FLAG_UPDATE_CURRENT); + final NotificationCompat.Builder builder = new NotificationCompat.Builder(context); + builder.setAutoCancel(true); + builder.setDefaults(Notification.DEFAULT_ALL); + builder.setWhen(msg.getTimestamp()); + builder.setSmallIcon(R.drawable.icon); + builder.setTicker(title); + builder.setContentTitle(title); + builder.setContentText(msg.getContent()); + builder.setDefaults(Notification.DEFAULT_LIGHTS); + builder.setContentIntent(contentIntent); + final Notification notification = builder.build(); + + + notificationManager.notify(R.drawable.icon, notification); + + } + + + @Override + public void onNetworkChanged(NetworkInfo info) { + CIMListenerManager.notifyOnNetworkChanged(info); + } + + + @Override + public void onConnectionSuccessed(boolean hasAutoBind) { + CIMListenerManager.notifyOnConnectionSuccessed(hasAutoBind); + } + + @Override + public void onConnectionClosed() { + CIMListenerManager.notifyOnConnectionClosed(); + } + + + @Override + public void onReplyReceived(ReplyBody body) { + CIMListenerManager.notifyOnReplyReceived(body); + } + + + + @Override + public void onConnectionFailed() { + // TODO Auto-generated method stub + CIMListenerManager.notifyOnConnectionFailed(); + } + +} diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/LoginActivity.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/LoginActivity.java similarity index 63% rename from cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/LoginActivity.java rename to cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/LoginActivity.java index 195c3da..f28be5c 100644 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/LoginActivity.java +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/LoginActivity.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.ichat.example.ui; import android.content.Intent; @@ -44,18 +59,13 @@ public class LoginActivity extends CIMMonitorActivity implements if (!"".equals(accountEdit.getText().toString().trim())) { showProgressDialog("提示", "正在登陆,请稍后......"); - if(CIMPushManager.getState(this) == CIMPushManager.STATE_NORMAL ) - { + if (CIMPushManager.isConnected(this)) { CIMPushManager.bindAccount(this, accountEdit.getText().toString().trim()); - return; + } else { + CIMPushManager.connect(this, Constant.CIM_SERVER_HOST, Constant.CIM_SERVER_PORT); } - if(CIMPushManager.getState(this) == CIMPushManager.STATE_STOPED ) - { - CIMPushManager.connect(this,Constant.CIM_SERVER_HOST, Constant.CIM_SERVER_PORT); - } - - } + } } @Override diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/SplanshActivity.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java similarity index 55% rename from cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/SplanshActivity.java rename to cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java index 051d9cc..cb396ea 100644 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/SplanshActivity.java +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.ichat.example.ui; diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/SystemMessageActivity.java b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java similarity index 69% rename from cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/SystemMessageActivity.java rename to cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java index 71e552c..09bc31e 100644 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/SystemMessageActivity.java +++ b/cim_for_mina/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.ichat.example.ui; import java.util.ArrayList; @@ -25,29 +40,19 @@ import com.farsunset.ichat.example.R; import com.farsunset.ichat.example.adapter.SystemMsgListViewAdapter; import com.farsunset.ichat.example.app.CIMMonitorActivity; import com.farsunset.ichat.example.app.Constant; -import com.farsunset.ichat.example.network.HttpAPIRequester; -import com.farsunset.ichat.example.network.HttpAPIResponser; -public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener, HttpAPIResponser{ +public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener{ protected ListView chatListView; - int currentPage = 1; protected SystemMsgListViewAdapter adapter; private ArrayList list; - - public HashMap apiParams = new HashMap(); - - //客户端向客户端发送消息接口地址 - public final static String SEND_MESSAGE_API_URL=Constant.SERVER_URL+"/cgi/message_send.api"; - - HttpAPIRequester requester ; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_system_chat); initViews(); - requester = new HttpAPIRequester(this); - + //绑定账号成功,获取离线消息 getOfflineMessage(); } @@ -73,7 +78,7 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick @Override public void onMessageReceived(Message message) { - if(message.getType().equals(Constant.MessageType.TYPE_999)) + if(message.getAction().equals(Constant.MessageType.TYPE_999)) { //返回登录页面,停止接受消息 CIMPushManager.stop(this); @@ -93,11 +98,11 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick } - //获取离线消息,代码示例,前提是服务端要实现此功能 + //获取离线消息,代码示例,前提是服务端要实现此功能,建议使用http 接口拉去大量的离线消息 private void getOfflineMessage() { SentBody sent = new SentBody(); - sent.setKey(CIMConstant.RequestKey.CLIENT_OFFLINE_MESSAGE); + sent.setKey(CIMConstant.RequestKey.CLIENT_PULL_MESSAGE); sent.put("account", this.getIntent().getStringExtra("account")); CIMPushManager.sendRequest(this, sent); } @@ -115,38 +120,8 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick } } - - - //发送消息示范,用户客户端与客户端之间的消息发送 - private void sendMessage() throws Exception - { - - requester.execute(SEND_MESSAGE_API_URL); - } - @Override - public void onSuccess(String data,String url) { - hideProgressDialog(); - - showToask("发送成功"); - } - - @Override - public Map getRequestParams() { - - apiParams.put("content", "hello world!"); - apiParams.put("sender", "xiaogou");//发送者账号 - apiParams.put("receiver", "xiaomao");//消息接收者账号 - apiParams.put("type",Constant.MessageType.TYPE_0); - - return apiParams; - } - - @Override - public void onRequest() { - showProgressDialog("提示", "正在发送消息..."); - } @Override public void onClick(View v) { @@ -158,9 +133,6 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick } } - @Override - public void onFailed(Exception e,String url) {} - @Override public void onBackPressed() { @@ -173,4 +145,4 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick } -} \ No newline at end of file +} diff --git a/cim_for_mina/client-mchat-android/res/color/login_text_button_selector.xml b/cim_for_mina/cim-client-android/app/src/main/res/color/login_text_button_selector.xml similarity index 100% rename from cim_for_mina/client-mchat-android/res/color/login_text_button_selector.xml rename to cim_for_mina/cim-client-android/app/src/main/res/color/login_text_button_selector.xml diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/icon.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-hdpi/icon.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/icon.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/login_bg.jpg b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/login_bg.jpg similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-hdpi/login_bg.jpg rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/login_bg.jpg diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/login_default_avatar.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/login_default_avatar.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-320dpi/login_default_avatar.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/login_default_avatar.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/login_input.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/login_input.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-hdpi/login_input.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/login_input.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_bg_pressed.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_common_btn_blue_bg_pressed.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_bg_pressed.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_common_btn_blue_bg_pressed.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_unpressed.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_common_btn_blue_unpressed.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_unpressed.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_common_btn_blue_unpressed.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_bar_bg.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_bar_bg.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_bar_bg.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_bar_bg.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_normal.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_btn_back_normal.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_normal.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_btn_back_normal.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_press.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_btn_back_press.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_press.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_btn_back_press.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_nor.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_nor.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_nor.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_nor.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_top.9.png b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_top.9.png similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_top.9.png rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_top.9.png diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/splash_bg.jpg b/cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/splash_bg.jpg similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable-hdpi/splash_bg.jpg rename to cim_for_mina/cim-client-android/app/src/main/res/drawable-hdpi/splash_bg.jpg diff --git a/cim_for_mina/client-mchat-android/res/drawable/common_button_blue.xml b/cim_for_mina/cim-client-android/app/src/main/res/drawable/common_button_blue.xml similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable/common_button_blue.xml rename to cim_for_mina/cim-client-android/app/src/main/res/drawable/common_button_blue.xml diff --git a/cim_for_mina/client-mchat-android/res/drawable/common_msgbox_bg.xml b/cim_for_mina/cim-client-android/app/src/main/res/drawable/common_msgbox_bg.xml similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable/common_msgbox_bg.xml rename to cim_for_mina/cim-client-android/app/src/main/res/drawable/common_msgbox_bg.xml diff --git a/cim_for_mina/client-mchat-android/res/drawable/top_back_left_selector.xml b/cim_for_mina/cim-client-android/app/src/main/res/drawable/top_back_left_selector.xml similarity index 100% rename from cim_for_mina/client-mchat-android/res/drawable/top_back_left_selector.xml rename to cim_for_mina/cim-client-android/app/src/main/res/drawable/top_back_left_selector.xml diff --git a/cim_for_netty/client-mchat-android/res/layout/activity_login.xml b/cim_for_mina/cim-client-android/app/src/main/res/layout/activity_login.xml similarity index 98% rename from cim_for_netty/client-mchat-android/res/layout/activity_login.xml rename to cim_for_mina/cim-client-android/app/src/main/res/layout/activity_login.xml index c3f13d7..0f08a3f 100644 --- a/cim_for_netty/client-mchat-android/res/layout/activity_login.xml +++ b/cim_for_mina/cim-client-android/app/src/main/res/layout/activity_login.xml @@ -17,7 +17,6 @@ android:layout_height="91.0dip" android:layout_gravity="center_horizontal" android:layout_marginTop="68.0dip" - android:background="@drawable/card_avatar" android:scaleType="fitXY" android:src="@drawable/login_default_avatar" /> diff --git a/cim_for_mina/client-mchat-android/res/layout/activity_splansh.xml b/cim_for_mina/cim-client-android/app/src/main/res/layout/activity_splansh.xml similarity index 100% rename from cim_for_mina/client-mchat-android/res/layout/activity_splansh.xml rename to cim_for_mina/cim-client-android/app/src/main/res/layout/activity_splansh.xml diff --git a/cim_for_mina/client-mchat-android/res/layout/activity_system_chat.xml b/cim_for_mina/cim-client-android/app/src/main/res/layout/activity_system_chat.xml similarity index 100% rename from cim_for_mina/client-mchat-android/res/layout/activity_system_chat.xml rename to cim_for_mina/cim-client-android/app/src/main/res/layout/activity_system_chat.xml diff --git a/cim_for_mina/client-mchat-android/res/layout/item_chat_sysmsg.xml b/cim_for_mina/cim-client-android/app/src/main/res/layout/item_chat_sysmsg.xml similarity index 93% rename from cim_for_mina/client-mchat-android/res/layout/item_chat_sysmsg.xml rename to cim_for_mina/cim-client-android/app/src/main/res/layout/item_chat_sysmsg.xml index 581abf5..09d183c 100644 --- a/cim_for_mina/client-mchat-android/res/layout/item_chat_sysmsg.xml +++ b/cim_for_mina/cim-client-android/app/src/main/res/layout/item_chat_sysmsg.xml @@ -28,7 +28,7 @@ android:layout_gravity="left|center" android:layout_marginLeft="10.0dip" android:layout_weight="1.0" - android:textColor="@color/gray" /> + android:textColor="@android:color/black" /> + android:textColor="@android:color/black" /> + android:textColor="@android:color/black" /> diff --git a/cim_for_mina/client-mchat-android/res/layout/layout_global_top_header.xml b/cim_for_mina/cim-client-android/app/src/main/res/layout/layout_global_top_header.xml similarity index 93% rename from cim_for_mina/client-mchat-android/res/layout/layout_global_top_header.xml rename to cim_for_mina/cim-client-android/app/src/main/res/layout/layout_global_top_header.xml index b27867e..7f7f252 100644 --- a/cim_for_mina/client-mchat-android/res/layout/layout_global_top_header.xml +++ b/cim_for_mina/cim-client-android/app/src/main/res/layout/layout_global_top_header.xml @@ -1,7 +1,7 @@ @@ -19,7 +19,7 @@ android:minWidth="55.0dip" android:paddingRight="10dip" android:singleLine="true" - android:textColor="@color/white" + android:textColor="@android:color/white" android:textSize="14.0sp" android:visibility="gone" /> diff --git a/cim_for_mina/client-mchat-android/res/raw/classic.mp3 b/cim_for_mina/cim-client-android/app/src/main/res/raw/classic.mp3 similarity index 100% rename from cim_for_mina/client-mchat-android/res/raw/classic.mp3 rename to cim_for_mina/cim-client-android/app/src/main/res/raw/classic.mp3 diff --git a/cim_for_mina/cim-client-android/app/src/main/res/values/colors.xml b/cim_for_mina/cim-client-android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..7ce5f5d --- /dev/null +++ b/cim_for_mina/cim-client-android/app/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #fefefe + \ No newline at end of file diff --git a/cim_for_mina/cim-client-android/app/src/main/res/values/strings.xml b/cim_for_mina/cim-client-android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..984afe5 --- /dev/null +++ b/cim_for_mina/cim-client-android/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + CIM示例 + diff --git a/cim_for_mina/cim-client-android/app/src/main/res/values/styles.xml b/cim_for_mina/cim-client-android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..f548224 --- /dev/null +++ b/cim_for_mina/cim-client-android/app/src/main/res/values/styles.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/cim_for_mina/cim-client-android/build.gradle b/cim_for_mina/cim-client-android/build.gradle new file mode 100644 index 0000000..74b2ab0 --- /dev/null +++ b/cim_for_mina/cim-client-android/build.gradle @@ -0,0 +1,23 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/cim_for_mina/cim-client-android/gradle.properties b/cim_for_mina/cim-client-android/gradle.properties new file mode 100644 index 0000000..aac7c9b --- /dev/null +++ b/cim_for_mina/cim-client-android/gradle.properties @@ -0,0 +1,17 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true diff --git a/cim_for_mina/cim-client-android/gradlew b/cim_for_mina/cim-client-android/gradlew new file mode 100644 index 0000000..9d82f78 --- /dev/null +++ b/cim_for_mina/cim-client-android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/cim_for_mina/cim-client-android/gradlew.bat b/cim_for_mina/cim-client-android/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/cim_for_mina/cim-client-android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/cim_for_mina/cim-client-android/settings.gradle b/cim_for_mina/cim-client-android/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/cim_for_mina/cim-client-android/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/cim_for_mina/cim-java-sdk/.classpath b/cim_for_mina/cim-java-sdk/.classpath index d559e33..742d1ff 100644 --- a/cim_for_mina/cim-java-sdk/.classpath +++ b/cim_for_mina/cim-java-sdk/.classpath @@ -3,8 +3,9 @@ - + + diff --git a/cim_for_mina/cim-java-sdk/.project b/cim_for_mina/cim-java-sdk/.project index 60f1a90..f63422e 100644 --- a/cim_for_mina/cim-java-sdk/.project +++ b/cim_for_mina/cim-java-sdk/.project @@ -1,6 +1,6 @@ - java-cim-sdk + cim-java-sdk diff --git a/cim_for_mina/cim-java-sdk/libs/mina-core-2.0.13.jar b/cim_for_mina/cim-java-sdk/libs/mina-core-2.0.13.jar deleted file mode 100644 index 557f190..0000000 Binary files a/cim_for_mina/cim-java-sdk/libs/mina-core-2.0.13.jar and /dev/null differ diff --git a/cim_for_mina/cim-java-sdk/libs/mina-core-2.0.16.jar b/cim_for_mina/cim-java-sdk/libs/mina-core-2.0.16.jar new file mode 100644 index 0000000..0e6d988 Binary files /dev/null and b/cim_for_mina/cim-java-sdk/libs/mina-core-2.0.16.jar differ diff --git a/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.2.0.jar new file mode 100644 index 0000000..b1f9701 Binary files /dev/null and b/cim_for_mina/cim-java-sdk/libs/protobuf-java-3.2.0.jar differ diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMCacheToolkit.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMCacheToolkit.java index b48b209..e7b4152 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMCacheToolkit.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMCacheToolkit.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; import java.util.HashMap; diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMConnectorManager.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMConnectorManager.java index 306c499..2e08fcf 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMConnectorManager.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMConnectorManager.java @@ -1,95 +1,93 @@ -/** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; import java.net.InetSocketAddress; +import java.util.Map; +import java.util.Random; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; import org.apache.log4j.Logger; import org.apache.mina.core.future.ConnectFuture; import org.apache.mina.core.future.WriteFuture; -import org.apache.mina.core.service.IoHandler; +import org.apache.mina.core.service.IoHandlerAdapter; import org.apache.mina.core.session.IdleStatus; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolCodecFilter; import org.apache.mina.filter.keepalive.KeepAliveFilter; import org.apache.mina.filter.keepalive.KeepAliveMessageFactory; +import org.apache.mina.filter.keepalive.KeepAliveRequestTimeoutHandler; import org.apache.mina.transport.socket.nio.NioSocketConnector; import com.farsunset.cim.sdk.client.constant.CIMConstant; -import com.farsunset.cim.sdk.client.exception.CIMSessionDisableException; -import com.farsunset.cim.sdk.client.exception.WriteToClosedSessionException; +import com.farsunset.cim.sdk.client.exception.SessionDisconnectedException; import com.farsunset.cim.sdk.client.filter.ClientMessageCodecFactory; +import com.farsunset.cim.sdk.client.model.HeartbeatRequest; +import com.farsunset.cim.sdk.client.model.HeartbeatResponse; import com.farsunset.cim.sdk.client.model.Intent; import com.farsunset.cim.sdk.client.model.Message; import com.farsunset.cim.sdk.client.model.ReplyBody; import com.farsunset.cim.sdk.client.model.SentBody; + /** * 连接服务端管理,cim核心处理类,管理连接,以及消息处理 * * @author 3979434@qq.com */ -class CIMConnectorManager implements IoHandler , KeepAliveMessageFactory { +class CIMConnectorManager extends IoHandlerAdapter implements KeepAliveMessageFactory { protected final Logger logger = Logger.getLogger(CIMConnectorManager.class); - private NioSocketConnector connector; - private ConnectFuture connectFuture; - - private final int BOTH_IDLE_TIME = 120;//秒 - - private final int HEARBEAT_TIME_OUT = 330 * 1000;// 收到服务端心跳请求超时时间 毫秒 - + private final int READ_BUFFER_SIZE = 2048;//bit + private final int CONNECT_TIMEOUT = 10 * 1000;//秒 + private final int WRITE_TIMEOUT = 10 * 1000;//秒 + + private final int READ_IDLE_TIME = 120;//秒 + private final int HEARBEAT_TIME_OUT = (READ_IDLE_TIME + 20) * 1000;// 收到服务端心跳请求超时时间 毫秒 private final String KEY_LAST_HEART_TIME = "KEY_LAST_HEART_TIME" ; + + private NioSocketConnector connector; + private ConnectFuture connectFuture; + private ExecutorService executor = Executors.newFixedThreadPool(1); - static CIMConnectorManager manager; + private static CIMConnectorManager manager; - // 消息广播action - public static final String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; - // 发送sendbody失败广播 - public static final String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; - - // 发送sendbody成功广播 - public static final String ACTION_SENT_SUCCESSED = "com.farsunset.cim.SENT_SUCCESSED"; - // 链接意外关闭广播 - public static final String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; - // 链接失败广播 - public static final String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; - // 链接成功广播 - public static final String ACTION_CONNECTION_SUCCESSED = "com.farsunset.cim.CONNECTION_SUCCESSED"; - // 发送sendbody成功后获得replaybody回应广播 - public static final String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; - // 网络变化广播 - public static final String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; - - // 未知异常 - public static final String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; - //重试连接 - public final static String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; - - private ExecutorService executor = Executors.newCachedThreadPool();; private CIMConnectorManager() { - connector = new NioSocketConnector(); - connector.setConnectTimeoutMillis(10 * 1000); + connector.setConnectTimeoutMillis(CONNECT_TIMEOUT); connector.getSessionConfig().setTcpNoDelay(true); - connector.getSessionConfig().setBothIdleTime(BOTH_IDLE_TIME); - connector.getSessionConfig().setReadBufferSize(2048); - connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ClientMessageCodecFactory())); + connector.getSessionConfig().setKeepAlive(true); + connector.getSessionConfig().setReadBufferSize(READ_BUFFER_SIZE); - KeepAliveFilter keepAliveaHandler = new KeepAliveFilter(this, IdleStatus.BOTH_IDLE); + KeepAliveFilter keepAliveaHandler = new KeepAliveFilter(this); + keepAliveaHandler.setRequestInterval(READ_IDLE_TIME); + keepAliveaHandler.setRequestTimeoutHandler(KeepAliveRequestTimeoutHandler.NOOP); keepAliveaHandler.setForwardEvent(true); - connector.getFilterChain().addLast("heartbeat", keepAliveaHandler); - connector.setHandler(this); - + connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ClientMessageCodecFactory())); + connector.getFilterChain().addLast("heartbeat", keepAliveaHandler); + + connector.setHandler(this); } @@ -101,119 +99,90 @@ class CIMConnectorManager implements IoHandler , KeepAliveMessageFactory { } - private synchronized void syncConnection(final String cimServerHost,final int cimServerPort) { + private synchronized void syncConnection(final String host,final int port) { + + if(isConnected()){ + return ; + } + try { - if(isConnected()){ - return ; - } + logger.info("****************CIM正在连接服务器 "+host+":"+port+"......"); CIMCacheToolkit.getInstance().putBoolean(CIMCacheToolkit.KEY_CIM_CONNECTION_STATE, false); - InetSocketAddress remoteSocketAddress = new InetSocketAddress(cimServerHost, cimServerPort); + InetSocketAddress remoteSocketAddress = new InetSocketAddress(host, port); connectFuture = connector.connect(remoteSocketAddress); connectFuture.awaitUninterruptibly(); connectFuture.getSession(); } catch (Exception e) { + long interval = CIMConstant.RECONN_INTERVAL_TIME - (5*1000 - new Random().nextInt(15*1000)); + Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_FAILED); - intent.putExtra("exception", e); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED); + intent.putExtra(Exception.class.getName(), e); + intent.putExtra("interval", interval); sendBroadcast(intent); - logger.error("******************CIM连接服务器失败 "+cimServerHost+":"+cimServerPort); - - } - - } - - private void sendBroadcast(final Intent intent) { - executor.execute(new Runnable(){ - @Override - public void run() { - CIMEventBroadcastReceiver.getInstance().onReceive(intent); - } - }); - } - - public void connect(final String cimServerHost, final int cimServerPort) { - - - Future future = executor.submit(new Runnable() { - @Override - public void run() { - syncConnection(cimServerHost, cimServerPort); - } - }); - try { - if(future.get()!=null) - { - connect(cimServerHost,cimServerPort); - } - } catch (Exception e) { - - connect(cimServerHost,cimServerPort); - e.printStackTrace(); + logger.error("****************CIM连接服务器失败 "+host+":"+port+"......将在"+interval/1000+"秒后重新尝试连接"); + } - + + } + + public void connect(final String host, final int port) { + + executor.execute(new Runnable() { + public void run() + { + syncConnection(host, port); + } + }); } - public void send(final SentBody body) { + public synchronized void send(SentBody body) { - - executor.execute(new Runnable() { - @Override - public void run() { - - - IoSession session = getCurrentSession(); - if(session!=null && session.isConnected()) - { - WriteFuture wf = session.write(body); - // 消息发送超时 10秒 - wf.awaitUninterruptibly(10, TimeUnit.SECONDS); - - if (!wf.isWritten()) { - - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new WriteToClosedSessionException()); - intent.putExtra("sentBody", body); - sendBroadcast(intent); - } - }else - { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new CIMSessionDisableException()); - intent.putExtra("sentBody", body); - sendBroadcast(intent); - } - } - }); + boolean isSuccessed = false; + + Throwable exception = new SessionDisconnectedException(); + + IoSession session = getCurrentSession(); + if(session!=null && session.isConnected()) + { + WriteFuture wf = session.write(body); + // 消息发送超时 5秒 + wf.awaitUninterruptibly(WRITE_TIMEOUT); + isSuccessed = wf.isWritten(); + exception = wf.getException(); + } + + if(!isSuccessed){ + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_SENT_FAILED); + intent.putExtra(Exception.class.getName(),exception); + intent.putExtra(SentBody.class.getName(), body); + sendBroadcast(intent); + } + } public void destroy() { IoSession session = getCurrentSession(); if (session != null) { session.closeNow(); - session.removeAttribute("account"); } if (connector != null && !connector.isDisposed()) { connector.dispose(); } + manager = null; } public boolean isConnected() { IoSession session = getCurrentSession(); - if (session == null ) { - return false; - } - return session.isConnected() ; + return session != null ; } @@ -229,90 +198,46 @@ class CIMConnectorManager implements IoHandler , KeepAliveMessageFactory { public IoSession getCurrentSession() { - if(connector.getManagedSessionCount()>0) + Map sessions = connector.getManagedSessions(); + for(Long key:sessions.keySet()) { - for(Long key:connector.getManagedSessions().keySet()) - { - return connector.getManagedSessions().get(key); + IoSession session = sessions.get(key); + if(session.isConnected()){ + return session; } } - - return null; - } - - private void setLastHeartbeatTime(IoSession session) - { - session.setAttribute(KEY_LAST_HEART_TIME, System.currentTimeMillis()); - } - - private long getLastHeartbeatTime(IoSession session) - { - long time = 0; - Object value ; - if((value = session.getAttribute(KEY_LAST_HEART_TIME)) !=null){ - time = Long.parseLong(value.toString()); - } - return time; - } - - - @Override - public Object getRequest(IoSession arg0) { return null; } - @Override - public Object getResponse(IoSession arg0, Object arg1) { - return CIMConstant.CMD_HEARTBEAT_RESPONSE; - } - - @Override - public boolean isRequest(IoSession session, Object data) { - - setLastHeartbeatTime(session); - - return CIMConstant.CMD_HEARTBEAT_REQUEST.equalsIgnoreCase(data.toString()); - } - - @Override - public boolean isResponse(IoSession arg0, Object arg1) { - return false; - } - - + @Override public void sessionCreated(IoSession session) throws Exception { - logger.debug("******************CIM连接服务器成功:"+session.getLocalAddress()); + logger.info("****************CIM连接服务器成功:"+session.getLocalAddress()+" NID:"+session.getId()); setLastHeartbeatTime(session); Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_SUCCESSED); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_SUCCESSED); sendBroadcast(intent); } - + @Override - public void sessionOpened(IoSession session) throws Exception { - session.getConfig().setBothIdleTime(180); - } + public void sessionClosed(IoSession session) { - @Override - public void sessionClosed(IoSession session) throws Exception { - - logger.debug("******************CIM与服务器断开连接:"+session.getLocalAddress()); + logger.error("****************CIM与服务器断开连接:"+session.getLocalAddress()+" NID:"+session.getId()); Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_CLOSED); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_CLOSED); sendBroadcast(intent); } @Override - public void sessionIdle(IoSession session, IdleStatus status)throws Exception { - logger.debug("******************CIM与服务器连接空闲:"+session.getLocalAddress() + " isActive:" + session.isActive()+ " isConnected:" + session.isConnected()); + public void sessionIdle(IoSession session, IdleStatus status) { + logger.debug("****************CIM "+status.toString().toUpperCase()+":"+session.getLocalAddress() +" NID:"+session.getId()+ " isConnected:" + session.isConnected()); /** * 用于解决,wifi情况下。偶而路由器与服务器断开连接时,客户端并没及时收到关闭事件 @@ -323,60 +248,102 @@ class CIMConnectorManager implements IoHandler , KeepAliveMessageFactory { if(System.currentTimeMillis() - lastHeartbeatTime >= HEARBEAT_TIME_OUT) { session.closeNow(); + logger.error("****************CIM心跳超时 ,即将重新连接......"+" NID:"+session.getId()); } } @Override - public void exceptionCaught(IoSession session, Throwable cause) - throws Exception { - + public void exceptionCaught(IoSession session, Throwable cause) { + + logger.error("****************CIM连接出现未知异常:"+session.getLocalAddress()+" NID:"+session.getId()); + + if(cause!=null && cause.getMessage()!=null){ + logger.error(cause.getMessage()); + } + Intent intent = new Intent(); - intent.setAction(ACTION_UNCAUGHT_EXCEPTION); - intent.putExtra("exception", cause); + intent.setAction(CIMConstant.IntentAction.ACTION_UNCAUGHT_EXCEPTION); + intent.putExtra(Exception.class.getName(), cause); sendBroadcast(intent); } @Override - public void messageReceived(IoSession session, Object obj) - throws Exception { - - logger.info(obj); + public void messageReceived(IoSession session, Object obj){ if (obj instanceof Message) { Intent intent = new Intent(); - intent.setAction(ACTION_MESSAGE_RECEIVED); - intent.putExtra("message", (Message) obj); + intent.setAction(CIMConstant.IntentAction.ACTION_MESSAGE_RECEIVED); + intent.putExtra(Message.class.getName(), (Message) obj); sendBroadcast(intent); } if (obj instanceof ReplyBody) { - Intent intent = new Intent(); - intent.setAction(ACTION_REPLY_RECEIVED); - intent.putExtra("replyBody", (ReplyBody) obj); + intent.setAction(CIMConstant.IntentAction.ACTION_REPLY_RECEIVED); + intent.putExtra(ReplyBody.class.getName(), (ReplyBody) obj); sendBroadcast(intent); } - - } @Override - public void messageSent(IoSession session, Object message) throws Exception { + public void messageSent(IoSession session, Object message) { if(message instanceof SentBody) { Intent intent = new Intent(); - intent.setAction(ACTION_SENT_SUCCESSED); - intent.putExtra("sentBody", (SentBody) message); + intent.setAction(CIMConstant.IntentAction.ACTION_SENT_SUCCESSED); + intent.putExtra(SentBody.class.getName(), (SentBody) message); sendBroadcast(intent); } - - logger.info(message); + } + + + private void setLastHeartbeatTime(IoSession session) + { + session.setAttribute(KEY_LAST_HEART_TIME, System.currentTimeMillis()); + } + + private long getLastHeartbeatTime(IoSession session) + { + long time = 0; + Object value = session.getAttribute(KEY_LAST_HEART_TIME); + if(value !=null){ + time = Long.parseLong(value.toString()); + } + return time; + } + + + @Override + public Object getRequest(IoSession arg0) { + return null; } @Override - public void inputClosed(IoSession arg0) throws Exception { - + public Object getResponse(IoSession session, Object arg1) { + return HeartbeatResponse.getInstance(); } -} \ No newline at end of file + + @Override + public boolean isRequest(IoSession session, Object data) { + + setLastHeartbeatTime(session); + + return data instanceof HeartbeatRequest; + } + + @Override + public boolean isResponse(IoSession arg0, Object arg1) { + return false; + } + + private void sendBroadcast(final Intent intent) { + executor.execute(new Runnable(){ + @Override + public void run() { + CIMEventBroadcastReceiver.getInstance().onReceive(intent); + } + }); + } +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventBroadcastReceiver.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventBroadcastReceiver.java index fc8060a..d358000 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventBroadcastReceiver.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventBroadcastReceiver.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; @@ -12,7 +27,7 @@ import java.util.Timer; import java.util.TimerTask; import com.farsunset.cim.sdk.client.constant.CIMConstant; -import com.farsunset.cim.sdk.client.exception.CIMSessionDisableException; +import com.farsunset.cim.sdk.client.exception.SessionDisconnectedException; import com.farsunset.cim.sdk.client.model.Intent; import com.farsunset.cim.sdk.client.model.Message; import com.farsunset.cim.sdk.client.model.ReplyBody; @@ -44,7 +59,7 @@ public class CIMEventBroadcastReceiver { /* * cim断开服务器事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_CLOSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_CLOSED)) { onInnerConnectionClosed(); } @@ -52,15 +67,16 @@ public class CIMEventBroadcastReceiver { /* * cim连接服务器失败事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_FAILED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED)) { - onInnerConnectionFailed((Exception) intent.getExtra("exception")); + long interval = intent.getLongExtra("interval", CIMConstant.RECONN_INTERVAL_TIME); + onInnerConnectionFailed((Exception) intent.getExtra(Exception.class.getName()),interval); } /* * cim连接服务器成功事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_SUCCESSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_SUCCESSED)) { onInnerConnectionSuccessed(); } @@ -68,51 +84,51 @@ public class CIMEventBroadcastReceiver { /* * 收到推送消息事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_MESSAGE_RECEIVED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_MESSAGE_RECEIVED)) { - onInnerMessageReceived((Message)intent.getExtra("message")); + onInnerMessageReceived((Message)intent.getExtra(Message.class.getName())); } /* * 获取收到replybody成功事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_REPLY_RECEIVED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_REPLY_RECEIVED)) { - listener.onReplyReceived((ReplyBody)intent.getExtra("replyBody")); + listener.onReplyReceived((ReplyBody)intent.getExtra(ReplyBody.class.getName())); } /* * 获取sendbody发送失败事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_SENT_FAILED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_SENT_FAILED)) { - onSentFailed((Exception) intent.getExtra("exception"),(SentBody)intent.getExtra("sentBody")); + onSentFailed((Exception) intent.getExtra(Exception.class.getName()),(SentBody)intent.getExtra(SentBody.class.getName())); } /* * 获取sendbody发送成功事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_SENT_SUCCESSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_SENT_SUCCESSED)) { - onSentSucceed((SentBody)intent.getExtra("sentBody")); + onSentSucceed((SentBody)intent.getExtra(SentBody.class.getName())); } /* * 获取cim数据传输异常事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_UNCAUGHT_EXCEPTION)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_UNCAUGHT_EXCEPTION)) { - onUncaughtException((Exception)intent.getExtra("exception")); + onUncaughtException((Exception)intent.getExtra(Exception.class.getName())); } /* * 重新连接,如果断开的话 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_RECOVERY)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_RECOVERY)) { CIMPushManager.connect(); } @@ -132,9 +148,9 @@ public class CIMEventBroadcastReceiver { - private void onInnerConnectionFailed(Exception e){ + private void onInnerConnectionFailed(Exception e,long interval){ - connectionHandler.schedule(new ConnectionTask(),random.nextInt(CIMConstant.RECONN_INTERVAL_TIME) + 20 ); + connectionHandler.schedule(new ConnectionTask(),interval); listener.onConnectionFailed(e); } @@ -159,14 +175,15 @@ public class CIMEventBroadcastReceiver { private void onSentFailed(Exception e, SentBody body){ + e.printStackTrace(); //与服务端端开链接,重新连接 - if(e instanceof CIMSessionDisableException) + if(e instanceof SessionDisconnectedException) { CIMPushManager.connect(); }else { //发送失败 重新发送 - CIMPushManager.sendRequest( body); + //CIMPushManager.sendRequest( body); } } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventListener.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventListener.java index 6d8e30e..385b3f3 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventListener.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventListener.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; @@ -21,31 +36,35 @@ public interface CIMEventListener * 当收到服务端推送过来的消息时调用 * @param message */ - public abstract void onMessageReceived(Message message); + void onMessageReceived(Message message); /** * 当调用CIMPushManager.sendRequest()向服务端发送请求,获得相应时调用 * @param replybody */ - public abstract void onReplyReceived(ReplyBody replybody); + void onReplyReceived(ReplyBody replybody); - /** * 当连接服务器成功时回调 * @param hasAutoBind : true 已经自动绑定账号到服务器了,不需要再手动调用bindAccount */ - public abstract void onConnectionSuccessed(boolean hasAutoBind); + void onConnectionSuccessed(boolean hasAutoBind); /** * 当断开服务器连接的时候回调 */ - public abstract void onConnectionClosed(); + void onConnectionClosed(); /** * 当服务器连接失败的时候回调 * */ - public abstract void onConnectionFailed(Exception e); + void onConnectionFailed(Exception e); + + /** + * 监听器在容器里面的排序。值越大则越先接收 + */ + int getEventDispatchOrder(); } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMListenerManager.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMListenerManager.java index 3948744..27ca337 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMListenerManager.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMListenerManager.java @@ -1,12 +1,31 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + import org.apache.log4j.Logger; + import com.farsunset.cim.sdk.client.model.Message; import com.farsunset.cim.sdk.client.model.ReplyBody; @@ -17,7 +36,7 @@ import com.farsunset.cim.sdk.client.model.ReplyBody; public class CIMListenerManager { private static ArrayList cimListeners = new ArrayList(); - + private static CIMMessageReceiveComparator comparator = new CIMMessageReceiveComparator(); protected static final Logger logger = Logger.getLogger(CIMListenerManager.class); @@ -25,6 +44,7 @@ public class CIMListenerManager { if (!cimListeners.contains(listener)) { cimListeners.add(listener); + Collections.sort(cimListeners,comparator); } } @@ -76,5 +96,21 @@ public class CIMListenerManager { logger.debug("#######" + listener.getClass().getName() + "#######" ); } } + + /** + * 消息接收activity的接收顺序排序,CIM_RECEIVE_ORDER倒序 + */ + private static class CIMMessageReceiveComparator implements Comparator{ + + @Override + public int compare(CIMEventListener arg1, CIMEventListener arg2) { + + int order1 = arg1.getEventDispatchOrder(); + int order2 = arg2.getEventDispatchOrder(); + return order2 - order1 ; + } + + } + -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushManager.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushManager.java index 0b1dbc2..4bb9423 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushManager.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushManager.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; import java.net.InetAddress; import java.net.NetworkInterface; @@ -30,7 +45,6 @@ public class CIMPushManager { static String ACTION_DESTORY ="ACTION_DESTORY"; - static String KEY_SEND_BODY ="KEY_SEND_BODY"; static String KEY_CIM_CONNECTION_STATUS ="KEY_CIM_CONNECTION_STATUS"; @@ -154,7 +168,7 @@ public class CIMPushManager { } Intent serviceIntent = new Intent(); - serviceIntent.putExtra(KEY_SEND_BODY, body); + serviceIntent.putExtra(SentBody.class.getName(), body); serviceIntent.setAction(ACTION_SEND_REQUEST_BODY); startService(serviceIntent); @@ -278,4 +292,4 @@ public class CIMPushManager { return null; } -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushService.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushService.java index f07f44d..c658350 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushService.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushService.java @@ -1,9 +1,24 @@ - /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; @@ -17,7 +32,7 @@ import com.farsunset.cim.sdk.client.model.SentBody; */ public class CIMPushService { - protected final static int DEF_CIM_PORT = 28888; + protected final static int DEF_CIM_PORT = 23456; private CIMConnectorManager manager; private static CIMPushService service; @@ -37,10 +52,8 @@ import com.farsunset.cim.sdk.client.model.SentBody; public void onStartCommand(Intent intent) { - if(intent==null) - { - return ; - } + intent = (intent == null ? new Intent(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE) : intent); + String action = intent.getAction(); @@ -53,7 +66,7 @@ import com.farsunset.cim.sdk.client.model.SentBody; if(CIMPushManager.ACTION_SEND_REQUEST_BODY.equals(action)) { - manager.send((SentBody) intent.getExtra(CIMPushManager.KEY_SEND_BODY)); + manager.send((SentBody) intent.getExtra(SentBody.class.getName())); } if(CIMPushManager.ACTION_CLOSE_CIM_CONNECTION.equals(action)) diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/constant/CIMConstant.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/constant/CIMConstant.java index fee11e3..5819d85 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/constant/CIMConstant.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/constant/CIMConstant.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.constant; /** @@ -11,48 +26,95 @@ package com.farsunset.cim.sdk.client.constant; */ public interface CIMConstant { + long RECONN_INTERVAL_TIME= 30 * 1000; + //消息头长度为3个字节,第一个字节为消息类型,第二,第三字节 转换int后为消息长度 + int DATA_HEADER_LENGTH = 3; + public static interface ReturnCode{ + + String CODE_404 ="404"; + + String CODE_403 ="403"; + + String CODE_405 ="405"; + + String CODE_200 ="200"; + + String CODE_206 ="206"; + + String CODE_500 ="500"; + + + } - public static String UTF8="UTF-8"; - - public static byte MESSAGE_SEPARATE='\b'; - - - //重连间隔随机数,在 30 -10 ----30+10 之间 - public static int RECONN_INTERVAL_TIME= 30 * 1000; - - public static int CIM_DEFAULT_MESSAGE_ORDER=1; - - - static class ConfigKey{ + public static interface ConfigKey{ public static String DEVICE_MODEL ="client.model"; public static String CLIENT_VERSION ="client.version"; public static String CLIENT_ACCOUNT ="client.account"; } - /** - * 服务端心跳请求命令 cmd_server_hb_request - */ - public static final String CMD_HEARTBEAT_REQUEST="S_H_RQ"; - /** - * 客户端心跳响应命令 cmd_client_hb_response - */ - public static final String CMD_HEARTBEAT_RESPONSE ="C_H_RS"; + public static interface ProtobufType{ + byte C_H_RS = 0; + byte S_H_RQ = 1; + byte MESSAGE = 2; + byte SENTBODY = 3; + byte REPLYBODY = 4; + } - public static class RequestKey{ + public static interface RequestKey{ - public static String CLIENT_BIND ="client_bind"; + String CLIENT_BIND ="client_bind"; - public static String CLIENT_OFFLINE_MESSAGE ="client_get_offline_message"; + String CLIENT_LOGOUT ="client_logout"; - public static String CLIENT_CYCLE_LOCATION ="client_cycle_location"; + @Deprecated + String CLIENT_PULL_MESSAGE ="client_pull_message"; - public static String CLIENT_PUSH_MESSAGE ="client_push_message"; - - public static String CLIENT_EXECUTE_SCRIPT ="client_execute_script"; - } -} \ No newline at end of file + + public static interface MessageAction{ + + //被其他设备登录挤下线消息 + String ACTION_999 ="999"; + //被系统禁用消息 + String ACTION_444 ="444"; + } + + + public static interface IntentAction{ + + // 消息广播action + String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; + + // 发送sendbody失败广播 + String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; + + // 发送sendbody成功广播 + String ACTION_SENT_SUCCESSED = "com.farsunset.cim.SENT_SUCCESSED"; + + // 链接意外关闭广播 + String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; + + // 链接失败广播 + String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; + + // 链接成功广播 + String ACTION_CONNECTION_SUCCESSED = "com.farsunset.cim.CONNECTION_SUCCESSED"; + + // 发送sendbody成功后获得replaybody回应广播 + String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; + + // 网络变化广播 + String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; + + // 未知异常 + String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; + + //重试连接 + String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; + } + +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/CIMSessionDisableException.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/CIMSessionDisableException.java deleted file mode 100644 index 967227f..0000000 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/CIMSessionDisableException.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.client.exception; - - -public class CIMSessionDisableException extends Exception { - - private static final long serialVersionUID = 1L; - - public CIMSessionDisableException() { - super(); - } - - public CIMSessionDisableException(String s) { - super(s); - } -} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetWorkDisableException.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetWorkDisableException.java deleted file mode 100644 index 43e657b..0000000 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetWorkDisableException.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.client.exception; - - -public class NetWorkDisableException extends Exception { - - private static final long serialVersionUID = 1L; - - public NetWorkDisableException() { - super(); - } - - public NetWorkDisableException(String s) { - super(s); - } -} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetworkDisconnectedException.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetworkDisconnectedException.java new file mode 100644 index 0000000..0557b47 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetworkDisconnectedException.java @@ -0,0 +1,36 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.exception; + + +public class NetworkDisconnectedException extends Exception { + + private static final long serialVersionUID = 1L; + + public NetworkDisconnectedException() { + super(); + } + + public NetworkDisconnectedException(String s) { + super(s); + } +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/SessionDisconnectedException.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/SessionDisconnectedException.java new file mode 100644 index 0000000..23f4427 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/SessionDisconnectedException.java @@ -0,0 +1,36 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.exception; + + +public class SessionDisconnectedException extends Exception { + + private static final long serialVersionUID = 1L; + + public SessionDisconnectedException() { + super(); + } + + public SessionDisconnectedException(String s) { + super(s); + } +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/WriteToClosedSessionException.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/WriteToClosedSessionException.java deleted file mode 100644 index 81a7ad3..0000000 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/WriteToClosedSessionException.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.client.exception; - -import java.io.Serializable; - - -public class WriteToClosedSessionException extends Exception implements Serializable { - - private static final long serialVersionUID = 1L; - - public WriteToClosedSessionException() { - super(); - } - - public WriteToClosedSessionException(String s) { - super(s); - } -} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageCodecFactory.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageCodecFactory.java index 860332d..65329f5 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageCodecFactory.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageCodecFactory.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.filter; import org.apache.mina.core.session.IoSession; @@ -12,26 +27,28 @@ import org.apache.mina.filter.codec.ProtocolDecoder; import org.apache.mina.filter.codec.ProtocolEncoder; /** - * android客户端端消息 编码解码器, 可以在 - * 关于消息加密与加密, 可在 encoder时进行消息加密,在ServerMessageCodecFactory的 decoder时对消息解密 + * android客户端端消息 编码解码器 */ public class ClientMessageCodecFactory implements ProtocolCodecFactory { + /** + * 消息编码器 + */ private final ClientMessageEncoder encoder; - + /** + * 消息解码器 + */ private final ClientMessageDecoder decoder; - + + public ClientMessageCodecFactory() { encoder = new ClientMessageEncoder(); decoder = new ClientMessageDecoder(); } - - - public ProtocolEncoder getEncoder(IoSession session) { + + public ProtocolEncoder getEncoder(IoSession session) throws Exception { return encoder; } - - public ProtocolDecoder getDecoder(IoSession session) throws Exception { return decoder; } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java index aa3adae..8677a2c 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java @@ -1,169 +1,142 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.filter; -import java.io.ByteArrayInputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; +import org.apache.log4j.Logger; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.CumulativeProtocolDecoder; import org.apache.mina.filter.codec.ProtocolDecoderOutput; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import com.farsunset.cim.sdk.client.constant.CIMConstant; +import com.farsunset.cim.sdk.client.model.HeartbeatRequest; import com.farsunset.cim.sdk.client.model.Message; import com.farsunset.cim.sdk.client.model.ReplyBody; +import com.farsunset.cim.sdk.model.proto.MessageProto; +import com.farsunset.cim.sdk.model.proto.ReplyBodyProto; +import com.google.protobuf.InvalidProtocolBufferException; /** * 客户端消息解码 */ public class ClientMessageDecoder extends CumulativeProtocolDecoder { - + protected final Logger logger = Logger.getLogger(ClientMessageDecoder.class); + @Override public boolean doDecode(IoSession iosession, IoBuffer iobuffer, ProtocolDecoderOutput out) throws Exception { - - IoBuffer buff = IoBuffer.allocate(320).setAutoExpand(true); - - boolean complete = false; - - - iobuffer.mark(); - - - while (iobuffer.hasRemaining()) { - byte b = iobuffer.get(); - /** - * CIMConstant.MESSAGE_SEPARATE 为消息界限 - * 当一次收到多个消息时,以此分隔解析多个消息 - */ - if (b == CIMConstant.MESSAGE_SEPARATE) { - - complete = true; - break; - } else { - buff.put(b); - } - } - - if (complete) { - buff.flip(); - byte[] bytes = new byte[buff.limit()]; - buff.get(bytes); - String message = new String(bytes, CIMConstant.UTF8); - buff.clear(); - - try - { - Object msg = mappingMessageObject(message); - out.write(msg); - }catch(Exception e) - { - e.printStackTrace(); - } - }else{ - //读取了一部分发现消息没有结束,则重置为没有读取 - iobuffer.reset(); - } - - return complete; + /** + * 消息头3位 + */ + if(iobuffer.remaining() < CIMConstant.DATA_HEADER_LENGTH){ + return false; + } + + iobuffer.mark(); + + byte conetnType = iobuffer.get(); + + byte lv =iobuffer.get();//int 低位 + byte hv =iobuffer.get();//int 高位 + + int conetnLength = getContentLength(lv,hv); + + //如果消息体没有接收完整,则重置读取,等待下一次重新读取 + if(conetnLength > iobuffer.remaining()){ + iobuffer.reset(); + return false; + } + + byte[] dataBytes = new byte[conetnLength]; + iobuffer.get(dataBytes, 0, conetnLength); + + Object message = mappingMessageObject(dataBytes,conetnType); + if(message!=null){ + out.write(message); + } + + return true; } - private Object mappingMessageObject(String message) throws Exception { + private Object mappingMessageObject(byte[] bytes,byte type) throws InvalidProtocolBufferException { - - if(CIMConstant.CMD_HEARTBEAT_REQUEST.equalsIgnoreCase(message)) + if(CIMConstant.ProtobufType.S_H_RQ == type) { - return message; + HeartbeatRequest request = HeartbeatRequest.getInstance(); + logger.info(request.toString()); + return request; } - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = (Document) builder.parse(new ByteArrayInputStream(message.getBytes(CIMConstant.UTF8))); - - String name = doc.getDocumentElement().getTagName(); - if (name.equals("reply")) { - ReplyBody reply = new ReplyBody(); - reply.setKey(doc.getElementsByTagName("key").item(0).getTextContent()); - reply.setCode(doc.getElementsByTagName("code").item(0).getTextContent()); - NodeList items = doc.getElementsByTagName("data").item(0).getChildNodes(); - for (int i = 0; i < items.getLength(); i++) { - Node node = items.item(i); - reply.getData().put(node.getNodeName(), node.getTextContent()); - } - return reply; - } - if (name.equals("message")) { - - Message body = new Message(); - NodeList nodeList = doc.getElementsByTagName("message").item(0).getChildNodes(); - int count = nodeList.getLength(); - for(int i = 0;i < count; i++){ - Node node = nodeList.item(i); - - if(node.getNodeName().equals("mid")) - { - body.setMid(node.getTextContent()); - } - - if(node.getNodeName().equals("type")) - { - body.setType(node.getTextContent()); - } - - if(node.getNodeName().equals("file")) - { - body.setFile(node.getTextContent()); - } - - if(node.getNodeName().equals("fileType")) - { - body.setFileType(node.getTextContent()); - } - - if(node.getNodeName().equals("content")) - { - body.setContent(node.getTextContent()); - } - - if(node.getNodeName().equals("sender")) - { - body.setSender(node.getTextContent()); - } - - if(node.getNodeName().equals("receiver")) - { - body.setReceiver(node.getTextContent()); - } - - if(node.getNodeName().equals("format")) - { - body.setFormat(node.getTextContent()); - } - - if(node.getNodeName().equals("timestamp")) - { - body.setTimestamp(Long.valueOf(node.getTextContent())); - } - } - - return body; + if(CIMConstant.ProtobufType.REPLYBODY == type) + { + ReplyBodyProto.Model bodyProto = ReplyBodyProto.Model.parseFrom(bytes); + ReplyBody body = new ReplyBody(); + body.setKey(bodyProto.getKey()); + body.setTimestamp(bodyProto.getTimestamp()); + body.putAll(bodyProto.getDataMap()); + body.setCode(bodyProto.getCode()); + body.setMessage(bodyProto.getMessage()); + + logger.info(body.toString()); + + return body; } - return null; + if(CIMConstant.ProtobufType.MESSAGE == type) + { + MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bytes); + Message message = new Message(); + message.setMid(bodyProto.getMid()); + message.setAction(bodyProto.getAction()); + message.setContent(bodyProto.getContent()); + message.setSender(bodyProto.getSender()); + message.setReceiver(bodyProto.getReceiver()); + message.setTitle(bodyProto.getTitle()); + message.setExtra(bodyProto.getExtra()); + message.setTimestamp(bodyProto.getTimestamp()); + message.setFormat(bodyProto.getFormat()); + + logger.info(message.toString()); + return message; + } + + return null; + + } + + /** + * 解析消息体长度 + * @param type + * @param length + * @return + */ + private int getContentLength(byte lv,byte hv){ + int l = (lv & 0xff); + int h = (hv & 0xff); + return (l| (h <<= 8)); } - } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageEncoder.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageEncoder.java index 52f24f0..6d210be 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageEncoder.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageEncoder.java @@ -1,35 +1,73 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.filter; - - +import org.apache.log4j.Logger; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolEncoderAdapter; import org.apache.mina.filter.codec.ProtocolEncoderOutput; - import com.farsunset.cim.sdk.client.constant.CIMConstant; +import com.farsunset.cim.sdk.client.model.Protobufable; /** - * 客户端消息发送前进行编码,可在此加密消息 + * 客户端消息发送前进行编码 */ public class ClientMessageEncoder extends ProtocolEncoderAdapter { - @Override - public void encode(IoSession iosession, Object message, ProtocolEncoderOutput out) throws Exception { - IoBuffer buff = IoBuffer.allocate(320).setAutoExpand(true); - buff.put(message.toString().getBytes(CIMConstant.UTF8)); - buff.put(CIMConstant.MESSAGE_SEPARATE); - buff.flip(); - out.write(buff); + protected final Logger logger = Logger.getLogger(ClientMessageEncoder.class); + @Override + public void encode(IoSession iosession, Object object, ProtocolEncoderOutput out) throws Exception { + + if(object instanceof Protobufable){ + + Protobufable data = (Protobufable) object; + byte[] byteArray = data.getByteArray(); + + IoBuffer buff = IoBuffer.allocate(byteArray.length + CIMConstant.DATA_HEADER_LENGTH).setAutoExpand(true); + + buff.put(createHeader(data.getType(),byteArray.length)); + buff.put(byteArray); + + buff.flip(); + out.write(buff); + //打印出收到的消息 + logger.info(data.toString()); + } + } - - + /** + * 消息体最大为65535 + * @param type + * @param length + * @return + */ + private byte[] createHeader(byte type,int length){ + byte[] header = new byte[CIMConstant.DATA_HEADER_LENGTH]; + header[0] = type; + header[1] = (byte) (length & 0xff); + header[2] = (byte) ((length >> 8) & 0xff); + return header; + } } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatRequest.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatRequest.java new file mode 100644 index 0000000..8376728 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatRequest.java @@ -0,0 +1,63 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.client.constant.CIMConstant; + +/** + * 服务端心跳请求 + * + */ +public class HeartbeatRequest implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "SERVER_HEARTBEAT_REQUEST"; + private static final String CMD_HEARTBEAT_RESPONSE = "SR"; + + private static HeartbeatRequest object = new HeartbeatRequest(); + + private HeartbeatRequest(){ + + } + + public static HeartbeatRequest getInstance() { + return object; + } + + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + + @Override + public byte getType() { + return CIMConstant.ProtobufType.S_H_RQ; + } + +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatResponse.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatResponse.java new file mode 100644 index 0000000..2487634 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatResponse.java @@ -0,0 +1,60 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.client.constant.CIMConstant; + +/** + * 客户端心跳响应 + */ +public class HeartbeatResponse implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "CLIENT_HEARTBEAT_RESPONSE"; + private static final String CMD_HEARTBEAT_RESPONSE = "CR"; + + private static HeartbeatResponse object = new HeartbeatResponse(); + + private HeartbeatResponse(){ + + } + + public static HeartbeatResponse getInstance() { + return object; + } + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.C_H_RS; + } + +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Intent.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Intent.java index c7b9b83..c6d6e6f 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Intent.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Intent.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.model; import java.io.Serializable; @@ -20,6 +35,14 @@ public class Intent implements Serializable { private HashMap data = new HashMap(); + + public Intent() { + } + + public Intent(String action) { + this.action = action; + } + public String getAction() { return action; } @@ -34,4 +57,13 @@ public class Intent implements Serializable { public Object getExtra(String key){ return data.get(key); } + + public long getLongExtra(String key, long defValue) { + Object v = getExtra(key); + try{ + return Long.parseLong(v.toString()); + }catch(Exception e){ + return defValue; + } + } } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java index abb30a1..0f0d69b 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java @@ -1,12 +1,28 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.model; import java.io.Serializable; + /** * 消息对象 */ @@ -24,13 +40,16 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String type; - + private String action; + /** + * 消息标题 + */ + private String title; + /** + * 消息类容,于action 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 + */ private String content; - private String file; - - private String fileType; /** * 消息发送者账号 */ @@ -40,12 +59,18 @@ public class Message implements Serializable { */ private String receiver; + + /** * content 内容格式 */ private String format; - + /** + * 附加内容 内容 + */ + private String extra; + private long timestamp; @@ -61,7 +86,22 @@ public class Message implements Serializable { this.timestamp = timestamp; } - + + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + public String getContent() { return content; } @@ -87,7 +127,6 @@ public class Message implements Serializable { } - public String getFormat() { return format; } @@ -97,71 +136,29 @@ public class Message implements Serializable { } - public String getType() { - return type; + + public String getExtra() { + return extra; } - public void setType(String type) { - this.type = type; - } - public String getFile() { - return file; - } - public void setFile(String file) { - this.file = file; - } - public String getFileType() { - return fileType; - } - public void setFileType(String fileType) { - this.fileType = fileType; + public void setExtra(String extra) { + this.extra = extra; } public String toString() { - + StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(mid).append(""); - - if (isNotEmpty(type)) { - buffer.append("").append(type).append(""); - } - - if (isNotEmpty(file)) { - buffer.append("").append(file).append(""); - } - - if (isNotEmpty(fileType)) { - buffer.append("").append(fileType).append(""); - } - - if (isNotEmpty(content)) { - buffer.append(""); - } - - if (isNotEmpty(sender)) { - buffer.append("").append(sender).append(""); - } - - if (isNotEmpty(receiver)) { - buffer.append("").append(receiver).append(""); - } - - if (isNotEmpty(format)) { - buffer.append("").append(format).append(""); - } - - if (timestamp > 0) { - buffer.append("").append(timestamp).append(""); - } - - buffer.append(""); + buffer.append("#Message#").append("\n"); + buffer.append("mid:").append(mid).append("\n"); + buffer.append("action:").append(action).append("\n"); + buffer.append("title:").append(title).append("\n"); + buffer.append("content:").append(content).append("\n"); + buffer.append("extra:").append(extra).append("\n"); + buffer.append("sender:").append(sender).append("\n"); + buffer.append("receiver:").append(receiver).append("\n"); + buffer.append("format:").append(format).append("\n"); + buffer.append("timestamp:").append(timestamp); return buffer.toString(); } - - public String toXmlString() { - - return toString(); - } + public String getMid() { return mid; @@ -172,8 +169,8 @@ public class Message implements Serializable { } public boolean isNotEmpty(String txt) { - return txt != null && txt.trim().length()>0; + return txt != null && txt.trim().length()!=0; } - + } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Protobufable.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Protobufable.java new file mode 100644 index 0000000..5631e28 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Protobufable.java @@ -0,0 +1,31 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.model; +/** + * 需要向另一端发送的结构体 + */ +public interface Protobufable { + + byte[] getByteArray(); + + byte getType(); +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/ReplyBody.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/ReplyBody.java index a567452..046a787 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/ReplyBody.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/ReplyBody.java @@ -1,13 +1,30 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * 请求应答对象 * @@ -64,7 +81,9 @@ public class ReplyBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } } public String get(String k) { @@ -83,8 +102,12 @@ public class ReplyBody implements Serializable { this.message = message; } - public HashMap getData() { - return data; + public void putAll(Map map) { + data.putAll(map); + } + + public Set getKeySet() { + return data.keySet(); } public String getCode() { @@ -98,27 +121,22 @@ public class ReplyBody implements Serializable { public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(this.getKey()).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append("").append(code).append(""); - buffer.append(""); - for(String key:this.getData().keySet()) - { - buffer.append("<"+key+">").append(this.get(key)).append(""); + buffer.append("#ReplyBody#").append("\n"); + buffer.append("key:").append(this.getKey()).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + buffer.append("code:").append(code).append("\n"); + + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); + return buffer.toString(); } - - public String toXmlString() - { - - return toString(); - } } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/SentBody.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/SentBody.java index 7e140e4..d193b07 100644 --- a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/SentBody.java +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/SentBody.java @@ -1,30 +1,48 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import com.farsunset.cim.sdk.client.constant.CIMConstant; +import com.farsunset.cim.sdk.model.proto.SentBodyProto; /** * java |android 客户端请求结构 * */ -public class SentBody implements Serializable { +public class SentBody implements Serializable,Protobufable { private static final long serialVersionUID = 1L; private String key; - private HashMap data; + private HashMap data = new HashMap();; private long timestamp; public SentBody() { - - data = new HashMap(); timestamp = System.currentTimeMillis(); } @@ -49,35 +67,54 @@ public class SentBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } + } + public void putAll(Map map) { + data.putAll(map); } + public Set getKeySet() { + return data.keySet(); + } + + public void remove(String k) { data.remove(k); } - public HashMap getData() { - return data; - } - @Override public String toString() { StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(key).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append(""); - for (String key : data.keySet()) { - buffer.append("<" + key + ">"); + buffer.append("#SentBody#").append("\n");; + buffer.append("key:").append(key).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); return buffer.toString(); } - - public String toXmlString() { - - return toString(); + + @Override + public byte[] getByteArray() { + SentBodyProto.Model.Builder builder = SentBodyProto.Model.newBuilder(); + builder.setKey(key); + builder.setTimestamp(timestamp); + if(!data.isEmpty()){ + builder.putAllData(data); + } + return builder.build().toByteArray(); } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.SENTBODY; + } + } diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto new file mode 100644 index 0000000..bd6d327 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.model.proto; +option java_outer_classname="MessageProto"; +message Model { + string mid = 1; + string action = 2; + string content = 3; + string sender = 4; + string receiver = 5; + string extra = 6; + string title = 7; + string format = 8; + int64 timestamp = 9; +} + \ No newline at end of file diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java new file mode 100644 index 0000000..3876250 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java @@ -0,0 +1,1603 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.model.proto; + +public final class MessageProto { + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string mid = 1; + */ + java.lang.String getMid(); + /** + * string mid = 1; + */ + com.google.protobuf.ByteString + getMidBytes(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + mid_ = ""; + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + mid_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); + } + + public static final int MID_FIELD_NUMBER = 1; + private volatile java.lang.Object mid_; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) obj; + + boolean result = true; + result = result && getMid() + .equals(other.getMid()); + result = result && getAction() + .equals(other.getAction()); + result = result && getContent() + .equals(other.getContent()); + result = result && getSender() + .equals(other.getSender()); + result = result && getReceiver() + .equals(other.getReceiver()); + result = result && getExtra() + .equals(other.getExtra()); + result = result && getTitle() + .equals(other.getTitle()); + result = result && getFormat() + .equals(other.getFormat()); + result = result && (getTimestamp() + == other.getTimestamp()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MID_FIELD_NUMBER; + hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) + com.farsunset.cim.sdk.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + mid_ = ""; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(this); + result.mid_ = mid_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (!other.getMid().isEmpty()) { + mid_ = other.mid_; + onChanged(); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object mid_ = ""; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mid = 1; + */ + public Builder setMid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mid_ = value; + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder clearMid() { + + mid_ = getDefaultInstance().getMid(); + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder setMidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mid_ = value; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) + private static final com.farsunset.cim.sdk.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022!com.farsunset.cim.sdk.m" + + "odel.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(\t\022\016\n\006act" + + "ion\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sender\030\004 \001" + + "(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001(\t\022\r\n\005t" + + "itle\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttimestamp\030" + + "\t \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, + new java.lang.String[] { "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBody.proto b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBody.proto new file mode 100644 index 0000000..f7875f7 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBody.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.model.proto; +option java_outer_classname="ReplyBodyProto"; + +message Model { + string key = 1; + string code = 2; + string message = 3; + int64 timestamp =4; + map data =5; + +} + \ No newline at end of file diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBodyProto.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBodyProto.java new file mode 100644 index 0000000..5d80348 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBodyProto.java @@ -0,0 +1,1241 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.model.proto; + +public final class ReplyBodyProto { + private ReplyBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string code = 2; + */ + java.lang.String getCode(); + /** + * string code = 2; + */ + com.google.protobuf.ByteString + getCodeBytes(); + + /** + * string message = 3; + */ + java.lang.String getMessage(); + /** + * string message = 3; + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + * int64 timestamp = 4; + */ + long getTimestamp(); + + /** + * map<string, string> data = 5; + */ + int getDataCount(); + /** + * map<string, string> data = 5; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 5; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + code_ = ""; + message_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + code_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 32: { + + timestamp_ = input.readInt64(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object code_; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 4; + private long timestamp_; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 5; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, code_); + } + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + if (timestamp_ != 0L) { + output.writeInt64(4, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 5); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!getCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, code_); + } + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model other = (com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && getCode() + .equals(other.getCode()); + result = result && getMessage() + .equals(other.getMessage()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + code_ = ""; + + message_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model build() { + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model result = new com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.code_ = code_; + result.message_ = message_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string code = 2; + */ + public Builder setCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value; + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder clearCode() { + + code_ = getDefaultInstance().getCode(); + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder setCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + code_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string message = 3; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 4; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 4; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 5; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) + private static final com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017ReplyBody.proto\022!com.farsunset.cim.sdk" + + ".model.proto\"\265\001\n\005Model\022\013\n\003key\030\001 \001(\t\022\014\n\004c" + + "ode\030\002 \001(\t\022\017\n\007message\030\003 \001(\t\022\021\n\ttimestamp\030" + + "\004 \001(\003\022@\n\004data\030\005 \003(\01322.com.farsunset.cim." + + "sdk.model.proto.Model.DataEntry\032+\n\tDataE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\020B\016" + + "ReplyBodyProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Code", "Message", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBody.proto b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBody.proto new file mode 100644 index 0000000..33785e6 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBody.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.model.proto; +option java_outer_classname="SentBodyProto"; + +message Model { + string key = 1; + int64 timestamp =2; + map data =3; + +} + \ No newline at end of file diff --git a/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBodyProto.java b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBodyProto.java new file mode 100644 index 0000000..5514e63 --- /dev/null +++ b/cim_for_mina/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBodyProto.java @@ -0,0 +1,966 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.model.proto; + +public final class SentBodyProto { + private SentBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * int64 timestamp = 2; + */ + long getTimestamp(); + + /** + * map<string, string> data = 3; + */ + int getDataCount(); + /** + * map<string, string> data = 3; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 3; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 16: { + + timestamp_ = input.readInt64(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 3; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (timestamp_ != 0L) { + output.writeInt64(2, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 3); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.model.proto.SentBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model other = (com.farsunset.cim.sdk.model.proto.SentBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.SentBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) + com.farsunset.cim.sdk.model.proto.SentBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.model.proto.SentBodyProto.Model build() { + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.model.proto.SentBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model result = new com.farsunset.cim.sdk.model.proto.SentBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.model.proto.SentBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.model.proto.SentBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.SentBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.model.proto.SentBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 2; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 2; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 3; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) + private static final com.farsunset.cim.sdk.model.proto.SentBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.SentBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016SentBody.proto\022!com.farsunset.cim.sdk." + + "model.proto\"\226\001\n\005Model\022\013\n\003key\030\001 \001(\t\022\021\n\tti" + + "mestamp\030\002 \001(\003\022@\n\004data\030\003 \003(\01322.com.farsun" + + "set.cim.sdk.model.proto.Model.DataEntry\032" + + "+\n\tDataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + + ":\0028\001B\017B\rSentBodyProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-server-sdk/.classpath b/cim_for_mina/cim-server-sdk/.classpath index f6610bc..423e344 100644 --- a/cim_for_mina/cim-server-sdk/.classpath +++ b/cim_for_mina/cim-server-sdk/.classpath @@ -1,8 +1,9 @@ - - + + + diff --git a/cim_for_mina/cim-server-sdk/libs/log4j-1.2.17.jar b/cim_for_mina/cim-server-sdk/libs/log4j-1.2.17.jar new file mode 100644 index 0000000..068867e Binary files /dev/null and b/cim_for_mina/cim-server-sdk/libs/log4j-1.2.17.jar differ diff --git a/cim_for_mina/cim-server-sdk/libs/mina-core-2.0.16.jar b/cim_for_mina/cim-server-sdk/libs/mina-core-2.0.16.jar new file mode 100644 index 0000000..0e6d988 Binary files /dev/null and b/cim_for_mina/cim-server-sdk/libs/mina-core-2.0.16.jar differ diff --git a/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.2.0.jar new file mode 100644 index 0000000..b1f9701 Binary files /dev/null and b/cim_for_mina/cim-server-sdk/libs/protobuf-java-3.2.0.jar differ diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/constant/CIMConstant.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/constant/CIMConstant.java index 3881fdd..0010c19 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/constant/CIMConstant.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/constant/CIMConstant.java @@ -1,79 +1,64 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.constant; /** * 常量 */ public interface CIMConstant { - - public static class ReturnCode{ + //消息头长度为3个字节,第一个字节为消息类型,第二,第三字节 转换int后为消息长度 + int DATA_HEADER_LENGTH = 3; + public static interface ReturnCode{ - public static String CODE_404 ="404"; - - public static String CODE_403 ="403"; - - public static String CODE_405 ="405"; - - public static String CODE_200 ="200"; - - public static String CODE_206 ="206"; - - public static String CODE_500 ="500"; - - - } - - public static String UTF8="UTF-8"; - - public static byte MESSAGE_SEPARATE='\b'; - //flex客户端 安全策略验证时会收到\0 - public static byte FLEX_DATA_SEPARATE = '\0'; - - - public static int CIM_DEFAULT_MESSAGE_ORDER=1; - - - public static final String SESSION_KEY ="account"; - - public static final String HEARTBEAT_KEY ="heartbeat"; - - - /** - * FLEX 客户端socket请求发的安全策略请求,需要特殊处理,返回安全验证报文 - */ - public static final String FLEX_POLICY_REQUEST =""; - - public static final String FLEX_POLICY_RESPONSE ="\0"; - - /** - * 服务端心跳请求命令 cmd_server_hb_request - */ - public static final String CMD_HEARTBEAT_REQUEST="S_H_RQ"; - /** - * 客户端心跳响应命令 cmd_client_hb_response - */ - public static final String CMD_HEARTBEAT_RESPONSE ="C_H_RS"; + String CODE_200 ="200"; - - - public static class SessionStatus{ + String CODE_404 ="404"; - public static int STATUS_OK =0; + String CODE_403 ="403"; - public static int STATUS_CLOSED =1; + String CODE_500 ="500"; } - - public static class MessageType{ - - //用户会 踢出下线消息类型 - public static String TYPE_999 ="999"; - + + + + String SESSION_KEY ="account"; + String HEARTBEAT_KEY ="heartbeat"; + + + public static interface ProtobufType{ + byte C_H_RS = 0; + byte S_H_RQ = 1; + byte MESSAGE = 2; + byte SENTBODY = 3; + byte REPLYBODY = 4; } + + public static interface MessageAction{ + + //被其他设备登录挤下线消息 + String ACTION_999 ="999"; + //被系统禁用消息 + String ACTION_444 ="444"; + } -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageCodecFactory.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageCodecFactory.java index c250f6e..5801d85 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageCodecFactory.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageCodecFactory.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.filter; import org.apache.mina.core.session.IoSession; @@ -12,8 +27,7 @@ import org.apache.mina.filter.codec.ProtocolDecoder; import org.apache.mina.filter.codec.ProtocolEncoder; /** - * 服务端消息 编码解码器, 可以在 - * 关于消息加密与加密, 可在 encoder时进行消息加密,在ClientMessageCodecFactory的 decoder时对消息解密 + * 服务端消息 编码解码器 */ public class ServerMessageCodecFactory implements ProtocolCodecFactory { diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageDecoder.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageDecoder.java index 7b00236..f4b12ec 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageDecoder.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageDecoder.java @@ -1,116 +1,109 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.filter; -import java.io.ByteArrayInputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - import org.apache.log4j.Logger; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.CumulativeProtocolDecoder; import org.apache.mina.filter.codec.ProtocolDecoderOutput; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.model.HeartbeatResponse; import com.farsunset.cim.sdk.server.model.SentBody; +import com.farsunset.cim.sdk.server.model.proto.SentBodyProto; /** - * 服务端接收消息解码,可在此解密消息 + * 服务端接收消息解码 */ public class ServerMessageDecoder extends CumulativeProtocolDecoder { protected final Logger logger = Logger.getLogger(ServerMessageDecoder.class); @Override public boolean doDecode(IoSession iosession, IoBuffer iobuffer, ProtocolDecoderOutput out) throws Exception { - - boolean complete = false; - IoBuffer tBuffer = IoBuffer.allocate(320).setAutoExpand(true); + /** + * 消息头3位 + */ + if(iobuffer.remaining() < CIMConstant.DATA_HEADER_LENGTH){ + return false; + } iobuffer.mark(); - while (iobuffer.hasRemaining()) { - byte b = iobuffer.get(); - /** - * CIMConstant.MESSAGE_SEPARATE 为消息界限 - * 当一次收到多个消息时,以此分隔解析多个消息 - */ - if (b == CIMConstant.MESSAGE_SEPARATE ) { - - complete = true; - break; - }else if(b == CIMConstant.FLEX_DATA_SEPARATE)//flex客户端 安全策略验证时会收到\0的消息,忽略此消息内容 - { - complete = true; - break; - } - else { - tBuffer.put(b); - } - } - if (complete) { - tBuffer.flip(); - byte[] bytes = new byte[tBuffer.limit()]; - tBuffer.get(bytes); - - String message = new String(bytes, CIMConstant.UTF8); - - logger.info(message); - - tBuffer.clear(); - try{ - - Object body = getSentBody(message); - out.write(body); - }catch(Exception e){ - out.write(message);//解析xml失败 是返回原始的xml数据到上层处理,比如flex sokcet的 安全验证请求xml - e.printStackTrace(); - logger.error(e); - } - }else - { - iobuffer.reset();//如果消息没有接收完整,对buffer进行重置,下次继续读取 - } - return complete; + byte conetnType = iobuffer.get(); + byte lv =iobuffer.get();//int 低位 + byte hv =iobuffer.get();//int 高位 + + int conetnLength = getContentLength(lv,hv); + + + //如果消息体没有接收完整,则重置读取,等待下一次重新读取 + if(conetnLength > iobuffer.remaining()){ + iobuffer.reset(); + return false; + } + + byte[] dataBytes = new byte[conetnLength]; + iobuffer.get(dataBytes, 0, conetnLength); + + Object message = mappingMessageObject(dataBytes,conetnType); + if(message != null){ + out.write(message); + } + return true; } - public Object getSentBody(String message) throws Exception + public Object mappingMessageObject(byte[] data,byte type) throws Exception { - if(CIMConstant.CMD_HEARTBEAT_RESPONSE.equalsIgnoreCase(message)) + if(CIMConstant.ProtobufType.C_H_RS == type) { - return CIMConstant.CMD_HEARTBEAT_RESPONSE; + HeartbeatResponse response = HeartbeatResponse.getInstance(); + logger.info(response.toString()); + return response; } - if(CIMConstant.FLEX_POLICY_REQUEST.equalsIgnoreCase(message)) + if(CIMConstant.ProtobufType.SENTBODY == type) { - return CIMConstant.FLEX_POLICY_REQUEST; + SentBodyProto.Model bodyProto = SentBodyProto.Model.parseFrom(data); + SentBody body = new SentBody(); + body.setKey(bodyProto.getKey()); + body.setTimestamp(bodyProto.getTimestamp()); + body.putAll(bodyProto.getDataMap()); + logger.info(body.toString()); + + return body; } - - SentBody body = new SentBody(); - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = builder.parse(new ByteArrayInputStream(message.getBytes(CIMConstant.UTF8))); - body.setKey(doc.getElementsByTagName("key").item(0).getTextContent()); - - NodeList datas = doc.getElementsByTagName("data"); - if(datas!=null&&datas.getLength()>0) - { - NodeList items = datas.item(0).getChildNodes(); - for (int i = 0; i < items.getLength(); i++) { - Node node = items.item(i); - body.getData().put(node.getNodeName(), node.getTextContent()); - } - } - - return body; + return null; } + /** + * 解析消息体长度 + * @param type + * @param length + * @return + */ + private int getContentLength(byte lv,byte hv){ + int l = (lv & 0xff); + int h = (hv & 0xff); + return (l| (h <<= 8)); + } } diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageEncoder.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageEncoder.java index 82998d3..2358807 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageEncoder.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageEncoder.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.filter; import org.apache.log4j.Logger; @@ -13,23 +28,48 @@ import org.apache.mina.filter.codec.ProtocolEncoderAdapter; import org.apache.mina.filter.codec.ProtocolEncoderOutput; import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.model.Protobufable; + /** - * 服务端发送消息前编码,可在此加密消息 + * 服务端发送消息前编码 */ public class ServerMessageEncoder extends ProtocolEncoderAdapter { protected final Logger logger = Logger.getLogger(ServerMessageEncoder.class); @Override - public void encode(IoSession iosession, Object message, ProtocolEncoderOutput out) throws Exception { + public void encode(IoSession iosession, Object object, ProtocolEncoderOutput out) throws Exception { - IoBuffer buff = IoBuffer.allocate(320).setAutoExpand(true); - buff.put(message.toString().getBytes(CIMConstant.UTF8)); - buff.put(CIMConstant.MESSAGE_SEPARATE); - buff.flip(); - out.write(buff); - - logger.debug(message); + if(object instanceof Protobufable){ + + Protobufable data = (Protobufable) object; + byte[] byteArray = data.getByteArray(); + + IoBuffer buff = IoBuffer.allocate(byteArray.length + CIMConstant.DATA_HEADER_LENGTH).setAutoExpand(true); + + buff.put(createHeader(data.getType(),byteArray.length)); + buff.put(byteArray); + + buff.flip(); + out.write(buff); + + //打印出收到的消息 + logger.info(data.toString()); + } + } + + /** + * 消息体最大为65535 + * @param type + * @param length + * @return + */ + private byte[] createHeader(byte type,int length){ + byte[] header = new byte[CIMConstant.DATA_HEADER_LENGTH]; + header[0] = type; + header[1] = (byte) (length & 0xff); + header[2] = (byte) ((length >> 8) & 0xff); + return header; } diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMIoHandler.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMIoHandler.java deleted file mode 100644 index 291cb42..0000000 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMIoHandler.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.server.handler; - -import java.util.HashMap; - -import org.apache.log4j.Logger; -import org.apache.mina.core.service.IoHandlerAdapter; -import org.apache.mina.core.session.IdleStatus; -import org.apache.mina.core.session.IoSession; - -import com.farsunset.cim.sdk.server.constant.CIMConstant; -import com.farsunset.cim.sdk.server.model.ReplyBody; -import com.farsunset.cim.sdk.server.model.SentBody; -import com.farsunset.cim.sdk.server.session.CIMSession; - -/** - * - * 客户端请求的入口,所有请求都首先经过它分发处理 - */ -public class CIMIoHandler extends IoHandlerAdapter { - - protected final Logger logger = Logger.getLogger(CIMIoHandler.class); - private final static String CIMSESSION_CLOSED_HANDLER_KEY = "client_cimsession_closed"; - private HashMap handlers = new HashMap(); - - - - public void sessionCreated(IoSession session) throws Exception { - logger.debug("sessionCreated()... from "+session.getRemoteAddress()); - } - - - public void sessionOpened(IoSession session) throws Exception { - - } - - - public void messageReceived(IoSession ios, Object message) - throws Exception { - - /** - * flex 客户端安全策略请求,需要返回特定报文 - */ - if(CIMConstant.FLEX_POLICY_REQUEST.equals(message)) - { - ios.write(CIMConstant.FLEX_POLICY_RESPONSE); - return ; - } - - - if(!(message instanceof SentBody)) - { - return ; - } - CIMSession cimSession =new CIMSession(ios); - ReplyBody reply = new ReplyBody(); - SentBody body = (SentBody) message; - String key = body.getKey(); - - CIMRequestHandler handler = handlers.get(key); - if (handler == null) { - reply.setCode(CIMConstant.ReturnCode.CODE_405); - reply.setCode("KEY ["+key+"] 服务端未定义"); - } else { - reply = handler.process(cimSession, body); - } - - if(reply!=null) - { - reply.setKey(key); - cimSession.write(reply); - logger.info("-----------------------process done. reply: " + reply.toString()); - } - } - - /** - */ - public void sessionClosed(IoSession ios) throws Exception { - logger.warn(ios.getRemoteAddress()); - CIMSession cimSession =new CIMSession(ios); - CIMRequestHandler handler = handlers.get(CIMSESSION_CLOSED_HANDLER_KEY); - handler.process(cimSession, null); - } - - /** - */ - public void sessionIdle(IoSession session, IdleStatus status) - throws Exception { - logger.debug("sessionIdle()... from "+session.getRemoteAddress()); - } - - /** - */ - public void exceptionCaught(IoSession session, Throwable cause) - throws Exception { - logger.error(cause); - cause.printStackTrace(); - } - - /** - */ - public void messageSent(IoSession session, Object message) throws Exception { - } - - - public HashMap getHandlers() { - return handlers; - } - - - public void setHandlers(HashMap handlers) { - this.handlers = handlers; - } - - - -} \ No newline at end of file diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMNioSocketAcceptor.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMNioSocketAcceptor.java new file mode 100644 index 0000000..d5bce8b --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMNioSocketAcceptor.java @@ -0,0 +1,202 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.handler; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.util.HashMap; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.mina.core.service.IoAcceptor; +import org.apache.mina.core.service.IoHandlerAdapter; +import org.apache.mina.core.session.IdleStatus; +import org.apache.mina.core.session.IoSession; +import org.apache.mina.filter.codec.ProtocolCodecFilter; +import org.apache.mina.filter.executor.ExecutorFilter; +import org.apache.mina.filter.keepalive.KeepAliveFilter; +import org.apache.mina.filter.keepalive.KeepAliveMessageFactory; +import org.apache.mina.filter.logging.LoggingFilter; +import org.apache.mina.transport.socket.DefaultSocketSessionConfig; +import org.apache.mina.transport.socket.nio.NioSocketAcceptor; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.filter.ServerMessageCodecFactory; +import com.farsunset.cim.sdk.server.model.HeartbeatRequest; +import com.farsunset.cim.sdk.server.model.HeartbeatResponse; +import com.farsunset.cim.sdk.server.model.ReplyBody; +import com.farsunset.cim.sdk.server.model.SentBody; +import com.farsunset.cim.sdk.server.session.CIMSession; + +public class CIMNioSocketAcceptor extends IoHandlerAdapter implements KeepAliveMessageFactory{ + + private final static String CIMSESSION_CLOSED_HANDLER_KEY = "client_cimsession_closed"; + private Logger logger = Logger.getLogger(CIMNioSocketAcceptor.class); + private HashMap handlers = new HashMap(); + private IoAcceptor acceptor; + private int port; + private final int IDLE_TIME = 120;//秒 + private final int TIME_OUT = 10;//秒 + private final int READ_BUFFER_SIZE = 1024;//byte + + public void bind() throws IOException + { + acceptor = new NioSocketAcceptor(); + acceptor.getSessionConfig().setReadBufferSize(READ_BUFFER_SIZE); + ((DefaultSocketSessionConfig)acceptor.getSessionConfig()).setKeepAlive(true); + ((DefaultSocketSessionConfig)acceptor.getSessionConfig()).setTcpNoDelay(true); + + + KeepAliveFilter keepAliveFilter = new KeepAliveFilter(this,IdleStatus.WRITER_IDLE); + keepAliveFilter.setRequestInterval(IDLE_TIME); + keepAliveFilter.setRequestTimeout(TIME_OUT); + keepAliveFilter.setForwardEvent(true); + + acceptor.getFilterChain().addLast("executor",new ExecutorFilter()); + acceptor.getFilterChain().addLast("logger",new LoggingFilter()); + acceptor.getFilterChain().addLast("codec",new ProtocolCodecFilter(new ServerMessageCodecFactory())); + acceptor.getFilterChain().addLast("heartbeat",keepAliveFilter); + + acceptor.setHandler(this); + + acceptor.bind(new InetSocketAddress(port)); + } + + public void unbind() + { + acceptor.unbind(); + } + + + public void sessionCreated(IoSession session) { + logger.warn("sessionCreated()... from "+session.getRemoteAddress()+" nid:" + session.getId()); + } + + public void messageReceived(IoSession ios, Object message){ + + SentBody body = (SentBody) message; + + + CIMRequestHandler handler = handlers.get(body.getKey()); + if (handler == null) { + + ReplyBody reply = new ReplyBody(); + reply.setKey(body.getKey()); + reply.setCode(CIMConstant.ReturnCode.CODE_404); + reply.setMessage("KEY:"+body.getKey()+" not defined on server"); + ios.write(reply); + + } else { + ReplyBody reply = handler.process(new CIMSession(ios), body); + if(reply!=null) + { + reply.setKey(body.getKey()); + ios.write(reply); + } + } + + + } + + /** + */ + public void sessionClosed(IoSession session) { + + CIMSession cimSession =new CIMSession(session); + + logger.warn("sessionClosed()... from "+session.getRemoteAddress()+" nid:"+cimSession.getNid() +",isConnected:"+session.isConnected()); + CIMRequestHandler handler = handlers.get(CIMSESSION_CLOSED_HANDLER_KEY); + if(handler!=null) + { + handler.process(cimSession, null); + } + } + + /** + */ + public void sessionIdle(IoSession session, IdleStatus status) { + logger.warn("sessionIdle()... from "+session.getRemoteAddress()+" nid:" + session.getId()); + } + + /** + */ + public void exceptionCaught(IoSession session, Throwable cause){ + + logger.error("exceptionCaught()... from "+session.getRemoteAddress()+" isConnected:"+session.isConnected()+" nid:" + session.getId(),cause); + session.closeNow(); + } + + /** + */ + public void messageSent(IoSession session, Object message) throws Exception { + } + + + + @Override + public Object getRequest(IoSession session) { + return HeartbeatRequest.getInstance(); + } + + @Override + public Object getResponse(IoSession arg0, Object arg1) { + return null; + } + + @Override + public boolean isRequest(IoSession arg0, Object arg1) { + return false; + } + + @Override + public boolean isResponse(IoSession arg0, Object arg1) { + return arg1 instanceof HeartbeatResponse; + } + + public Map getManagedSessions() + { + return acceptor.getManagedSessions(); + } + + public IoSession getManagedSession(Long nid) + { + if(nid == null) + { + return null; + } + + return getManagedSessions().get(nid); + } + + public void setAcceptor(IoAcceptor acceptor) { + this.acceptor = acceptor; + } + + public void setPort(int port) { + this.port = port; + } + + public void setHandlers(HashMap handlers) { + this.handlers = handlers; + } + +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMRequestHandler.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMRequestHandler.java index 4dbcdd9..dbdd302 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMRequestHandler.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMRequestHandler.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.handler; /** @@ -14,7 +29,7 @@ import com.farsunset.cim.sdk.server.model.ReplyBody; import com.farsunset.cim.sdk.server.model.SentBody; import com.farsunset.cim.sdk.server.session.CIMSession; -public interface CIMRequestHandler { +public interface CIMRequestHandler { - public abstract ReplyBody process(CIMSession session,SentBody message); -} \ No newline at end of file + ReplyBody process(CIMSession session,SentBody message); +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/ServerKeepAliveFactoryImpl.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/ServerKeepAliveFactoryImpl.java deleted file mode 100644 index b9bf766..0000000 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/ServerKeepAliveFactoryImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.server.handler; - -import org.apache.mina.core.session.IoSession; -import org.apache.mina.filter.keepalive.KeepAliveMessageFactory; - -import com.farsunset.cim.sdk.server.constant.CIMConstant; - -public class ServerKeepAliveFactoryImpl implements KeepAliveMessageFactory { - @Override - public Object getRequest(IoSession arg0) { - return CIMConstant.CMD_HEARTBEAT_REQUEST; - } - - @Override - public Object getResponse(IoSession arg0, Object arg1) { - return null; - } - - @Override - public boolean isRequest(IoSession arg0, Object arg1) { - return false; - } - - @Override - public boolean isResponse(IoSession arg0, Object arg1) { - return CIMConstant.CMD_HEARTBEAT_RESPONSE.equalsIgnoreCase(arg1.toString()); - } - -} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/launcher/CIMNioSocketAcceptor.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/launcher/CIMNioSocketAcceptor.java deleted file mode 100644 index 0a462da..0000000 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/launcher/CIMNioSocketAcceptor.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.server.launcher; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.util.Map; - -import org.apache.mina.core.service.IoAcceptor; -import org.apache.mina.core.service.IoHandler; -import org.apache.mina.core.session.IdleStatus; -import org.apache.mina.core.session.IoSession; -import org.apache.mina.filter.codec.ProtocolCodecFilter; -import org.apache.mina.filter.executor.ExecutorFilter; -import org.apache.mina.filter.keepalive.KeepAliveFilter; -import org.apache.mina.filter.keepalive.KeepAliveMessageFactory; -import org.apache.mina.filter.keepalive.KeepAliveRequestTimeoutHandler; -import org.apache.mina.filter.logging.LoggingFilter; -import org.apache.mina.transport.socket.DefaultSocketSessionConfig; -import org.apache.mina.transport.socket.nio.NioSocketAcceptor; - -import com.farsunset.cim.sdk.server.handler.ServerKeepAliveFactoryImpl; - -public class CIMNioSocketAcceptor { - IoAcceptor acceptor; - IoHandler ioHandler; - int port; - - private final int IDLE_TIME = 300;//秒 - private final int TIME_OUT = 10;//秒 - public void bind() throws IOException - { - acceptor = new NioSocketAcceptor(); - acceptor.getSessionConfig().setReadBufferSize(1024); - ((DefaultSocketSessionConfig)acceptor.getSessionConfig()).setTcpNoDelay(true); - acceptor.getSessionConfig().setBothIdleTime(IDLE_TIME); - acceptor.getFilterChain().addLast("executor",new ExecutorFilter()); - acceptor.getFilterChain().addLast("logger",new LoggingFilter()); - acceptor.getFilterChain().addLast("codec",new ProtocolCodecFilter(new com.farsunset.cim.sdk.server.filter.ServerMessageCodecFactory())); - KeepAliveMessageFactory heartBeatFactory = new ServerKeepAliveFactoryImpl(); - KeepAliveFilter keepAliveFilter = new KeepAliveFilter(heartBeatFactory,IdleStatus.BOTH_IDLE,KeepAliveRequestTimeoutHandler.CLOSE,IDLE_TIME,TIME_OUT); - keepAliveFilter.setForwardEvent(true); - acceptor.getFilterChain().addLast("heartbeat",keepAliveFilter); - acceptor.setHandler(ioHandler); - - acceptor.bind(new InetSocketAddress(port)); - } - - public void unbind() - { - acceptor.unbind(); - } - public void setAcceptor(IoAcceptor acceptor) { - this.acceptor = acceptor; - } - public void setIoHandler(IoHandler ioHandler) { - this.ioHandler = ioHandler; - } - public void setPort(int port) { - this.port = port; - } - - public Map getManagedSessions() - { - return acceptor.getManagedSessions(); - } -} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatRequest.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatRequest.java new file mode 100644 index 0000000..49a4cd0 --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; +/** + * 服务端心跳请求 + * + */ +public class HeartbeatRequest implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "SERVER_HEARTBEAT_REQUEST"; + private static final String CMD_HEARTBEAT_RESPONSE = "SR"; + + private static HeartbeatRequest object = new HeartbeatRequest(); + + private HeartbeatRequest(){ + + } + + public static HeartbeatRequest getInstance() { + return object; + } + + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + + @Override + public byte getType() { + return CIMConstant.ProtobufType.S_H_RQ; + } + +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatResponse.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatResponse.java new file mode 100644 index 0000000..99b75f5 --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatResponse.java @@ -0,0 +1,60 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; + +/** + * 客户端心跳响应 + */ +public class HeartbeatResponse implements Serializable, Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "CLIENT_HEARTBEAT_RESPONSE"; + private static final String CMD_HEARTBEAT_RESPONSE = "CR"; + private static HeartbeatResponse object = new HeartbeatResponse(); + + private HeartbeatResponse() { + + } + + public static HeartbeatResponse getInstance() { + return object; + } + + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString() { + return TAG; + } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.C_H_RS; + } + +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java index a777a5e..6d50d7f 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java @@ -1,16 +1,34 @@ /** - * probject:cim-server-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.model; import java.io.Serializable; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.model.proto.MessageProto; /** * 消息对象 */ -public class Message implements Serializable { +public class Message implements Serializable,Protobufable { private static final long serialVersionUID = 1L; @@ -24,13 +42,13 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String type; + private String action; /** * 消息标题 */ private String title; /** - * 消息类容,于type 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 + * 消息类容,于action 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 */ private String content; @@ -43,21 +61,16 @@ public class Message implements Serializable { */ private String receiver; - /** - * 文件 url - */ - private String file; - /** - * 文件类型 - */ - private String fileType; - /** * content 内容格式 */ - private String format = "txt"; + private String format; + + /** + * 附加内容 内容 + */ + private String extra; - private long timestamp; @@ -73,14 +86,14 @@ public class Message implements Serializable { this.timestamp = timestamp; } - public String getType() { - return type; - } + - public void setType(String type) { - this.type = type; + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; } - public String getTitle() { return title; } @@ -113,22 +126,7 @@ public class Message implements Serializable { this.receiver = receiver; } - public String getFile() { - return file; - } - - public void setFile(String file) { - this.file = file; - } - - public String getFileType() { - return fileType; - } - - public void setFileType(String fileType) { - this.fileType = fileType; - } - + public String getFormat() { return format; } @@ -137,56 +135,16 @@ public class Message implements Serializable { this.format = format; } - public String toString() { - - StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(mid).append(""); - - if (isNotEmpty(type)) { - buffer.append("").append(type).append(""); - } - - if (isNotEmpty(title)) { - buffer.append("").append(title).append(""); - } - if (isNotEmpty(content)) { - buffer.append(""); - } - - if (isNotEmpty(file)) { - buffer.append("").append(file).append(""); - } - - if (isNotEmpty(fileType)) { - buffer.append("").append(fileType).append(""); - } - - if (isNotEmpty(sender)) { - buffer.append("").append(sender).append(""); - } - - if (isNotEmpty(receiver)) { - buffer.append("").append(receiver).append(""); - } - - if (isNotEmpty(format)) { - buffer.append("").append(format).append(""); - } - - if (timestamp > 0) { - buffer.append("").append(timestamp).append(""); - } - - buffer.append(""); - return buffer.toString(); + + + public String getExtra() { + return extra; } - - public String toXmlString() { - - return toString(); + public void setExtra(String extra) { + this.extra = extra; } + + public String getMid() { return mid; @@ -195,10 +153,57 @@ public class Message implements Serializable { public void setMid(String mid) { this.mid = mid; } + + @Override + public String toString() { + + StringBuffer buffer = new StringBuffer(); + buffer.append("#Message#").append("\n"); + buffer.append("mid:").append(mid).append("\n"); + buffer.append("action:").append(action).append("\n"); + buffer.append("title:").append(title).append("\n"); + buffer.append("content:").append(content).append("\n"); + buffer.append("extra:").append(extra).append("\n"); + buffer.append("sender:").append(sender).append("\n"); + buffer.append("receiver:").append(receiver).append("\n"); + buffer.append("format:").append(format).append("\n"); + buffer.append("timestamp:").append(timestamp); + return buffer.toString(); + } public boolean isNotEmpty(String txt) { - return txt != null && txt.trim().length()>0; + return txt != null && txt.trim().length()!=0; + } + @Override + public byte[] getByteArray() { + MessageProto.Model.Builder builder = MessageProto.Model.newBuilder(); + builder.setMid(mid); + builder.setAction(action); + builder.setSender(sender); + builder.setReceiver(receiver); + builder.setTimestamp(timestamp); + + /** + * 下面字段可能为空 + */ + if(content!=null){ + builder.setContent(content); + } + if(title!=null){ + builder.setTitle(title); + } + if(extra!=null){ + builder.setExtra(extra); + } + if(format!=null){ + builder.setFormat(format); + } + return builder.build().toByteArray(); + } + @Override + public byte getType() { + return CIMConstant.ProtobufType.MESSAGE; } -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Protobufable.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Protobufable.java new file mode 100644 index 0000000..4adf021 --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Protobufable.java @@ -0,0 +1,31 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model; +/** + * 需要向另一端发送的结构体 + */ +public interface Protobufable { + + byte[] getByteArray(); + + byte getType(); +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/ReplyBody.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/ReplyBody.java index 050d57c..6208090 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/ReplyBody.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/ReplyBody.java @@ -1,18 +1,38 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto; /** * 请求应答对象 * */ -public class ReplyBody implements Serializable { +public class ReplyBody implements Serializable ,Protobufable{ private static final long serialVersionUID = 1L; @@ -35,14 +55,13 @@ public class ReplyBody implements Serializable { /** * 返回数据集合 */ - private HashMap data; + private HashMap data = new HashMap(); private long timestamp; public ReplyBody() { - data = new HashMap(); timestamp = System.currentTimeMillis(); } public long getTimestamp() { @@ -64,9 +83,15 @@ public class ReplyBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } } + public void putAll(Map map) { + data.putAll(map); + } + public String get(String k) { return data.get(k); } @@ -83,8 +108,8 @@ public class ReplyBody implements Serializable { this.message = message; } - public HashMap getData() { - return data; + public Set getKeySet() { + return data.keySet(); } public String getCode() { @@ -95,30 +120,46 @@ public class ReplyBody implements Serializable { this.code = code; } - + @Override public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(this.getKey()).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append("").append(code).append(""); - buffer.append(""); - for(String key:this.getData().keySet()) - { - buffer.append("<"+key+">").append(this.get(key)).append(""); + buffer.append("#ReplyBody#").append("\n"); + buffer.append("key:").append(this.getKey()).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + buffer.append("code:").append(code).append("\n"); + + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); + return buffer.toString(); } - - - public String toXmlString() - { + @Override + public byte[] getByteArray() { + ReplyBodyProto.Model.Builder builder = ReplyBodyProto.Model.newBuilder(); + builder.setCode(code); + if(message!=null){ + builder.setMessage(message); + } + if(!data.isEmpty()){ + builder.putAllData(data); + } + builder.setKey(key); + builder.setTimestamp(timestamp); - return toString(); + return builder.build().toByteArray(); } + + @Override + public byte getType() { + // TODO Auto-generated method stub + return CIMConstant.ProtobufType.REPLYBODY; + } + } diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/SentBody.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/SentBody.java index cd5d2d1..7ec1664 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/SentBody.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/SentBody.java @@ -1,13 +1,30 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * java |android 客户端请求结构 * @@ -18,16 +35,10 @@ public class SentBody implements Serializable { private String key; - private HashMap data; + private HashMap data = new HashMap(); private long timestamp; - public SentBody() { - - data = new HashMap(); - timestamp = System.currentTimeMillis(); - } - public String getKey() { return key; } @@ -48,37 +59,43 @@ public class SentBody implements Serializable { this.key = key; } - public void put(String k, String v) { - data.put(k, v); - } - + public void remove(String k) { data.remove(k); } - public HashMap getData() { - return data; + public void put(String k, String v) { + if(v!=null && k!=null){ + data.put(k, v); + } } - + + public void putAll(Map map) { + data.putAll(map); + } + + public Set getKeySet() { + return data.keySet(); + } + + @Override public String toString() { StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(key).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append(""); - for (String key : data.keySet()) { - buffer.append("<" + key + ">").append(data.get(key)).append( - ""); + buffer.append("#SentBody#").append("\n");; + buffer.append("key:").append(key).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); + return buffer.toString(); } - - public String toXmlString() { - - return toString(); - } + } diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto new file mode 100644 index 0000000..677e574 --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.server.model.proto; +option java_outer_classname="MessageProto"; +message Model { + string mid = 1; + string action = 2; + string content = 3; + string sender = 4; + string receiver = 5; + string extra = 6; + string title = 7; + string format = 8; + int64 timestamp = 9; +} + \ No newline at end of file diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java new file mode 100644 index 0000000..1a73a9f --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java @@ -0,0 +1,1603 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model.proto; + +public final class MessageProto { + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string mid = 1; + */ + java.lang.String getMid(); + /** + * string mid = 1; + */ + com.google.protobuf.ByteString + getMidBytes(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + mid_ = ""; + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + mid_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); + } + + public static final int MID_FIELD_NUMBER = 1; + private volatile java.lang.Object mid_; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) obj; + + boolean result = true; + result = result && getMid() + .equals(other.getMid()); + result = result && getAction() + .equals(other.getAction()); + result = result && getContent() + .equals(other.getContent()); + result = result && getSender() + .equals(other.getSender()); + result = result && getReceiver() + .equals(other.getReceiver()); + result = result && getExtra() + .equals(other.getExtra()); + result = result && getTitle() + .equals(other.getTitle()); + result = result && getFormat() + .equals(other.getFormat()); + result = result && (getTimestamp() + == other.getTimestamp()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MID_FIELD_NUMBER; + hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) + com.farsunset.cim.sdk.server.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + mid_ = ""; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(this); + result.mid_ = mid_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (!other.getMid().isEmpty()) { + mid_ = other.mid_; + onChanged(); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object mid_ = ""; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mid = 1; + */ + public Builder setMid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mid_ = value; + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder clearMid() { + + mid_ = getDefaultInstance().getMid(); + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder setMidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mid_ = value; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) + private static final com.farsunset.cim.sdk.server.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022(com.farsunset.cim.sdk.s" + + "erver.model.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(\t" + + "\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sen" + + "der\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001" + + "(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttim" + + "estamp\030\t \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, + new java.lang.String[] { "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBody.proto b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBody.proto new file mode 100644 index 0000000..8bc7102 --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBody.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.server.model.proto; +option java_outer_classname="ReplyBodyProto"; + +message Model { + string key = 1; + string code = 2; + message = 3; + int64 timestamp =4; + map data =5; + +} + \ No newline at end of file diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBodyProto.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBodyProto.java new file mode 100644 index 0000000..f5c5262 --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBodyProto.java @@ -0,0 +1,1241 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model.proto; + +public final class ReplyBodyProto { + private ReplyBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string code = 2; + */ + java.lang.String getCode(); + /** + * string code = 2; + */ + com.google.protobuf.ByteString + getCodeBytes(); + + /** + * string message = 3; + */ + java.lang.String getMessage(); + /** + * string message = 3; + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + * int64 timestamp = 4; + */ + long getTimestamp(); + + /** + * map<string, string> data = 5; + */ + int getDataCount(); + /** + * map<string, string> data = 5; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 5; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + code_ = ""; + message_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + code_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 32: { + + timestamp_ = input.readInt64(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object code_; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 4; + private long timestamp_; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 5; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, code_); + } + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + if (timestamp_ != 0L) { + output.writeInt64(4, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 5); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!getCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, code_); + } + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model other = (com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && getCode() + .equals(other.getCode()); + result = result && getMessage() + .equals(other.getMessage()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + code_ = ""; + + message_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model build() { + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model result = new com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.code_ = code_; + result.message_ = message_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string code = 2; + */ + public Builder setCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value; + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder clearCode() { + + code_ = getDefaultInstance().getCode(); + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder setCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + code_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string message = 3; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 4; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 4; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 5; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) + private static final com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017ReplyBody.proto\022(com.farsunset.cim.sdk" + + ".server.model.proto\"\274\001\n\005Model\022\013\n\003key\030\001 \001" + + "(\t\022\014\n\004code\030\002 \001(\t\022\017\n\007message\030\003 \001(\t\022\021\n\ttim" + + "estamp\030\004 \001(\003\022G\n\004data\030\005 \003(\01329.com.farsuns" + + "et.cim.sdk.server.model.proto.Model.Data" + + "Entry\032+\n\tDataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" + + "\030\002 \001(\t:\0028\001B\020B\016ReplyBodyProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Code", "Message", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBody.proto b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBody.proto new file mode 100644 index 0000000..68a645e --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBody.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.server.model.proto; +option java_outer_classname="SentBodyProto"; + +message Model { + string key = 1; + int64 timestamp =2; + map data =3; + +} + \ No newline at end of file diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBodyProto.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBodyProto.java new file mode 100644 index 0000000..d919ccc --- /dev/null +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBodyProto.java @@ -0,0 +1,967 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model.proto; + +public final class SentBodyProto { + private SentBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * int64 timestamp = 2; + */ + long getTimestamp(); + + /** + * map<string, string> data = 3; + */ + int getDataCount(); + /** + * map<string, string> data = 3; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 3; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 16: { + + timestamp_ = input.readInt64(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 3; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (timestamp_ != 0L) { + output.writeInt64(2, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 3); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model other = (com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model build() { + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model result = new com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 2; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 2; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 3; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) + private static final com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016SentBody.proto\022(com.farsunset.cim.sdk." + + "server.model.proto\"\235\001\n\005Model\022\013\n\003key\030\001 \001(" + + "\t\022\021\n\ttimestamp\030\002 \001(\003\022G\n\004data\030\003 \003(\01329.com" + + ".farsunset.cim.sdk.server.model.proto.Mo" + + "del.DataEntry\032+\n\tDataEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\t:\0028\001B\017B\rSentBodyProtob\006pro" + + "to3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/CIMSession.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/CIMSession.java index 628f255..bb7cd12 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/CIMSession.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/CIMSession.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.session; import java.io.Serializable; @@ -11,6 +26,7 @@ import java.net.InetAddress; import java.net.SocketAddress; import java.net.UnknownHostException; +import org.apache.mina.core.future.WriteFuture; import org.apache.mina.core.session.IoSession; import com.farsunset.cim.sdk.server.constant.CIMConstant; @@ -40,7 +56,7 @@ public class CIMSession implements Serializable{ private transient IoSession session; private String gid;//session全局ID - private long nid;//session在本台服务器上的ID + private Long nid;//session在本台服务器上的ID private String deviceId;//客户端ID (设备号码+应用包名),ios为devicetoken private String host;//session绑定的服务器IP private String account;//session绑定的账号 @@ -271,14 +287,16 @@ public class CIMSession implements Serializable{ public boolean write(Object msg) { if(session!=null) { - return session.write(msg).isWritten(); + WriteFuture future = session.write(msg); + future.awaitUninterruptibly(10 * 1000); + return future.isWritten(); } return false; } public boolean isConnected() { - if(session != null && isLocalhost()) + if(session != null) { return session.isConnected(); } @@ -324,16 +342,18 @@ public class CIMSession implements Serializable{ public String getPackageName() { return packageName; } + + + public int hashCode(){ + + return (deviceId + nid + host).hashCode(); + } + public boolean equals(Object o) { - if (o instanceof CIMSession) { - - CIMSession t = (CIMSession) o; - if(t.deviceId!=null && deviceId!=null) - { - return t.deviceId.equals(deviceId) && t.nid == nid && t.host.equals(host); - } - } + if(o instanceof CIMSession){ + return hashCode() == o.hashCode(); + } return false; } @@ -388,4 +408,4 @@ public class CIMSession implements Serializable{ -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/DefaultSessionManager.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/DefaultSessionManager.java index 335d585..b5ff727 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/DefaultSessionManager.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/DefaultSessionManager.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.session; import java.util.ArrayList; import java.util.HashMap; @@ -29,11 +44,11 @@ public class DefaultSessionManager implements SessionManager{ /** * */ - public void add(String account,CIMSession session) { + public void add(CIMSession session) { if(session!=null) { - session.setAttribute(CIMConstant.SESSION_KEY, account); - sessions.put(account, session); + session.setAttribute(CIMConstant.SESSION_KEY, session.getAccount()); + sessions.put(session.getAccount(), session); connectionsCounter.incrementAndGet(); } @@ -50,9 +65,9 @@ public class DefaultSessionManager implements SessionManager{ public List queryAll() { - List list = new ArrayList(); - list.addAll(sessions.values()); - return list; + List list = new ArrayList(); + list.addAll(sessions.values()); + return list; } public void remove(CIMSession session) { @@ -74,37 +89,10 @@ public class DefaultSessionManager implements SessionManager{ return sessions.containsKey(account); } - - public String getAccount(CIMSession ios) - { - if(ios.getAttribute(CIMConstant.SESSION_KEY)==null) - { - for(String key:sessions.keySet()) - { - if(sessions.get(key).equals(ios) || sessions.get(key).getGid()==ios.getGid()) - { - return key; - } - } - }else - { - return ios.getAttribute(CIMConstant.SESSION_KEY).toString(); - } - - return null; - } - @Override public void update(CIMSession session) { sessions.put(session.getAccount(), session); } - - - @Override - public void setState(String account,int state) { - sessions.get(account).setStatus(state); - } - } diff --git a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/SessionManager.java b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/SessionManager.java index a46e32b..2fe0959 100644 --- a/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/SessionManager.java +++ b/cim_for_mina/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/SessionManager.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.session; import java.util.List; @@ -20,7 +35,7 @@ public interface SessionManager { /** * 添加新的session */ - public void add(String account,CIMSession session); + public void add(CIMSession session); /** * 更新session @@ -47,9 +62,4 @@ public interface SessionManager { */ public void remove(String account); - /** - * 设置session失效 - * @param session - */ - public void setState(String account,int state); -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-server/.classpath b/cim_for_mina/cim-server/.classpath index d5375db..0d97d57 100644 --- a/cim_for_mina/cim-server/.classpath +++ b/cim_for_mina/cim-server/.classpath @@ -2,41 +2,17 @@ - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/cim_for_mina/cim-server/.mymetadata b/cim_for_mina/cim-server/.mymetadata deleted file mode 100644 index 576f422..0000000 --- a/cim_for_mina/cim-server/.mymetadata +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/cim_for_mina/cim-server/.project b/cim_for_mina/cim-server/.project index 96180f8..1f42254 100644 --- a/cim_for_mina/cim-server/.project +++ b/cim_for_mina/cim-server/.project @@ -5,33 +5,13 @@ - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder - - - org.eclipse.jdt.core.javabuilder - com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator - - - - - com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator + org.eclipse.wst.common.project.facet.core.builder @@ -40,19 +20,12 @@ - - com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder - - - org.eclipse.jem.workbench.JavaEMFNature - com.genuitec.eclipse.ast.deploy.core.deploymentnature - com.genuitec.eclipse.j2eedt.core.webnature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature org.eclipse.wst.jsdt.core.jsNature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.common.modulecore.ModuleCoreNature diff --git a/cim_for_mina/cim-server/.settings/.jsdtscope b/cim_for_mina/cim-server/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ b/cim_for_mina/cim-server/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/cim_for_mina/cim-server/.settings/org.eclipse.core.resources.prefs b/cim_for_mina/cim-server/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index be1ca8f..0000000 --- a/cim_for_mina/cim-server/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Mon Sep 15 17:02:27 CST 2014 -eclipse.preferences.version=1 -encoding//WebRoot/console/webclient/cim.js=UTF-8 -encoding//src/main/java/com/farsunset/ichat/api/action/MessageAction.java=gbk -encoding/=UTF-8 diff --git a/cim_for_mina/cim-server/.settings/org.eclipse.jdt.core.prefs b/cim_for_mina/cim-server/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/cim_for_mina/cim-server/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/cim_for_mina/cim-server/.settings/org.eclipse.wst.common.component b/cim_for_mina/cim-server/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..ea3a893 --- /dev/null +++ b/cim_for_mina/cim-server/.settings/org.eclipse.wst.common.component @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/cim_for_mina/cim-server/.settings/org.eclipse.wst.common.project.facet.core.xml b/cim_for_mina/cim-server/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..2ccaeb9 --- /dev/null +++ b/cim_for_mina/cim-server/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/cim_for_mina/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.container b/cim_for_mina/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/cim_for_mina/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/cim_for_mina/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.name b/cim_for_mina/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/cim_for_mina/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/cim_for_mina/cim-server/WebRoot/META-INF/MANIFEST.MF b/cim_for_mina/cim-server/WebContent/META-INF/MANIFEST.MF similarity index 100% rename from cim_for_mina/cim-server/WebRoot/META-INF/MANIFEST.MF rename to cim_for_mina/cim-server/WebContent/META-INF/MANIFEST.MF diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.aop-3.0.2.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.aop-3.0.2.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.aop-3.0.2.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.aop-3.0.2.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.transaction-3.0.2.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.transaction-3.0.2.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.transaction-3.0.2.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.transaction-3.0.2.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/antlr-2.7.6.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/antlr-2.7.6.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/antlr-2.7.6.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/antlr-2.7.6.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/asm.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/asm.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/asm.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/asm.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/aspectjweaver.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/aspectjweaver.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/aspectjweaver.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/aspectjweaver.jar diff --git a/cim_for_mina/cim-server/WebContent/WEB-INF/lib/cim-server-sdk-3.0.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/cim-server-sdk-3.0.jar new file mode 100644 index 0000000..0527b34 Binary files /dev/null and b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/cim-server-sdk-3.0.jar differ diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/commons-io-2.4.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/commons-io-2.4.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/commons-io-2.4.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/commons-io-2.4.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/commons-lang-2.3.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/commons-lang-2.3.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/commons-lang-2.3.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/commons-lang-2.3.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/commons-logging-1.0.4.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/commons-logging-1.0.4.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/freemarker-2.3.15.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/freemarker-2.3.15.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/freemarker-2.3.15.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/freemarker-2.3.15.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/gson-2.1.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/gson-2.1.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/gson-2.1.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/gson-2.1.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/httpclient-4.3.4.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/httpclient-4.3.4.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/httpclient-4.3.4.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/httpclient-4.3.4.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/httpcore-4.3.2.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/httpcore-4.3.2.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/jstl-1.2.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/jstl-1.2.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/jstl-1.2.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/jstl-1.2.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/log4j.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/log4j.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/log4j.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/log4j.jar diff --git a/cim_for_mina/cim-server/WebContent/WEB-INF/lib/mina-core-2.0.16.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/mina-core-2.0.16.jar new file mode 100644 index 0000000..0e6d988 Binary files /dev/null and b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/mina-core-2.0.16.jar differ diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/ognl-2.7.3.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/ognl-2.7.3.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/ognl-2.7.3.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/ognl-2.7.3.jar diff --git a/cim_for_mina/cim-server/WebContent/WEB-INF/lib/protobuf-java-3.2.0.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/protobuf-java-3.2.0.jar new file mode 100644 index 0000000..b1f9701 Binary files /dev/null and b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/protobuf-java-3.2.0.jar differ diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/slf4j-api-1.7.5.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/slf4j-api-1.7.5.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/slf4j-nop-1.7.5.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/slf4j-nop-1.7.5.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/spring-context-support.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/spring-context-support.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/spring-context-support.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/spring-context-support.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/struts2-core-2.1.8.1.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/struts2-core-2.1.8.1.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/xstream-1.3.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/xstream-1.3.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/xstream-1.3.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/xstream-1.3.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar b/cim_for_mina/cim-server/WebContent/WEB-INF/lib/xwork-core-2.1.6.jar similarity index 100% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar rename to cim_for_mina/cim-server/WebContent/WEB-INF/lib/xwork-core-2.1.6.jar diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/web.xml b/cim_for_mina/cim-server/WebContent/WEB-INF/web.xml similarity index 97% rename from cim_for_mina/cim-server/WebRoot/WEB-INF/web.xml rename to cim_for_mina/cim-server/WebContent/WEB-INF/web.xml index 219d911..00c3ab1 100644 --- a/cim_for_mina/cim-server/WebRoot/WEB-INF/web.xml +++ b/cim_for_mina/cim-server/WebContent/WEB-INF/web.xml @@ -2,7 +2,7 @@ - ichat + cim-server diff --git a/cim_for_mina/cim-server/WebRoot/console/header.jsp b/cim_for_mina/cim-server/WebContent/console/header.jsp similarity index 100% rename from cim_for_mina/cim-server/WebRoot/console/header.jsp rename to cim_for_mina/cim-server/WebContent/console/header.jsp diff --git a/cim_for_mina/cim-server/WebRoot/console/index.jsp b/cim_for_mina/cim-server/WebContent/console/index.jsp similarity index 100% rename from cim_for_mina/cim-server/WebRoot/console/index.jsp rename to cim_for_mina/cim-server/WebContent/console/index.jsp diff --git a/cim_for_mina/cim-server/WebRoot/console/nav.jsp b/cim_for_mina/cim-server/WebContent/console/nav.jsp similarity index 59% rename from cim_for_mina/cim-server/WebRoot/console/nav.jsp rename to cim_for_mina/cim-server/WebContent/console/nav.jsp index 3a606c0..35fa388 100644 --- a/cim_for_mina/cim-server/WebRoot/console/nav.jsp +++ b/cim_for_mina/cim-server/WebContent/console/nav.jsp @@ -8,15 +8,7 @@
    - -
  • - - -
  • -
  • +
  • 在线用户 diff --git a/cim_for_mina/cim-server/WebRoot/console/session/manage.jsp b/cim_for_mina/cim-server/WebContent/console/session/manage.jsp similarity index 99% rename from cim_for_mina/cim-server/WebRoot/console/session/manage.jsp rename to cim_for_mina/cim-server/WebContent/console/session/manage.jsp index 3b648e1..85dacaa 100644 --- a/cim_for_mina/cim-server/WebRoot/console/session/manage.jsp +++ b/cim_for_mina/cim-server/WebContent/console/session/manage.jsp @@ -39,7 +39,7 @@ return; } showProcess('正在发送,请稍后......'); - $.post("<%=basePath%>/cgi/message_send.action", {content:message,type:2,sender:'system',receiver:account}, + $.post("<%=basePath%>/cgi/message_send.action", {content:message,action:2,sender:'system',receiver:account}, function(data){ hideProcess(); diff --git a/cim_for_mina/cim-server/WebRoot/index.jsp b/cim_for_mina/cim-server/WebContent/index.jsp similarity index 100% rename from cim_for_mina/cim-server/WebRoot/index.jsp rename to cim_for_mina/cim-server/WebContent/index.jsp diff --git a/cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/css/bootstrap.min.css b/cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/css/bootstrap.min.css similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/css/bootstrap.min.css rename to cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/css/bootstrap.min.css diff --git a/cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot b/cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot rename to cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot diff --git a/cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg b/cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg rename to cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg diff --git a/cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf b/cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf rename to cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf diff --git a/cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff b/cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff rename to cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff diff --git a/cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 b/cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 rename to cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 diff --git a/cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/js/bootstrap.min.js b/cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/js/bootstrap.min.js similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/js/bootstrap.min.js rename to cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/js/bootstrap.min.js diff --git a/cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/js/npm.js b/cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/js/npm.js similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/js/npm.js rename to cim_for_mina/cim-server/WebContent/resource/bootstrap-3.3.6-dist/js/npm.js diff --git a/cim_for_mina/cim-server/WebRoot/resource/css/base-ui.css b/cim_for_mina/cim-server/WebContent/resource/css/base-ui.css similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/css/base-ui.css rename to cim_for_mina/cim-server/WebContent/resource/css/base-ui.css diff --git a/cim_for_mina/cim-server/WebRoot/resource/css/dialog.css b/cim_for_mina/cim-server/WebContent/resource/css/dialog.css similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/css/dialog.css rename to cim_for_mina/cim-server/WebContent/resource/css/dialog.css diff --git a/cim_for_mina/cim-server/WebRoot/resource/css/login.css b/cim_for_mina/cim-server/WebContent/resource/css/login.css similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/css/login.css rename to cim_for_mina/cim-server/WebContent/resource/css/login.css diff --git a/cim_for_mina/cim-server/WebRoot/resource/css/main-layout.css b/cim_for_mina/cim-server/WebContent/resource/css/main-layout.css similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/css/main-layout.css rename to cim_for_mina/cim-server/WebContent/resource/css/main-layout.css diff --git a/cim_for_mina/cim-server/WebRoot/resource/css/table.css b/cim_for_mina/cim-server/WebContent/resource/css/table.css similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/css/table.css rename to cim_for_mina/cim-server/WebContent/resource/css/table.css diff --git a/cim_for_mina/cim-server/WebRoot/resource/css/webbase.css b/cim_for_mina/cim-server/WebContent/resource/css/webbase.css similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/css/webbase.css rename to cim_for_mina/cim-server/WebContent/resource/css/webbase.css diff --git a/cim_for_mina/cim-server/WebRoot/resource/img/icon.png b/cim_for_mina/cim-server/WebContent/resource/img/icon.png similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/img/icon.png rename to cim_for_mina/cim-server/WebContent/resource/img/icon.png diff --git a/cim_for_mina/cim-server/WebRoot/resource/img/icon_loading_small.gif b/cim_for_mina/cim-server/WebContent/resource/img/icon_loading_small.gif similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/img/icon_loading_small.gif rename to cim_for_mina/cim-server/WebContent/resource/img/icon_loading_small.gif diff --git a/cim_for_mina/cim-server/WebRoot/resource/img/pattern.png b/cim_for_mina/cim-server/WebContent/resource/img/pattern.png similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/img/pattern.png rename to cim_for_mina/cim-server/WebContent/resource/img/pattern.png diff --git a/cim_for_mina/cim-server/WebRoot/resource/js/framework.js b/cim_for_mina/cim-server/WebContent/resource/js/framework.js similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/js/framework.js rename to cim_for_mina/cim-server/WebContent/resource/js/framework.js diff --git a/cim_for_mina/cim-server/WebRoot/resource/js/jquery-2.2.3.min.js b/cim_for_mina/cim-server/WebContent/resource/js/jquery-2.2.3.min.js similarity index 100% rename from cim_for_mina/cim-server/WebRoot/resource/js/jquery-2.2.3.min.js rename to cim_for_mina/cim-server/WebContent/resource/js/jquery-2.2.3.min.js diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/cim-server-sdk-2.2.jar b/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/cim-server-sdk-2.2.jar deleted file mode 100644 index 287fe85..0000000 Binary files a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/cim-server-sdk-2.2.jar and /dev/null differ diff --git a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/mina-core-2.0.13.jar b/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/mina-core-2.0.13.jar deleted file mode 100644 index 557f190..0000000 Binary files a/cim_for_mina/cim-server/WebRoot/WEB-INF/lib/mina-core-2.0.13.jar and /dev/null differ diff --git a/cim_for_mina/cim-server/WebRoot/console/webclient/CIMBridge.swf b/cim_for_mina/cim-server/WebRoot/console/webclient/CIMBridge.swf deleted file mode 100644 index 624ae51..0000000 Binary files a/cim_for_mina/cim-server/WebRoot/console/webclient/CIMBridge.swf and /dev/null differ diff --git a/cim_for_mina/cim-server/WebRoot/console/webclient/LoginDialog.jsp b/cim_for_mina/cim-server/WebRoot/console/webclient/LoginDialog.jsp deleted file mode 100644 index 6e3f74c..0000000 --- a/cim_for_mina/cim-server/WebRoot/console/webclient/LoginDialog.jsp +++ /dev/null @@ -1,44 +0,0 @@ - <%@ page language="java" pageEncoding="utf-8"%> - <% - String loginBasePath = request.getScheme() + "://" - + request.getServerName() + ":" + request.getServerPort() - + request.getContextPath(); - - %> - - - - \ No newline at end of file diff --git a/cim_for_mina/cim-server/WebRoot/console/webclient/MessageDialog.jsp b/cim_for_mina/cim-server/WebRoot/console/webclient/MessageDialog.jsp deleted file mode 100644 index cb6fd4b..0000000 --- a/cim_for_mina/cim-server/WebRoot/console/webclient/MessageDialog.jsp +++ /dev/null @@ -1,19 +0,0 @@ - <%@ page language="java" pageEncoding="utf-8"%> - - \ No newline at end of file diff --git a/cim_for_mina/cim-server/WebRoot/console/webclient/cim.js b/cim_for_mina/cim-server/WebRoot/console/webclient/cim.js deleted file mode 100644 index 66eb45f..0000000 --- a/cim_for_mina/cim-server/WebRoot/console/webclient/cim.js +++ /dev/null @@ -1,5 +0,0 @@ -var CIM_HOST="127.0.0.1";//修改为服务器的真实IP -var CIM_PORT=23456;//修改为服务器的真实IP - -var ACCOUNT; - \ No newline at end of file diff --git a/cim_for_mina/cim-server/WebRoot/console/webclient/dingdong.mp3 b/cim_for_mina/cim-server/WebRoot/console/webclient/dingdong.mp3 deleted file mode 100644 index 5f15ae7..0000000 Binary files a/cim_for_mina/cim-server/WebRoot/console/webclient/dingdong.mp3 and /dev/null differ diff --git a/cim_for_mina/cim-server/WebRoot/console/webclient/main.jsp b/cim_for_mina/cim-server/WebRoot/console/webclient/main.jsp deleted file mode 100644 index b252aa8..0000000 --- a/cim_for_mina/cim-server/WebRoot/console/webclient/main.jsp +++ /dev/null @@ -1,125 +0,0 @@ -<%@ page language="java" pageEncoding="utf-8"%> -<% - String path = request.getContextPath(); - String basePath = request.getScheme() + "://" - + request.getServerName() + ":" + request.getServerPort() - + path; -%> - - - - - - -CIM for Web - - - - - - - - - - - - - - - - - - - - -<%@include file="LoginDialog.jsp"%> -<%@include file="MessageDialog.jsp"%> - - \ No newline at end of file diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java index 2e9419b..9edc18e 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.admin.action; @@ -12,6 +27,7 @@ import java.io.IOException; import org.apache.struts2.ServletActionContext; import com.farsunset.cim.push.SystemMessagePusher; +import com.farsunset.cim.sdk.server.constant.CIMConstant; import com.farsunset.cim.sdk.server.model.Message; import com.farsunset.cim.sdk.server.session.DefaultSessionManager; import com.farsunset.cim.util.ContextHolder; @@ -39,7 +55,7 @@ public class SessionAction extends ActionSupport { String account = ServletActionContext.getRequest().getParameter("account"); Message msg = new Message(); - msg.setType("999");//强行下线消息类型 + msg.setAction(CIMConstant.MessageAction.ACTION_999);//强行下线消息类型 msg.setReceiver(account); //向客户端 发送消息 diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java index cae3ec3..e84f2c8 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.api.action; import java.util.HashMap; @@ -51,7 +66,7 @@ public class MessageAction extends ActionSupport implements ModelDriven list = messageService.queryOffLineMessages(account); - List list = new ArrayList(); - for (Message m : list) { - - ios.write(m); - } - - } catch (Exception e) { - reply.setCode(CIMConstant.ReturnCode.CODE_500); - e.printStackTrace(); - logger.error("拉取离线消息失败", e); - } - return reply; - } -} \ No newline at end of file diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java index 4a7970f..0336277 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.handler; import org.apache.log4j.Logger; @@ -33,7 +48,6 @@ public class SessionClosedHandler implements CIMRequestHandler { DefaultSessionManager sessionManager = ((DefaultSessionManager) ContextHolder.getBean("CIMSessionManager")); ios.removeAttribute(CIMConstant.SESSION_KEY); - ios.closeNow(); sessionManager.remove(account.toString()); return null; @@ -41,4 +55,4 @@ public class SessionClosedHandler implements CIMRequestHandler { -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java index 7d95633..ee8a8a8 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java @@ -1,9 +1,24 @@ - /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.push; import com.farsunset.cim.sdk.server.model.Message; diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java index 147f4ba..04fc363 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java @@ -1,20 +1,30 @@ - /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.push; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import com.farsunset.cim.sdk.server.model.Message; import com.farsunset.cim.sdk.server.session.CIMSession; import com.farsunset.cim.sdk.server.session.DefaultSessionManager; - - /** * 消息发送实现类 * @@ -22,8 +32,6 @@ import com.farsunset.cim.sdk.server.session.DefaultSessionManager; public class DefaultMessagePusher implements CIMMessagePusher { - private final Log log = LogFactory.getLog(getClass()); - private DefaultSessionManager sessionManager; @@ -38,94 +46,51 @@ public class DefaultMessagePusher implements CIMMessagePusher { public void push(Message msg) { CIMSession session = sessionManager.get(msg.getReceiver()); - /*服务器集群时,可以在此 判断当前session是否连接于本台服务器,如果是,继续往下走,如果不是,将此消息发往当前session连接的服务器并 return - if(!session.isLocalhost()){//判断当前session是否连接于本台服务器,如不是 - - MessageDispatcher.execute(msg, session.getHost()); - return; - } - */ - + /* + * 服务器集群时,可以在此 + * 判断当前session是否连接于本台服务器,如果是,继续往下走,如果不是,将此消息发往当前session连接的服务器并 return + * if(session!=null&&!session.isLocalhost()){//判断当前session是否连接于本台服务器,如不是 + * //发往目标服务器处理 + * MessageDispatcher.execute(MessageUtil.transform(msg),session.getHost()); + * return; + * } + */ + if (session != null && session.isConnected()) { - - /*//如果用户标示了DeviceToken 且 需要后台推送(Pushable=1) 说明这是ios设备需要使用anps发送 - - if(StringUtil.isNotEmpty(session.getDeviceToken())&&session.getPushable()==User.PUSHABLE) - { - try { - deliverByANPS(msg,session.getDeviceToken()); - msg.setStatus(Message.STATUS_SEND); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - msg.setStatus(Message.STATUS_NOT_SEND); - } - }else - { - - //推送消息 - session.deliver(MessageUtil.transform(msg)); - }*/ - - //推送消息 - session.write(msg); - - }else{ - - /*User target = ((UserService)ContextHolder.getBean("userServiceImpl")).getUserByAccount(msg.getReceiver()); - //如果用户标示了DeviceToken 且 需要后台推送(Pushable=1) 说明这是ios设备需要使用anps发送 - if(StringUtil.isNotEmpty(target.getDeviceToken())&&target.getPushable()==User.PUSHABLE) - { - try { - deliverByANPS(msg,target.getDeviceToken()); - msg.setStatus(Message.STATUS_SEND); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - msg.setStatus(Message.STATUS_NOT_SEND); - } - - } */ - //未发送 + session.write(msg); + return; } - try{ - //可以在这保存消息到数据库 - //((MessageService)ContextHolder.getBean("messageServiceImpl")).save(msg); - }catch(Exception e){ - log.warn(" Messages insert to database failure!!"); + + // 如果用户标示了APNS ON 说明这是ios设备需要使用apns发送 + if (session != null && session.getApnsAble() == CIMSession.APNS_ON) { + + apnsPush(1,msg.getContent(),session.getDeviceId()); } + } - -/* public void deliverByANPS(Message msg,String deviceToken) throws Exception { + /** + * 引入javaapns相关jar + * @param badge + * @param content + * @param token + */ + private void apnsPush(int badge,String content,String token){ + /*String password = "password"; + String keystore = "p12 文件 绝对路径"; + boolean isDebug = true; - - - String alert = getMessageTile(msg); - // 被推送的iphone应用程序标示符 - PayLoad payLoad = new PayLoad(); - payLoad.addAlert(alert); - payLoad.addBadge(1); - payLoad.addSound("default"); - PushNotificationManager pushManager = PushNotificationManager.getInstance(); - pushManager.addDevice(deviceToken, deviceToken); - String host = ConfigManager.getInstance().get("apple.anps.host"); // 测试用的苹果推送服务器 - int port = Integer.parseInt(ConfigManager.getInstance().get("apple.anps.port")); - - String password = ConfigManager.getInstance().get("apple.anps.p12.password"); - String p12File = ConfigManager.getInstance().get("apple.anps.p12.file"); - pushManager.initializeConnection(host, port,this.getClass().getClassLoader().getResourceAsStream(p12File), password, - SSLConnectionHelper.KEYSTORE_TYPE_PKCS12); + PushNotificationPayload payload = PushNotificationPayload.complex(); + try { + payload.addAlert(content); + payload.addBadge(1); + payload.addSound("default"); + Push.payload(payload, keystore, password, isDebug, token); - // Send Push - Device client = pushManager.getDevice(deviceToken); - pushManager.sendNotification(client, payLoad); // 推送消息 - pushManager.stopConnection(); - pushManager.removeDevice(deviceToken); + } catch (Exception e) { + e.printStackTrace(); + }*/ + } - } - - - */ } diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java index 2373146..c44c791 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java @@ -1,9 +1,24 @@ - /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.push; import com.farsunset.cim.sdk.server.model.Message; diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java index 9d56341..f36b9f7 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java @@ -1,15 +1,29 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.session; import java.util.List; import com.farsunset.cim.sdk.server.session.CIMSession; import com.farsunset.cim.sdk.server.session.SessionManager; -import com.farsunset.cim.sdk.server.launcher.CIMNioSocketAcceptor; /** * 集群 session管理实现示例, 各位可以自行实现 AbstractSessionManager接口来实现自己的 session管理 @@ -18,16 +32,6 @@ import com.farsunset.cim.sdk.server.launcher.CIMNioSocketAcceptor; public class ClusterSessionManager implements SessionManager{ - - - public void addSession(String account,CIMSession session) { - - - /** - * 下面 将session 存入数据库 - */ - - } public CIMSession get(String account) { @@ -42,8 +46,6 @@ public class ClusterSessionManager implements SessionManager{ @Override public List queryAll() { - /*//这里查询数据库 - return database.getSessions();*/ return null; } @@ -51,30 +53,19 @@ public class ClusterSessionManager implements SessionManager{ @Override public void remove(String account) { - //database.removeSession(account);*/ } - - @Override - public void setState(String account, int state) { - // TODO Auto-generated method stub - - } - - @Override public void update(CIMSession session) { } - @Override - public void add(String account, CIMSession session) { - // TODO Auto-generated method stub + public void add(CIMSession arg0) { } -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/Constants.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/Constants.java index 024cdee..129a69e 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/Constants.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/Constants.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.util; public interface Constants { diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java index 8f0a79a..7464ad3 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.util; import org.springframework.beans.BeansException; @@ -30,4 +45,4 @@ public class ContextHolder implements ApplicationContextAware{ throws BeansException { context = applicationContext; } -} \ No newline at end of file +} diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java index e835856..e040c55 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.util; import java.util.ArrayList; import java.util.List; @@ -52,13 +67,12 @@ public class MessageDispatcher { HttpPost httpPost = new HttpPost(url); List nvps = new ArrayList (); nvps.add(new BasicNameValuePair("mid", msg.getMid())); - nvps.add(new BasicNameValuePair("type", msg.getType())); + nvps.add(new BasicNameValuePair("extra", msg.getExtra())); + nvps.add(new BasicNameValuePair("action", msg.getAction())); nvps.add(new BasicNameValuePair("title", msg.getTitle())); nvps.add(new BasicNameValuePair("content",msg.getContent())); nvps.add(new BasicNameValuePair("sender", msg.getSender())); nvps.add(new BasicNameValuePair("receiver",msg.getReceiver())); - nvps.add(new BasicNameValuePair("file",msg.getFile())); - nvps.add(new BasicNameValuePair("fileType",msg.getFileType())); nvps.add(new BasicNameValuePair("timestamp",String.valueOf(msg.getTimestamp()))); httpPost.setEntity(new UrlEncodedFormEntity(nvps)); CloseableHttpResponse response2 = httpclient.execute(httpPost); diff --git a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java index c429684..341be83 100644 --- a/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java +++ b/cim_for_mina/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java @@ -1,3 +1,24 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.util; import java.text.SimpleDateFormat; diff --git a/cim_for_mina/cim-server/src/main/resource/spring-cim.xml b/cim_for_mina/cim-server/src/main/resource/spring-cim.xml index 2eedc80..ccb4895 100644 --- a/cim_for_mina/cim-server/src/main/resource/spring-cim.xml +++ b/cim_for_mina/cim-server/src/main/resource/spring-cim.xml @@ -1,46 +1,37 @@  - - - - + "> + + + + + + - - - + - - - - - - - - - - - + + + - - + + + + + + + \ No newline at end of file diff --git a/cim_for_mina/cim-server/src/main/resource/spring-config.xml b/cim_for_mina/cim-server/src/main/resource/spring-config.xml deleted file mode 100644 index de92bdb..0000000 --- a/cim_for_mina/cim-server/src/main/resource/spring-config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_mina/cim-server/src/main/resource/spring-push.xml b/cim_for_mina/cim-server/src/main/resource/spring-push.xml deleted file mode 100644 index d4eab02..0000000 --- a/cim_for_mina/cim-server/src/main/resource/spring-push.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/.classpath b/cim_for_mina/client-mchat-android/.classpath deleted file mode 100644 index 9c49fa5..0000000 --- a/cim_for_mina/client-mchat-android/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/cim_for_mina/client-mchat-android/.project b/cim_for_mina/client-mchat-android/.project deleted file mode 100644 index 71b77c4..0000000 --- a/cim_for_mina/client-mchat-android/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - client-mchat-android - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/cim_for_mina/client-mchat-android/.settings/org.eclipse.jdt.core.prefs b/cim_for_mina/client-mchat-android/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b080d2d..0000000 --- a/cim_for_mina/client-mchat-android/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/cim_for_mina/client-mchat-android/libs/android-support-v4.jar b/cim_for_mina/client-mchat-android/libs/android-support-v4.jar deleted file mode 100644 index d006198..0000000 Binary files a/cim_for_mina/client-mchat-android/libs/android-support-v4.jar and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/libs/cim-android-sdk-2.2.jar b/cim_for_mina/client-mchat-android/libs/cim-android-sdk-2.2.jar deleted file mode 100644 index e4b8470..0000000 Binary files a/cim_for_mina/client-mchat-android/libs/cim-android-sdk-2.2.jar and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/libs/fastjson-1.1.47.android.jar b/cim_for_mina/client-mchat-android/libs/fastjson-1.1.47.android.jar deleted file mode 100644 index 9062508..0000000 Binary files a/cim_for_mina/client-mchat-android/libs/fastjson-1.1.47.android.jar and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/libs/httpmime-4.1.1.jar b/cim_for_mina/client-mchat-android/libs/httpmime-4.1.1.jar deleted file mode 100644 index 01af40b..0000000 Binary files a/cim_for_mina/client-mchat-android/libs/httpmime-4.1.1.jar and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/libs/mina-core-2.0.13.jar b/cim_for_mina/client-mchat-android/libs/mina-core-2.0.13.jar deleted file mode 100644 index 557f190..0000000 Binary files a/cim_for_mina/client-mchat-android/libs/mina-core-2.0.13.jar and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/lint.xml b/cim_for_mina/client-mchat-android/lint.xml deleted file mode 100644 index 30966e4..0000000 --- a/cim_for_mina/client-mchat-android/lint.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/proguard.cfg b/cim_for_mina/client-mchat-android/proguard.cfg deleted file mode 100644 index 22a2de2..0000000 --- a/cim_for_mina/client-mchat-android/proguard.cfg +++ /dev/null @@ -1,36 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --dontwarn --keep public class org.apache.mina.** {*;} --keep public class com.farsunset.cim.sdk.android.model.** {*;} - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembernames class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembernames class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/project.properties b/cim_for_mina/client-mchat-android/project.properties deleted file mode 100644 index 358ce4a..0000000 --- a/cim_for_mina/client-mchat-android/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-22 diff --git a/cim_for_mina/client-mchat-android/res/anim/activity_back.xml b/cim_for_mina/client-mchat-android/res/anim/activity_back.xml deleted file mode 100644 index 236e499..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/activity_back.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/activity_finish.xml b/cim_for_mina/client-mchat-android/res/anim/activity_finish.xml deleted file mode 100644 index cb91d85..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/activity_finish.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/activity_new.xml b/cim_for_mina/client-mchat-android/res/anim/activity_new.xml deleted file mode 100644 index 3be216c..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/activity_new.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/activity_out.xml b/cim_for_mina/client-mchat-android/res/anim/activity_out.xml deleted file mode 100644 index 87c3b67..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/activity_out.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/appear.xml b/cim_for_mina/client-mchat-android/res/anim/appear.xml deleted file mode 100644 index 42eabbe..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/appear.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/disappear.xml b/cim_for_mina/client-mchat-android/res/anim/disappear.xml deleted file mode 100644 index ea454d7..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/disappear.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/disappear_del.xml b/cim_for_mina/client-mchat-android/res/anim/disappear_del.xml deleted file mode 100644 index a46ac7d..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/disappear_del.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/extension_appear_from_bottom_to_top.xml b/cim_for_mina/client-mchat-android/res/anim/extension_appear_from_bottom_to_top.xml deleted file mode 100644 index f0f37c3..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/extension_appear_from_bottom_to_top.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/extension_disappear_from_top_to_bottom.xml b/cim_for_mina/client-mchat-android/res/anim/extension_disappear_from_top_to_bottom.xml deleted file mode 100644 index c89b166..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/extension_disappear_from_top_to_bottom.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/rotate.xml b/cim_for_mina/client-mchat-android/res/anim/rotate.xml deleted file mode 100644 index 348512d..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/rotate.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/slide_in_from_bottom.xml b/cim_for_mina/client-mchat-android/res/anim/slide_in_from_bottom.xml deleted file mode 100644 index d2b6340..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/slide_in_from_bottom.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/slide_in_from_left.xml b/cim_for_mina/client-mchat-android/res/anim/slide_in_from_left.xml deleted file mode 100644 index e19ac80..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/slide_in_from_left.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/slide_out_to_bottom.xml b/cim_for_mina/client-mchat-android/res/anim/slide_out_to_bottom.xml deleted file mode 100644 index 5e8bd9d..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/slide_out_to_bottom.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/anim/slide_out_to_right.xml b/cim_for_mina/client-mchat-android/res/anim/slide_out_to_right.xml deleted file mode 100644 index 6272b4f..0000000 --- a/cim_for_mina/client-mchat-android/res/anim/slide_out_to_right.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/action_sheet_base_9.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/action_sheet_base_9.9.png deleted file mode 100644 index ca46d55..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/action_sheet_base_9.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_create_troop.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_create_troop.png deleted file mode 100644 index 22e984d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_create_troop.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_similarity.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_similarity.png deleted file mode 100644 index 2a6c22c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_similarity.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_troop.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_troop.png deleted file mode 100644 index 6d56f46..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_troop.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_friend_bg_nor.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_friend_bg_nor.9.png deleted file mode 100644 index 664e40b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_friend_bg_nor.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_friend_bg_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_friend_bg_pressed.9.png deleted file mode 100644 index 1771dff..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_friend_bg_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_user_bg_nor.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_user_bg_nor.9.png deleted file mode 100644 index cdea0c0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_user_bg_nor.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_user_bg_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_user_bg_pressed.9.png deleted file mode 100644 index 66362e8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/aio_user_bg_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/card_avatar.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/card_avatar.9.png deleted file mode 100644 index ffe13ae..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/card_avatar.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_camera.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_camera.png deleted file mode 100644 index dee2c0a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_camera.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_location.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_location.png deleted file mode 100644 index fd3fb63..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_location.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_photo.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_photo.png deleted file mode 100644 index 4363324..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_photo.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_send_file.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_send_file.png deleted file mode 100644 index 31afee4..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/chat_tool_send_file.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_0.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_0.png deleted file mode 100644 index da34dea..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_0.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_1.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_1.png deleted file mode 100644 index afb0284..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_1.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_10.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_10.png deleted file mode 100644 index c0de888..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_10.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_11.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_11.png deleted file mode 100644 index 9794810..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_11.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_2.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_2.png deleted file mode 100644 index ee14cb5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_2.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_3.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_3.png deleted file mode 100644 index ae50016..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_3.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_4.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_4.png deleted file mode 100644 index 37cbbae..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_4.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_5.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_5.png deleted file mode 100644 index 39fca11..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_5.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_6.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_6.png deleted file mode 100644 index 1e48cd5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_6.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_7.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_7.png deleted file mode 100644 index 00ff673..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_7.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_8.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_8.png deleted file mode 100644 index 93cf418..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_8.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_9.png deleted file mode 100644 index 88d702b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/common_loading_9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/ic_date_time.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/ic_date_time.png deleted file mode 100644 index 76cb1d8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/ic_date_time.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/ic_read.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/ic_read.png deleted file mode 100644 index 73b06e7..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/ic_read.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_addfriend.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_addfriend.png deleted file mode 100644 index 7a9515f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_addfriend.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_face_click.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_face_click.png deleted file mode 100644 index 84384f2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_face_click.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_face_nor.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_face_nor.png deleted file mode 100644 index 0312e1e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_face_nor.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_joinfroup.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_joinfroup.png deleted file mode 100644 index f0a930a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_joinfroup.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_more.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_more.png deleted file mode 100644 index c67b3bf..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_more.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_recent_sysmsg.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_recent_sysmsg.png deleted file mode 100644 index c0d048d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/icon_recent_sysmsg.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/input_box_bg.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/input_box_bg.9.png deleted file mode 100644 index afaa782..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/input_box_bg.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/list_head_border_whitebg.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/list_head_border_whitebg.9.png deleted file mode 100644 index c3bda48..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/list_head_border_whitebg.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png deleted file mode 100644 index 6def1bb..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png deleted file mode 100644 index cde2205..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png deleted file mode 100644 index 2ac9df5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_female.jpg b/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_female.jpg deleted file mode 100644 index 0e3514e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_female.jpg and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_male.jpg b/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_male.jpg deleted file mode 100644 index 42ba79e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_male.jpg and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_input_bar_bg.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_input_bar_bg.9.png deleted file mode 100644 index f9ce5ed..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_input_bar_bg.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_more_nor.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_more_nor.png deleted file mode 100644 index 5b5dd17..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_more_nor.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_more_pressed.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_more_pressed.png deleted file mode 100644 index fc72dc9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_more_pressed.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_normal.9.png deleted file mode 100644 index 741bcb3..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_pressed.9.png deleted file mode 100644 index 16161ea..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_bottom_bar_background.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_bottom_bar_background.png deleted file mode 100644 index 3ea9de9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_bottom_bar_background.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_disable.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_disable.9.png deleted file mode 100644 index c433b1c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_disable.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_normal.9.png deleted file mode 100644 index 434f6a0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_pressed.9.png deleted file mode 100644 index e6d72f2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_disabled.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_disabled.9.png deleted file mode 100644 index cf26862..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_disabled.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_pressed.9.png deleted file mode 100644 index 23f36b2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png deleted file mode 100644 index 9e2f395..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_disabled.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_disabled.9.png deleted file mode 100644 index e946848..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_disabled.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_pressed.9.png deleted file mode 100644 index faa9786..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png deleted file mode 100644 index c13a8ad..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_normal.9.png deleted file mode 100644 index a74f592..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_press.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_press.9.png deleted file mode 100644 index 2cf15e3..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_press.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_disable.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_disable.9.png deleted file mode 100644 index 1f2ac7b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_disable.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png deleted file mode 100644 index 87a34e0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_press.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_press.9.png deleted file mode 100644 index 16dbb9b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_press.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_normal.9.png deleted file mode 100644 index 8f2f995..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_press.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_press.9.png deleted file mode 100644 index 72ad591..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_btn_press.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_icon_group.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_icon_group.png deleted file mode 100644 index f7f3460..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_icon_group.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_icon_single.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_icon_single.png deleted file mode 100644 index 9289bc7..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_icon_single.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_normal.9.png deleted file mode 100644 index 121915f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_pressed.9.png deleted file mode 100644 index ee4f3de..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_normal.9.png deleted file mode 100644 index c8762c5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_pressed.9.png deleted file mode 100644 index 07b360f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_normal.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_normal.png deleted file mode 100644 index 586637d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_selected.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_selected.png deleted file mode 100644 index 67c40c9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_selected.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_normal.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_normal.png deleted file mode 100644 index 1aef389..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_selected.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_selected.png deleted file mode 100644 index 58dc52f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_selected.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_normal.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_normal.png deleted file mode 100644 index 494c775..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_selected.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_selected.png deleted file mode 100644 index 4081a03..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_selected.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_normal.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_normal.png deleted file mode 100644 index 82995d6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_selected.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_selected.png deleted file mode 100644 index 577eca5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_selected.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage.png deleted file mode 100644 index 998c5c0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage2.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage2.9.png deleted file mode 100644 index b34abf0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage2.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select.9.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select.9.png deleted file mode 100644 index 865e0d7..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_left.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_left.png deleted file mode 100644 index 40c178d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_left.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_right.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_right.png deleted file mode 100644 index e8be980..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_right.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-320dpi/tab_new.png b/cim_for_mina/client-mchat-android/res/drawable-320dpi/tab_new.png deleted file mode 100644 index 7f677bf..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-320dpi/tab_new.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/aicon_error.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/aicon_error.png deleted file mode 100644 index 7bdaed6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/aicon_error.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/app_main_bg.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/app_main_bg.png deleted file mode 100644 index 103ea69..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/app_main_bg.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/arrow.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/arrow.png deleted file mode 100644 index d29af2b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/arrow.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/blue_button_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/blue_button_normal.9.png deleted file mode 100644 index 53eb720..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/blue_button_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/blue_button_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/blue_button_pressed.9.png deleted file mode 100644 index 807c2b9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/blue_button_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/bodylisttop.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/bodylisttop.9.png deleted file mode 100644 index 8ba7f02..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/bodylisttop.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/bottom.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/bottom.9.png deleted file mode 100644 index 0b5c6c4..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/bottom.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/btn_check_off.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/btn_check_off.png deleted file mode 100644 index 4ac8c48..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/btn_check_off.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/btn_check_on.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/btn_check_on.png deleted file mode 100644 index bbbc179..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/btn_check_on.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/chat_time_block.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/chat_time_block.9.png deleted file mode 100644 index e987c49..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/chat_time_block.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/close_del.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/close_del.png deleted file mode 100644 index a49370d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/close_del.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/close_pressed.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/close_pressed.png deleted file mode 100644 index 1863272..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/close_pressed.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/colorful_line.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/colorful_line.png deleted file mode 100644 index 03aa8d7..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/colorful_line.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/conversation_loading_icon.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/conversation_loading_icon.png deleted file mode 100644 index 12e3d6e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/conversation_loading_icon.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/conversation_net_error_icon.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/conversation_net_error_icon.png deleted file mode 100644 index b495e75..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/conversation_net_error_icon.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/cutline.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/cutline.png deleted file mode 100644 index 35771f5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/cutline.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/edittext_bg.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/edittext_bg.9.png deleted file mode 100644 index 87b94de..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/edittext_bg.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f000.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f000.gif deleted file mode 100644 index cd75cab..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f000.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f001.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f001.gif deleted file mode 100644 index 29e59c6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f001.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f002.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f002.gif deleted file mode 100644 index e4afbf5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f002.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f003.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f003.gif deleted file mode 100644 index 89ab9ef..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f003.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f004.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f004.gif deleted file mode 100644 index 9962e46..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f004.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f005.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f005.gif deleted file mode 100644 index 596447d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f005.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f006.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f006.gif deleted file mode 100644 index b98791f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f006.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f007.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f007.png deleted file mode 100644 index f5c788f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f007.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f008.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f008.png deleted file mode 100644 index 1189a7d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f008.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f009.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f009.gif deleted file mode 100644 index b43cb16..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f009.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f010.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f010.gif deleted file mode 100644 index b9911b9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f010.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f011.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f011.gif deleted file mode 100644 index 1d5b4c2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f011.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f012.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f012.gif deleted file mode 100644 index e388fff..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f012.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f013.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f013.gif deleted file mode 100644 index 9c79e8e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f013.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f014.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f014.gif deleted file mode 100644 index 49a29c0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f014.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f015.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f015.gif deleted file mode 100644 index b312a9e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f015.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f016.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f016.png deleted file mode 100644 index 28d74f6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f016.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f017.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f017.gif deleted file mode 100644 index ff87ee9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f017.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f018.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f018.gif deleted file mode 100644 index b3a13d1..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f018.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f019.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f019.gif deleted file mode 100644 index 4fe7626..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f019.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f020.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f020.gif deleted file mode 100644 index bf77a41..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f020.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f021.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f021.gif deleted file mode 100644 index 2e2d871..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f021.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f022.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f022.gif deleted file mode 100644 index c864eb1..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f022.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f023.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f023.gif deleted file mode 100644 index b0a22db..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f023.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f024.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f024.gif deleted file mode 100644 index a4e351c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f024.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f025.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f025.gif deleted file mode 100644 index 087d409..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f025.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f026.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f026.gif deleted file mode 100644 index 516d91c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f026.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f027.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f027.gif deleted file mode 100644 index 86df7df..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f027.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f028.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f028.png deleted file mode 100644 index d85dd30..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f028.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f029.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f029.gif deleted file mode 100644 index 976fdc1..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f029.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f030.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f030.gif deleted file mode 100644 index d8a2811..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f030.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f031.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f031.gif deleted file mode 100644 index 1258a90..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f031.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f032.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f032.png deleted file mode 100644 index 004500e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f032.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f033.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f033.gif deleted file mode 100644 index b3f7f1a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f033.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f034.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f034.gif deleted file mode 100644 index 9dcfd7a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f034.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f035.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f035.gif deleted file mode 100644 index f767d36..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f035.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f036.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f036.gif deleted file mode 100644 index 7cd7f94..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f036.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f037.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f037.gif deleted file mode 100644 index 38200e0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f037.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f038.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f038.gif deleted file mode 100644 index 466ab43..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f038.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f039.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f039.png deleted file mode 100644 index 59af419..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f039.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f040.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f040.gif deleted file mode 100644 index bc32ca2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f040.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f041.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f041.gif deleted file mode 100644 index f857313..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f041.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f042.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f042.gif deleted file mode 100644 index a20cdbc..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f042.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f043.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f043.gif deleted file mode 100644 index 68f8b0d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f043.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f044.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f044.gif deleted file mode 100644 index d397d74..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f044.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f045.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f045.gif deleted file mode 100644 index 35eae02..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f045.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f046.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f046.gif deleted file mode 100644 index 5a953c8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f046.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f047.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f047.png deleted file mode 100644 index 42bbddd..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f047.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f048.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f048.gif deleted file mode 100644 index bad2c64..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f048.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f049.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f049.gif deleted file mode 100644 index 4a872ef..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f049.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f050.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f050.gif deleted file mode 100644 index 1e95b53..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f050.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f051.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f051.gif deleted file mode 100644 index 11475e6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f051.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f052.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f052.gif deleted file mode 100644 index 13b460e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f052.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f053.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f053.gif deleted file mode 100644 index 87f2990..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f053.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f054.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f054.gif deleted file mode 100644 index 7b85568..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f054.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f055.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f055.gif deleted file mode 100644 index 7f2d417..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f055.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f056.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f056.gif deleted file mode 100644 index 1d2b1a6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f056.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f057.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f057.png deleted file mode 100644 index 94c9277..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f057.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f058.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f058.png deleted file mode 100644 index 42bb7ee..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f058.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f059.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f059.gif deleted file mode 100644 index cb0197a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f059.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f060.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f060.png deleted file mode 100644 index 2be04f2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f060.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f061.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f061.gif deleted file mode 100644 index 6a6d9e0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f061.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f062.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f062.gif deleted file mode 100644 index 3f1c513..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f062.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f063.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f063.gif deleted file mode 100644 index a39068e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f063.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f064.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f064.png deleted file mode 100644 index 1875bf2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f064.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f065.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f065.gif deleted file mode 100644 index 0a8eebe..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f065.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f066.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f066.gif deleted file mode 100644 index 4239600..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f066.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f067.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f067.png deleted file mode 100644 index ccb101b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f067.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f068.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f068.png deleted file mode 100644 index 3ae7d31..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f068.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f069.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f069.png deleted file mode 100644 index a1be64e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f069.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f070.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f070.gif deleted file mode 100644 index d243db0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f070.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f071.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f071.png deleted file mode 100644 index 03ed33f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f071.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f072.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f072.gif deleted file mode 100644 index 8ed341e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f072.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f073.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f073.gif deleted file mode 100644 index bbe3dab..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f073.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f074.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f074.gif deleted file mode 100644 index 1cbedb9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f074.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f075.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f075.png deleted file mode 100644 index 7d8a3af..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f075.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f076.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f076.png deleted file mode 100644 index 315392a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f076.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f077.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f077.gif deleted file mode 100644 index 8ab455f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f077.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f078.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f078.png deleted file mode 100644 index 8a7ea81..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f078.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f079.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f079.gif deleted file mode 100644 index 1be369b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f079.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f080.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f080.png deleted file mode 100644 index dbc258c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f080.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f081.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f081.gif deleted file mode 100644 index f40fc49..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f081.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f082.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f082.gif deleted file mode 100644 index 2b59b94..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f082.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f083.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f083.gif deleted file mode 100644 index 7c0ba4b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f083.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f084.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f084.gif deleted file mode 100644 index 012b953..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f084.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f085.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f085.gif deleted file mode 100644 index a9047a2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f085.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f086.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f086.gif deleted file mode 100644 index ac09218..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f086.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f087.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f087.gif deleted file mode 100644 index 559c8c8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f087.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f088.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f088.gif deleted file mode 100644 index 6dd40f1..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f088.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f089.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f089.gif deleted file mode 100644 index 3caead4..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f089.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f090.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f090.gif deleted file mode 100644 index 5ca6afc..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f090.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f091.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f091.gif deleted file mode 100644 index bb09d0f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f091.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f092.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f092.gif deleted file mode 100644 index 477a994..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f092.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f093.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f093.gif deleted file mode 100644 index 029bc34..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f093.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f094.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f094.gif deleted file mode 100644 index 7e5af84..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f094.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f095.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f095.gif deleted file mode 100644 index 8f6049c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f095.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f096.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f096.gif deleted file mode 100644 index fd1485a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f096.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f097.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f097.gif deleted file mode 100644 index 2103bee..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f097.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f098.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f098.gif deleted file mode 100644 index 796c41f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f098.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f099.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f099.gif deleted file mode 100644 index 140d0a8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f099.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f100.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f100.gif deleted file mode 100644 index 09390e8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f100.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f101.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f101.gif deleted file mode 100644 index 460746b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f101.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f102.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f102.gif deleted file mode 100644 index c157bd8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f102.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f103.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f103.gif deleted file mode 100644 index 63f3923..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f103.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f104.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f104.gif deleted file mode 100644 index 2f13fd5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f104.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f105.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f105.gif deleted file mode 100644 index 3ad0fa9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f105.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f106.gif b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f106.gif deleted file mode 100644 index 4c81113..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f106.gif and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_000.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_000.png deleted file mode 100644 index 5875442..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_000.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_001.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_001.png deleted file mode 100644 index 051e7eb..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_001.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_002.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_002.png deleted file mode 100644 index f8f9430..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_002.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_003.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_003.png deleted file mode 100644 index e69a076..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_003.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_004.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_004.png deleted file mode 100644 index b06515a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_004.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_005.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_005.png deleted file mode 100644 index 78d8234..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_005.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_006.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_006.png deleted file mode 100644 index e48785b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_006.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_007.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_007.png deleted file mode 100644 index f5c788f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_007.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_008.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_008.png deleted file mode 100644 index 1189a7d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_008.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_009.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_009.png deleted file mode 100644 index 1b514a7..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_009.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_010.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_010.png deleted file mode 100644 index df9a459..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_010.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_011.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_011.png deleted file mode 100644 index e502d4d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_011.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_012.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_012.png deleted file mode 100644 index 83237fd..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_012.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_013.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_013.png deleted file mode 100644 index 273081e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_013.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_014.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_014.png deleted file mode 100644 index 4af6fc2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_014.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_015.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_015.png deleted file mode 100644 index 28081a2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_015.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_016.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_016.png deleted file mode 100644 index 28d74f6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_016.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_017.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_017.png deleted file mode 100644 index 56d5760..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_017.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_018.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_018.png deleted file mode 100644 index 83f304b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_018.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_019.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_019.png deleted file mode 100644 index 5a769f0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_019.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_020.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_020.png deleted file mode 100644 index b77259c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_020.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_021.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_021.png deleted file mode 100644 index b379586..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_021.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_022.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_022.png deleted file mode 100644 index bdb94e0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_022.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_023.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_023.png deleted file mode 100644 index d97ff5f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_023.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_024.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_024.png deleted file mode 100644 index 4e2eb4d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_024.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_025.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_025.png deleted file mode 100644 index 02780e9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_025.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_026.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_026.png deleted file mode 100644 index 85d095a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_026.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_027.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_027.png deleted file mode 100644 index c8fc628..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_027.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_028.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_028.png deleted file mode 100644 index d85dd30..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_028.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_029.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_029.png deleted file mode 100644 index d37e5fe..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_029.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_030.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_030.png deleted file mode 100644 index 3efb667..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_030.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_031.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_031.png deleted file mode 100644 index 8a0bdc5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_031.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_032.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_032.png deleted file mode 100644 index 004500e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_032.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_033.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_033.png deleted file mode 100644 index 1ab0a23..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_033.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_034.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_034.png deleted file mode 100644 index ef598ba..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_034.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_035.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_035.png deleted file mode 100644 index 3260627..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_035.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_036.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_036.png deleted file mode 100644 index 8b6bd2a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_036.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_037.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_037.png deleted file mode 100644 index 2e50c1f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_037.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_038.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_038.png deleted file mode 100644 index ae7ee00..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_038.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_039.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_039.png deleted file mode 100644 index 59af419..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_039.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_040.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_040.png deleted file mode 100644 index cee4c08..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_040.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_041.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_041.png deleted file mode 100644 index 4d05ffa..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_041.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_042.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_042.png deleted file mode 100644 index 364558b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_042.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_043.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_043.png deleted file mode 100644 index f055c30..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_043.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_044.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_044.png deleted file mode 100644 index 605ccea..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_044.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_045.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_045.png deleted file mode 100644 index 5815657..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_045.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_046.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_046.png deleted file mode 100644 index 70f7b1c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_046.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_047.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_047.png deleted file mode 100644 index 42bbddd..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_047.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_048.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_048.png deleted file mode 100644 index 022720a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_048.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_049.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_049.png deleted file mode 100644 index 906aa62..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_049.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_050.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_050.png deleted file mode 100644 index d01d9fe..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_050.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_051.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_051.png deleted file mode 100644 index b041181..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_051.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_052.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_052.png deleted file mode 100644 index 98061e2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_052.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_053.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_053.png deleted file mode 100644 index e79ab1b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_053.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_054.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_054.png deleted file mode 100644 index 083e467..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_054.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_055.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_055.png deleted file mode 100644 index 0cdcb3c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_055.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_056.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_056.png deleted file mode 100644 index 9763453..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_056.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_057.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_057.png deleted file mode 100644 index 94c9277..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_057.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_058.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_058.png deleted file mode 100644 index 42bb7ee..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_058.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_059.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_059.png deleted file mode 100644 index bd6abad..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_059.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_060.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_060.png deleted file mode 100644 index 2be04f2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_060.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_061.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_061.png deleted file mode 100644 index 229f4c8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_061.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_062.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_062.png deleted file mode 100644 index 0e3ef0e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_062.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_063.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_063.png deleted file mode 100644 index 8e5458c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_063.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_064.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_064.png deleted file mode 100644 index 1875bf2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_064.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_065.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_065.png deleted file mode 100644 index 06d4ffa..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_065.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_066.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_066.png deleted file mode 100644 index 3d4ef11..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_066.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_067.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_067.png deleted file mode 100644 index ccb101b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_067.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_068.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_068.png deleted file mode 100644 index 3ae7d31..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_068.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_069.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_069.png deleted file mode 100644 index a1be64e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_069.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_070.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_070.png deleted file mode 100644 index 5df5aaa..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_070.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_071.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_071.png deleted file mode 100644 index 03ed33f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_071.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_072.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_072.png deleted file mode 100644 index 953c7c4..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_072.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_073.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_073.png deleted file mode 100644 index fd93144..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_073.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_074.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_074.png deleted file mode 100644 index faa8185..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_074.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_075.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_075.png deleted file mode 100644 index 7d8a3af..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_075.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_076.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_076.png deleted file mode 100644 index 315392a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_076.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_077.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_077.png deleted file mode 100644 index 578f579..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_077.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_078.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_078.png deleted file mode 100644 index 8a7ea81..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_078.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_079.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_079.png deleted file mode 100644 index 7f458bc..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_079.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_080.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_080.png deleted file mode 100644 index dbc258c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_080.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_081.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_081.png deleted file mode 100644 index 5452bba..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_081.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_082.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_082.png deleted file mode 100644 index 06adc90..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_082.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_083.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_083.png deleted file mode 100644 index 0d726f9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_083.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_084.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_084.png deleted file mode 100644 index 84394ba..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_084.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_085.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_085.png deleted file mode 100644 index 3d2ea19..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_085.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_086.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_086.png deleted file mode 100644 index 40a2dbf..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_086.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_087.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_087.png deleted file mode 100644 index 1881c51..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_087.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_088.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_088.png deleted file mode 100644 index 91e5001..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_088.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_089.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_089.png deleted file mode 100644 index 709aadc..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_089.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_090.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_090.png deleted file mode 100644 index 73b2673..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_090.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_091.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_091.png deleted file mode 100644 index e4825c8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_091.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_092.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_092.png deleted file mode 100644 index a5ab2ba..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_092.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_093.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_093.png deleted file mode 100644 index 32747a5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_093.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_094.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_094.png deleted file mode 100644 index 89fe440..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_094.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_095.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_095.png deleted file mode 100644 index 37f5a78..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_095.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_096.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_096.png deleted file mode 100644 index 79d4699..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_096.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_097.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_097.png deleted file mode 100644 index 9881beb..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_097.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_098.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_098.png deleted file mode 100644 index 214017c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_098.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_099.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_099.png deleted file mode 100644 index 24c92ba..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_099.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_100.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_100.png deleted file mode 100644 index e42beb5..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_100.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_101.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_101.png deleted file mode 100644 index f7adb23..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_101.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_102.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_102.png deleted file mode 100644 index 4c92efc..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_102.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_103.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_103.png deleted file mode 100644 index 718cca7..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_103.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_104.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_104.png deleted file mode 100644 index a21ce49..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_104.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_105.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_105.png deleted file mode 100644 index 4d163bd..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_105.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_106.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_106.png deleted file mode 100644 index 06b4ccd..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/f_static_106.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/grouphead_normal.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/grouphead_normal.png deleted file mode 100644 index 7f25f46..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/grouphead_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/h033.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/h033.png deleted file mode 100644 index 0de2b39..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/h033.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_away.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_away.png deleted file mode 100644 index 63d77db..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_away.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_error.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_error.png deleted file mode 100644 index 4bd3f06..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_error.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_invisiable.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_invisiable.png deleted file mode 100644 index 8f7072d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_invisiable.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_logo.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_logo.png deleted file mode 100644 index 0828184..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_logo.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_normal.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_normal.png deleted file mode 100644 index 9568b0d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_notify.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_notify.png deleted file mode 100644 index e85c92d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_notify.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_offline.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_offline.png deleted file mode 100644 index 77e8cfc..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_offline.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_online.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_online.png deleted file mode 100644 index 8c75355..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_online.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_share.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_share.png deleted file mode 100644 index 3e330bd..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_share.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_success.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_success.png deleted file mode 100644 index fd8ec0a..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/icon_success.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/image_empty.jpg b/cim_for_mina/client-mchat-android/res/drawable-hdpi/image_empty.jpg deleted file mode 100644 index e0b2944..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/image_empty.jpg and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/input.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/input.9.png deleted file mode 100644 index 3010c31..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/input.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/input_over.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/input_over.9.png deleted file mode 100644 index 96541f2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/input_over.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/list_blockbg.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/list_blockbg.9.png deleted file mode 100644 index 3350dfc..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/list_blockbg.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/list_divider_line.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/list_divider_line.png deleted file mode 100644 index b1936b7..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/list_divider_line.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/listitem_hover.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/listitem_hover.9.png deleted file mode 100644 index ffd7160..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/listitem_hover.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_1.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_1.png deleted file mode 100644 index 6531ea6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_1.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_10.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_10.png deleted file mode 100644 index f34df80..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_10.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_11.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_11.png deleted file mode 100644 index eed8afc..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_11.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_12.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_12.png deleted file mode 100644 index 55e603c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_12.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_13.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_13.png deleted file mode 100644 index 348607e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_13.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_14.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_14.png deleted file mode 100644 index 250c692..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_14.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_15.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_15.png deleted file mode 100644 index 525658c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_15.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_16.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_16.png deleted file mode 100644 index 383fdd2..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_16.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_17.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_17.png deleted file mode 100644 index 112e8bf..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_17.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_18.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_18.png deleted file mode 100644 index 47c0808..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_18.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_19.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_19.png deleted file mode 100644 index ea124f8..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_19.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_2.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_2.png deleted file mode 100644 index 5308892..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_2.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_20.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_20.png deleted file mode 100644 index 7646ae3..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_20.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_21.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_21.png deleted file mode 100644 index ee1cad0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_21.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_22.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_22.png deleted file mode 100644 index 1cb8c28..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_22.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_23.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_23.png deleted file mode 100644 index fbf7994..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_23.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_24.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_24.png deleted file mode 100644 index 12d1824..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_24.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_3.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_3.png deleted file mode 100644 index 7e871ba..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_3.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_4.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_4.png deleted file mode 100644 index 3fce700..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_4.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_5.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_5.png deleted file mode 100644 index cf86a3f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_5.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_6.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_6.png deleted file mode 100644 index f082aa1..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_6.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_7.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_7.png deleted file mode 100644 index 8105112..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_7.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_8.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_8.png deleted file mode 100644 index f985f3b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_8.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_9.png deleted file mode 100644 index a5e3a9f..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_bg.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_bg.png deleted file mode 100644 index 0ecb5a4..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_bg.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_coffee.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_coffee.png deleted file mode 100644 index 5598cd0..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/loading_coffee.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/message_hint.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/message_hint.png deleted file mode 100644 index 03bfe4b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/message_hint.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/msg_tips_bg_normal.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/msg_tips_bg_normal.9.png deleted file mode 100644 index f643c56..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/msg_tips_bg_normal.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/msg_tips_bg_pressed.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/msg_tips_bg_pressed.9.png deleted file mode 100644 index 41c1cf6..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/msg_tips_bg_pressed.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/narrow.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/narrow.9.png deleted file mode 100644 index 48aacf1..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/narrow.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/narrow_select.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/narrow_select.9.png deleted file mode 100644 index 6690171..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/narrow_select.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/scrollbar.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/scrollbar.9.png deleted file mode 100644 index d23b51c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/scrollbar.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_bottom.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_bottom.9.png deleted file mode 100644 index 74085ae..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_bottom.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_bottom_pre.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_bottom_pre.9.png deleted file mode 100644 index 2218423..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_bottom_pre.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_middle.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_middle.9.png deleted file mode 100644 index aa17a3c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_middle.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_middle_pre.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_middle_pre.9.png deleted file mode 100644 index d4a3fc1..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_middle_pre.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_single.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_single.9.png deleted file mode 100644 index 4a13540..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_single.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_single_pre.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_single_pre.9.png deleted file mode 100644 index 6a11115..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_single_pre.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_top.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_top.9.png deleted file mode 100644 index 91ab8bb..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_top.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_top_pre.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_top_pre.9.png deleted file mode 100644 index a31b497..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/set_list_top_pre.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/show.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/show.png deleted file mode 100644 index dbb2d2e..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/show.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_normal.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_normal.png deleted file mode 100644 index a385d13..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_pressed.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_pressed.png deleted file mode 100644 index cfc3e89..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_pressed.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/success.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/success.png deleted file mode 100644 index b2ccbc4..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/success.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab2_normal.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab2_normal.png deleted file mode 100644 index b640d29..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab2_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab2_over.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab2_over.png deleted file mode 100644 index bfd217c..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab2_over.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab3_normal.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab3_normal.png deleted file mode 100644 index b2a3c19..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab3_normal.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab3_over.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab3_over.png deleted file mode 100644 index 3a3f25b..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/tab3_over.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/table_arrow.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/table_arrow.png deleted file mode 100644 index dd3dfe9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/table_arrow.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/toast_bg.9.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/toast_bg.9.png deleted file mode 100644 index a7a11a9..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/toast_bg.9.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/topface_back.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/topface_back.png deleted file mode 100644 index 4f937cf..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/topface_back.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_1.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_1.png deleted file mode 100644 index d585e7d..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_1.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_2.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_2.png deleted file mode 100644 index f7c43de..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_2.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_3.png b/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_3.png deleted file mode 100644 index 52e2827..0000000 Binary files a/cim_for_mina/client-mchat-android/res/drawable-hdpi/troop_default_head_3.png and /dev/null differ diff --git a/cim_for_mina/client-mchat-android/res/values/arrays.xml b/cim_for_mina/client-mchat-android/res/values/arrays.xml deleted file mode 100644 index 3610151..0000000 --- a/cim_for_mina/client-mchat-android/res/values/arrays.xml +++ /dev/null @@ -1,225 +0,0 @@ - - - - - f_static_000 - f_static_001 - f_static_002 - f_static_003 - f_static_004 - f_static_005 - f_static_006 - f_static_007 - f_static_008 - f_static_009 - f_static_010 - f_static_011 - f_static_012 - f_static_013 - f_static_014 - f_static_015 - f_static_016 - f_static_017 - f_static_018 - f_static_019 - f_static_020 - f_static_021 - f_static_022 - f_static_023 - f_static_024 - f_static_025 - f_static_026 - f_static_027 - f_static_028 - f_static_029 - f_static_030 - f_static_031 - f_static_032 - f_static_033 - f_static_034 - f_static_035 - f_static_036 - f_static_037 - f_static_038 - f_static_039 - f_static_040 - f_static_041 - f_static_042 - f_static_043 - f_static_044 - f_static_045 - f_static_046 - f_static_047 - f_static_048 - f_static_049 - f_static_050 - f_static_051 - f_static_052 - f_static_053 - f_static_054 - f_static_055 - f_static_056 - f_static_057 - f_static_058 - f_static_059 - f_static_060 - f_static_061 - f_static_062 - f_static_063 - f_static_064 - f_static_065 - f_static_066 - f_static_067 - f_static_068 - f_static_069 - f_static_070 - f_static_071 - f_static_072 - f_static_073 - f_static_074 - f_static_075 - f_static_076 - f_static_077 - f_static_078 - f_static_079 - f_static_080 - f_static_081 - f_static_082 - f_static_083 - f_static_084 - f_static_085 - f_static_086 - f_static_087 - f_static_088 - f_static_089 - f_static_090 - f_static_091 - f_static_092 - f_static_093 - f_static_094 - f_static_095 - f_static_096 - f_static_097 - f_static_098 - f_static_099 - f_static_100 - f_static_101 - f_static_102 - f_static_103 - f_static_104 - f_static_105 - f_static_106 - - - - - 000 - 001 - 002 - 003 - 004 - 005 - 006 - 007 - 008 - 009 - 010 - 011 - 012 - 013 - 014 - 015 - 016 - 017 - 018 - 019 - 020 - 021 - 022 - 023 - 024 - 025 - 026 - 027 - 028 - 029 - 030 - 031 - 032 - 033 - 034 - 035 - 036 - 037 - 038 - 039 - 040 - 041 - 042 - 043 - 044 - 045 - 046 - 047 - 048 - 049 - 050 - 051 - 052 - 053 - 054 - 055 - 056 - 057 - 058 - 059 - 060 - 061 - 062 - 063 - 064 - 065 - 066 - 067 - 068 - 069 - 070 - 071 - 072 - 073 - 074 - 075 - 076 - 077 - 078 - 079 - 080 - 081 - 082 - 083 - 084 - 085 - 086 - 087 - 088 - 089 - 090 - 091 - 092 - 093 - 094 - 095 - 096 - 097 - 098 - 099 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/values/attrs.xml b/cim_for_mina/client-mchat-android/res/values/attrs.xml deleted file mode 100644 index 520cbbb..0000000 --- a/cim_for_mina/client-mchat-android/res/values/attrs.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/cim_for_mina/client-mchat-android/res/values/color.xml b/cim_for_mina/client-mchat-android/res/values/color.xml deleted file mode 100644 index 8d861c4..0000000 --- a/cim_for_mina/client-mchat-android/res/values/color.xml +++ /dev/null @@ -1,27 +0,0 @@ - - -#f89636 -#ffffff -#3399CC -#A5CD4E -#ff789089 -#000000 -#E20C0C - #fff4f6f8 -#c8ffffff -#ffeef1f3 -#00000000 - -#050917 -#59687C - -#050917 - -#DDDDFF - #AAAAAA - #00000000 - #0D3EDE - #519A2D - - #00ffffff - diff --git a/cim_for_mina/client-mchat-android/res/values/dimens.xml b/cim_for_mina/client-mchat-android/res/values/dimens.xml deleted file mode 100644 index 1431fa5..0000000 --- a/cim_for_mina/client-mchat-android/res/values/dimens.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - 19.0sp - 16.0sp - 15.0sp - 12.0sp - 52.0dip - 34.0dip - 15.0sp - 50.0dip - 8.0dip - 8.0dip - 15.0dip - 8.0dip - 10.0dip - 42.0dip - 16.0dip - 16.0sp - 18.0sp - 20.0sp - 22.0sp - 100.0dip - 110.0dip - 120.0dip - 130.0dip - 150.0dip - 240.0dip - 5.0dip - 10.0dip - 10.0dip - 10.0dip - 10.0dip - 10.0dip - 64.0dip - 64.0dip - 285.0dip - 172.0dip - 3.0dip - 43.5dip - 6.5dip - 29.0dip - 48.0dip - 0.0dip - 0.0dip - 150.0dip - 150.0dip - 104.0dip - 64.0dip - 52.0dip - 60.0dip - 180.0dip - 22.0sp - 18.0sp - 16.0sp - 14.0sp - 12.0sp - 10.0dip - 6.0dip - 2.0dip - 10.0dip - 6.0dip - 2.0dip - 50.0dip - 50.0dip - 146.0dip - 11.0sp - 12.0sp - 13.0sp - 14.0sp - 15.0sp - 16.0sp - 17.0sp - 18.0sp - 19.0sp - 20.0sp - 21.0sp - 11.0dip - 10.0dip - 6.0dip - 0.0dip - 20.0dip - 12.0dip - 12.0dip - 7.0dip - 14.0dip - 80.0dip - 64.0dip - 75.0dip - 10.0dip - 9.0dip - 288.0dip - 48.0dip - 12.0dip - 12.0dip - 5.0dip - 2.0dip - 2.0dip - 5.0dip - 2.0dip - 254.0dip - 122.0dip - 46.0dip - 10.0dip - 10.0dip - 20.0dip - 30.0dip - 10.0dip - 5.0dip - 10.0dip - 12.5dip - 25.0dip - 20.0dip - 18.0dip - 3.0dip - 3.0dip - 10.0dip - 15.5sp - 16.5dip - 10.0dip - 12.0dip - 48.0dip - 40.0dip - 40.0dip - 60.0dip - 5.0dip - 70.0dip - 62.0dip - 4.0dip - 4.0dip - 4.0dip - 1.0dip - 1.0dip - 2.0dip - 9.0dip - 9.0dip - 13.0dip - 9.0dip - 6.0dip - 6.0dip - 7.0dip - 8.0dip - 14.0dip - 10.0dip - 11.0dip - 10.0dip - 10.0dip - 0.0dip - 10.0dip - 6.0dip - 6.0dip - 47.0dip - 42.0dip - 35.0dip - 29.0dip - 96.0dip - 66.0dip - 4.0dip - 194.0dip - 12.5dip - 10.0dip - 10.0dip - 10.0dip - 10.0dip - 3.0dip - 10.0dip - 75.0dip - 23.0dip - 6.0dip - 104.0dip - 98.0dip - 99.0dip - 57.0dip - 38.0dip - 61.0dip - 151.0dip - 133.0dip - 40.0dip - 30.0dip - 31.0dip - 10.0dip - 108.0dip - 400.0px - 300.0px - 117.0dip - 110.0dip - 80.0dip - 107.0dip - 25.0dip - 20.0dip - 5.0dip - 115.0dip - 6.0dip - 56.0dip - 4.0dip - 30.0dip - 40.0dip - 50.0dip - 32.0dip - 19.0sp - 22.0sp - 16.0sp - 14.0sp - 12.0sp - 44.0dip - 40.0dip - 50.0dip - 36.0dip - 10.0dip - 13.0dip - 15.0dip - 15.0sp - 13.0sp - 13.0sp - 15.0sp - 11.0sp - 12.0sp - 4.0dip - 7.0dip - 15.0dip - 10.0dip - 5.0dip - 3.5sp - 0.0dip - 2.0dip - 60.0dip - 5.0dip - 4.0dip - 2.0dip - 15.0dip - 2.0dip - 5.0dip - 5.0dip - 35.0dip - 74.25dip - 80.0dip - 80.0dip - 1.0dip - 2.0dip - 3.0dip - 5.0dip - 6.0dip - 7.0dip - 8.0dip - 9.0dip - 10.0dip - 11.0dip - 12.0dip - 13.0dip - 14.0dip - 15.0dip - 17.0dip - 23.0dip - 25.0dip - 30.0dip - 35.0dip - 32.0dip - 50.0dip - 53.0dip - 105.0dip - 126.66998dip - 155.0dip - 169.32999dip - 50.0dip - 50.0dip - 58.0dip - 55.0dip - 14.0dip - 300.0dip - 64.0dip - 14.0dip - 56.0dip - 18.0dip - 2.0dip - 2.0dip - 10.0dip - 12.0dip - 4.0dip - 48.0dip - 68.0dip - 26.0dip - 60.0dip - 6.0sp - 8.0sp - 10.0sp - 12.0sp - 13.0sp - 14.0sp - 16.0sp - 18.0sp - 20.0sp - 0.5dip - 58.0dip - 38.0dip - 57.0dip - 39.0dip - 10.5dip - 10.5dip - 50.0dip - 30.0dip - 11.0dip - 11.0dip - 4.0dip - 5.0dip - 4.0dip - 50.0dip - 60.0dip - 60.0dip - 4.0dip - 5.0dip - 360.0dip - 402.0dip - 23.0dip - 63.0dip - -100.0dip - 360.0dip - 402.0dip - 24.0dip - 50.0dip - 12.0dip - 147.0dip - 160.0dip - 12.0dip - 12.0dip - 9.0dip - 4.5dip - 147.0dip - 110.0dip - 3.0dip - 3.0dip - 60.0dip - 10.0dip - 15.0dip - 52.0dip - 8.0dip - 83.0dip - 120.0dip - 8.0dip - 3.0dip - 16.0dip - 3.0dip - 2.0dip - 4.0dip - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/res/values/strings.xml b/cim_for_mina/client-mchat-android/res/values/strings.xml deleted file mode 100644 index e67fda0..0000000 --- a/cim_for_mina/client-mchat-android/res/values/strings.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - ichat - 分钟前 - 小时前 - 天前 - 松开获取更多 - 下拉可以刷新 - 上次更新: - 重新加载 - 网络连接失败 - 查看更多 - 正在检查更新...... - 当前已是最新版本 - 发现新版本 - 刚刚 - diff --git a/cim_for_mina/client-mchat-android/res/values/styles.xml b/cim_for_mina/client-mchat-android/res/values/styles.xml deleted file mode 100644 index 8fdab2e..0000000 --- a/cim_for_mina/client-mchat-android/res/values/styles.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java b/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java deleted file mode 100644 index a60ef9a..0000000 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.adapter; - -import java.util.Comparator; - -import com.farsunset.cim.sdk.android.model.Message; - -public class MessageTimeDescComparator implements Comparator{ - - @Override - public int compare(Message arg0, Message arg1) { - - return (int) (arg1.getTimestamp() - arg0.getTimestamp()) ; - } - - - -} diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java b/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java deleted file mode 100644 index 560da3a..0000000 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.app; - - -import com.farsunset.cim.sdk.android.CIMEventListener; -import com.farsunset.cim.sdk.android.CIMListenerManager; -import com.farsunset.cim.sdk.android.model.Message; -import com.farsunset.cim.sdk.android.model.ReplyBody; - -import android.app.Activity; -import android.net.NetworkInfo; -import android.os.Bundle; - -public abstract class CIMMonitorActivity extends Activity implements CIMEventListener{ - - - CommonBaseControl commonBaseControl; - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - CIMListenerManager.registerMessageListener(this,this); - - commonBaseControl = new CommonBaseControl(this); - - - } - - @Override - public void finish() { - super.finish(); - CIMListenerManager.removeMessageListener(this); - - } - - @Override - public void onRestart() { - super.onRestart(); - CIMListenerManager.registerMessageListener(this,this); - } - - - public void showProgressDialog(String title,String content) - { - commonBaseControl.showProgressDialog(title, content); - } - - public void hideProgressDialog() - { - commonBaseControl.hideProgressDialog(); - } - - public void showToask(String hint){ - - commonBaseControl.showToask(hint); - } - - - - - @Override - public void onMessageReceived(Message arg0){}; - - @Override - public void onNetworkChanged(NetworkInfo info){} - - /** - * 与服务端断开连接时回调,不要在里面做连接服务端的操作 - */ - @Override - public void onConnectionClosed() {} - - - /** - * 连接服务端成功时回调 - */ - - @Override - public void onConnectionSuccessed(boolean arg0) {} - - - @Override - public void onReplyReceived(ReplyBody arg0) {} - @Override - public void onConnectionFailed(Exception e){}; -} diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/CommonBaseControl.java b/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/CommonBaseControl.java deleted file mode 100644 index 56d7a79..0000000 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/CommonBaseControl.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.app; - - - -import android.app.ProgressDialog; -import android.content.Context; -import android.widget.Toast; - - -public class CommonBaseControl { - - private ProgressDialog progressDialog; - - Context mMontent; - - - public CommonBaseControl(Context content) - { - this.mMontent = content; - } - - - - public void showProgressDialog(String title,String message) - { - if(progressDialog==null) - { - - progressDialog = ProgressDialog.show(mMontent, title, message, true, true); - }else if(progressDialog.isShowing()) - { - progressDialog.setTitle(title); - progressDialog.setMessage(message); - } - - progressDialog.show(); - - } - - public void hideProgressDialog() - { - - if(progressDialog!=null&&progressDialog.isShowing()) - { - progressDialog.dismiss(); - } - - } - - public void showToask(String hint){ - - Toast toast=Toast.makeText(mMontent,hint,Toast.LENGTH_SHORT); - toast.show(); - } - - -} diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java b/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java deleted file mode 100644 index 75e0c14..0000000 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.app; - -public interface Constant { - - //服务端IP地址 - public static final String CIM_SERVER_HOST = "192.168.191.1"; - - //服务端web地址 - public static final String SERVER_URL = "http://"+CIM_SERVER_HOST+":8080/cim-server"; - - - //注意,这里的端口不是tomcat的端口,CIM端口在服务端spring-cim.xml中配置的,没改动就使用默认的23456 - public static final int CIM_SERVER_PORT = 23456; - - public static interface MessageType{ - - - //用户之间的普通消息 - public static final String TYPE_0 = "0"; - - - //下线类型 - String TYPE_999 = "999"; - } - - - public static interface MessageStatus{ - - //消息未读 - public static final String STATUS_0 = "0"; - //消息已经读取 - public static final String STATUS_1 = "1"; - } - -} diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIRequester.java b/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIRequester.java deleted file mode 100644 index 5ddad4d..0000000 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIRequester.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.network; -import java.io.File; -import java.nio.charset.Charset; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.mime.MultipartEntity; -import org.apache.http.entity.mime.content.FileBody; -import org.apache.http.entity.mime.content.StringBody; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.params.CoreConnectionPNames; -import org.apache.http.util.EntityUtils; -import android.os.Handler; -import android.os.Message; -import com.alibaba.fastjson.JSON; - - -public class HttpAPIRequester { - HttpAPIResponser responser; - private static BlockingQueue queue = new LinkedBlockingQueue(); - private static ThreadPoolExecutor executor = new ThreadPoolExecutor(3, 5, 20, TimeUnit.SECONDS,queue);; - - public HttpAPIRequester(HttpAPIResponser responser) - { - this.responser = responser; - - } - - public HttpAPIRequester() - {} - - - //http api 调用 - public void execute(final HashMap params, final String url) - { - executor.execute(new Runnable() { - @Override - public void run() { - try { - httpPost(url,params); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - - - /** - * HTTP api 调用方法,回应将再responser里面处理 - *execute(这里用一句话描述这个方法的作用) - *(这里描述这个方法是用条件 - 可选) - * @param dtype 返回数据的 data节点数据泛型 - * @param dltype 返回数据的 dataList节点数据泛型 - * @param url - *void - * @exception - * @since 1.0.0 - */ - public void execute( final String url) - { - - responser.onRequest(); - executor.execute(new Runnable() { - @Override - public void run() { - - Message message = handler.obtainMessage(); - message.getData().putString("url", url); - try { - String dataString = httpPost(url,responser.getRequestParams()); - - message.getData().putString("data", dataString); - message.what = 0; - } catch (Exception e) { - e.printStackTrace(); - message.getData().putSerializable("exception", e); - message.what = 1; - } - handler.sendMessage(message); - } - }); - - } - - - public static String httpPost(String url,Map map) throws Exception - { - HttpPost httpPost = new HttpPost(url); - MultipartEntity mpEntity = new MultipartEntity(); - - for(String key:map.keySet()) - { - if(map.get(key)!=null) - { - if(map.get(key) instanceof File) - { - FileBody fileBody = new FileBody((File)map.get(key)); - mpEntity.addPart(key,fileBody); - }else - { - StringBody stringBody = new StringBody(map.get(key).toString(), Charset.forName("UTF-8")); - mpEntity.addPart(key,stringBody); - } - } - } - - System.out.println(url); - System.out.println(JSON.toJSONString(map)); - httpPost.setEntity(mpEntity); - HttpClient httpClient = new DefaultHttpClient(); - httpClient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 30000); - httpClient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 30000); - HttpResponse httpResp = httpClient.execute(httpPost); - String json = EntityUtils.toString(httpResp.getEntity(), "UTF-8"); - httpClient.getConnectionManager().closeIdleConnections(1, TimeUnit.MILLISECONDS); - System.out.println(json); - return json; - } - - Handler handler = new Handler(){ - public void handleMessage(Message message) - { - String url = message.getData().getString("url"); - switch(message.what) - { - case 0: - String data = message.getData().getString("data"); - responser.onSuccess(data,url); - - break; - case 1: - responser.onFailed((Exception) message.getData().get("exception"),url); - break; - } - - } - }; -} diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIResponser.java b/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIResponser.java deleted file mode 100644 index a59b8d2..0000000 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIResponser.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.network; - -import java.util.Map; - - -public interface HttpAPIResponser { - public void onSuccess(String resulet,String url); - public void onFailed(Exception e,String url); - public Map getRequestParams(); - public void onRequest(); -} diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java b/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java deleted file mode 100644 index 4440f83..0000000 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.receiver; - - -import android.app.Notification; -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.net.NetworkInfo; - -import com.farsunset.cim.sdk.android.CIMEventBroadcastReceiver; -import com.farsunset.cim.sdk.android.CIMListenerManager; -import com.farsunset.cim.sdk.android.model.Message; -import com.farsunset.cim.sdk.android.model.ReplyBody; -import com.farsunset.ichat.example.R; -import com.farsunset.ichat.example.ui.SystemMessageActivity; - -/** - * 消息入口,所有消息都会经过这里 - * @author 3979434 - * - */ -public final class CustomCIMMessageReceiver extends CIMEventBroadcastReceiver { - - private NotificationManager notificationManager; - - - - //当收到消息时,会执行onMessageReceived,这里是消息第一入口 - @Override - public void onMessageReceived(Message message) { - - //调用分发消息监听 - CIMListenerManager.notifyOnMessageReceived(message); - - //以开头的为动作消息,无须显示,如被强行下线消息Constant.TYPE_999 - if(message.getType().startsWith("9")) - { - return ; - } - - showNotify(context,message); - } - - - - private void showNotify(Context context , Message msg) - { - - this.notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - String title = "系统消息"; - - Notification notification = new Notification(R.drawable.icon_notify,title,msg.getTimestamp()); - notification.defaults = Notification.DEFAULT_LIGHTS; - notification.flags |= Notification.FLAG_AUTO_CANCEL; - - Intent notificationIntent = new Intent(context,SystemMessageActivity.class); - PendingIntent contentIntent = PendingIntent.getActivity(context,1, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); - notification.contentIntent = contentIntent; - notification.setLatestEventInfo(context,title, msg.getContent(),contentIntent); - notificationManager.notify(R.drawable.icon_notify, notification); - - } - - @Override - public void onNetworkChanged(NetworkInfo info) { - CIMListenerManager.notifyOnNetworkChanged(info); - } - - - @Override - public void onConnectionSuccessed(boolean hasAutoBind) { - CIMListenerManager.notifyOnConnectionSuccessed(hasAutoBind); - } - - @Override - public void onConnectionClosed() { - CIMListenerManager.notifyOnConnectionClosed(); - } - - - @Override - public void onReplyReceived(ReplyBody body) { - CIMListenerManager.notifyOnReplyReceived(body); - } - - - - @Override - public void onConnectionFailed(Exception arg0) { - // TODO Auto-generated method stub - CIMListenerManager.notifyOnConnectionFailed(arg0); - } - -} diff --git a/cim_for_netty/cim-android-sdk/.classpath b/cim_for_netty/cim-android-sdk/.classpath index 6f7dcf0..8b81c43 100644 --- a/cim_for_netty/cim-android-sdk/.classpath +++ b/cim_for_netty/cim-android-sdk/.classpath @@ -2,11 +2,13 @@ - - - - - - + + + + + + + + diff --git a/cim_for_netty/cim-android-sdk/.project b/cim_for_netty/cim-android-sdk/.project index 4719939..dab9061 100644 --- a/cim_for_netty/cim-android-sdk/.project +++ b/cim_for_netty/cim-android-sdk/.project @@ -10,8 +10,14 @@ + + com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder + + + + com.genuitec.eclipse.ast.deploy.core.deploymentnature org.eclipse.jdt.core.javanature diff --git a/cim_for_netty/client-mchat-android/.settings/org.eclipse.core.resources.prefs b/cim_for_netty/cim-android-sdk/.settings/org.eclipse.core.resources.prefs similarity index 64% rename from cim_for_netty/client-mchat-android/.settings/org.eclipse.core.resources.prefs rename to cim_for_netty/cim-android-sdk/.settings/org.eclipse.core.resources.prefs index 2a5a0ea..99b2bf9 100644 --- a/cim_for_netty/client-mchat-android/.settings/org.eclipse.core.resources.prefs +++ b/cim_for_netty/cim-android-sdk/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,3 @@ -#Mon Mar 07 09:18:02 CST 2011 +#Wed Oct 15 09:31:41 CST 2014 eclipse.preferences.version=1 encoding/=UTF-8 diff --git a/cim_for_netty/cim-android-sdk/.settings/org.eclipse.jdt.core.prefs b/cim_for_netty/cim-android-sdk/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..d17b672 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/cim_for_netty/cim-android-sdk/libs/log4j-1.2.17.jar b/cim_for_netty/cim-android-sdk/libs/log4j-1.2.17.jar new file mode 100644 index 0000000..068867e Binary files /dev/null and b/cim_for_netty/cim-android-sdk/libs/log4j-1.2.17.jar differ diff --git a/cim_for_netty/cim-android-sdk/libs/netty-buffer-4.1.9.Final.jar b/cim_for_netty/cim-android-sdk/libs/netty-buffer-4.1.9.Final.jar new file mode 100644 index 0000000..31d9a48 Binary files /dev/null and b/cim_for_netty/cim-android-sdk/libs/netty-buffer-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-android-sdk/libs/netty-codec-4.1.9.Final.jar b/cim_for_netty/cim-android-sdk/libs/netty-codec-4.1.9.Final.jar new file mode 100644 index 0000000..7c1717c Binary files /dev/null and b/cim_for_netty/cim-android-sdk/libs/netty-codec-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-android-sdk/libs/netty-common-4.1.9.Final.jar b/cim_for_netty/cim-android-sdk/libs/netty-common-4.1.9.Final.jar new file mode 100644 index 0000000..e38f723 Binary files /dev/null and b/cim_for_netty/cim-android-sdk/libs/netty-common-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-android-sdk/libs/netty-handler-4.1.9.Final.jar b/cim_for_netty/cim-android-sdk/libs/netty-handler-4.1.9.Final.jar new file mode 100644 index 0000000..1498d27 Binary files /dev/null and b/cim_for_netty/cim-android-sdk/libs/netty-handler-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-android-sdk/libs/netty-transport-4.1.9.Final.jar b/cim_for_netty/cim-android-sdk/libs/netty-transport-4.1.9.Final.jar new file mode 100644 index 0000000..0cc8904 Binary files /dev/null and b/cim_for_netty/cim-android-sdk/libs/netty-transport-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-android-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_netty/cim-android-sdk/libs/protobuf-java-3.2.0.jar new file mode 100644 index 0000000..b1f9701 Binary files /dev/null and b/cim_for_netty/cim-android-sdk/libs/protobuf-java-3.2.0.jar differ diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMCacheToolkit.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMCacheToolkit.java index eaf1c6e..4557dab 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMCacheToolkit.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMCacheToolkit.java @@ -1,11 +1,27 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; +import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; @@ -15,14 +31,16 @@ class CIMCacheToolkit extends SQLiteOpenHelper { private static final String DATABASE_NAME = "CIM_CONFIG_INFO.db"; private static final int DATABASE_VERSION = 20160406; + private static final String TABLE_NAME = "T_CIM_CONFIG"; + private static CIMCacheToolkit toolkit; + + private static final String TABLE_SQL = "CREATE TABLE IF NOT EXISTS "+TABLE_NAME+" (KEY VARCHAR(64) PRIMARY KEY,VALUE TEXT)"; - private static final String TABLE_SQL = "CREATE TABLE IF NOT EXISTS T_CIM_CONFIG (KEY VARCHAR(64) PRIMARY KEY,VALUE TEXT)"; + private static final String DELETE_SQL = "DELETE FROM "+TABLE_NAME+" WHERE KEY = ?"; - private static final String DELETE_SQL = "DELETE FROM T_CIM_CONFIG WHERE KEY = ?"; + private static final String QUERY_SQL = "SELECT VALUE FROM "+TABLE_NAME+" WHERE KEY = ?"; - private static final String SAVE_SQL = "INSERT INTO T_CIM_CONFIG (KEY,VALUE) VALUES(?,?)"; - - private static final String QUERY_SQL = "SELECT VALUE FROM T_CIM_CONFIG WHERE KEY = ?"; + private SQLiteDatabase mSQLiteDatabase; public static final String CIM_CONFIG_INFO = "CIM_CONFIG_INFO"; @@ -38,13 +56,14 @@ class CIMCacheToolkit extends SQLiteOpenHelper { public static final String KEY_CIM_CONNECTION_STATE = "KEY_CIM_CONNECTION_STATE"; - static CIMCacheToolkit toolkit; - private SQLiteDatabase mSQLiteDatabase; + public synchronized static CIMCacheToolkit getInstance(Context context){ - if (toolkit==null){ - toolkit = new CIMCacheToolkit(context); - } - return toolkit; + + if(toolkit==null){ + toolkit = new CIMCacheToolkit(context); + } + + return toolkit; } @@ -57,7 +76,6 @@ class CIMCacheToolkit extends SQLiteOpenHelper { } - public synchronized void remove(String key) { getSQLiteDatabase().execSQL(DELETE_SQL,new String[]{key}); @@ -66,8 +84,15 @@ class CIMCacheToolkit extends SQLiteOpenHelper { public synchronized void putString(String key,String value) { - getSQLiteDatabase().execSQL(DELETE_SQL,new String[]{key}); - getSQLiteDatabase().execSQL(SAVE_SQL, new String[]{key, value}); + + ContentValues values = new ContentValues(); + values.put("VALUE", value); + int result = getSQLiteDatabase().updateWithOnConflict(TABLE_NAME, values, "KEY=?",new String[]{key},SQLiteDatabase.CONFLICT_FAIL); + if(result<=0){ + + values.put("KEY", key); + getSQLiteDatabase().insert(TABLE_NAME, null, values); + } } @@ -75,14 +100,15 @@ class CIMCacheToolkit extends SQLiteOpenHelper { { String value = null; Cursor cursor = getSQLiteDatabase().rawQuery(QUERY_SQL, new String[]{key}); - if (cursor!=null&&cursor.moveToFirst()) + if (cursor!=null) { - value = cursor.getString(0); + if(cursor.moveToFirst()){ + value = cursor.getString(0); + } + cursor.close(); } - - - + return value; } @@ -121,6 +147,8 @@ class CIMCacheToolkit extends SQLiteOpenHelper { try{toolkit.close();}catch(Exception e){} } + toolkit = null; + } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMConnectorManager.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMConnectorManager.java index fc4bc20..4272927 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMConnectorManager.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMConnectorManager.java @@ -1,117 +1,107 @@ -/** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.ChannelPipeline; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.SocketChannel; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.serialization.ClassResolvers; -import io.netty.handler.timeout.IdleState; -import io.netty.handler.timeout.IdleStateEvent; -import io.netty.handler.timeout.IdleStateHandler; -import io.netty.util.AttributeKey; - -import java.net.InetSocketAddress; +import java.util.Random; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Future; - import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.util.Log; - +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler.Sharable; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.timeout.IdleState; +import io.netty.handler.timeout.IdleStateEvent; +import io.netty.handler.timeout.IdleStateHandler; +import io.netty.util.AttributeKey; import com.farsunset.cim.sdk.android.constant.CIMConstant; -import com.farsunset.cim.sdk.android.exception.CIMSessionDisableException; -import com.farsunset.cim.sdk.android.exception.NetWorkDisableException; -import com.farsunset.cim.sdk.android.exception.WriteToClosedSessionException; +import com.farsunset.cim.sdk.android.exception.SessionDisconnectedException; import com.farsunset.cim.sdk.android.filter.ClientMessageDecoder; import com.farsunset.cim.sdk.android.filter.ClientMessageEncoder; +import com.farsunset.cim.sdk.android.exception.NetworkDisconnectedException; +import com.farsunset.cim.sdk.android.model.HeartbeatRequest; +import com.farsunset.cim.sdk.android.model.HeartbeatResponse; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; import com.farsunset.cim.sdk.android.model.SentBody; /** * 连接服务端管理,cim核心处理类,管理连接,以及消息处理 + * + * @author 3979434@qq.com */ -@io.netty.channel.ChannelHandler.Sharable -class CIMConnectorManager extends SimpleChannelInboundHandler { +@Sharable +class CIMConnectorManager extends SimpleChannelInboundHandler { - private final static String TAG = CIMConnectorManager.class.getSimpleName(); - private Channel channel;; + private final String TAG = CIMConnectorManager.class.getSimpleName(); + private final int CONNECT_TIMEOUT = 10 * 1000;//秒 + private final int WRITE_TIMEOUT = 10 * 1000;//秒 - Context context; + private final int READ_IDLE_TIME = 120;//秒 + private final int HEARBEAT_TIME_OUT = (READ_IDLE_TIME + 20) * 1000;// 收到服务端心跳请求超时时间 毫秒 + private final String KEY_LAST_HEART_TIME = "KEY_LAST_HEART_TIME" ; + + private Bootstrap bootstrap; + private EventLoopGroup loopGroup ; + private Channel channel;; + private ExecutorService executor = Executors.newFixedThreadPool(1); + private Context context; - Bootstrap bootstrap; - EventLoopGroup loopGroup ; - static CIMConnectorManager manager; + private static CIMConnectorManager manager; - // 消息广播action - public static final String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; - // 发送sendbody失败广播 - public static final String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; - - // 发送sendbody成功广播 - public static final String ACTION_SENT_SUCCESSED = "com.farsunset.cim.SENT_SUCCESSED"; - // 链接意外关闭广播 - public static final String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; - // 链接失败广播 - public static final String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; - // 链接成功广播 - public static final String ACTION_CONNECTION_SUCCESSED = "com.farsunset.cim.CONNECTION_SUCCESSED"; - // 发送sendbody成功后获得replaybody回应广播 - public static final String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; - // 网络变化广播 - public static final String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; - - // 未知异常 - public static final String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; - //重试连接 - public final static String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; - - private ExecutorService executor; - public static final String HEARTBEAT_PINGED ="HEARTBEAT_PINGED"; - //连接空闲时间 - public static final int READ_IDLE_TIME = 180;//秒 - - //心跳超时 - public static final int HEART_TIME_OUT = 30 * 1000;//秒 - private CIMConnectorManager(Context ctx) { context = ctx; - executor = Executors.newCachedThreadPool(); + bootstrap = new Bootstrap(); loopGroup = new NioEventLoopGroup(); bootstrap.group(loopGroup); bootstrap.channel(NioSocketChannel.class); bootstrap.option(ChannelOption.TCP_NODELAY, true); + bootstrap.option(ChannelOption.SO_KEEPALIVE, true); + bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, CONNECT_TIMEOUT); + bootstrap.handler(new ChannelInitializer() { @Override public void initChannel(SocketChannel ch) throws Exception { - ChannelPipeline pipeline = ch.pipeline(); - pipeline.addLast(new ClientMessageDecoder(ClassResolvers.cacheDisabled(CIMConnectorManager.class.getClassLoader()))); - pipeline.addLast(new ClientMessageEncoder()); - pipeline.addLast(new IdleStateHandler(READ_IDLE_TIME,0,0)); - pipeline.addLast(CIMConnectorManager.this); - + ch.pipeline().addLast(new ClientMessageDecoder()); + ch.pipeline().addLast(new ClientMessageEncoder()); + ch.pipeline().addLast(new IdleStateHandler(READ_IDLE_TIME,0,0)); + ch.pipeline().addLast(CIMConnectorManager.this); } }); - + } public synchronized static CIMConnectorManager getManager(Context context) { @@ -122,100 +112,93 @@ class CIMConnectorManager extends SimpleChannelInboundHandler { } - private synchronized void syncConnection(final String cimServerHost,final int cimServerPort) { + private synchronized void syncConnection( String host, int port) { + + if(isConnected()){ + return ; + } + try { - if(isConnected()){ - return ; - } - ChannelFuture channelFuture = bootstrap.connect(new InetSocketAddress(cimServerHost, cimServerPort)).sync(); //这里的IP和端口,根据自己情况修改 + Log.i(TAG, "****************CIM正在连接服务器 "+host+":"+port+"......"); + ChannelFuture channelFuture = bootstrap.connect(host, port).syncUninterruptibly(); channel = channelFuture.channel(); } catch (Exception e) { + long interval = CIMConstant.RECONN_INTERVAL_TIME - (5*1000 - new Random().nextInt(15*1000)); + Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_FAILED); - intent.putExtra("exception", e); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED); + intent.putExtra(Exception.class.getName(), e); + intent.putExtra("interval", interval); context.sendBroadcast(intent); - Log.e(TAG,"******************CIM连接服务器失败 "+cimServerHost+":"+cimServerPort); - - } + Log.e(TAG, "****************CIM连接服务器失败 "+host+":"+port+"......将在"+interval/1000+"秒后重新尝试连接"); + + } } - public void connect(final String cimServerHost, final int cimServerPort) { + public void connect(final String host, final int port) { - - if (!netWorkAvailable(context)) { + if (!isNetworkConnected(context)) { Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_FAILED); - intent.putExtra("exception", new NetWorkDisableException()); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED); + intent.putExtra(Exception.class.getName(), new NetworkDisconnectedException()); context.sendBroadcast(intent); return; } - - Future future = executor.submit(new Runnable() { - @Override - public void run() { - syncConnection(cimServerHost, cimServerPort); - } - }); - try { - if(future.get()!=null) + + executor.execute(new Runnable() { + public void run() { - connect(cimServerHost,cimServerPort); - } - } catch (Exception e) { - - connect(cimServerHost,cimServerPort); - e.printStackTrace(); - } + syncConnection(host, port); + } + }); + } - public void send(final SentBody body) { + public synchronized void send(SentBody body) { - - executor.execute(new Runnable() { - @Override - public void run() { - - if(channel!=null && channel.isActive()) - { - boolean isDone = channel.writeAndFlush(body).awaitUninterruptibly(10000); - if (!isDone) { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new WriteToClosedSessionException()); - intent.putExtra("sentBody", body); - context.sendBroadcast(intent); - }else - { - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_SUCCESSED); - intent.putExtra("sentBody", body); - context.sendBroadcast(intent); - } - }else - { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new CIMSessionDisableException()); - intent.putExtra("sentBody", body); - context.sendBroadcast(intent); - } - } - }); + boolean isSuccessed = false; + + Throwable exception = new SessionDisconnectedException(); + + if(channel!=null && channel.isActive()) + { + isSuccessed = channel.writeAndFlush(body).awaitUninterruptibly(WRITE_TIMEOUT); + } + + if(!isSuccessed){ + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_SENT_FAILED); + intent.putExtra(Exception.class.getName(),exception); + intent.putExtra(SentBody.class.getName(), body); + context.sendBroadcast(intent); + }else + { + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_SENT_SUCCESSED); + intent.putExtra(SentBody.class.getName(), (SentBody) body); + context.sendBroadcast(intent); + } + } public void destroy() { - if (manager.channel != null) { - manager.channel.close(); + if (channel != null) { + channel.close(); } - loopGroup.shutdownGracefully(); + + if (loopGroup != null) { + loopGroup.shutdownGracefully(); + } + + + CIMCacheToolkit.destroy(); + manager = null; } @@ -227,6 +210,7 @@ class CIMConnectorManager extends SimpleChannelInboundHandler { } + public void closeSession() { if(channel!=null) @@ -236,91 +220,106 @@ class CIMConnectorManager extends SimpleChannelInboundHandler { } - /** - * 检测到连接空闲事件,发送心跳请求命令 - */ - @Override - public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { - Log.e(TAG,"userEventTriggered:"+evt.toString()); - if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.READER_IDLE)) - { - onReaderIdeled(ctx.channel()); - } - super.userEventTriggered(ctx, evt); - } - - - private void onReaderIdeled(Channel channel){ - - //如果心跳请求发出30秒内没收到响应,则关闭连接 - Long lastTime = (Long) channel.attr(AttributeKey.valueOf(HEARTBEAT_PINGED)).get(); - if(lastTime != null && System.currentTimeMillis() - lastTime > HEART_TIME_OUT) - { - channel.close(); - } - } - @Override - public void channelActive( ChannelHandlerContext ctx) throws Exception { + public void channelActive(ChannelHandlerContext ctx) throws Exception { - Log.i(TAG,"******************CIM连接服务器成功:"+ctx.channel().localAddress()); - ctx.channel().attr(AttributeKey.valueOf(HEARTBEAT_PINGED)).set(System.currentTimeMillis()); + Log.i(TAG, "****************CIM连接服务器成功:"+ctx.channel().localAddress()+" NID:"+ctx.channel().id().asShortText()); + + setLastHeartbeatTime(ctx.channel()); Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_SUCCESSED); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_SUCCESSED); + context.sendBroadcast(intent); + + } + + @Override + public void channelInactive(ChannelHandlerContext ctx) { + + Log.e(TAG, "****************CIM与服务器断开连接:"+ctx.channel().localAddress()+" NID:"+ctx.channel().id().asShortText()); + + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_CLOSED); + context.sendBroadcast(intent); + + } + + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { + + /** + * 用于解决,wifi情况下。偶而路由器与服务器断开连接时,客户端并没及时收到关闭事件 + * 导致这样的情况下当前连接无效也不会重连的问题 + * + */ + if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.READER_IDLE)) + { + Log.d(TAG, "****************CIM "+IdleState.READER_IDLE+":"+ctx.channel().localAddress()+" NID:"+ctx.channel().id().asShortText()); + + Long lastTime = getLastHeartbeatTime(ctx.channel()); + if(lastTime != null && System.currentTimeMillis() - lastTime > HEARBEAT_TIME_OUT) + { + channel.close(); + Log.e(TAG, "****************CIM心跳超时 ,即将重新连接......"+" NID:"+ctx.channel().id().asShortText()); + } + } + + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { + + Log.e(TAG, "****************CIM连接出现未知异常:"+ctx.channel().localAddress()+" NID:"+ctx.channel().id().asShortText()); + + if(cause!=null && cause.getMessage()!=null){ + Log.e(TAG, cause.getMessage()); + } + + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_UNCAUGHT_EXCEPTION); + intent.putExtra(Exception.class.getName(), cause); context.sendBroadcast(intent); } - @Override - public void channelInactive(ChannelHandlerContext ctx) throws Exception { - - Log.e(TAG,"******************closeCIM与服务器断开连接:"+ctx.channel().localAddress()); - if(channel.id().asLongText().equals(ctx.channel().id().asLongText())) - { - Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_CLOSED); - context.sendBroadcast(intent); - - } - } - - - @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception{ + if (msg instanceof Message) { Intent intent = new Intent(); - intent.setAction(ACTION_UNCAUGHT_EXCEPTION); - intent.putExtra("exception", cause.getCause()); + intent.setAction(CIMConstant.IntentAction.ACTION_MESSAGE_RECEIVED); + intent.putExtra(Message.class.getName(), (Message) msg); context.sendBroadcast(intent); - } - - @Override - protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { - if (msg instanceof Message) { - Intent intent = new Intent(); - intent.setAction(ACTION_MESSAGE_RECEIVED); - intent.putExtra("message", (Message) msg); - context.sendBroadcast(intent); - + } if (msg instanceof ReplyBody) { - Intent intent = new Intent(); - intent.setAction(ACTION_REPLY_RECEIVED); - intent.putExtra("replyBody", (ReplyBody) msg); - context.sendBroadcast(intent); + + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_REPLY_RECEIVED); + intent.putExtra(ReplyBody.class.getName(), (ReplyBody) msg); + context.sendBroadcast(intent); } //收到服务端发来的心跳请求命令,则马上回应服务器 - if (msg.equals(CIMConstant.CMD_HEARTBEAT_REQUEST)) { - ctx.writeAndFlush(CIMConstant.CMD_HEARTBEAT_RESPONSE); - ctx.channel().attr(AttributeKey.valueOf(HEARTBEAT_PINGED)).set(System.currentTimeMillis()); - } + if (msg instanceof HeartbeatRequest) { + ctx.writeAndFlush(HeartbeatResponse.getInstance()); + setLastHeartbeatTime(ctx.channel()); + } + + } + + private void setLastHeartbeatTime(Channel channel) + { + channel.attr(AttributeKey.valueOf(KEY_LAST_HEART_TIME)).set(System.currentTimeMillis()); } - public static boolean netWorkAvailable(Context context) { + private Long getLastHeartbeatTime(Channel channel) + { + return (Long) channel.attr(AttributeKey.valueOf(KEY_LAST_HEART_TIME)).get(); + } + + public static boolean isNetworkConnected(Context context) { try { ConnectivityManager nw = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = nw.getActiveNetworkInfo(); @@ -329,7 +328,5 @@ class CIMConnectorManager extends SimpleChannelInboundHandler { return false; } - - - -} \ No newline at end of file + +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java index d95d0de..596b8f2 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventBroadcastReceiver.java @@ -1,14 +1,30 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; + import com.farsunset.cim.sdk.android.constant.CIMConstant; -import com.farsunset.cim.sdk.android.exception.CIMSessionDisableException; +import com.farsunset.cim.sdk.android.exception.SessionDisconnectedException; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; import com.farsunset.cim.sdk.android.model.SentBody; @@ -18,28 +34,24 @@ import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; -import android.os.Handler; /** * 消息入口,所有消息都会经过这里 */ -public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver implements CIMEventListener { +public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver{ - public Context context; + protected Context context; @Override - public void onReceive(Context ctx, Intent it) { + public void onReceive(Context ctx, Intent intent) { context = ctx; - - /* * 操作事件广播,用于提高service存活率 */ - if(it.getAction().equals(Intent.ACTION_USER_PRESENT) - ||it.getAction().equals(Intent.ACTION_POWER_CONNECTED) - ||it.getAction().equals(Intent.ACTION_POWER_DISCONNECTED) - ) + if(intent.getAction().equals(Intent.ACTION_USER_PRESENT) + ||intent.getAction().equals(Intent.ACTION_POWER_CONNECTED) + ||intent.getAction().equals(Intent.ACTION_POWER_DISCONNECTED)) { startPushService(); } @@ -48,17 +60,16 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl /* * 设备网络状态变化事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_NETWORK_CHANGED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_NETWORK_CHANGED)) { ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); - android.net.NetworkInfo info = connectivityManager.getActiveNetworkInfo(); - onDevicesNetworkChanged(info); + onDevicesNetworkChanged(connectivityManager.getActiveNetworkInfo()); } /* * cim断开服务器事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_CLOSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_CLOSED)) { onInnerConnectionClosed(); } @@ -66,15 +77,16 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl /* * cim连接服务器失败事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_FAILED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED)) { - onInnerConnectionFailed((Exception) it.getSerializableExtra("exception")); + long interval = intent.getLongExtra("interval", CIMConstant.RECONN_INTERVAL_TIME); + onConnectionFailed((Exception) intent.getSerializableExtra(Exception.class.getName()),interval); } /* * cim连接服务器成功事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_SUCCESSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_SUCCESSED)) { onInnerConnectionSuccessed(); } @@ -82,94 +94,84 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl /* * 收到推送消息事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_MESSAGE_RECEIVED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_MESSAGE_RECEIVED)) { - onInnerMessageReceived((Message)it.getSerializableExtra("message")); + onInnerMessageReceived((Message)intent.getSerializableExtra(Message.class.getName()),intent); } /* * 获取收到replybody成功事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_REPLY_RECEIVED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_REPLY_RECEIVED)) { - onReplyReceived((ReplyBody)it.getSerializableExtra("replyBody")); + onReplyReceived((ReplyBody)intent.getSerializableExtra(ReplyBody.class.getName())); } /* * 获取sendbody发送失败事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_SENT_FAILED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_SENT_FAILED)) { - onSentFailed((Exception) it.getSerializableExtra("exception"),(SentBody)it.getSerializableExtra("sentBody")); + Exception exception = (Exception) intent.getSerializableExtra(Exception.class.getName()); + SentBody sentBody = (SentBody)intent.getSerializableExtra(SentBody.class.getName()); + onSentFailed(exception,sentBody); } /* * 获取sendbody发送成功事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_SENT_SUCCESSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_SENT_SUCCESSED)) { - onSentSucceed((SentBody)it.getSerializableExtra("sentBody")); + onSentSucceed((SentBody)intent.getSerializableExtra(SentBody.class.getName())); } /* * 获取cim数据传输异常事件 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_UNCAUGHT_EXCEPTION)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_UNCAUGHT_EXCEPTION)) { - onUncaughtException((Exception)it.getSerializableExtra("exception")); + onUncaughtException((Exception)intent.getSerializableExtra(Exception.class.getName())); } /* * 重新连接,如果断开的话 */ - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_RECOVERY)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_RECOVERY)) { - CIMPushManager.connect(context); + CIMPushManager.connect(context,0); } } - private void startPushService() - { + private void startPushService(){ Intent intent = new Intent(context, CIMPushService.class); intent.setAction(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE); context.startService(intent); } + private void onInnerConnectionClosed(){ CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_CONNECTION_STATE, false); - if(CIMConnectorManager.netWorkAvailable(context)) + if(CIMConnectorManager.isNetworkConnected(context)) { - CIMPushManager.connect(context); + CIMPushManager.connect(context,0); } onConnectionClosed(); } - - Handler connectionHandler = new Handler(){ - @Override - public void handleMessage(android.os.Message message){ - CIMPushManager.connect(context); - } - }; - private void onInnerConnectionFailed(Exception e){ + private void onConnectionFailed(Exception e,long reinterval){ - if(CIMConnectorManager.netWorkAvailable(context)) + if(CIMConnectorManager.isNetworkConnected(context)) { - connectionHandler.sendEmptyMessageDelayed(0, CIMConstant.RECONN_INTERVAL_TIME); + onConnectionFailed(); + + CIMPushManager.connect(context,reinterval); } - - onConnectionFailed(e); } - - - - - private void onInnerConnectionSuccessed(){ CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_CONNECTION_STATE, true); @@ -179,34 +181,36 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl private void onUncaughtException(Throwable arg0) {} - - private void onDevicesNetworkChanged(NetworkInfo info) { if(info !=null) { - CIMPushManager.connect(context); + CIMPushManager.connect(context,0); } onNetworkChanged(info); } - private void onInnerMessageReceived(com.farsunset.cim.sdk.android.model.Message message) - { - if(CIMConstant.MessageType.TYPE_999.equals(message.getType())) + private void onInnerMessageReceived(com.farsunset.cim.sdk.android.model.Message message, Intent intent){ + if(isForceOfflineMessage(message.getAction())) { - CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_MANUAL_STOP,true); + CIMPushManager.stop(context); } - onMessageReceived(message); + onMessageReceived(message,intent); } - private void onSentFailed(Exception e, SentBody body){ + private boolean isForceOfflineMessage(String action) + { + return CIMConstant.MessageAction.ACTION_999.equals(action) || CIMConstant.MessageAction.ACTION_444.equals(action); + } + + private void onSentFailed(Exception e, SentBody body){ //与服务端端开链接,重新连接 - if(e instanceof CIMSessionDisableException) + if(e instanceof SessionDisconnectedException) { - CIMPushManager.connect(context); + CIMPushManager.connect(context,0); }else { //发送失败 重新发送 @@ -215,13 +219,32 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver impl } - private void onSentSucceed(SentBody body){} - @Override - public abstract void onMessageReceived(Message message); - @Override - public abstract void onReplyReceived(ReplyBody body); - public abstract void onNetworkChanged(NetworkInfo info); - public abstract void onConnectionFailed(Exception e); + + + public abstract void onMessageReceived(com.farsunset.cim.sdk.android.model.Message message,Intent intent); + + public void onNetworkChanged(NetworkInfo info) { + CIMListenerManager.notifyOnNetworkChanged(info); + } + + public void onConnectionSuccessed(boolean hasAutoBind) { + CIMListenerManager.notifyOnConnectionSuccessed(hasAutoBind); + } + + public void onConnectionClosed() { + CIMListenerManager.notifyOnConnectionClosed(); + } + + public void onConnectionFailed() { + CIMListenerManager.notifyOnConnectionFailed(); + } + + public void onReplyReceived(ReplyBody body) { + CIMListenerManager.notifyOnReplyReceived(body); + } + public void onSentSucceed(SentBody body){ + CIMListenerManager.notifyOnSentSucceed(body); + } } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventListener.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventListener.java index 18928e3..1bc8191 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventListener.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMEventListener.java @@ -1,15 +1,31 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import android.net.NetworkInfo; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.cim.sdk.android.model.SentBody; /** *CIM 主要事件接口 @@ -22,36 +38,49 @@ public interface CIMEventListener * 当收到服务端推送过来的消息时调用 * @param message */ - public abstract void onMessageReceived(Message message); + void onMessageReceived(Message message); /** * 当调用CIMPushManager.sendRequest()向服务端发送请求,获得相应时调用 * @param replybody */ - public abstract void onReplyReceived(ReplyBody replybody); + void onReplyReceived(ReplyBody replybody); + /** + * 当调用CIMPushManager.sendRequest()向服务端发送请求成功时 + * @param body + */ + void onSentSuccessed(SentBody body); + + /** * 当手机网络发生变化时调用 * @param networkinfo */ - public abstract void onNetworkChanged(NetworkInfo networkinfo); + void onNetworkChanged(NetworkInfo networkinfo); /** * 当连接服务器成功时回调 * @param hasAutoBind : true 已经自动绑定账号到服务器了,不需要再手动调用bindAccount */ - public abstract void onConnectionSuccessed(boolean hasAutoBind); + void onConnectionSuccessed(boolean hasAutoBind); /** * 当断开服务器连接的时候回调 - */ - public abstract void onConnectionClosed(); - - /** - * 当服务器连接失败的时候回调 * */ - public abstract void onConnectionFailed(Exception e); + void onConnectionClosed(); + + /** + * 当连接服务器失败的时候回调 + * + */ + void onConnectionFailed(); + + /** + * 监听器在容器里面的排序。值越大则越先接收 + */ + int getEventDispatchOrder(); } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMListenerManager.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMListenerManager.java index 1c9c845..0008d0d 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMListenerManager.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMListenerManager.java @@ -1,22 +1,33 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import com.farsunset.cim.sdk.android.constant.CIMConstant; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.cim.sdk.android.model.SentBody; -import android.app.Activity; -import android.content.Context; -import android.content.pm.ActivityInfo; -import android.content.pm.PackageManager; import android.net.NetworkInfo; import android.util.Log; @@ -27,15 +38,13 @@ import android.util.Log; public class CIMListenerManager { private static ArrayList cimListeners = new ArrayList(); + private static CIMMessageReceiveComparator comparator = new CIMMessageReceiveComparator(); - - - public static void registerMessageListener(CIMEventListener listener,Context mcontext) { + public static void registerMessageListener(CIMEventListener listener) { if (!cimListeners.contains(listener)) { cimListeners.add(listener); - // 按照接收顺序倒序 - Collections.sort(cimListeners, new CIMMessageReceiveComparator(mcontext)); + Collections.sort(cimListeners,comparator); } } @@ -73,6 +82,12 @@ public class CIMListenerManager { } } + public static void notifyOnConnectionFailed() { + for (CIMEventListener listener : cimListeners) { + listener.onConnectionFailed(); + } + } + public static void notifyOnReplyReceived(ReplyBody body) { for (CIMEventListener listener : cimListeners) { @@ -80,11 +95,12 @@ public class CIMListenerManager { } } - public static void notifyOnConnectionFailed(Exception e) { + public static void notifyOnSentSucceed(SentBody body) { for (CIMEventListener listener : cimListeners) { - listener.onConnectionFailed(e); + listener.onSentSuccessed(body); } } + public static void destory() { cimListeners.clear(); @@ -99,47 +115,17 @@ public class CIMListenerManager { /** * 消息接收activity的接收顺序排序,CIM_RECEIVE_ORDER倒序 */ - static class CIMMessageReceiveComparator implements Comparator{ + private static class CIMMessageReceiveComparator implements Comparator{ - Context mcontext; - public CIMMessageReceiveComparator(Context ctx) - { - mcontext = ctx; - } - @Override public int compare(CIMEventListener arg1, CIMEventListener arg2) { - Integer order1 = CIMConstant.CIM_DEFAULT_MESSAGE_ORDER; - Integer order2 = CIMConstant.CIM_DEFAULT_MESSAGE_ORDER; - ActivityInfo info; - if (arg1 instanceof Activity ) { - - try { - info = mcontext.getPackageManager() .getActivityInfo(((Activity)(arg1)).getComponentName(), PackageManager.GET_META_DATA); - if(info.metaData!=null) - { - order1 = info.metaData.getInt("CIM_RECEIVE_ORDER"); - } - - } catch (Exception e) {} - } - - if (arg1 instanceof Activity ) { - try { - info = mcontext.getPackageManager() .getActivityInfo(((Activity)(arg2)).getComponentName(), PackageManager.GET_META_DATA); - if(info.metaData!=null) - { - order2 = info.metaData.getInt("CIM_RECEIVE_ORDER"); - } - - } catch (Exception e) {} - } - - return order2.compareTo(order1); + int order1 = arg1.getEventDispatchOrder(); + int order2 = arg2.getEventDispatchOrder(); + return order2 - order1 ; } - } -} \ No newline at end of file + +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushManager.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushManager.java index c98c48f..6d27800 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushManager.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushManager.java @@ -1,9 +1,24 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import java.util.UUID; @@ -33,27 +48,20 @@ public class CIMPushManager { static String KEY_SEND_BODY ="KEY_SEND_BODY"; - static String KEY_CIM_CONNECTION_STATUS ="KEY_CIM_CONNECTION_STATUS"; - //被销毁的destroy() - public static final int STATE_DESTROYED = 0x0000DE; - //被销停止的 stop() - public static final int STATE_STOPED = 0x0000EE; - - public static final int STATE_NORMAL = 0x000000; /** * 初始化,连接服务端,在程序启动页或者 在Application里调用 * @param context * @param ip * @param port */ - public static void connect(Context context,String host,int port){ + public static void connect(Context context,String host,int port){ - connect(context,host,port,false); + connect(context,host,port,false,0); - } + } -private static void connect(Context context,String ip,int port,boolean autoBind){ + private static void connect(Context context,String ip,int port,boolean autoBind,long delayedTime){ CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED, false); CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_MANUAL_STOP, false); @@ -69,12 +77,13 @@ private static void connect(Context context,String ip,int port,boolean autoBind Intent serviceIntent = new Intent(context, CIMPushService.class); serviceIntent.putExtra(CIMCacheToolkit.KEY_CIM_SERVIER_HOST, ip); serviceIntent.putExtra(CIMCacheToolkit.KEY_CIM_SERVIER_PORT, port); + serviceIntent.putExtra(CIMPushService.KEY_DELAYED_TIME, delayedTime); serviceIntent.setAction(ACTION_CREATE_CIM_CONNECTION); context.startService(serviceIntent); - } + } - protected static void connect(Context context){ + protected static void connect(Context context,long delayedTime){ boolean isManualStop = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_MANUAL_STOP); boolean isManualDestory = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED); @@ -87,9 +96,9 @@ private static void connect(Context context,String ip,int port,boolean autoBind String host = CIMCacheToolkit.getInstance(context).getString( CIMCacheToolkit.KEY_CIM_SERVIER_HOST); int port =CIMCacheToolkit.getInstance(context).getInt( CIMCacheToolkit.KEY_CIM_SERVIER_PORT); - connect(context,host,port,true); + connect(context,host,port,true,delayedTime); - } + } /** @@ -104,6 +113,7 @@ private static void connect(Context context,String ip,int port,boolean autoBind { return ; } + sendBindRequest(context,account); } @@ -132,8 +142,7 @@ private static void connect(Context context,String ip,int port,boolean autoBind String account = CIMCacheToolkit.getInstance(context).getString(CIMCacheToolkit.KEY_ACCOUNT); boolean isManualDestory = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED); - boolean isManualStoped = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_MANUAL_STOP); - if( isManualStoped || account==null || account.trim().length()==0 || isManualDestory ) + if( account==null || account.trim().length()==0 || isManualDestory ) { return false; } @@ -195,7 +204,7 @@ private static void connect(Context context,String ip,int port,boolean autoBind CIMCacheToolkit.getInstance(context).putBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED, true); - CIMCacheToolkit.getInstance(context).remove(CIMCacheToolkit.KEY_ACCOUNT); + CIMCacheToolkit.getInstance(context).putString(CIMCacheToolkit.KEY_ACCOUNT, null); Intent serviceIntent = new Intent(context, CIMPushService.class); serviceIntent.setAction(ACTION_DESTORY); @@ -205,9 +214,8 @@ private static void connect(Context context,String ip,int port,boolean autoBind /** - * 重新恢复接收推送,重新连接服务端,并登录当前账号如果aotuBind == true + * 重新恢复接收推送,重新连接服务端,并登录当前账号 * @param context - * @param aotuBind */ public static void resume(Context context){ @@ -223,19 +231,7 @@ private static void connect(Context context,String ip,int port,boolean autoBind return CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_CIM_CONNECTION_STATE); } - public static int getState(Context context){ - boolean isManualDestory = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_CIM_DESTROYED); - if(isManualDestory){ - return STATE_DESTROYED; - } - - boolean isManualStop = CIMCacheToolkit.getInstance(context).getBoolean(CIMCacheToolkit.KEY_MANUAL_STOP); - if(isManualStop){ - return STATE_STOPED; - } - - return STATE_NORMAL; - } + private static String getVersionName(Context context) { String versionName = null; @@ -246,5 +242,5 @@ private static void connect(Context context,String ip,int port,boolean autoBind } return versionName; } - -} \ No newline at end of file + +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java index 21ad487..9ae1cc7 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/CIMPushService.java @@ -1,54 +1,88 @@ - /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android; import android.app.Service; -import android.content.Context; import android.content.Intent; +import android.os.Handler; import android.os.IBinder; -import android.os.PowerManager; -import android.os.PowerManager.WakeLock; +import android.os.Message; import android.util.Log; - import com.farsunset.cim.sdk.android.model.SentBody; /** * 与服务端连接服务 + * @author 3979434 * */ public class CIMPushService extends Service { - final static String TAG = CIMPushService.class.getSimpleName(); - protected final static int DEF_CIM_PORT = 28888; - CIMConnectorManager manager; - WakeLock wakeLock; + private final String TAG = CIMPushService.class.getSimpleName(); + public final static String KEY_DELAYED_TIME ="KEY_DELAYED_TIME"; + private CIMConnectorManager manager; @Override public void onCreate() { manager = CIMConnectorManager.getManager(this.getApplicationContext()); - PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); - wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, CIMPushService.class.getName()); } + + Handler connectionHandler = new Handler(){ + @Override + public void handleMessage(android.os.Message message){ + + connectionHandler.removeMessages(0); + + String host = message.getData().getString(CIMCacheToolkit.KEY_CIM_SERVIER_HOST); + int port = message.getData().getInt(CIMCacheToolkit.KEY_CIM_SERVIER_PORT,0); + manager.connect(host, port); + } + }; + @Override public int onStartCommand(Intent intent,int flags, int startId) { - if(intent==null) - { - return START_STICKY; - } + + intent = (intent == null ? new Intent(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE) : intent); String action = intent.getAction(); if(CIMPushManager.ACTION_CREATE_CIM_CONNECTION.equals(action)) { - String host = CIMCacheToolkit.getInstance(this).getString(CIMCacheToolkit.KEY_CIM_SERVIER_HOST); - int port =CIMCacheToolkit.getInstance(this).getInt(CIMCacheToolkit.KEY_CIM_SERVIER_PORT); - manager.connect(host,port); + + long delayMillis = intent.getLongExtra(KEY_DELAYED_TIME,0); + if( delayMillis > 0){ + + Message msg = connectionHandler.obtainMessage(); + msg.what = 0; + msg.setData(intent.getExtras()); + connectionHandler.sendMessageDelayed(msg, delayMillis); + + }else + { + String host = intent.getStringExtra(CIMCacheToolkit.KEY_CIM_SERVIER_HOST); + int port = intent.getIntExtra(CIMCacheToolkit.KEY_CIM_SERVIER_PORT,0); + manager.connect(host,port); + } } if(CIMPushManager.ACTION_SEND_REQUEST_BODY.equals(action)) @@ -65,7 +99,6 @@ import com.farsunset.cim.sdk.android.model.SentBody; { manager.destroy(); this.stopSelf(); - android.os.Process.killProcess(android.os.Process.myPid()); } if(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE.equals(action) ) @@ -73,42 +106,23 @@ import com.farsunset.cim.sdk.android.model.SentBody; if(!manager.isConnected()){ boolean isManualStop = CIMCacheToolkit.getInstance(this).getBoolean(CIMCacheToolkit.KEY_MANUAL_STOP); - Log.d(TAG, "CIM.isConnected() == false, isManualStop == " + isManualStop); - CIMPushManager.connect(this); - + Log.w(TAG, "manager.isConnected() == false, isManualStop == " + isManualStop); + CIMPushManager.connect(this,0); + }else { - Log.d(TAG, "CIM.isConnected() == true"); + Log.i(TAG, "manager.isConnected() == true"); } } - - try{ - if(!wakeLock.isHeld()) - { - this.wakeLock.acquire(); - } - }catch(Exception e){} - + return START_STICKY; } - - - public void onDestroy() - { - super.onDestroy(); - if(wakeLock.isHeld()) - { - this.wakeLock.release(); - wakeLock = null; - } - } - @Override public IBinder onBind(Intent arg0) { return null; } - + } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java index d666bb2..bfd66c2 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/constant/CIMConstant.java @@ -1,9 +1,24 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.constant; /** @@ -11,58 +26,89 @@ package com.farsunset.cim.sdk.android.constant; */ public interface CIMConstant { - - public static String UTF8="UTF-8"; - - public static byte MESSAGE_SEPARATE='\b'; - - public static long RECONN_INTERVAL_TIME= 30 * 1000; - - public static int CIM_DEFAULT_MESSAGE_ORDER=1; - - public static class ReturnCode{ + long RECONN_INTERVAL_TIME= 30 * 1000; + //消息头长度为3个字节,第一个字节为消息类型,第二,第三字节 转换int后为消息长度 + int DATA_HEADER_LENGTH = 3; + public static interface ReturnCode{ - public static String CODE_404 ="404"; + String CODE_404 ="404"; - public static String CODE_403 ="403"; + String CODE_403 ="403"; - public static String CODE_405 ="405"; + String CODE_405 ="405"; - public static String CODE_200 ="200"; + String CODE_200 ="200"; - public static String CODE_206 ="206"; + String CODE_206 ="206"; - public static String CODE_500 ="500"; + String CODE_500 ="500"; } - - /** - * 服务端心跳请求命令 cmd_server_hb_request - */ - public static final String CMD_HEARTBEAT_REQUEST="S_H_RQ"; - /** - * 客户端心跳响应命令 cmd_client_hb_response - */ - public static final String CMD_HEARTBEAT_RESPONSE ="C_H_RS"; - - public static class RequestKey{ + + + public static interface ProtobufType{ + byte C_H_RS = 0; + byte S_H_RQ = 1; + byte MESSAGE = 2; + byte SENTBODY = 3; + byte REPLYBODY = 4; + } + + public static interface RequestKey{ - public static String CLIENT_BIND ="client_bind"; + String CLIENT_BIND ="client_bind"; + String CLIENT_LOGOUT ="client_logout"; - public static String CLIENT_OFFLINE_MESSAGE ="client_get_offline_message"; + @Deprecated + String CLIENT_PULL_MESSAGE ="client_pull_message"; } - public static class MessageType{ + public static interface MessageAction{ - //用户会 踢出下线消息类型 - public static String TYPE_999 ="999"; - - } + //被其他设备登录挤下线消息 + String ACTION_999 ="999"; + //被系统禁用消息 + String ACTION_444 ="444"; + } -} \ No newline at end of file + + public static interface IntentAction{ + + // 消息广播action + String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; + + // 发送sendbody失败广播 + String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; + + // 发送sendbody成功广播 + String ACTION_SENT_SUCCESSED = "com.farsunset.cim.SENT_SUCCESSED"; + + // 链接意外关闭广播 + String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; + + // 链接失败广播 + String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; + + // 链接成功广播 + String ACTION_CONNECTION_SUCCESSED = "com.farsunset.cim.CONNECTION_SUCCESSED"; + + // 发送sendbody成功后获得replaybody回应广播 + String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; + + // 网络变化广播 + String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; + + // 未知异常 + String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; + + //重试连接 + String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; + } + +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/CIMSessionDisableException.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/CIMSessionDisableException.java deleted file mode 100644 index eb3a005..0000000 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/CIMSessionDisableException.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.android.exception; - - -public class CIMSessionDisableException extends Exception { - - private static final long serialVersionUID = 1L; - - public CIMSessionDisableException() { - super(); - } - - public CIMSessionDisableException(String s) { - super(s); - } -} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetWorkDisableException.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetWorkDisableException.java deleted file mode 100644 index d549e9f..0000000 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetWorkDisableException.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.android.exception; - - -public class NetWorkDisableException extends Exception { - - private static final long serialVersionUID = 1L; - - public NetWorkDisableException() { - super(); - } - - public NetWorkDisableException(String s) { - super(s); - } -} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetworkDisconnectedException.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetworkDisconnectedException.java new file mode 100644 index 0000000..151d878 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/NetworkDisconnectedException.java @@ -0,0 +1,36 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.exception; + + +public class NetworkDisconnectedException extends Exception { + + private static final long serialVersionUID = 1L; + + public NetworkDisconnectedException() { + super(); + } + + public NetworkDisconnectedException(String s) { + super(s); + } +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/SessionDisconnectedException.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/SessionDisconnectedException.java new file mode 100644 index 0000000..149098d --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/SessionDisconnectedException.java @@ -0,0 +1,36 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.exception; + + +public class SessionDisconnectedException extends Exception { + + private static final long serialVersionUID = 1L; + + public SessionDisconnectedException() { + super(); + } + + public SessionDisconnectedException(String s) { + super(s); + } +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/WriteToClosedSessionException.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/WriteToClosedSessionException.java deleted file mode 100644 index 5c925a6..0000000 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/exception/WriteToClosedSessionException.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.android.exception; - -import java.io.Serializable; - - -public class WriteToClosedSessionException extends Exception implements Serializable { - - private static final long serialVersionUID = 1L; - - public WriteToClosedSessionException() { - super(); - } - - public WriteToClosedSessionException(String s) { - super(s); - } -} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java index e42b7e2..d15108c 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageDecoder.java @@ -1,164 +1,138 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.filter; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufUtil; -import io.netty.buffer.PooledByteBufAllocator; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.serialization.ClassResolver; -import io.netty.handler.codec.serialization.ObjectDecoder; - -import java.io.ByteArrayInputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; +import java.util.List; import com.farsunset.cim.sdk.android.constant.CIMConstant; +import com.farsunset.cim.sdk.android.model.HeartbeatRequest; import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.cim.sdk.android.model.proto.MessageProto; +import com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto; +import com.google.protobuf.InvalidProtocolBufferException; import android.util.Log; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; + /** - * 客户端消息解码 + * 客户端消息解码 */ -public class ClientMessageDecoder extends ObjectDecoder { - - - public ClientMessageDecoder(ClassResolver classResolver) { - super(classResolver); - } - +public class ClientMessageDecoder extends ByteToMessageDecoder { + final static String TAG = ClientMessageDecoder.class.getSimpleName(); @Override - public Object decode(ChannelHandlerContext arg0, ByteBuf buffer) throws Exception { - - final ByteBuf tBuffer = PooledByteBufAllocator.DEFAULT.buffer(640); - - buffer.markReaderIndex(); - boolean complete = false; - - while(buffer.isReadable()){ - byte b = buffer.readByte(); - if (b == CIMConstant.MESSAGE_SEPARATE) { - complete = true; - break; - } else { - tBuffer.writeByte(b); - } - } - + protected void decode(ChannelHandlerContext arg0, ByteBuf buffer, List queue) throws Exception { - if(complete){ - - String message = new String(new String(ByteBufUtil.getBytes(tBuffer),CIMConstant.UTF8)); - Log.i("ClientMessageDecoder", message); - Object msg = mappingMessageObject(message); - return msg; - - }else{ - - buffer.resetReaderIndex(); - return null; - + /** + * 消息头3位 + */ + if (buffer.readableBytes() < CIMConstant.DATA_HEADER_LENGTH) { + return; } + + buffer.markReaderIndex(); + + buffer.markReaderIndex(); + + byte conetnType = buffer.readByte(); + + byte lv = buffer.readByte();// int 低位 + byte hv = buffer.readByte();// int 高位 + + int conetnLength = getContentLength(lv, hv); + + // 如果消息体没有接收完整,则重置读取,等待下一次重新读取 + if (conetnLength > buffer.readableBytes()) { + buffer.resetReaderIndex(); + return; + } + + byte[] dataBytes = new byte[conetnLength]; + buffer.readBytes(dataBytes); + + Object message = mappingMessageObject(dataBytes, conetnType); + + if(message!=null){ + queue.add(message); + } + } - private Object mappingMessageObject(String message) throws Exception { - - if(message.equals(CIMConstant.CMD_HEARTBEAT_REQUEST))//如果是心跳请求命令则直接返回 - { - return CIMConstant.CMD_HEARTBEAT_REQUEST; - } - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = (Document) builder.parse(new ByteArrayInputStream(message.getBytes(CIMConstant.UTF8))); - - String name = doc.getDocumentElement().getTagName(); - if (name.equals("reply")) { - ReplyBody reply = new ReplyBody(); - reply.setKey(doc.getElementsByTagName("key").item(0).getTextContent()); - reply.setCode(doc.getElementsByTagName("code").item(0).getTextContent()); - NodeList items = doc.getElementsByTagName("data").item(0).getChildNodes(); - for (int i = 0; i < items.getLength(); i++) { - Node node = items.item(i); - reply.getData().put(node.getNodeName(), node.getTextContent()); - } - return reply; - } - if (name.equals("message")) { + private Object mappingMessageObject(byte[] bytes, byte type) throws InvalidProtocolBufferException { - Message body = new Message(); - NodeList nodeList = doc.getElementsByTagName("message").item(0).getChildNodes(); - int count = nodeList.getLength(); - for(int i = 0;i < count; i++){ - Node node = nodeList.item(i); - - if(node.getNodeName().equals("mid")) - { - body.setMid(node.getTextContent()); - } - - if(node.getNodeName().equals("type")) - { - body.setType(node.getTextContent()); - } - - if(node.getNodeName().equals("content")) - { - body.setContent(node.getTextContent()); - } - - if(node.getNodeName().equals("file")) - { - body.setFile(node.getTextContent()); - } - - if(node.getNodeName().equals("fileType")) - { - body.setFileType(node.getTextContent()); - } - - if(node.getNodeName().equals("title")) - { - body.setTitle(node.getTextContent()); - } - - if(node.getNodeName().equals("sender")) - { - body.setSender(node.getTextContent()); - } - - if(node.getNodeName().equals("receiver")) - { - body.setReceiver(node.getTextContent()); - } - - if(node.getNodeName().equals("format")) - { - body.setFormat(node.getTextContent()); - } - - if(node.getNodeName().equals("timestamp")) - { - body.setTimestamp(Long.valueOf(node.getTextContent())); - } - } + if (CIMConstant.ProtobufType.S_H_RQ == type) { + HeartbeatRequest request = HeartbeatRequest.getInstance(); + Log.i(TAG, request.toString()); + return request; + } + + if (CIMConstant.ProtobufType.REPLYBODY == type) { + ReplyBodyProto.Model bodyProto = ReplyBodyProto.Model.parseFrom(bytes); + ReplyBody body = new ReplyBody(); + body.setKey(bodyProto.getKey()); + body.setTimestamp(bodyProto.getTimestamp()); + body.putAll(bodyProto.getDataMap()); + body.setCode(bodyProto.getCode()); + body.setMessage(bodyProto.getMessage()); + + Log.i(TAG, body.toString()); return body; } - - return null; + + if (CIMConstant.ProtobufType.MESSAGE == type) { + MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bytes); + Message message = new Message(); + message.setMid(bodyProto.getMid()); + message.setAction(bodyProto.getAction()); + message.setContent(bodyProto.getContent()); + message.setSender(bodyProto.getSender()); + message.setReceiver(bodyProto.getReceiver()); + message.setTitle(bodyProto.getTitle()); + message.setExtra(bodyProto.getExtra()); + message.setTimestamp(bodyProto.getTimestamp()); + message.setFormat(bodyProto.getFormat()); + + Log.i(TAG, message.toString()); + return message; + } + + return null; + } - + /** + * 解析消息体长度 + * + * @param type + * @param length + * @return + */ + private int getContentLength(byte lv, byte hv) { + int l = (lv & 0xff); + int h = (hv & 0xff); + return (l | (h <<= 8)); + } - } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageEncoder.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageEncoder.java index 820f174..383875b 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageEncoder.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/filter/ClientMessageEncoder.java @@ -1,13 +1,29 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.filter; import com.farsunset.cim.sdk.android.constant.CIMConstant; +import com.farsunset.cim.sdk.android.model.Protobufable; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; @@ -24,11 +40,36 @@ public class ClientMessageEncoder extends MessageToByteEncoder { @Override protected void encode(ChannelHandlerContext ctx, Object message, ByteBuf out) throws Exception { - out.writeBytes(message.toString().getBytes(CIMConstant.UTF8)); - out.writeByte(CIMConstant.MESSAGE_SEPARATE); + + + if(message instanceof Protobufable){ + + Protobufable data = (Protobufable) message; + byte[] byteArray = data.getByteArray(); + + + out.writeBytes(createHeader(data.getType(),byteArray.length)); + out.writeBytes(byteArray); + + } + Log.i(ClientMessageEncoder.class.getSimpleName(), message.toString()); } + /** + * 消息体最大为65535 + * @param type + * @param length + * @return + */ + private byte[] createHeader(byte type,int length){ + byte[] header = new byte[CIMConstant.DATA_HEADER_LENGTH]; + header[0] = type; + header[1] = (byte) (length & 0xff); + header[2] = (byte) ((length >> 8) & 0xff); + return header; + } + diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatRequest.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatRequest.java new file mode 100644 index 0000000..ece6cfa --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.android.constant.CIMConstant; +/** + * 服务端心跳请求 + * + */ +public class HeartbeatRequest implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "SERVER_HEARTBEAT_REQUEST"; + private static final String CMD_HEARTBEAT_RESPONSE = "SR"; + + private static HeartbeatRequest object = new HeartbeatRequest(); + + private HeartbeatRequest(){ + + } + + public static HeartbeatRequest getInstance() { + return object; + } + + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + + @Override + public byte getType() { + return CIMConstant.ProtobufType.S_H_RQ; + } + +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatResponse.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatResponse.java new file mode 100644 index 0000000..5250fb0 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/HeartbeatResponse.java @@ -0,0 +1,59 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.android.constant.CIMConstant; +/** + * 客户端心跳响应 + */ +public class HeartbeatResponse implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "CLIENT_HEARTBEAT_RESPONSE"; + private static final String CMD_HEARTBEAT_RESPONSE = "CR"; + + private static HeartbeatResponse object = new HeartbeatResponse(); + + private HeartbeatResponse(){ + + } + + public static HeartbeatResponse getInstance() { + return object; + } + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.C_H_RS; + } + +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java index e59786b..d8e46a7 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Message.java @@ -1,12 +1,28 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.model; import java.io.Serializable; + /** * 消息对象 */ @@ -24,13 +40,13 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String type; + private String action; /** * 消息标题 */ private String title; /** - * 消息类容,于type 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 + * 消息类容,于action 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 */ private String content; @@ -43,21 +59,18 @@ public class Message implements Serializable { */ private String receiver; - /** - * 文件 url - */ - private String file; - /** - * 文件类型 - */ - private String fileType; - + + /** * content 内容格式 */ - private String format = "txt"; + private String format; + + /** + * 附加内容 内容 + */ + private String extra; - private long timestamp; @@ -73,14 +86,14 @@ public class Message implements Serializable { this.timestamp = timestamp; } - public String getType() { - return type; - } + - public void setType(String type) { - this.type = type; + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; } - public String getTitle() { return title; } @@ -113,22 +126,7 @@ public class Message implements Serializable { this.receiver = receiver; } - public String getFile() { - return file; - } - - public void setFile(String file) { - this.file = file; - } - - public String getFileType() { - return fileType; - } - - public void setFileType(String fileType) { - this.fileType = fileType; - } - + public String getFormat() { return format; } @@ -137,56 +135,30 @@ public class Message implements Serializable { this.format = format; } + + + public String getExtra() { + return extra; + } + public void setExtra(String extra) { + this.extra = extra; + } public String toString() { - + StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(mid).append(""); - - if (isNotEmpty(type)) { - buffer.append("").append(type).append(""); - } - - if (isNotEmpty(title)) { - buffer.append("").append(title).append(""); - } - if (isNotEmpty(content)) { - buffer.append(""); - } - - if (isNotEmpty(file)) { - buffer.append("").append(file).append(""); - } - - if (isNotEmpty(fileType)) { - buffer.append("").append(fileType).append(""); - } - - if (isNotEmpty(sender)) { - buffer.append("").append(sender).append(""); - } - - if (isNotEmpty(receiver)) { - buffer.append("").append(receiver).append(""); - } - - if (isNotEmpty(format)) { - buffer.append("").append(format).append(""); - } - - if (timestamp > 0) { - buffer.append("").append(timestamp).append(""); - } - - buffer.append(""); + buffer.append("#Message#").append("\n"); + buffer.append("mid:").append(mid).append("\n"); + buffer.append("action:").append(action).append("\n"); + buffer.append("title:").append(title).append("\n"); + buffer.append("content:").append(content).append("\n"); + buffer.append("extra:").append(extra).append("\n"); + buffer.append("sender:").append(sender).append("\n"); + buffer.append("receiver:").append(receiver).append("\n"); + buffer.append("format:").append(format).append("\n"); + buffer.append("timestamp:").append(timestamp); return buffer.toString(); } - - public String toXmlString() { - - return toString(); - } + public String getMid() { return mid; @@ -197,8 +169,8 @@ public class Message implements Serializable { } public boolean isNotEmpty(String txt) { - return txt != null && !txt.isEmpty(); + return txt != null && txt.trim().length()!=0; } - + } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Protobufable.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Protobufable.java new file mode 100644 index 0000000..d504891 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/Protobufable.java @@ -0,0 +1,31 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model; +/** + * 需要向另一端发送的结构体 + */ +public interface Protobufable { + + byte[] getByteArray(); + + byte getType(); +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/ReplyBody.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/ReplyBody.java index 9fa706e..3a834ce 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/ReplyBody.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/ReplyBody.java @@ -1,13 +1,30 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * 请求应答对象 * @@ -64,7 +81,9 @@ public class ReplyBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } } public String get(String k) { @@ -83,8 +102,12 @@ public class ReplyBody implements Serializable { this.message = message; } - public HashMap getData() { - return data; + public void putAll(Map map) { + data.putAll(map); + } + + public Set getKeySet() { + return data.keySet(); } public String getCode() { @@ -98,27 +121,22 @@ public class ReplyBody implements Serializable { public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(this.getKey()).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append("").append(code).append(""); - buffer.append(""); - for(String key:this.getData().keySet()) - { - buffer.append("<"+key+">").append(this.get(key)).append(""); + buffer.append("#ReplyBody#").append("\n"); + buffer.append("key:").append(this.getKey()).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + buffer.append("code:").append(code).append("\n"); + + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); + return buffer.toString(); } - - public String toXmlString() - { - - return toString(); - } } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/SentBody.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/SentBody.java index 61951f9..d73c444 100644 --- a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/SentBody.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/SentBody.java @@ -1,30 +1,48 @@ /** - * probject:cim-android-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.android.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import com.farsunset.cim.sdk.android.constant.CIMConstant; +import com.farsunset.cim.sdk.android.model.proto.SentBodyProto; /** * java |android 客户端请求结构 * */ -public class SentBody implements Serializable { +public class SentBody implements Serializable,Protobufable { private static final long serialVersionUID = 1L; private String key; - private HashMap data; + private HashMap data = new HashMap();; private long timestamp; public SentBody() { - - data = new HashMap(); timestamp = System.currentTimeMillis(); } @@ -49,36 +67,54 @@ public class SentBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } + } + public void putAll(Map map) { + data.putAll(map); } + public Set getKeySet() { + return data.keySet(); + } + + public void remove(String k) { data.remove(k); } - public HashMap getData() { - return data; - } - @Override public String toString() { StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(key).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append(""); - for (String key : data.keySet()) { - buffer.append("<" + key + ">").append(data.get(key)).append( - ""); + buffer.append("#SentBody#").append("\n");; + buffer.append("key:").append(key).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); return buffer.toString(); } - - public String toXmlString() { - - return toString(); + + @Override + public byte[] getByteArray() { + SentBodyProto.Model.Builder builder = SentBodyProto.Model.newBuilder(); + builder.setKey(key); + builder.setTimestamp(timestamp); + if(!data.isEmpty()){ + builder.putAllData(data); + } + return builder.build().toByteArray(); } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.SENTBODY; + } + } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto new file mode 100644 index 0000000..a5cb5ee --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/Message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="MessageProto"; +message Model { + string mid = 1; + string action = 2; + string content = 3; + string sender = 4; + string receiver = 5; + string extra = 6; + string title = 7; + string format = 8; + int64 timestamp = 9; +} + \ No newline at end of file diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java new file mode 100644 index 0000000..39d9167 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/MessageProto.java @@ -0,0 +1,1603 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model.proto; + +public final class MessageProto { + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string mid = 1; + */ + java.lang.String getMid(); + /** + * string mid = 1; + */ + com.google.protobuf.ByteString + getMidBytes(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + mid_ = ""; + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + mid_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.Builder.class); + } + + public static final int MID_FIELD_NUMBER = 1; + private volatile java.lang.Object mid_; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.android.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.android.model.proto.MessageProto.Model) obj; + + boolean result = true; + result = result && getMid() + .equals(other.getMid()); + result = result && getAction() + .equals(other.getAction()); + result = result && getContent() + .equals(other.getContent()); + result = result && getSender() + .equals(other.getSender()); + result = result && getReceiver() + .equals(other.getReceiver()); + result = result && getExtra() + .equals(other.getExtra()); + result = result && getTitle() + .equals(other.getTitle()); + result = result && getFormat() + .equals(other.getFormat()); + result = result && (getTimestamp() + == other.getTimestamp()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MID_FIELD_NUMBER; + hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.android.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) + com.farsunset.cim.sdk.android.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + mid_ = ""; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.android.model.proto.MessageProto.Model(this); + result.mid_ = mid_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.android.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.android.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.android.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.android.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (!other.getMid().isEmpty()) { + mid_ = other.mid_; + onChanged(); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.android.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.android.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object mid_ = ""; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mid = 1; + */ + public Builder setMid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mid_ = value; + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder clearMid() { + + mid_ = getDefaultInstance().getMid(); + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder setMidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mid_ = value; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) + private static final com.farsunset.cim.sdk.android.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.android.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.android.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.android.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022)com.farsunset.cim.sdk.a" + + "ndroid.model.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(" + + "\t\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006se" + + "nder\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 " + + "\001(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\tti" + + "mestamp\030\t \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor, + new java.lang.String[] { "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto new file mode 100644 index 0000000..db92900 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBody.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="ReplyBodyProto"; + +message Model { + string key = 1; + string code = 2; + string message = 3; + int64 timestamp =4; + map data =5; + +} + \ No newline at end of file diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java new file mode 100644 index 0000000..d370594 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/ReplyBodyProto.java @@ -0,0 +1,1241 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model.proto; + +public final class ReplyBodyProto { + private ReplyBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string code = 2; + */ + java.lang.String getCode(); + /** + * string code = 2; + */ + com.google.protobuf.ByteString + getCodeBytes(); + + /** + * string message = 3; + */ + java.lang.String getMessage(); + /** + * string message = 3; + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + * int64 timestamp = 4; + */ + long getTimestamp(); + + /** + * map<string, string> data = 5; + */ + int getDataCount(); + /** + * map<string, string> data = 5; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 5; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + code_ = ""; + message_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + code_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 32: { + + timestamp_ = input.readInt64(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object code_; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 4; + private long timestamp_; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 5; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, code_); + } + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + if (timestamp_ != 0L) { + output.writeInt64(4, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 5); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!getCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, code_); + } + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model other = (com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && getCode() + .equals(other.getCode()); + result = result && getMessage() + .equals(other.getMessage()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + code_ = ""; + + message_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model build() { + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model result = new com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.code_ = code_; + result.message_ = message_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string code = 2; + */ + public Builder setCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value; + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder clearCode() { + + code_ = getDefaultInstance().getCode(); + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder setCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + code_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string message = 3; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 4; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 4; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 5; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) + private static final com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.android.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017ReplyBody.proto\022)com.farsunset.cim.sdk" + + ".android.model.proto\"\275\001\n\005Model\022\013\n\003key\030\001 " + + "\001(\t\022\014\n\004code\030\002 \001(\t\022\017\n\007message\030\003 \001(\t\022\021\n\tti" + + "mestamp\030\004 \001(\003\022H\n\004data\030\005 \003(\0132:.com.farsun" + + "set.cim.sdk.android.model.proto.Model.Da" + + "taEntry\032+\n\tDataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005val" + + "ue\030\002 \001(\t:\0028\001B\020B\016ReplyBodyProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Code", "Message", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBody.proto b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBody.proto new file mode 100644 index 0000000..20f0534 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBody.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="SentBodyProto"; + +message Model { + string key = 1; + int64 timestamp =2; + map data =3; + +} + \ No newline at end of file diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java new file mode 100644 index 0000000..a781e8b --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/sdk/android/model/proto/SentBodyProto.java @@ -0,0 +1,967 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.android.model.proto; + +public final class SentBodyProto { + private SentBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.android.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * int64 timestamp = 2; + */ + long getTimestamp(); + + /** + * map<string, string> data = 3; + */ + int getDataCount(); + /** + * map<string, string> data = 3; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 3; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.android.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 16: { + + timestamp_ = input.readInt64(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 3; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (timestamp_ != 0L) { + output.writeInt64(2, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 3); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model other = (com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.android.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.android.model.proto.Model) + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model build() { + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model result = new com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 2; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 2; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 3; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.android.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.android.model.proto.Model) + private static final com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.android.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016SentBody.proto\022)com.farsunset.cim.sdk." + + "android.model.proto\"\236\001\n\005Model\022\013\n\003key\030\001 \001" + + "(\t\022\021\n\ttimestamp\030\002 \001(\003\022H\n\004data\030\003 \003(\0132:.co" + + "m.farsunset.cim.sdk.android.model.proto." + + "Model.DataEntry\032+\n\tDataEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001B\017B\rSentBodyProtob\006p" + + "roto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_android_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-client-android/.gitignore b/cim_for_netty/cim-client-android/.gitignore new file mode 100644 index 0000000..39fb081 --- /dev/null +++ b/cim_for_netty/cim-client-android/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/cim_for_netty/cim-client-android/.idea/compiler.xml b/cim_for_netty/cim-client-android/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/cim_for_netty/cim-client-android/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/.idea/copyright/profiles_settings.xml b/cim_for_netty/cim-client-android/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/cim_for_netty/cim-client-android/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/.idea/encodings.xml b/cim_for_netty/cim-client-android/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/cim_for_netty/cim-client-android/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/.idea/gradle.xml b/cim_for_netty/cim-client-android/.idea/gradle.xml new file mode 100644 index 0000000..3aff3ca --- /dev/null +++ b/cim_for_netty/cim-client-android/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/.idea/misc.xml b/cim_for_netty/cim-client-android/.idea/misc.xml new file mode 100644 index 0000000..df91e58 --- /dev/null +++ b/cim_for_netty/cim-client-android/.idea/misc.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + Android + + + Android > Lint > Correctness + + + Android > Lint > Internationalization + + + Android > Lint > Security + + + CorrectnessLintAndroid + + + Gradle + + + LintAndroid + + + Probable bugsGradle + + + + + Android + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/.idea/modules.xml b/cim_for_netty/cim-client-android/.idea/modules.xml new file mode 100644 index 0000000..8b941a4 --- /dev/null +++ b/cim_for_netty/cim-client-android/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/.idea/qaplug_profiles.xml b/cim_for_netty/cim-client-android/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..e24d63d --- /dev/null +++ b/cim_for_netty/cim-client-android/.idea/qaplug_profiles.xml @@ -0,0 +1,289 @@ + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/.idea/runConfigurations.xml b/cim_for_netty/cim-client-android/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/cim_for_netty/cim-client-android/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/app/.gitignore b/cim_for_netty/cim-client-android/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/cim_for_netty/cim-client-android/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/cim_for_netty/cim-client-android/app/build.gradle b/cim_for_netty/cim-client-android/app/build.gradle new file mode 100644 index 0000000..0c33c49 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/build.gradle @@ -0,0 +1,39 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 25 + buildToolsVersion "25.0.2" + defaultConfig { + applicationId "com.farsunset.ichat.example" + minSdkVersion 14 + targetSdkVersion 21 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + + + packagingOptions { + exclude 'META-INF/INDEX.LIST' + exclude 'META-INF/io.netty.versions.properties' + } + + lintOptions { + checkReleaseBuilds false + abortOnError false + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:25.1.0' + compile 'com.google.protobuf:protobuf-java:3.2.0' + compile 'org.apache.mina:mina-core:2.0.16' + compile 'org.slf4j:slf4j-api:1.7.24' + compile 'org.slf4j:slf4j-nop:1.7.24' +} diff --git a/cim_for_netty/cim-client-android/app/libs/cim-server-sdk-3.0.jar b/cim_for_netty/cim-client-android/app/libs/cim-server-sdk-3.0.jar new file mode 100644 index 0000000..1c364be Binary files /dev/null and b/cim_for_netty/cim-client-android/app/libs/cim-server-sdk-3.0.jar differ diff --git a/cim_for_netty/cim-client-android/app/libs/netty-buffer-4.1.9.Final.jar b/cim_for_netty/cim-client-android/app/libs/netty-buffer-4.1.9.Final.jar new file mode 100644 index 0000000..31d9a48 Binary files /dev/null and b/cim_for_netty/cim-client-android/app/libs/netty-buffer-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-client-android/app/libs/netty-codec-4.1.9.Final.jar b/cim_for_netty/cim-client-android/app/libs/netty-codec-4.1.9.Final.jar new file mode 100644 index 0000000..7c1717c Binary files /dev/null and b/cim_for_netty/cim-client-android/app/libs/netty-codec-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-client-android/app/libs/netty-common-4.1.9.Final.jar b/cim_for_netty/cim-client-android/app/libs/netty-common-4.1.9.Final.jar new file mode 100644 index 0000000..e38f723 Binary files /dev/null and b/cim_for_netty/cim-client-android/app/libs/netty-common-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-client-android/app/libs/netty-handler-4.1.9.Final.jar b/cim_for_netty/cim-client-android/app/libs/netty-handler-4.1.9.Final.jar new file mode 100644 index 0000000..1498d27 Binary files /dev/null and b/cim_for_netty/cim-client-android/app/libs/netty-handler-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-client-android/app/libs/netty-resolver-4.1.9.Final.jar b/cim_for_netty/cim-client-android/app/libs/netty-resolver-4.1.9.Final.jar new file mode 100644 index 0000000..7d83091 Binary files /dev/null and b/cim_for_netty/cim-client-android/app/libs/netty-resolver-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-client-android/app/libs/netty-transport-4.1.9.Final.jar b/cim_for_netty/cim-client-android/app/libs/netty-transport-4.1.9.Final.jar new file mode 100644 index 0000000..0cc8904 Binary files /dev/null and b/cim_for_netty/cim-client-android/app/libs/netty-transport-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-client-android/app/proguard-rules.pro b/cim_for_netty/cim-client-android/app/proguard-rules.pro new file mode 100644 index 0000000..0efbf97 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in D:\Program Files (x86)\dev\android-sdk-windos/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/cim_for_netty/client-mchat-android/AndroidManifest.xml b/cim_for_netty/cim-client-android/app/src/main/AndroidManifest.xml similarity index 92% rename from cim_for_netty/client-mchat-android/AndroidManifest.xml rename to cim_for_netty/cim-client-android/app/src/main/AndroidManifest.xml index 2ed9424..913e67f 100644 --- a/cim_for_netty/client-mchat-android/AndroidManifest.xml +++ b/cim_for_netty/cim-client-android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="30" + android:versionName="3.0.0" > @@ -10,10 +10,6 @@ - - - + diff --git a/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java new file mode 100644 index 0000000..3a88250 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java @@ -0,0 +1,38 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.adapter; + +import java.util.Comparator; + +import com.farsunset.cim.sdk.android.model.Message; + +public class MessageTimeDescComparator implements Comparator{ + + @Override + public int compare(Message arg0, Message arg1) { + + return (int) (arg1.getTimestamp() - arg0.getTimestamp()) ; + } + + + +} diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java similarity index 65% rename from cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java rename to cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java index 266b324..fe43a78 100644 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.ichat.example.adapter; import java.text.SimpleDateFormat; @@ -67,7 +82,7 @@ public class SystemMsgListViewAdapter extends BaseAdapter { ((TextView) chatItemView.findViewById(R.id.time)).setText(getDateTimeString(Long.valueOf(msg.getTimestamp()))); ((TextView) chatItemView.findViewById(R.id.content)).setText(msg.getContent() ); - ((ImageView) chatItemView.findViewById(R.id.headImageView)).setImageResource(R.drawable.icon_recent_sysmsg); + ((ImageView) chatItemView.findViewById(R.id.headImageView)).setImageResource(R.drawable.icon); return chatItemView; } diff --git a/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CIMMonitorActivity.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CIMMonitorActivity.java new file mode 100644 index 0000000..4671678 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CIMMonitorActivity.java @@ -0,0 +1,118 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.app; + + +import com.farsunset.cim.sdk.android.CIMEventListener; +import com.farsunset.cim.sdk.android.CIMListenerManager; +import com.farsunset.cim.sdk.android.model.Message; +import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.cim.sdk.android.model.SentBody; + +import android.app.Activity; +import android.net.NetworkInfo; +import android.os.Bundle; + +public abstract class CIMMonitorActivity extends Activity implements CIMEventListener{ + + + CommonBaseControl commonBaseControl; + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + CIMListenerManager.registerMessageListener(this); + + commonBaseControl = new CommonBaseControl(this); + + + } + + @Override + public void finish() { + super.finish(); + CIMListenerManager.removeMessageListener(this); + + } + + @Override + public void onRestart() { + super.onRestart(); + CIMListenerManager.registerMessageListener(this); + } + + + public void showProgressDialog(String title,String content) + { + commonBaseControl.showProgressDialog(title, content); + } + + public void hideProgressDialog() + { + commonBaseControl.hideProgressDialog(); + } + + public void showToask(String hint){ + + commonBaseControl.showToask(hint); + } + + + + + @Override + public void onMessageReceived(Message arg0){}; + + @Override + public void onNetworkChanged(NetworkInfo info){} + + /** + * 与服务端断开连接时回调,不要在里面做连接服务端的操作 + */ + @Override + public void onConnectionClosed() {} + + @Override + public void onConnectionFailed() { + + } + + @Override + public int getEventDispatchOrder() { + return 0; + } + + /** + * 连接服务端成功时回调 + */ + + @Override + public void onConnectionSuccessed(boolean arg0) {} + + + @Override + public void onReplyReceived(ReplyBody arg0) {} + + @Override + public void onSentSuccessed(SentBody sentBody) { + + } +} diff --git a/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CommonBaseControl.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CommonBaseControl.java new file mode 100644 index 0000000..49bd017 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/CommonBaseControl.java @@ -0,0 +1,78 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.app; + + + +import android.app.ProgressDialog; +import android.content.Context; +import android.widget.Toast; + + +public class CommonBaseControl { + + private ProgressDialog progressDialog; + + Context mMontent; + + + public CommonBaseControl(Context content) + { + this.mMontent = content; + } + + + + public void showProgressDialog(String title,String message) + { + if(progressDialog==null) + { + + progressDialog = ProgressDialog.show(mMontent, title, message, true, true); + }else if(progressDialog.isShowing()) + { + progressDialog.setTitle(title); + progressDialog.setMessage(message); + } + + progressDialog.show(); + + } + + public void hideProgressDialog() + { + + if(progressDialog!=null&&progressDialog.isShowing()) + { + progressDialog.dismiss(); + } + + } + + public void showToask(String hint){ + + Toast toast=Toast.makeText(mMontent,hint,Toast.LENGTH_SHORT); + toast.show(); + } + + +} diff --git a/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/Constant.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/Constant.java new file mode 100644 index 0000000..15b6ee8 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/app/Constant.java @@ -0,0 +1,53 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.app; + +public interface Constant { + + //服务端IP地址 + public static final String CIM_SERVER_HOST = "172.168.11.28"; + + + //注意,这里的端口不是tomcat的端口,CIM端口在服务端spring-cim.xml中配置的,没改动就使用默认的23456 + public static final int CIM_SERVER_PORT = 23456; + + public static interface MessageType{ + + + //用户之间的普通消息 + public static final String TYPE_0 = "0"; + + + //下线类型 + String TYPE_999 = "999"; + } + + + public static interface MessageStatus{ + + //消息未读 + public static final String STATUS_0 = "0"; + //消息已经读取 + public static final String STATUS_1 = "1"; + } + +} diff --git a/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/receiver/CIMPushManagerReceiver.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/receiver/CIMPushManagerReceiver.java new file mode 100644 index 0000000..b1832b6 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/receiver/CIMPushManagerReceiver.java @@ -0,0 +1,126 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.ichat.example.receiver; + + +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.net.NetworkInfo; +import android.support.v4.app.NotificationCompat; + +import com.farsunset.cim.sdk.android.CIMEventBroadcastReceiver; +import com.farsunset.cim.sdk.android.CIMListenerManager; +import com.farsunset.cim.sdk.android.model.Message; +import com.farsunset.cim.sdk.android.model.ReplyBody; +import com.farsunset.ichat.example.R; +import com.farsunset.ichat.example.ui.SystemMessageActivity; + +import static android.R.id.message; +import static com.farsunset.ichat.example.R.id.content; + +/** + * 消息入口,所有消息都会经过这里 + * @author 3979434 + * + */ +public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver { + + private NotificationManager notificationManager; + + //当收到消息时,会执行onMessageReceived,这里是消息第一入口 + + @Override + public void onMessageReceived(Message message, Intent intent) { + + //调用分发消息监听 + CIMListenerManager.notifyOnMessageReceived(message); + + //以开头的为动作消息,无须显示,如被强行下线消息Constant.TYPE_999 + if(message.getAction().startsWith("9")) + { + return ; + } + + showNotify(context,message); + } + + + + private void showNotify(Context context , Message msg) + { + + this.notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + String title = "系统消息"; + + PendingIntent contentIntent = PendingIntent.getActivity(context,1, new Intent(context,SystemMessageActivity.class), PendingIntent.FLAG_UPDATE_CURRENT); + final NotificationCompat.Builder builder = new NotificationCompat.Builder(context); + builder.setAutoCancel(true); + builder.setDefaults(Notification.DEFAULT_ALL); + builder.setWhen(msg.getTimestamp()); + builder.setSmallIcon(R.drawable.icon); + builder.setTicker(title); + builder.setContentTitle(title); + builder.setContentText(msg.getContent()); + builder.setDefaults(Notification.DEFAULT_LIGHTS); + builder.setContentIntent(contentIntent); + final Notification notification = builder.build(); + + + notificationManager.notify(R.drawable.icon, notification); + + } + + + @Override + public void onNetworkChanged(NetworkInfo info) { + CIMListenerManager.notifyOnNetworkChanged(info); + } + + + @Override + public void onConnectionSuccessed(boolean hasAutoBind) { + CIMListenerManager.notifyOnConnectionSuccessed(hasAutoBind); + } + + @Override + public void onConnectionClosed() { + CIMListenerManager.notifyOnConnectionClosed(); + } + + + @Override + public void onReplyReceived(ReplyBody body) { + CIMListenerManager.notifyOnReplyReceived(body); + } + + + + @Override + public void onConnectionFailed() { + // TODO Auto-generated method stub + CIMListenerManager.notifyOnConnectionFailed(); + } + +} diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/LoginActivity.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/LoginActivity.java similarity index 61% rename from cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/LoginActivity.java rename to cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/LoginActivity.java index 4d96339..f28be5c 100644 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/LoginActivity.java +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/LoginActivity.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.ichat.example.ui; import android.content.Intent; @@ -43,19 +58,14 @@ public class LoginActivity extends CIMMonitorActivity implements private void doLogin() { if (!"".equals(accountEdit.getText().toString().trim())) { - showProgressDialog("提示", "正在登录,请稍候......"); - if(CIMPushManager.getState(this) == CIMPushManager.STATE_NORMAL ) - { + showProgressDialog("提示", "正在登陆,请稍后......"); + if (CIMPushManager.isConnected(this)) { CIMPushManager.bindAccount(this, accountEdit.getText().toString().trim()); - return; + } else { + CIMPushManager.connect(this, Constant.CIM_SERVER_HOST, Constant.CIM_SERVER_PORT); } - if(CIMPushManager.getState(this) == CIMPushManager.STATE_STOPED ) - { - CIMPushManager.connect(this,Constant.CIM_SERVER_HOST, Constant.CIM_SERVER_PORT); - } - - } + } } @Override diff --git a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/SplanshActivity.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java similarity index 55% rename from cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/SplanshActivity.java rename to cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java index 051d9cc..cb396ea 100644 --- a/cim_for_mina/client-mchat-android/src/com/farsunset/ichat/example/ui/SplanshActivity.java +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SplanshActivity.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.ichat.example.ui; diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/SystemMessageActivity.java b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java similarity index 69% rename from cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/SystemMessageActivity.java rename to cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java index 71e552c..09bc31e 100644 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/ui/SystemMessageActivity.java +++ b/cim_for_netty/cim-client-android/app/src/main/java/com/farsunset/ichat/example/ui/SystemMessageActivity.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.ichat.example.ui; import java.util.ArrayList; @@ -25,29 +40,19 @@ import com.farsunset.ichat.example.R; import com.farsunset.ichat.example.adapter.SystemMsgListViewAdapter; import com.farsunset.ichat.example.app.CIMMonitorActivity; import com.farsunset.ichat.example.app.Constant; -import com.farsunset.ichat.example.network.HttpAPIRequester; -import com.farsunset.ichat.example.network.HttpAPIResponser; -public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener, HttpAPIResponser{ +public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener{ protected ListView chatListView; - int currentPage = 1; protected SystemMsgListViewAdapter adapter; private ArrayList list; - - public HashMap apiParams = new HashMap(); - - //客户端向客户端发送消息接口地址 - public final static String SEND_MESSAGE_API_URL=Constant.SERVER_URL+"/cgi/message_send.api"; - - HttpAPIRequester requester ; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_system_chat); initViews(); - requester = new HttpAPIRequester(this); - + //绑定账号成功,获取离线消息 getOfflineMessage(); } @@ -73,7 +78,7 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick @Override public void onMessageReceived(Message message) { - if(message.getType().equals(Constant.MessageType.TYPE_999)) + if(message.getAction().equals(Constant.MessageType.TYPE_999)) { //返回登录页面,停止接受消息 CIMPushManager.stop(this); @@ -93,11 +98,11 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick } - //获取离线消息,代码示例,前提是服务端要实现此功能 + //获取离线消息,代码示例,前提是服务端要实现此功能,建议使用http 接口拉去大量的离线消息 private void getOfflineMessage() { SentBody sent = new SentBody(); - sent.setKey(CIMConstant.RequestKey.CLIENT_OFFLINE_MESSAGE); + sent.setKey(CIMConstant.RequestKey.CLIENT_PULL_MESSAGE); sent.put("account", this.getIntent().getStringExtra("account")); CIMPushManager.sendRequest(this, sent); } @@ -115,38 +120,8 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick } } - - - //发送消息示范,用户客户端与客户端之间的消息发送 - private void sendMessage() throws Exception - { - - requester.execute(SEND_MESSAGE_API_URL); - } - @Override - public void onSuccess(String data,String url) { - hideProgressDialog(); - - showToask("发送成功"); - } - - @Override - public Map getRequestParams() { - - apiParams.put("content", "hello world!"); - apiParams.put("sender", "xiaogou");//发送者账号 - apiParams.put("receiver", "xiaomao");//消息接收者账号 - apiParams.put("type",Constant.MessageType.TYPE_0); - - return apiParams; - } - - @Override - public void onRequest() { - showProgressDialog("提示", "正在发送消息..."); - } @Override public void onClick(View v) { @@ -158,9 +133,6 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick } } - @Override - public void onFailed(Exception e,String url) {} - @Override public void onBackPressed() { @@ -173,4 +145,4 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick } -} \ No newline at end of file +} diff --git a/cim_for_netty/client-mchat-android/res/color/login_text_button_selector.xml b/cim_for_netty/cim-client-android/app/src/main/res/color/login_text_button_selector.xml similarity index 100% rename from cim_for_netty/client-mchat-android/res/color/login_text_button_selector.xml rename to cim_for_netty/cim-client-android/app/src/main/res/color/login_text_button_selector.xml diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/icon.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-hdpi/icon.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/icon.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/login_bg.jpg b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/login_bg.jpg similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-hdpi/login_bg.jpg rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/login_bg.jpg diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/login_default_avatar.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/login_default_avatar.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-320dpi/login_default_avatar.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/login_default_avatar.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/login_input.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/login_input.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-hdpi/login_input.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/login_input.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_bg_pressed.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_common_btn_blue_bg_pressed.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_bg_pressed.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_common_btn_blue_bg_pressed.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_unpressed.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_common_btn_blue_unpressed.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_unpressed.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_common_btn_blue_unpressed.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_bar_bg.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_bar_bg.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_bar_bg.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_bar_bg.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_normal.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_btn_back_normal.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_normal.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_btn_back_normal.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_press.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_btn_back_press.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_press.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_header_btn_back_press.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_nor.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_nor.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_nor.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_nor.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_top.9.png b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_top.9.png similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_top.9.png rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/skin_msgbox_bg_top.9.png diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/splash_bg.jpg b/cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/splash_bg.jpg similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable-hdpi/splash_bg.jpg rename to cim_for_netty/cim-client-android/app/src/main/res/drawable-hdpi/splash_bg.jpg diff --git a/cim_for_netty/client-mchat-android/res/drawable/common_button_blue.xml b/cim_for_netty/cim-client-android/app/src/main/res/drawable/common_button_blue.xml similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable/common_button_blue.xml rename to cim_for_netty/cim-client-android/app/src/main/res/drawable/common_button_blue.xml diff --git a/cim_for_netty/client-mchat-android/res/drawable/common_msgbox_bg.xml b/cim_for_netty/cim-client-android/app/src/main/res/drawable/common_msgbox_bg.xml similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable/common_msgbox_bg.xml rename to cim_for_netty/cim-client-android/app/src/main/res/drawable/common_msgbox_bg.xml diff --git a/cim_for_netty/client-mchat-android/res/drawable/top_back_left_selector.xml b/cim_for_netty/cim-client-android/app/src/main/res/drawable/top_back_left_selector.xml similarity index 100% rename from cim_for_netty/client-mchat-android/res/drawable/top_back_left_selector.xml rename to cim_for_netty/cim-client-android/app/src/main/res/drawable/top_back_left_selector.xml diff --git a/cim_for_mina/client-mchat-android/res/layout/activity_login.xml b/cim_for_netty/cim-client-android/app/src/main/res/layout/activity_login.xml similarity index 98% rename from cim_for_mina/client-mchat-android/res/layout/activity_login.xml rename to cim_for_netty/cim-client-android/app/src/main/res/layout/activity_login.xml index c3f13d7..0f08a3f 100644 --- a/cim_for_mina/client-mchat-android/res/layout/activity_login.xml +++ b/cim_for_netty/cim-client-android/app/src/main/res/layout/activity_login.xml @@ -17,7 +17,6 @@ android:layout_height="91.0dip" android:layout_gravity="center_horizontal" android:layout_marginTop="68.0dip" - android:background="@drawable/card_avatar" android:scaleType="fitXY" android:src="@drawable/login_default_avatar" /> diff --git a/cim_for_netty/client-mchat-android/res/layout/activity_splansh.xml b/cim_for_netty/cim-client-android/app/src/main/res/layout/activity_splansh.xml similarity index 100% rename from cim_for_netty/client-mchat-android/res/layout/activity_splansh.xml rename to cim_for_netty/cim-client-android/app/src/main/res/layout/activity_splansh.xml diff --git a/cim_for_netty/client-mchat-android/res/layout/activity_system_chat.xml b/cim_for_netty/cim-client-android/app/src/main/res/layout/activity_system_chat.xml similarity index 100% rename from cim_for_netty/client-mchat-android/res/layout/activity_system_chat.xml rename to cim_for_netty/cim-client-android/app/src/main/res/layout/activity_system_chat.xml diff --git a/cim_for_netty/client-mchat-android/res/layout/item_chat_sysmsg.xml b/cim_for_netty/cim-client-android/app/src/main/res/layout/item_chat_sysmsg.xml similarity index 93% rename from cim_for_netty/client-mchat-android/res/layout/item_chat_sysmsg.xml rename to cim_for_netty/cim-client-android/app/src/main/res/layout/item_chat_sysmsg.xml index 581abf5..09d183c 100644 --- a/cim_for_netty/client-mchat-android/res/layout/item_chat_sysmsg.xml +++ b/cim_for_netty/cim-client-android/app/src/main/res/layout/item_chat_sysmsg.xml @@ -28,7 +28,7 @@ android:layout_gravity="left|center" android:layout_marginLeft="10.0dip" android:layout_weight="1.0" - android:textColor="@color/gray" /> + android:textColor="@android:color/black" /> + android:textColor="@android:color/black" /> + android:textColor="@android:color/black" /> diff --git a/cim_for_netty/client-mchat-android/res/layout/layout_global_top_header.xml b/cim_for_netty/cim-client-android/app/src/main/res/layout/layout_global_top_header.xml similarity index 93% rename from cim_for_netty/client-mchat-android/res/layout/layout_global_top_header.xml rename to cim_for_netty/cim-client-android/app/src/main/res/layout/layout_global_top_header.xml index b27867e..7f7f252 100644 --- a/cim_for_netty/client-mchat-android/res/layout/layout_global_top_header.xml +++ b/cim_for_netty/cim-client-android/app/src/main/res/layout/layout_global_top_header.xml @@ -1,7 +1,7 @@ @@ -19,7 +19,7 @@ android:minWidth="55.0dip" android:paddingRight="10dip" android:singleLine="true" - android:textColor="@color/white" + android:textColor="@android:color/white" android:textSize="14.0sp" android:visibility="gone" /> diff --git a/cim_for_netty/client-mchat-android/res/raw/classic.mp3 b/cim_for_netty/cim-client-android/app/src/main/res/raw/classic.mp3 similarity index 100% rename from cim_for_netty/client-mchat-android/res/raw/classic.mp3 rename to cim_for_netty/cim-client-android/app/src/main/res/raw/classic.mp3 diff --git a/cim_for_netty/cim-client-android/app/src/main/res/values/colors.xml b/cim_for_netty/cim-client-android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..7ce5f5d --- /dev/null +++ b/cim_for_netty/cim-client-android/app/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #fefefe + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/app/src/main/res/values/strings.xml b/cim_for_netty/cim-client-android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..984afe5 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + CIM示例 + diff --git a/cim_for_netty/cim-client-android/app/src/main/res/values/styles.xml b/cim_for_netty/cim-client-android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..f548224 --- /dev/null +++ b/cim_for_netty/cim-client-android/app/src/main/res/values/styles.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-client-android/build.gradle b/cim_for_netty/cim-client-android/build.gradle new file mode 100644 index 0000000..74b2ab0 --- /dev/null +++ b/cim_for_netty/cim-client-android/build.gradle @@ -0,0 +1,23 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.2.3' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/cim_for_netty/cim-client-android/gradle.properties b/cim_for_netty/cim-client-android/gradle.properties new file mode 100644 index 0000000..aac7c9b --- /dev/null +++ b/cim_for_netty/cim-client-android/gradle.properties @@ -0,0 +1,17 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true diff --git a/cim_for_netty/cim-client-android/gradlew b/cim_for_netty/cim-client-android/gradlew new file mode 100644 index 0000000..9d82f78 --- /dev/null +++ b/cim_for_netty/cim-client-android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/cim_for_netty/cim-client-android/gradlew.bat b/cim_for_netty/cim-client-android/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/cim_for_netty/cim-client-android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/cim_for_netty/cim-client-android/settings.gradle b/cim_for_netty/cim-client-android/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/cim_for_netty/cim-client-android/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/cim_for_netty/cim-java-sdk/.classpath b/cim_for_netty/cim-java-sdk/.classpath index b220497..8a0478f 100644 --- a/cim_for_netty/cim-java-sdk/.classpath +++ b/cim_for_netty/cim-java-sdk/.classpath @@ -2,11 +2,13 @@ - - - - - - + + + + + + + + diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/log4j.jar b/cim_for_netty/cim-java-sdk/libs/log4j.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/log4j.jar rename to cim_for_netty/cim-java-sdk/libs/log4j.jar diff --git a/cim_for_netty/cim-java-sdk/libs/netty-buffer-4.1.9.Final.jar b/cim_for_netty/cim-java-sdk/libs/netty-buffer-4.1.9.Final.jar new file mode 100644 index 0000000..31d9a48 Binary files /dev/null and b/cim_for_netty/cim-java-sdk/libs/netty-buffer-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-java-sdk/libs/netty-codec-4.1.9.Final.jar b/cim_for_netty/cim-java-sdk/libs/netty-codec-4.1.9.Final.jar new file mode 100644 index 0000000..7c1717c Binary files /dev/null and b/cim_for_netty/cim-java-sdk/libs/netty-codec-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-java-sdk/libs/netty-common-4.1.9.Final.jar b/cim_for_netty/cim-java-sdk/libs/netty-common-4.1.9.Final.jar new file mode 100644 index 0000000..e38f723 Binary files /dev/null and b/cim_for_netty/cim-java-sdk/libs/netty-common-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-java-sdk/libs/netty-handler-4.1.9.Final.jar b/cim_for_netty/cim-java-sdk/libs/netty-handler-4.1.9.Final.jar new file mode 100644 index 0000000..1498d27 Binary files /dev/null and b/cim_for_netty/cim-java-sdk/libs/netty-handler-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-java-sdk/libs/netty-resolver-4.1.9.Final.jar b/cim_for_netty/cim-java-sdk/libs/netty-resolver-4.1.9.Final.jar new file mode 100644 index 0000000..7d83091 Binary files /dev/null and b/cim_for_netty/cim-java-sdk/libs/netty-resolver-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-java-sdk/libs/netty-transport-4.1.9.Final.jar b/cim_for_netty/cim-java-sdk/libs/netty-transport-4.1.9.Final.jar new file mode 100644 index 0000000..0cc8904 Binary files /dev/null and b/cim_for_netty/cim-java-sdk/libs/netty-transport-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.2.0.jar new file mode 100644 index 0000000..b1f9701 Binary files /dev/null and b/cim_for_netty/cim-java-sdk/libs/protobuf-java-3.2.0.jar differ diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMCacheToolkit.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMCacheToolkit.java index b48b209..e7b4152 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMCacheToolkit.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMCacheToolkit.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; import java.util.HashMap; diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMConnectorManager.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMConnectorManager.java index 21b7f42..5099430 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMConnectorManager.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMConnectorManager.java @@ -1,10 +1,41 @@ -/** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; +import java.util.Random; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import org.apache.log4j.Logger; +import com.farsunset.cim.sdk.client.constant.CIMConstant; +import com.farsunset.cim.sdk.client.exception.SessionDisconnectedException; +import com.farsunset.cim.sdk.client.filter.ClientMessageDecoder; +import com.farsunset.cim.sdk.client.filter.ClientMessageEncoder; +import com.farsunset.cim.sdk.client.model.HeartbeatRequest; +import com.farsunset.cim.sdk.client.model.HeartbeatResponse; +import com.farsunset.cim.sdk.client.model.Intent; +import com.farsunset.cim.sdk.client.model.Message; +import com.farsunset.cim.sdk.client.model.ReplyBody; +import com.farsunset.cim.sdk.client.model.SentBody; + import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; @@ -14,96 +45,61 @@ import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; import io.netty.channel.EventLoopGroup; import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.serialization.ClassResolvers; import io.netty.handler.timeout.IdleState; import io.netty.handler.timeout.IdleStateEvent; import io.netty.handler.timeout.IdleStateHandler; import io.netty.util.AttributeKey; - -import java.net.InetSocketAddress; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - - -import com.farsunset.cim.sdk.client.constant.CIMConstant; -import com.farsunset.cim.sdk.client.exception.CIMSessionDisableException; -import com.farsunset.cim.sdk.client.exception.WriteToClosedSessionException; -import com.farsunset.cim.sdk.client.filter.ClientMessageDecoder; -import com.farsunset.cim.sdk.client.filter.ClientMessageEncoder; -import com.farsunset.cim.sdk.client.model.Intent; -import com.farsunset.cim.sdk.client.model.Message; -import com.farsunset.cim.sdk.client.model.ReplyBody; -import com.farsunset.cim.sdk.client.model.SentBody; + /** * 连接服务端管理,cim核心处理类,管理连接,以及消息处理 + * + * @author 3979434@qq.com */ -@io.netty.channel.ChannelHandler.Sharable +@Sharable class CIMConnectorManager extends SimpleChannelInboundHandler { + protected final Logger logger = Logger.getLogger(CIMConnectorManager.class.getSimpleName()); + private final int CONNECT_TIMEOUT = 10 * 1000;//秒 + private final int WRITE_TIMEOUT = 10 * 1000;//秒 - private Channel channel;; + private final int READ_IDLE_TIME = 120;//秒 + private final int HEARBEAT_TIME_OUT = (READ_IDLE_TIME + 20) * 1000;// 收到服务端心跳请求超时时间 毫秒 + private final String KEY_LAST_HEART_TIME = "KEY_LAST_HEART_TIME" ; + + private Bootstrap bootstrap; + private EventLoopGroup loopGroup ; + private Channel channel;; + private ExecutorService executor = Executors.newCachedThreadPool(); + private static CIMConnectorManager manager; - Bootstrap bootstrap; - EventLoopGroup loopGroup ; - static CIMConnectorManager manager; - // 消息广播action - public static final String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; - - // 发送sendbody失败广播 - public static final String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; - - // 发送sendbody成功广播 - public static final String ACTION_SENT_SUCCESSED = "com.farsunset.cim.SENT_SUCCESSED"; - // 链接意外关闭广播 - public static final String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; - // 链接失败广播 - public static final String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; - // 链接成功广播 - public static final String ACTION_CONNECTION_SUCCESSED = "com.farsunset.cim.CONNECTION_SUCCESSED"; - // 发送sendbody成功后获得replaybody回应广播 - public static final String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; - // 网络变化广播 - public static final String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; - - // 未知异常 - public static final String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; - //重试连接 - public final static String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; - - private ExecutorService executor; - public static final String HEARTBEAT_PINGED ="HEARTBEAT_PINGED"; - //连接空闲时间 - public static final int READ_IDLE_TIME = 180;//秒 - - //心跳超时 - public static final int HEART_TIME_OUT = 30 * 1000;//秒 - private CIMConnectorManager() { - executor = Executors.newCachedThreadPool(); + bootstrap = new Bootstrap(); loopGroup = new NioEventLoopGroup(); bootstrap.group(loopGroup); bootstrap.channel(NioSocketChannel.class); bootstrap.option(ChannelOption.TCP_NODELAY, true); + bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, CONNECT_TIMEOUT); + bootstrap.handler(new ChannelInitializer() { @Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); - pipeline.addLast(new ClientMessageDecoder(ClassResolvers.cacheDisabled(CIMConnectorManager.class.getClassLoader()))); + pipeline.addLast(new ClientMessageDecoder()); pipeline.addLast(new ClientMessageEncoder()); pipeline.addLast(new IdleStateHandler(READ_IDLE_TIME,0,0)); pipeline.addLast(CIMConnectorManager.this); } }); - + } public synchronized static CIMConnectorManager getManager() { @@ -114,90 +110,81 @@ class CIMConnectorManager extends SimpleChannelInboundHandler { } - private synchronized void syncConnection(final String cimServerHost,final int cimServerPort) { + private synchronized void syncConnection( String host, int port) { + + if(isConnected()){ + return ; + } + try { - if(isConnected()){ - return ; - } - ChannelFuture channelFuture = bootstrap.connect(new InetSocketAddress(cimServerHost, cimServerPort)).sync(); //这里的IP和端口,根据自己情况修改 + logger.info("****************CIM正在连接服务器 "+host+":"+port+"......"); + + ChannelFuture channelFuture = bootstrap.connect(host, port).syncUninterruptibly(); channel = channelFuture.channel(); } catch (Exception e) { + long interval = CIMConstant.RECONN_INTERVAL_TIME - (5*1000 - new Random().nextInt(15*1000)); + Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_FAILED); - intent.putExtra("exception", e); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED); + intent.putExtra(Exception.class.getName(), e); + intent.putExtra("interval", interval); sendBroadcast(intent); - - } - - } - - public void connect(final String cimServerHost, final int cimServerPort) { - - - Future future = executor.submit(new Runnable() { - @Override - public void run() { - syncConnection(cimServerHost, cimServerPort); - } - }); - try { - if(future.get()!=null) - { - connect(cimServerHost,cimServerPort); - } - } catch (Exception e) { - - connect(cimServerHost,cimServerPort); - e.printStackTrace(); - } - } - - public void send(final SentBody body) { - + logger.error("****************CIM连接服务器失败 "+host+":"+port+"......将在"+interval/1000+"秒后重新尝试连接"); + } + + } + + public void connect(final String host, final int port) { + executor.execute(new Runnable() { - @Override - public void run() { - - - if(channel!=null && channel.isActive()) - { - boolean isDone = channel.writeAndFlush(body).awaitUninterruptibly(5000); - if (!isDone) { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new WriteToClosedSessionException()); - intent.putExtra("sentBody", body); - sendBroadcast(intent); - }else - { - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_SUCCESSED); - intent.putExtra("sentBody", body); - sendBroadcast(intent); - } - }else - { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new CIMSessionDisableException()); - intent.putExtra("sentBody", body); - sendBroadcast(intent); - } - } + public void run() + { + syncConnection(host, port); + } }); + + } + + public synchronized void send(SentBody body) { + + boolean isSuccessed = false; + + Throwable exception = new SessionDisconnectedException(); + + if(channel!=null && channel.isActive()) + { + isSuccessed = channel.writeAndFlush(body).awaitUninterruptibly(WRITE_TIMEOUT); + } + + if(!isSuccessed){ + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_SENT_FAILED); + intent.putExtra(Exception.class.getName(),exception); + intent.putExtra(SentBody.class.getName(), body); + sendBroadcast(intent); + }else + { + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_SENT_SUCCESSED); + intent.putExtra(SentBody.class.getName(), (SentBody) body); + sendBroadcast(intent); + } + } public void destroy() { - if (manager.channel != null) { - manager.channel.close(); + if (channel != null) { + channel.close(); } - loopGroup.shutdownGracefully(); + + if (loopGroup != null) { + loopGroup.shutdownGracefully(); + } + manager = null; } @@ -209,6 +196,7 @@ class CIMConnectorManager extends SimpleChannelInboundHandler { } + public void closeSession() { if(channel!=null) @@ -218,98 +206,112 @@ class CIMConnectorManager extends SimpleChannelInboundHandler { } - /** - * 检测到连接空闲事件,发送心跳请求命令 - */ - @Override - public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { - if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.READER_IDLE)) - { - onReaderIdeled(ctx.channel()); - } - super.userEventTriggered(ctx, evt); - } - - - private void onReaderIdeled(Channel channel){ - - //如果心跳请求发出30秒内没收到响应,则关闭连接 - Long lastTime = (Long) channel.attr(AttributeKey.valueOf(HEARTBEAT_PINGED)).get(); - if(lastTime != null && System.currentTimeMillis() - lastTime > HEART_TIME_OUT) - { - channel.close(); - } - } - @Override - public void channelActive( ChannelHandlerContext ctx) throws Exception { + public void channelActive(ChannelHandlerContext ctx) throws Exception { - System.out.println("******************CIM连接服务器成功:"+ctx.channel().localAddress()); - ctx.channel().attr(AttributeKey.valueOf(HEARTBEAT_PINGED)).set(System.currentTimeMillis()); + logger.info("****************CIM连接服务器成功:"+ctx.channel().localAddress()+" NID:"+ctx.channel().id().asShortText()); + + setLastHeartbeatTime(ctx.channel()); Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_SUCCESSED); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_SUCCESSED); + sendBroadcast(intent); + + } + + @Override + public void channelInactive(ChannelHandlerContext ctx) { + + logger.error("****************CIM与服务器断开连接:"+ctx.channel().localAddress()+" NID:"+ctx.channel().id().asShortText()); + + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_CONNECTION_CLOSED); + sendBroadcast(intent); + + } + + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { + + /** + * 用于解决,wifi情况下。偶而路由器与服务器断开连接时,客户端并没及时收到关闭事件 + * 导致这样的情况下当前连接无效也不会重连的问题 + * + */ + if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.READER_IDLE)) + { + logger.debug( "****************CIM "+IdleState.READER_IDLE+":"+ctx.channel().localAddress()+" NID:"+ctx.channel().id().asShortText()); + + Long lastTime = getLastHeartbeatTime(ctx.channel()); + if(lastTime != null && System.currentTimeMillis() - lastTime > HEARBEAT_TIME_OUT) + { + channel.close(); + logger.error("****************CIM心跳超时 ,即将重新连接......"+" NID:"+ctx.channel().id().asShortText()); + } + } + + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { + + logger.error("****************CIM连接出现未知异常:"+ctx.channel().localAddress()+" NID:"+ctx.channel().id().asShortText()); + + if(cause!=null && cause.getMessage()!=null){ + logger.error(cause.getMessage()); + } + + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_UNCAUGHT_EXCEPTION); + intent.putExtra(Exception.class.getName(), cause); sendBroadcast(intent); } - @Override - public void channelInactive(ChannelHandlerContext ctx) throws Exception { - - System.out.println("******************closeCIM与服务器断开连接:"+ctx.channel().localAddress()); - if(channel.id().asLongText().equals(ctx.channel().id().asLongText())) - { - Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_CLOSED); - sendBroadcast(intent); - - } - } - - - @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - - Intent intent = new Intent(); - intent.setAction(ACTION_UNCAUGHT_EXCEPTION); - intent.putExtra("exception", cause.getCause()); - sendBroadcast(intent); - } - - @Override - protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { + public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception{ if (msg instanceof Message) { - Intent intent = new Intent(); - intent.setAction(ACTION_MESSAGE_RECEIVED); - intent.putExtra("message", (Message) msg); - sendBroadcast(intent); - + + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_MESSAGE_RECEIVED); + intent.putExtra(Message.class.getName(), (Message) msg); + sendBroadcast(intent); + } if (msg instanceof ReplyBody) { - Intent intent = new Intent(); - intent.setAction(ACTION_REPLY_RECEIVED); - intent.putExtra("replyBody", (ReplyBody) msg); - sendBroadcast(intent); + + Intent intent = new Intent(); + intent.setAction(CIMConstant.IntentAction.ACTION_REPLY_RECEIVED); + intent.putExtra(ReplyBody.class.getName(), (ReplyBody) msg); + sendBroadcast(intent); } //收到服务端发来的心跳请求命令,则马上回应服务器 - if (msg.equals(CIMConstant.CMD_HEARTBEAT_REQUEST)) { - ctx.writeAndFlush(CIMConstant.CMD_HEARTBEAT_RESPONSE); - ctx.channel().attr(AttributeKey.valueOf(HEARTBEAT_PINGED)).set(System.currentTimeMillis()); - } - } - - - private void sendBroadcast(final Intent intent) { - executor.execute(new Runnable(){ - @Override - public void run() { - CIMEventBroadcastReceiver.getInstance().onReceive(intent); - } - }); + if (msg instanceof HeartbeatRequest) { + ctx.writeAndFlush(HeartbeatResponse.getInstance()); + setLastHeartbeatTime(ctx.channel()); + } + } + private void setLastHeartbeatTime(Channel channel) + { + channel.attr(AttributeKey.valueOf(KEY_LAST_HEART_TIME)).set(System.currentTimeMillis()); + } -} \ No newline at end of file + private Long getLastHeartbeatTime(Channel channel) + { + return (Long) channel.attr(AttributeKey.valueOf(KEY_LAST_HEART_TIME)).get(); + } + + + private void sendBroadcast(final Intent intent) { + executor.execute(new Runnable(){ + @Override + public void run() { + CIMEventBroadcastReceiver.getInstance().onReceive(intent); + } + }); + } +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventBroadcastReceiver.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventBroadcastReceiver.java index fc8060a..d358000 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventBroadcastReceiver.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventBroadcastReceiver.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; @@ -12,7 +27,7 @@ import java.util.Timer; import java.util.TimerTask; import com.farsunset.cim.sdk.client.constant.CIMConstant; -import com.farsunset.cim.sdk.client.exception.CIMSessionDisableException; +import com.farsunset.cim.sdk.client.exception.SessionDisconnectedException; import com.farsunset.cim.sdk.client.model.Intent; import com.farsunset.cim.sdk.client.model.Message; import com.farsunset.cim.sdk.client.model.ReplyBody; @@ -44,7 +59,7 @@ public class CIMEventBroadcastReceiver { /* * cim断开服务器事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_CLOSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_CLOSED)) { onInnerConnectionClosed(); } @@ -52,15 +67,16 @@ public class CIMEventBroadcastReceiver { /* * cim连接服务器失败事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_FAILED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_FAILED)) { - onInnerConnectionFailed((Exception) intent.getExtra("exception")); + long interval = intent.getLongExtra("interval", CIMConstant.RECONN_INTERVAL_TIME); + onInnerConnectionFailed((Exception) intent.getExtra(Exception.class.getName()),interval); } /* * cim连接服务器成功事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_SUCCESSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_SUCCESSED)) { onInnerConnectionSuccessed(); } @@ -68,51 +84,51 @@ public class CIMEventBroadcastReceiver { /* * 收到推送消息事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_MESSAGE_RECEIVED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_MESSAGE_RECEIVED)) { - onInnerMessageReceived((Message)intent.getExtra("message")); + onInnerMessageReceived((Message)intent.getExtra(Message.class.getName())); } /* * 获取收到replybody成功事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_REPLY_RECEIVED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_REPLY_RECEIVED)) { - listener.onReplyReceived((ReplyBody)intent.getExtra("replyBody")); + listener.onReplyReceived((ReplyBody)intent.getExtra(ReplyBody.class.getName())); } /* * 获取sendbody发送失败事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_SENT_FAILED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_SENT_FAILED)) { - onSentFailed((Exception) intent.getExtra("exception"),(SentBody)intent.getExtra("sentBody")); + onSentFailed((Exception) intent.getExtra(Exception.class.getName()),(SentBody)intent.getExtra(SentBody.class.getName())); } /* * 获取sendbody发送成功事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_SENT_SUCCESSED)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_SENT_SUCCESSED)) { - onSentSucceed((SentBody)intent.getExtra("sentBody")); + onSentSucceed((SentBody)intent.getExtra(SentBody.class.getName())); } /* * 获取cim数据传输异常事件 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_UNCAUGHT_EXCEPTION)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_UNCAUGHT_EXCEPTION)) { - onUncaughtException((Exception)intent.getExtra("exception")); + onUncaughtException((Exception)intent.getExtra(Exception.class.getName())); } /* * 重新连接,如果断开的话 */ - if(intent.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_RECOVERY)) + if(intent.getAction().equals(CIMConstant.IntentAction.ACTION_CONNECTION_RECOVERY)) { CIMPushManager.connect(); } @@ -132,9 +148,9 @@ public class CIMEventBroadcastReceiver { - private void onInnerConnectionFailed(Exception e){ + private void onInnerConnectionFailed(Exception e,long interval){ - connectionHandler.schedule(new ConnectionTask(),random.nextInt(CIMConstant.RECONN_INTERVAL_TIME) + 20 ); + connectionHandler.schedule(new ConnectionTask(),interval); listener.onConnectionFailed(e); } @@ -159,14 +175,15 @@ public class CIMEventBroadcastReceiver { private void onSentFailed(Exception e, SentBody body){ + e.printStackTrace(); //与服务端端开链接,重新连接 - if(e instanceof CIMSessionDisableException) + if(e instanceof SessionDisconnectedException) { CIMPushManager.connect(); }else { //发送失败 重新发送 - CIMPushManager.sendRequest( body); + //CIMPushManager.sendRequest( body); } } diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventListener.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventListener.java index 6d8e30e..385b3f3 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventListener.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMEventListener.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; @@ -21,31 +36,35 @@ public interface CIMEventListener * 当收到服务端推送过来的消息时调用 * @param message */ - public abstract void onMessageReceived(Message message); + void onMessageReceived(Message message); /** * 当调用CIMPushManager.sendRequest()向服务端发送请求,获得相应时调用 * @param replybody */ - public abstract void onReplyReceived(ReplyBody replybody); + void onReplyReceived(ReplyBody replybody); - /** * 当连接服务器成功时回调 * @param hasAutoBind : true 已经自动绑定账号到服务器了,不需要再手动调用bindAccount */ - public abstract void onConnectionSuccessed(boolean hasAutoBind); + void onConnectionSuccessed(boolean hasAutoBind); /** * 当断开服务器连接的时候回调 */ - public abstract void onConnectionClosed(); + void onConnectionClosed(); /** * 当服务器连接失败的时候回调 * */ - public abstract void onConnectionFailed(Exception e); + void onConnectionFailed(Exception e); + + /** + * 监听器在容器里面的排序。值越大则越先接收 + */ + int getEventDispatchOrder(); } diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMListenerManager.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMListenerManager.java index 3b4dcaf..27ca337 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMListenerManager.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMListenerManager.java @@ -1,11 +1,31 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +import org.apache.log4j.Logger; + import com.farsunset.cim.sdk.client.model.Message; import com.farsunset.cim.sdk.client.model.ReplyBody; @@ -16,13 +36,15 @@ import com.farsunset.cim.sdk.client.model.ReplyBody; public class CIMListenerManager { private static ArrayList cimListeners = new ArrayList(); - + private static CIMMessageReceiveComparator comparator = new CIMMessageReceiveComparator(); + protected static final Logger logger = Logger.getLogger(CIMListenerManager.class); public static void registerMessageListener(CIMEventListener listener) { if (!cimListeners.contains(listener)) { cimListeners.add(listener); + Collections.sort(cimListeners,comparator); } } @@ -71,8 +93,24 @@ public class CIMListenerManager { public static void logListenersName() { for (CIMEventListener listener : cimListeners) { - System.out.println("#######" + listener.getClass().getName() + "#######" ); + logger.debug("#######" + listener.getClass().getName() + "#######" ); } } + + /** + * 消息接收activity的接收顺序排序,CIM_RECEIVE_ORDER倒序 + */ + private static class CIMMessageReceiveComparator implements Comparator{ + + @Override + public int compare(CIMEventListener arg1, CIMEventListener arg2) { + + int order1 = arg1.getEventDispatchOrder(); + int order2 = arg2.getEventDispatchOrder(); + return order2 - order1 ; + } + + } + -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushManager.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushManager.java index ba8dc63..4bb9423 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushManager.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushManager.java @@ -1,14 +1,30 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; import java.net.InetAddress; import java.net.NetworkInterface; import java.util.Properties; +import org.apache.log4j.Logger; import com.farsunset.cim.sdk.client.constant.CIMConstant; import com.farsunset.cim.sdk.client.model.Intent; @@ -18,6 +34,7 @@ import com.farsunset.cim.sdk.client.model.SentBody; * CIM 功能接口 */ public class CIMPushManager { + protected static final Logger logger = Logger.getLogger(CIMPushManager.class); static String ACTION_ACTIVATE_PUSH_SERVICE ="ACTION_ACTIVATE_PUSH_SERVICE"; static String ACTION_CREATE_CIM_CONNECTION ="ACTION_CREATE_CIM_CONNECTION"; @@ -28,7 +45,6 @@ public class CIMPushManager { static String ACTION_DESTORY ="ACTION_DESTORY"; - static String KEY_SEND_BODY ="KEY_SEND_BODY"; static String KEY_CIM_CONNECTION_STATUS ="KEY_CIM_CONNECTION_STATUS"; @@ -152,7 +168,7 @@ public class CIMPushManager { } Intent serviceIntent = new Intent(); - serviceIntent.putExtra(KEY_SEND_BODY, body); + serviceIntent.putExtra(SentBody.class.getName(), body); serviceIntent.setAction(ACTION_SEND_REQUEST_BODY); startService(serviceIntent); @@ -276,4 +292,4 @@ public class CIMPushManager { return null; } -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushService.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushService.java index f07f44d..c658350 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushService.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/CIMPushService.java @@ -1,9 +1,24 @@ - /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client; @@ -17,7 +32,7 @@ import com.farsunset.cim.sdk.client.model.SentBody; */ public class CIMPushService { - protected final static int DEF_CIM_PORT = 28888; + protected final static int DEF_CIM_PORT = 23456; private CIMConnectorManager manager; private static CIMPushService service; @@ -37,10 +52,8 @@ import com.farsunset.cim.sdk.client.model.SentBody; public void onStartCommand(Intent intent) { - if(intent==null) - { - return ; - } + intent = (intent == null ? new Intent(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE) : intent); + String action = intent.getAction(); @@ -53,7 +66,7 @@ import com.farsunset.cim.sdk.client.model.SentBody; if(CIMPushManager.ACTION_SEND_REQUEST_BODY.equals(action)) { - manager.send((SentBody) intent.getExtra(CIMPushManager.KEY_SEND_BODY)); + manager.send((SentBody) intent.getExtra(SentBody.class.getName())); } if(CIMPushManager.ACTION_CLOSE_CIM_CONNECTION.equals(action)) diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/constant/CIMConstant.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/constant/CIMConstant.java index fee11e3..5819d85 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/constant/CIMConstant.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/constant/CIMConstant.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.constant; /** @@ -11,48 +26,95 @@ package com.farsunset.cim.sdk.client.constant; */ public interface CIMConstant { + long RECONN_INTERVAL_TIME= 30 * 1000; + //消息头长度为3个字节,第一个字节为消息类型,第二,第三字节 转换int后为消息长度 + int DATA_HEADER_LENGTH = 3; + public static interface ReturnCode{ + + String CODE_404 ="404"; + + String CODE_403 ="403"; + + String CODE_405 ="405"; + + String CODE_200 ="200"; + + String CODE_206 ="206"; + + String CODE_500 ="500"; + + + } - public static String UTF8="UTF-8"; - - public static byte MESSAGE_SEPARATE='\b'; - - - //重连间隔随机数,在 30 -10 ----30+10 之间 - public static int RECONN_INTERVAL_TIME= 30 * 1000; - - public static int CIM_DEFAULT_MESSAGE_ORDER=1; - - - static class ConfigKey{ + public static interface ConfigKey{ public static String DEVICE_MODEL ="client.model"; public static String CLIENT_VERSION ="client.version"; public static String CLIENT_ACCOUNT ="client.account"; } - /** - * 服务端心跳请求命令 cmd_server_hb_request - */ - public static final String CMD_HEARTBEAT_REQUEST="S_H_RQ"; - /** - * 客户端心跳响应命令 cmd_client_hb_response - */ - public static final String CMD_HEARTBEAT_RESPONSE ="C_H_RS"; + public static interface ProtobufType{ + byte C_H_RS = 0; + byte S_H_RQ = 1; + byte MESSAGE = 2; + byte SENTBODY = 3; + byte REPLYBODY = 4; + } - public static class RequestKey{ + public static interface RequestKey{ - public static String CLIENT_BIND ="client_bind"; + String CLIENT_BIND ="client_bind"; - public static String CLIENT_OFFLINE_MESSAGE ="client_get_offline_message"; + String CLIENT_LOGOUT ="client_logout"; - public static String CLIENT_CYCLE_LOCATION ="client_cycle_location"; + @Deprecated + String CLIENT_PULL_MESSAGE ="client_pull_message"; - public static String CLIENT_PUSH_MESSAGE ="client_push_message"; - - public static String CLIENT_EXECUTE_SCRIPT ="client_execute_script"; - } -} \ No newline at end of file + + public static interface MessageAction{ + + //被其他设备登录挤下线消息 + String ACTION_999 ="999"; + //被系统禁用消息 + String ACTION_444 ="444"; + } + + + public static interface IntentAction{ + + // 消息广播action + String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; + + // 发送sendbody失败广播 + String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; + + // 发送sendbody成功广播 + String ACTION_SENT_SUCCESSED = "com.farsunset.cim.SENT_SUCCESSED"; + + // 链接意外关闭广播 + String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; + + // 链接失败广播 + String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; + + // 链接成功广播 + String ACTION_CONNECTION_SUCCESSED = "com.farsunset.cim.CONNECTION_SUCCESSED"; + + // 发送sendbody成功后获得replaybody回应广播 + String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; + + // 网络变化广播 + String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; + + // 未知异常 + String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; + + //重试连接 + String ACTION_CONNECTION_RECOVERY = "com.farsunset.cim.CONNECTION_RECOVERY"; + } + +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/CIMSessionDisableException.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/CIMSessionDisableException.java deleted file mode 100644 index 967227f..0000000 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/CIMSessionDisableException.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.client.exception; - - -public class CIMSessionDisableException extends Exception { - - private static final long serialVersionUID = 1L; - - public CIMSessionDisableException() { - super(); - } - - public CIMSessionDisableException(String s) { - super(s); - } -} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetWorkDisableException.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetWorkDisableException.java deleted file mode 100644 index 43e657b..0000000 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetWorkDisableException.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.client.exception; - - -public class NetWorkDisableException extends Exception { - - private static final long serialVersionUID = 1L; - - public NetWorkDisableException() { - super(); - } - - public NetWorkDisableException(String s) { - super(s); - } -} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetworkDisconnectedException.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetworkDisconnectedException.java new file mode 100644 index 0000000..0557b47 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/NetworkDisconnectedException.java @@ -0,0 +1,36 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.exception; + + +public class NetworkDisconnectedException extends Exception { + + private static final long serialVersionUID = 1L; + + public NetworkDisconnectedException() { + super(); + } + + public NetworkDisconnectedException(String s) { + super(s); + } +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/SessionDisconnectedException.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/SessionDisconnectedException.java new file mode 100644 index 0000000..23f4427 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/SessionDisconnectedException.java @@ -0,0 +1,36 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.exception; + + +public class SessionDisconnectedException extends Exception { + + private static final long serialVersionUID = 1L; + + public SessionDisconnectedException() { + super(); + } + + public SessionDisconnectedException(String s) { + super(s); + } +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/WriteToClosedSessionException.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/WriteToClosedSessionException.java deleted file mode 100644 index 81a7ad3..0000000 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/exception/WriteToClosedSessionException.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.client.exception; - -import java.io.Serializable; - - -public class WriteToClosedSessionException extends Exception implements Serializable { - - private static final long serialVersionUID = 1L; - - public WriteToClosedSessionException() { - super(); - } - - public WriteToClosedSessionException(String s) { - super(s); - } -} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java index d8fe2d1..07b9233 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageDecoder.java @@ -1,160 +1,140 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.filter; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufUtil; -import io.netty.buffer.PooledByteBufAllocator; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.serialization.ClassResolver; -import io.netty.handler.codec.serialization.ObjectDecoder; +import java.util.List; -import java.io.ByteArrayInputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; +import org.apache.log4j.Logger; import com.farsunset.cim.sdk.client.constant.CIMConstant; +import com.farsunset.cim.sdk.client.model.HeartbeatRequest; import com.farsunset.cim.sdk.client.model.Message; import com.farsunset.cim.sdk.client.model.ReplyBody; +import com.farsunset.cim.sdk.model.proto.MessageProto; +import com.farsunset.cim.sdk.model.proto.ReplyBodyProto; +import com.google.protobuf.InvalidProtocolBufferException; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; /** - * 客户端消息解码 + * 客户端消息解码 */ -public class ClientMessageDecoder extends ObjectDecoder { - - - public ClientMessageDecoder(ClassResolver classResolver) { - super(classResolver); - } +public class ClientMessageDecoder extends ByteToMessageDecoder { + protected final Logger logger = Logger.getLogger(ClientMessageDecoder.class.getSimpleName()); @Override - public Object decode(ChannelHandlerContext arg0, ByteBuf buffer) throws Exception { - - final ByteBuf tBuffer = PooledByteBufAllocator.DEFAULT.buffer(640); - - buffer.markReaderIndex(); - boolean complete = false; - - while(buffer.isReadable()){ - byte b = buffer.readByte(); - if (b == CIMConstant.MESSAGE_SEPARATE) { - complete = true; - break; - } else { - tBuffer.writeByte(b); - } - } - + protected void decode(ChannelHandlerContext arg0, ByteBuf buffer, List queue) throws Exception { - if(complete){ - - String message = new String(new String(ByteBufUtil.getBytes(tBuffer),CIMConstant.UTF8)); - Object msg = mappingMessageObject(message); - return msg; - - }else{ - - buffer.resetReaderIndex(); - return null; - + /** + * 消息头3位 + */ + if (buffer.readableBytes() < CIMConstant.DATA_HEADER_LENGTH) { + return; } + + buffer.markReaderIndex(); + + buffer.markReaderIndex(); + + byte conetnType = buffer.readByte(); + + byte lv = buffer.readByte();// int 低位 + byte hv = buffer.readByte();// int 高位 + + int conetnLength = getContentLength(lv, hv); + + // 如果消息体没有接收完整,则重置读取,等待下一次重新读取 + if (conetnLength > buffer.readableBytes()) { + buffer.resetReaderIndex(); + return; + } + + byte[] dataBytes = new byte[conetnLength]; + buffer.readBytes(dataBytes); + + Object message = mappingMessageObject(dataBytes, conetnType); - + if(message!=null){ + queue.add(message); + } + } - private Object mappingMessageObject(String message) throws Exception { - - if(message.equals(CIMConstant.CMD_HEARTBEAT_REQUEST)){//如果是心跳请求命令则直接返回 - - return CIMConstant.CMD_HEARTBEAT_REQUEST; - } - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = (Document) builder.parse(new ByteArrayInputStream(message.getBytes(CIMConstant.UTF8))); - - String name = doc.getDocumentElement().getTagName(); - if (name.equals("reply")) { - ReplyBody reply = new ReplyBody(); - reply.setKey(doc.getElementsByTagName("key").item(0).getTextContent()); - reply.setCode(doc.getElementsByTagName("code").item(0).getTextContent()); - NodeList items = doc.getElementsByTagName("data").item(0).getChildNodes(); - for (int i = 0; i < items.getLength(); i++) { - Node node = items.item(i); - reply.getData().put(node.getNodeName(), node.getTextContent()); - } - return reply; - } - if (name.equals("message")) { + private Object mappingMessageObject(byte[] bytes, byte type) throws InvalidProtocolBufferException { - Message body = new Message(); - NodeList nodeList = doc.getElementsByTagName("message").item(0).getChildNodes(); - int count = nodeList.getLength(); - for(int i = 0;i < count; i++){ - Node node = nodeList.item(i); - - if(node.getNodeName().equals("mid")){ - - body.setMid(node.getTextContent()); - } - - if(node.getNodeName().equals("type")){ - - body.setType(node.getTextContent()); - } - - if(node.getNodeName().equals("content")){ - - body.setContent(node.getTextContent()); - } - - if(node.getNodeName().equals("file")){ - - body.setFile(node.getTextContent()); - } - - if(node.getNodeName().equals("fileType")){ - - body.setFileType(node.getTextContent()); - } - - - if(node.getNodeName().equals("sender")){ - - body.setSender(node.getTextContent()); - } - - if(node.getNodeName().equals("receiver")){ - - body.setReceiver(node.getTextContent()); - } - - if(node.getNodeName().equals("format")){ - - body.setFormat(node.getTextContent()); - } - - if(node.getNodeName().equals("timestamp")){ - - body.setTimestamp(Long.valueOf(node.getTextContent())); - } - } + if (CIMConstant.ProtobufType.S_H_RQ == type) { + HeartbeatRequest request = HeartbeatRequest.getInstance(); + logger.info(request.toString()); + return request; + } + + if (CIMConstant.ProtobufType.REPLYBODY == type) { + ReplyBodyProto.Model bodyProto = ReplyBodyProto.Model.parseFrom(bytes); + ReplyBody body = new ReplyBody(); + body.setKey(bodyProto.getKey()); + body.setTimestamp(bodyProto.getTimestamp()); + body.putAll(bodyProto.getDataMap()); + body.setCode(bodyProto.getCode()); + body.setMessage(bodyProto.getMessage()); + + logger.info(body.toString()); return body; } - - return null; + + if (CIMConstant.ProtobufType.MESSAGE == type) { + MessageProto.Model bodyProto = MessageProto.Model.parseFrom(bytes); + Message message = new Message(); + message.setMid(bodyProto.getMid()); + message.setAction(bodyProto.getAction()); + message.setContent(bodyProto.getContent()); + message.setSender(bodyProto.getSender()); + message.setReceiver(bodyProto.getReceiver()); + message.setTitle(bodyProto.getTitle()); + message.setExtra(bodyProto.getExtra()); + message.setTimestamp(bodyProto.getTimestamp()); + message.setFormat(bodyProto.getFormat()); + + logger.info( message.toString()); + return message; + } + + return null; + } - + /** + * 解析消息体长度 + * + * @param type + * @param length + * @return + */ + private int getContentLength(byte lv, byte hv) { + int l = (lv & 0xff); + int h = (hv & 0xff); + return (l | (h <<= 8)); + } - } diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageEncoder.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageEncoder.java index aed46cb..548ee03 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageEncoder.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/filter/ClientMessageEncoder.java @@ -1,31 +1,75 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.filter; +import org.apache.log4j.Logger; + import com.farsunset.cim.sdk.client.constant.CIMConstant; +import com.farsunset.cim.sdk.client.model.Protobufable; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToByteEncoder; - /** * 客户端消息发送前进行编码,可在此加密消息 * */ public class ClientMessageEncoder extends MessageToByteEncoder { - + protected final Logger logger = Logger.getLogger(ClientMessageEncoder.class.getSimpleName()); + @Override protected void encode(ChannelHandlerContext ctx, Object message, ByteBuf out) throws Exception { - out.writeBytes(message.toString().getBytes(CIMConstant.UTF8)); - out.writeByte(CIMConstant.MESSAGE_SEPARATE); + + + if(message instanceof Protobufable){ + + Protobufable data = (Protobufable) message; + byte[] byteArray = data.getByteArray(); + + + out.writeBytes(createHeader(data.getType(),byteArray.length)); + out.writeBytes(byteArray); + + } + + logger.info(message.toString()); + } + + /** + * 消息体最大为65535 + * @param type + * @param length + * @return + */ + private byte[] createHeader(byte type,int length){ + byte[] header = new byte[CIMConstant.DATA_HEADER_LENGTH]; + header[0] = type; + header[1] = (byte) (length & 0xff); + header[2] = (byte) ((length >> 8) & 0xff); + return header; } diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatRequest.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatRequest.java new file mode 100644 index 0000000..8376728 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatRequest.java @@ -0,0 +1,63 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.client.constant.CIMConstant; + +/** + * 服务端心跳请求 + * + */ +public class HeartbeatRequest implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "SERVER_HEARTBEAT_REQUEST"; + private static final String CMD_HEARTBEAT_RESPONSE = "SR"; + + private static HeartbeatRequest object = new HeartbeatRequest(); + + private HeartbeatRequest(){ + + } + + public static HeartbeatRequest getInstance() { + return object; + } + + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + + @Override + public byte getType() { + return CIMConstant.ProtobufType.S_H_RQ; + } + +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatResponse.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatResponse.java new file mode 100644 index 0000000..2487634 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/HeartbeatResponse.java @@ -0,0 +1,60 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.client.constant.CIMConstant; + +/** + * 客户端心跳响应 + */ +public class HeartbeatResponse implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "CLIENT_HEARTBEAT_RESPONSE"; + private static final String CMD_HEARTBEAT_RESPONSE = "CR"; + + private static HeartbeatResponse object = new HeartbeatResponse(); + + private HeartbeatResponse(){ + + } + + public static HeartbeatResponse getInstance() { + return object; + } + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.C_H_RS; + } + +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Intent.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Intent.java index c7b9b83..c6d6e6f 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Intent.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Intent.java @@ -1,9 +1,24 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.model; import java.io.Serializable; @@ -20,6 +35,14 @@ public class Intent implements Serializable { private HashMap data = new HashMap(); + + public Intent() { + } + + public Intent(String action) { + this.action = action; + } + public String getAction() { return action; } @@ -34,4 +57,13 @@ public class Intent implements Serializable { public Object getExtra(String key){ return data.get(key); } + + public long getLongExtra(String key, long defValue) { + Object v = getExtra(key); + try{ + return Long.parseLong(v.toString()); + }catch(Exception e){ + return defValue; + } + } } diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java index abb30a1..0f0d69b 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Message.java @@ -1,12 +1,28 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.model; import java.io.Serializable; + /** * 消息对象 */ @@ -24,13 +40,16 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String type; - + private String action; + /** + * 消息标题 + */ + private String title; + /** + * 消息类容,于action 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 + */ private String content; - private String file; - - private String fileType; /** * 消息发送者账号 */ @@ -40,12 +59,18 @@ public class Message implements Serializable { */ private String receiver; + + /** * content 内容格式 */ private String format; - + /** + * 附加内容 内容 + */ + private String extra; + private long timestamp; @@ -61,7 +86,22 @@ public class Message implements Serializable { this.timestamp = timestamp; } - + + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + public String getContent() { return content; } @@ -87,7 +127,6 @@ public class Message implements Serializable { } - public String getFormat() { return format; } @@ -97,71 +136,29 @@ public class Message implements Serializable { } - public String getType() { - return type; + + public String getExtra() { + return extra; } - public void setType(String type) { - this.type = type; - } - public String getFile() { - return file; - } - public void setFile(String file) { - this.file = file; - } - public String getFileType() { - return fileType; - } - public void setFileType(String fileType) { - this.fileType = fileType; + public void setExtra(String extra) { + this.extra = extra; } public String toString() { - + StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(mid).append(""); - - if (isNotEmpty(type)) { - buffer.append("").append(type).append(""); - } - - if (isNotEmpty(file)) { - buffer.append("").append(file).append(""); - } - - if (isNotEmpty(fileType)) { - buffer.append("").append(fileType).append(""); - } - - if (isNotEmpty(content)) { - buffer.append(""); - } - - if (isNotEmpty(sender)) { - buffer.append("").append(sender).append(""); - } - - if (isNotEmpty(receiver)) { - buffer.append("").append(receiver).append(""); - } - - if (isNotEmpty(format)) { - buffer.append("").append(format).append(""); - } - - if (timestamp > 0) { - buffer.append("").append(timestamp).append(""); - } - - buffer.append(""); + buffer.append("#Message#").append("\n"); + buffer.append("mid:").append(mid).append("\n"); + buffer.append("action:").append(action).append("\n"); + buffer.append("title:").append(title).append("\n"); + buffer.append("content:").append(content).append("\n"); + buffer.append("extra:").append(extra).append("\n"); + buffer.append("sender:").append(sender).append("\n"); + buffer.append("receiver:").append(receiver).append("\n"); + buffer.append("format:").append(format).append("\n"); + buffer.append("timestamp:").append(timestamp); return buffer.toString(); } - - public String toXmlString() { - - return toString(); - } + public String getMid() { return mid; @@ -172,8 +169,8 @@ public class Message implements Serializable { } public boolean isNotEmpty(String txt) { - return txt != null && txt.trim().length()>0; + return txt != null && txt.trim().length()!=0; } - + } diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Protobufable.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Protobufable.java new file mode 100644 index 0000000..5631e28 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/Protobufable.java @@ -0,0 +1,31 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.client.model; +/** + * 需要向另一端发送的结构体 + */ +public interface Protobufable { + + byte[] getByteArray(); + + byte getType(); +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/ReplyBody.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/ReplyBody.java index a567452..046a787 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/ReplyBody.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/ReplyBody.java @@ -1,13 +1,30 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * 请求应答对象 * @@ -64,7 +81,9 @@ public class ReplyBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } } public String get(String k) { @@ -83,8 +102,12 @@ public class ReplyBody implements Serializable { this.message = message; } - public HashMap getData() { - return data; + public void putAll(Map map) { + data.putAll(map); + } + + public Set getKeySet() { + return data.keySet(); } public String getCode() { @@ -98,27 +121,22 @@ public class ReplyBody implements Serializable { public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(this.getKey()).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append("").append(code).append(""); - buffer.append(""); - for(String key:this.getData().keySet()) - { - buffer.append("<"+key+">").append(this.get(key)).append(""); + buffer.append("#ReplyBody#").append("\n"); + buffer.append("key:").append(this.getKey()).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + buffer.append("code:").append(code).append("\n"); + + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); + return buffer.toString(); } - - public String toXmlString() - { - - return toString(); - } } diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/SentBody.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/SentBody.java index 7e140e4..d193b07 100644 --- a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/SentBody.java +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/client/model/SentBody.java @@ -1,30 +1,48 @@ /** - * probject:cim-java-sdk - * @version 2.0.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.client.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import com.farsunset.cim.sdk.client.constant.CIMConstant; +import com.farsunset.cim.sdk.model.proto.SentBodyProto; /** * java |android 客户端请求结构 * */ -public class SentBody implements Serializable { +public class SentBody implements Serializable,Protobufable { private static final long serialVersionUID = 1L; private String key; - private HashMap data; + private HashMap data = new HashMap();; private long timestamp; public SentBody() { - - data = new HashMap(); timestamp = System.currentTimeMillis(); } @@ -49,35 +67,54 @@ public class SentBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } + } + public void putAll(Map map) { + data.putAll(map); } + public Set getKeySet() { + return data.keySet(); + } + + public void remove(String k) { data.remove(k); } - public HashMap getData() { - return data; - } - @Override public String toString() { StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(key).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append(""); - for (String key : data.keySet()) { - buffer.append("<" + key + ">"); + buffer.append("#SentBody#").append("\n");; + buffer.append("key:").append(key).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); return buffer.toString(); } - - public String toXmlString() { - - return toString(); + + @Override + public byte[] getByteArray() { + SentBodyProto.Model.Builder builder = SentBodyProto.Model.newBuilder(); + builder.setKey(key); + builder.setTimestamp(timestamp); + if(!data.isEmpty()){ + builder.putAllData(data); + } + return builder.build().toByteArray(); } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.SENTBODY; + } + } diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto new file mode 100644 index 0000000..bd6d327 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/Message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.model.proto; +option java_outer_classname="MessageProto"; +message Model { + string mid = 1; + string action = 2; + string content = 3; + string sender = 4; + string receiver = 5; + string extra = 6; + string title = 7; + string format = 8; + int64 timestamp = 9; +} + \ No newline at end of file diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java new file mode 100644 index 0000000..3876250 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/MessageProto.java @@ -0,0 +1,1603 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.model.proto; + +public final class MessageProto { + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string mid = 1; + */ + java.lang.String getMid(); + /** + * string mid = 1; + */ + com.google.protobuf.ByteString + getMidBytes(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + mid_ = ""; + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + mid_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); + } + + public static final int MID_FIELD_NUMBER = 1; + private volatile java.lang.Object mid_; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) obj; + + boolean result = true; + result = result && getMid() + .equals(other.getMid()); + result = result && getAction() + .equals(other.getAction()); + result = result && getContent() + .equals(other.getContent()); + result = result && getSender() + .equals(other.getSender()); + result = result && getReceiver() + .equals(other.getReceiver()); + result = result && getExtra() + .equals(other.getExtra()); + result = result && getTitle() + .equals(other.getTitle()); + result = result && getFormat() + .equals(other.getFormat()); + result = result && (getTimestamp() + == other.getTimestamp()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MID_FIELD_NUMBER; + hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) + com.farsunset.cim.sdk.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + mid_ = ""; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(this); + result.mid_ = mid_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (!other.getMid().isEmpty()) { + mid_ = other.mid_; + onChanged(); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object mid_ = ""; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mid = 1; + */ + public Builder setMid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mid_ = value; + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder clearMid() { + + mid_ = getDefaultInstance().getMid(); + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder setMidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mid_ = value; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) + private static final com.farsunset.cim.sdk.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022!com.farsunset.cim.sdk.m" + + "odel.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(\t\022\016\n\006act" + + "ion\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sender\030\004 \001" + + "(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001(\t\022\r\n\005t" + + "itle\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttimestamp\030" + + "\t \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, + new java.lang.String[] { "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBody.proto b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBody.proto new file mode 100644 index 0000000..f7875f7 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBody.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.model.proto; +option java_outer_classname="ReplyBodyProto"; + +message Model { + string key = 1; + string code = 2; + string message = 3; + int64 timestamp =4; + map data =5; + +} + \ No newline at end of file diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBodyProto.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBodyProto.java new file mode 100644 index 0000000..5d80348 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/ReplyBodyProto.java @@ -0,0 +1,1241 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.model.proto; + +public final class ReplyBodyProto { + private ReplyBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string code = 2; + */ + java.lang.String getCode(); + /** + * string code = 2; + */ + com.google.protobuf.ByteString + getCodeBytes(); + + /** + * string message = 3; + */ + java.lang.String getMessage(); + /** + * string message = 3; + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + * int64 timestamp = 4; + */ + long getTimestamp(); + + /** + * map<string, string> data = 5; + */ + int getDataCount(); + /** + * map<string, string> data = 5; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 5; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + code_ = ""; + message_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + code_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 32: { + + timestamp_ = input.readInt64(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object code_; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 4; + private long timestamp_; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 5; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, code_); + } + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + if (timestamp_ != 0L) { + output.writeInt64(4, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 5); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!getCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, code_); + } + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model other = (com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && getCode() + .equals(other.getCode()); + result = result && getMessage() + .equals(other.getMessage()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + code_ = ""; + + message_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model build() { + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model result = new com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.code_ = code_; + result.message_ = message_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string code = 2; + */ + public Builder setCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value; + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder clearCode() { + + code_ = getDefaultInstance().getCode(); + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder setCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + code_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string message = 3; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 4; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 4; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 5; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) + private static final com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017ReplyBody.proto\022!com.farsunset.cim.sdk" + + ".model.proto\"\265\001\n\005Model\022\013\n\003key\030\001 \001(\t\022\014\n\004c" + + "ode\030\002 \001(\t\022\017\n\007message\030\003 \001(\t\022\021\n\ttimestamp\030" + + "\004 \001(\003\022@\n\004data\030\005 \003(\01322.com.farsunset.cim." + + "sdk.model.proto.Model.DataEntry\032+\n\tDataE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\020B\016" + + "ReplyBodyProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Code", "Message", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBody.proto b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBody.proto new file mode 100644 index 0000000..33785e6 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBody.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.model.proto; +option java_outer_classname="SentBodyProto"; + +message Model { + string key = 1; + int64 timestamp =2; + map data =3; + +} + \ No newline at end of file diff --git a/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBodyProto.java b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBodyProto.java new file mode 100644 index 0000000..5514e63 --- /dev/null +++ b/cim_for_netty/cim-java-sdk/src/com/farsunset/cim/sdk/model/proto/SentBodyProto.java @@ -0,0 +1,966 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.model.proto; + +public final class SentBodyProto { + private SentBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * int64 timestamp = 2; + */ + long getTimestamp(); + + /** + * map<string, string> data = 3; + */ + int getDataCount(); + /** + * map<string, string> data = 3; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 3; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 16: { + + timestamp_ = input.readInt64(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 3; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (timestamp_ != 0L) { + output.writeInt64(2, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 3); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.model.proto.SentBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model other = (com.farsunset.cim.sdk.model.proto.SentBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.model.proto.SentBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.model.proto.Model) + com.farsunset.cim.sdk.model.proto.SentBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.model.proto.SentBodyProto.Model build() { + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.model.proto.SentBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model result = new com.farsunset.cim.sdk.model.proto.SentBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.model.proto.SentBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.model.proto.SentBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.model.proto.SentBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.model.proto.SentBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.model.proto.SentBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.model.proto.SentBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 2; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 2; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 3; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.model.proto.Model) + private static final com.farsunset.cim.sdk.model.proto.SentBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.model.proto.SentBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.model.proto.SentBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016SentBody.proto\022!com.farsunset.cim.sdk." + + "model.proto\"\226\001\n\005Model\022\013\n\003key\030\001 \001(\t\022\021\n\tti" + + "mestamp\030\002 \001(\003\022@\n\004data\030\003 \003(\01322.com.farsun" + + "set.cim.sdk.model.proto.Model.DataEntry\032" + + "+\n\tDataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + + ":\0028\001B\017B\rSentBodyProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-server-sdk/.classpath b/cim_for_netty/cim-server-sdk/.classpath index d94d058..a64a1d9 100644 --- a/cim_for_netty/cim-server-sdk/.classpath +++ b/cim_for_netty/cim-server-sdk/.classpath @@ -1,12 +1,13 @@ - - - - - - + + + + + + + diff --git a/cim_for_mina/client-mchat-android/.settings/org.eclipse.core.resources.prefs b/cim_for_netty/cim-server-sdk/.settings/org.eclipse.core.resources.prefs similarity index 64% rename from cim_for_mina/client-mchat-android/.settings/org.eclipse.core.resources.prefs rename to cim_for_netty/cim-server-sdk/.settings/org.eclipse.core.resources.prefs index 2a5a0ea..99b2bf9 100644 --- a/cim_for_mina/client-mchat-android/.settings/org.eclipse.core.resources.prefs +++ b/cim_for_netty/cim-server-sdk/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,3 @@ -#Mon Mar 07 09:18:02 CST 2011 +#Wed Oct 15 09:31:41 CST 2014 eclipse.preferences.version=1 encoding/=UTF-8 diff --git a/cim_for_netty/cim-server-sdk/libs/log4j-1.2.17.jar b/cim_for_netty/cim-server-sdk/libs/log4j-1.2.17.jar new file mode 100644 index 0000000..068867e Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/log4j-1.2.17.jar differ diff --git a/cim_for_netty/cim-server-sdk/libs/netty-buffer-4.1.9.Final.jar b/cim_for_netty/cim-server-sdk/libs/netty-buffer-4.1.9.Final.jar new file mode 100644 index 0000000..31d9a48 Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/netty-buffer-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server-sdk/libs/netty-codec-4.1.9.Final.jar b/cim_for_netty/cim-server-sdk/libs/netty-codec-4.1.9.Final.jar new file mode 100644 index 0000000..7c1717c Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/netty-codec-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server-sdk/libs/netty-common-4.1.9.Final.jar b/cim_for_netty/cim-server-sdk/libs/netty-common-4.1.9.Final.jar new file mode 100644 index 0000000..e38f723 Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/netty-common-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server-sdk/libs/netty-handler-4.1.9.Final.jar b/cim_for_netty/cim-server-sdk/libs/netty-handler-4.1.9.Final.jar new file mode 100644 index 0000000..1498d27 Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/netty-handler-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server-sdk/libs/netty-resolver-4.1.9.Final.jar b/cim_for_netty/cim-server-sdk/libs/netty-resolver-4.1.9.Final.jar new file mode 100644 index 0000000..7d83091 Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/netty-resolver-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server-sdk/libs/netty-transport-4.1.9.Final.jar b/cim_for_netty/cim-server-sdk/libs/netty-transport-4.1.9.Final.jar new file mode 100644 index 0000000..0cc8904 Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/netty-transport-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.2.0.jar b/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.2.0.jar new file mode 100644 index 0000000..b1f9701 Binary files /dev/null and b/cim_for_netty/cim-server-sdk/libs/protobuf-java-3.2.0.jar differ diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/constant/CIMConstant.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/constant/CIMConstant.java index 743c609..82ecc3c 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/constant/CIMConstant.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/constant/CIMConstant.java @@ -1,91 +1,68 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.constant; + /** * 常量 */ public interface CIMConstant { - public static class ReturnCode{ + public static interface ReturnCode{ - public static String CODE_404 ="404"; - - public static String CODE_403 ="403"; - - public static String CODE_405 ="405"; - - public static String CODE_200 ="200"; - - public static String CODE_206 ="206"; - - public static String CODE_500 ="500"; - - - } - - public static String UTF8="UTF-8"; - - public static byte MESSAGE_SEPARATE='\b'; - - //flex客户端 安全策略验证时会收到\0 - public static byte FLEX_DATA_SEPARATE = '\0'; - - public static int CIM_DEFAULT_MESSAGE_ORDER=1; - - - public static final String SESSION_KEY ="account"; - - public static final String HEARTBEAT_KEY ="heartbeat"; - - - - /** - * FLEX 客户端socket请求发的安全策略请求,需要特殊处理,返回安全验证报文 - */ - public static final String FLEX_POLICY_REQUEST =""; - - public static final String FLEX_POLICY_RESPONSE ="\0"; - - /** - * 服务端心跳请求命令 cmd_server_hb_request - */ - public static final String CMD_HEARTBEAT_REQUEST="S_H_RQ"; - /** - * 客户端心跳响应命令 cmd_client_hb_response - */ - public static final String CMD_HEARTBEAT_RESPONSE ="C_H_RS"; + String CODE_200 ="200"; - - - public static class SessionStatus{ + String CODE_404 ="404"; - public static int STATUS_OK =0; + String CODE_403 ="403"; - public static int STATUS_CLOSED =1; + String CODE_500 ="500"; } - - public static class MessageType{ - - //用户会 踢出下线消息类型 - public static String TYPE_999 ="999"; - + + + + String SESSION_KEY ="account"; + String HEARTBEAT_KEY ="heartbeat"; + + String CLIENT_HEARTBEAT ="client_heartbeat"; + + //消息头长度为3个字节,第一个字节为消息类型,第二,第三字节 转换int后为消息长度 + int DATA_HEADER_LENGTH = 3; + + public static interface ProtobufType{ + byte C_H_RS = 0; + byte S_H_RQ = 1; + byte MESSAGE = 2; + byte SENTBODY = 3; + byte REPLYBODY = 4; } - - public static class RequestKey{ + + public static interface MessageAction{ - public static String CLIENT_BIND ="client_bind"; - public static String CLIENT_HEARTBEAT="client_heartbeat"; - public static String CLIENT_FLASH_POLICY="client_flash_policy"; - public static String CLIENT_LOGOUT ="client_logout"; - public static String CLIENT_OFFLINE_MESSAGE ="client_get_offline_message"; - public static String KEY_CLIENT_CIMSESSION_CLOSED = "client_cimsession_closed"; - - } + //被其他设备登录挤下线消息 + String ACTION_999 ="999"; + //被系统禁用消息 + String ACTION_444 ="444"; + } -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageDecoder.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageDecoder.java index 127b22d..2f3259c 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageDecoder.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageDecoder.java @@ -1,110 +1,115 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.filter; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufUtil; -import io.netty.buffer.PooledByteBufAllocator; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.serialization.ClassResolver; -import io.netty.handler.codec.serialization.ObjectDecoder; -import java.io.ByteArrayInputStream; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; +import java.util.List; import org.apache.log4j.Logger; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.model.HeartbeatResponse; import com.farsunset.cim.sdk.server.model.SentBody; -/** - * 服务端接收消息解码,可在此解密消息 - */ -public class ServerMessageDecoder extends ObjectDecoder { - protected final Logger logger = Logger.getLogger(ServerMessageDecoder.class.getSimpleName()); - public ServerMessageDecoder(ClassResolver classResolver) { - super(classResolver); - } +import com.farsunset.cim.sdk.server.model.proto.SentBodyProto; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; +/** + * 服务端接收消息解码 + */ +public class ServerMessageDecoder extends ByteToMessageDecoder { + + protected final Logger logger = Logger.getLogger(ServerMessageDecoder.class); @Override - public Object decode(ChannelHandlerContext arg0, ByteBuf buffer) throws Exception { - - final ByteBuf tBuffer = PooledByteBufAllocator.DEFAULT.buffer(320); - + protected void decode(ChannelHandlerContext arg0, ByteBuf buffer, List queue) throws Exception { + /** + * 消息头3位 + */ + if (buffer.readableBytes() < CIMConstant.DATA_HEADER_LENGTH) { + return; + } + buffer.markReaderIndex(); - boolean complete = false; - - while(buffer.isReadable()){ - byte b = buffer.readByte(); - if (b == CIMConstant.MESSAGE_SEPARATE || b == CIMConstant.FLEX_DATA_SEPARATE) { - complete = true; - break; - } else { - tBuffer.writeByte(b); - } - } - - if(complete){ - - String message = new String(new String(ByteBufUtil.getBytes(tBuffer),CIMConstant.UTF8)); - - logger.info(message); - - - Object body = parserMessageToSentBody(message); - return body; - - }else{ - + + buffer.markReaderIndex(); + + byte conetnType = buffer.readByte(); + + byte lv = buffer.readByte();// int 低位 + byte hv = buffer.readByte();// int 高位 + + int conetnLength = getContentLength(lv, hv); + + // 如果消息体没有接收完整,则重置读取,等待下一次重新读取 + if (conetnLength > buffer.readableBytes()) { buffer.resetReaderIndex(); - return null; + return; } - + + byte[] dataBytes = new byte[conetnLength]; + buffer.readBytes(dataBytes); + + Object message = mappingMessageObject(dataBytes,conetnType); + if(message != null){ + queue.add(message); + } } - private Object parserMessageToSentBody(String message) throws Exception + public Object mappingMessageObject(byte[] data,byte type) throws Exception { - SentBody body = new SentBody(); - /* - * 如果是心跳响应,则让HeartbeatHandler去处理 - */ - if(message.equalsIgnoreCase(CIMConstant.CMD_HEARTBEAT_RESPONSE)){ - - body.setKey(CIMConstant.RequestKey.CLIENT_HEARTBEAT); + if(CIMConstant.ProtobufType.C_H_RS == type) + { + HeartbeatResponse response = HeartbeatResponse.getInstance(); + logger.info(response.toString()); + SentBody body = new SentBody(); + body.setKey(CIMConstant.CLIENT_HEARTBEAT); + body.setTimestamp(System.currentTimeMillis()); return body; } - /* - * flex 客户端安全策略请求,需要返回特定报文 - */ - if(CIMConstant.FLEX_POLICY_REQUEST.equalsIgnoreCase(message)){ - - body.setKey(CIMConstant.RequestKey.CLIENT_FLASH_POLICY); - return body; + if(CIMConstant.ProtobufType.SENTBODY == type) + { + SentBodyProto.Model bodyProto = SentBodyProto.Model.parseFrom(data); + SentBody body = new SentBody(); + body.setKey(bodyProto.getKey()); + body.setTimestamp(bodyProto.getTimestamp()); + body.putAll(bodyProto.getDataMap()); + logger.info(body.toString()); + + return body; } - - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = builder.parse(new ByteArrayInputStream(message.toString().getBytes(CIMConstant.UTF8))); - body.setKey(doc.getElementsByTagName("key").item(0).getTextContent()); - NodeList dataNodeList = doc.getElementsByTagName("data"); - if(dataNodeList!=null && dataNodeList.getLength()>0){ - - NodeList items = dataNodeList.item(0).getChildNodes(); - for (int i = 0; i < items.getLength(); i++) { - Node node = items.item(i); - body.getData().put(node.getNodeName(), node.getTextContent()); - } - } - - return body; + return null; } + /** + * 解析消息体长度 + * @param type + * @param length + * @return + */ + private int getContentLength(byte lv,byte hv){ + int l = (lv & 0xff); + int h = (hv & 0xff); + return (l| (h <<= 8)); + } } diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageEncoder.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageEncoder.java index 70e4208..2c6eb8e 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageEncoder.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/filter/ServerMessageEncoder.java @@ -1,34 +1,74 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.filter; + import org.apache.log4j.Logger; +import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.model.Protobufable; + import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToByteEncoder; -import com.farsunset.cim.sdk.server.constant.CIMConstant; - /** - * 服务端发送消息前编码,可在此加密消息 + * 服务端发送消息前编码 */ public class ServerMessageEncoder extends MessageToByteEncoder { + protected final Logger logger = Logger.getLogger(ServerMessageEncoder.class.getSimpleName()); @Override protected void encode(ChannelHandlerContext ctx, Object message, ByteBuf out) throws Exception { - out.writeBytes(message.toString().getBytes(CIMConstant.UTF8)); - out.writeByte(CIMConstant.MESSAGE_SEPARATE); - logger.debug(message); + + + if(message instanceof Protobufable){ + + Protobufable data = (Protobufable) message; + byte[] byteArray = data.getByteArray(); + + + out.writeBytes(createHeader(data.getType(),byteArray.length)); + out.writeBytes(byteArray); + + } + + logger.info(message.toString()); } - - + /** + * 消息体最大为65535 + * @param type + * @param length + * @return + */ + private byte[] createHeader(byte type,int length){ + byte[] header = new byte[CIMConstant.DATA_HEADER_LENGTH]; + header[0] = type; + header[1] = (byte) (length & 0xff); + header[2] = (byte) ((length >> 8) & 0xff); + return header; + } } diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMNioSocketAcceptor.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMNioSocketAcceptor.java new file mode 100644 index 0000000..7c17746 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMNioSocketAcceptor.java @@ -0,0 +1,173 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.handler; + +import java.io.IOException; +import java.util.HashMap; + +import org.apache.log4j.Logger; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.filter.ServerMessageDecoder; +import com.farsunset.cim.sdk.server.filter.ServerMessageEncoder; +import com.farsunset.cim.sdk.server.model.HeartbeatRequest; +import com.farsunset.cim.sdk.server.model.ReplyBody; +import com.farsunset.cim.sdk.server.model.SentBody; +import com.farsunset.cim.sdk.server.session.CIMSession; + +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.ChannelHandler.Sharable; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.handler.timeout.IdleState; +import io.netty.handler.timeout.IdleStateEvent; +import io.netty.handler.timeout.IdleStateHandler; +import io.netty.util.AttributeKey; + +@Sharable +public class CIMNioSocketAcceptor extends SimpleChannelInboundHandler{ + + private final static String CIMSESSION_CLOSED_HANDLER_KEY = "client_cimsession_closed"; + private Logger logger = Logger.getLogger(CIMNioSocketAcceptor.class); + private HashMap handlers = new HashMap(); + private int port; + + //连接空闲时间 + public static final int READ_IDLE_TIME = 150;//秒 + + //连接空闲时间 + public static final int WRITE_IDLE_TIME = 120;//秒 + + public static final int PING_TIME_OUT = 30;//心跳响应 超时为30秒 + + public void bind() throws IOException + { + ServerBootstrap bootstrap = new ServerBootstrap(); + bootstrap.group(new NioEventLoopGroup(), new NioEventLoopGroup()); + bootstrap.childOption(ChannelOption.TCP_NODELAY, true); + bootstrap.channel(NioServerSocketChannel.class); + bootstrap.childHandler(new ChannelInitializer() { + @Override + public void initChannel(SocketChannel ch) throws Exception { + + ch.pipeline().addLast(new ServerMessageDecoder()); + ch.pipeline().addLast(new ServerMessageEncoder()); + ch.pipeline().addLast(new IdleStateHandler(READ_IDLE_TIME,WRITE_IDLE_TIME,0)); + ch.pipeline().addLast(CIMNioSocketAcceptor.this); + } + }); + + bootstrap.bind(port); + } + + + public void channelRegistered(ChannelHandlerContext ctx) { + logger.info("sessionCreated()... from "+ctx.channel().remoteAddress()+" nid:" + ctx.channel().id().asShortText()); + } + + protected void channelRead0(ChannelHandlerContext ctx, SentBody body) throws Exception { + + CIMSession cimSession =new CIMSession(ctx.channel()); + + CIMRequestHandler handler = handlers.get(body.getKey()); + if (handler == null) { + + ReplyBody reply = new ReplyBody(); + reply.setKey(body.getKey()); + reply.setCode(CIMConstant.ReturnCode.CODE_404); + reply.setMessage("KEY:"+body.getKey()+" not defined on server"); + cimSession.write(reply); + + } else { + ReplyBody reply = handler.process(cimSession, body); + if(reply!=null) + { + reply.setKey(body.getKey()); + cimSession.write(reply); + } + } + + + } + + /** + */ + public void channelInactive(ChannelHandlerContext ctx) throws Exception { + + CIMSession cimSession =new CIMSession(ctx.channel()); + + logger.warn("sessionClosed()... from "+ctx.channel().remoteAddress()+" nid:"+cimSession.getNid() +",isConnected:"+ctx.channel().isActive()); + CIMRequestHandler handler = handlers.get(CIMSESSION_CLOSED_HANDLER_KEY); + if(handler!=null) + { + handler.process(cimSession, null); + } + } + + /** + */ + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { + if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.WRITER_IDLE)) { + ctx.channel().attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_KEY)).set(System.currentTimeMillis()); + ctx.channel().writeAndFlush(HeartbeatRequest.getInstance()); + logger.debug(IdleState.WRITER_IDLE +"... from "+ctx.channel().remoteAddress()+" nid:" +ctx.channel().id().asShortText()); + + } + + //如果心跳请求发出30秒内没收到响应,则关闭连接 + if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.READER_IDLE)) + { + + logger.debug(IdleState.READER_IDLE +"... from "+ctx.channel().remoteAddress()+" nid:" +ctx.channel().id().asShortText()); + Long lastTime = (Long) ctx.channel().attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_KEY)).get(); + if(lastTime != null && System.currentTimeMillis() - lastTime >= PING_TIME_OUT) + { + ctx.channel().close(); + } + + ctx.channel().attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_KEY)).set(null); + } + } + + /** + */ + public void exceptionCaught( ChannelHandlerContext ctx, Throwable cause){ + + logger.error("exceptionCaught()... from "+ctx.channel().remoteAddress()+" isConnected:"+ctx.channel().isActive()+" nid:" +ctx.channel().id().asShortText(),cause); + ctx.channel().close(); + } + + + public void setPort(int port) { + this.port = port; + } + + public void setHandlers(HashMap handlers) { + this.handlers = handlers; + } + +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMRequestHandler.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMRequestHandler.java index 4dbcdd9..dbdd302 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMRequestHandler.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/CIMRequestHandler.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.handler; /** @@ -14,7 +29,7 @@ import com.farsunset.cim.sdk.server.model.ReplyBody; import com.farsunset.cim.sdk.server.model.SentBody; import com.farsunset.cim.sdk.server.session.CIMSession; -public interface CIMRequestHandler { +public interface CIMRequestHandler { - public abstract ReplyBody process(CIMSession session,SentBody message); -} \ No newline at end of file + ReplyBody process(CIMSession session,SentBody message); +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/FlashPolicyHandler.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/FlashPolicyHandler.java deleted file mode 100644 index 42bdd40..0000000 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/FlashPolicyHandler.java +++ /dev/null @@ -1,31 +0,0 @@ - /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.cim.sdk.server.handler; - -import com.farsunset.cim.sdk.server.constant.CIMConstant; -import com.farsunset.cim.sdk.server.model.ReplyBody; -import com.farsunset.cim.sdk.server.model.SentBody; -import com.farsunset.cim.sdk.server.session.CIMSession; - - -/** - *返回flash安全验证 - * - * @author - */ -public class FlashPolicyHandler implements CIMRequestHandler { - - - public ReplyBody process(CIMSession session, SentBody message) { - - session.write(CIMConstant.FLEX_POLICY_RESPONSE); - return null; - } - - - -} \ No newline at end of file diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/HeartbeatHandler.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/HeartbeatHandler.java index f78ecb3..2246103 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/HeartbeatHandler.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/handler/HeartbeatHandler.java @@ -1,9 +1,24 @@ - /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.handler; import com.farsunset.cim.sdk.server.model.ReplyBody; @@ -12,15 +27,12 @@ import com.farsunset.cim.sdk.server.session.CIMSession; /** - *客户端心跳实现 + *记录心跳实现 * - * @author */ public class HeartbeatHandler implements CIMRequestHandler { - public ReplyBody process(CIMSession session, SentBody message) { - //收到心跳响应,设置心跳时间 session.setHeartbeat(System.currentTimeMillis()); return null; @@ -28,4 +40,4 @@ public class HeartbeatHandler implements CIMRequestHandler { -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/launcher/CIMNioSocketAcceptor.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/launcher/CIMNioSocketAcceptor.java deleted file mode 100644 index 9a3a5ea..0000000 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/launcher/CIMNioSocketAcceptor.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.farsunset.cim.sdk.server.launcher; -import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.ChannelPipeline; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.SocketChannel; -import io.netty.channel.socket.nio.NioServerSocketChannel; -import io.netty.handler.codec.serialization.ClassResolvers; -import io.netty.handler.timeout.IdleState; -import io.netty.handler.timeout.IdleStateEvent; -import io.netty.handler.timeout.IdleStateHandler; -import io.netty.util.AttributeKey; - -import java.util.HashMap; - -import org.apache.log4j.Logger; - -import com.farsunset.cim.sdk.server.constant.CIMConstant; -import com.farsunset.cim.sdk.server.filter.ServerMessageDecoder; -import com.farsunset.cim.sdk.server.filter.ServerMessageEncoder; -import com.farsunset.cim.sdk.server.handler.CIMRequestHandler; -import com.farsunset.cim.sdk.server.model.ReplyBody; -import com.farsunset.cim.sdk.server.model.SentBody; -import com.farsunset.cim.sdk.server.session.CIMSession; - -@io.netty.channel.ChannelHandler.Sharable -public class CIMNioSocketAcceptor extends SimpleChannelInboundHandler{ - - protected final Logger logger = Logger.getLogger(CIMNioSocketAcceptor.class.getSimpleName()); - private HashMap handlers = new HashMap(); - - private int port; - //连接空闲时间 - public static final int READ_IDLE_TIME = 180;//秒 - - //连接空闲时间 - public static final int WRITE_IDLE_TIME = 150;//秒 - - public static final int PING_TIME_OUT = 30;//心跳响应 超时为30秒 - - - - public void bind() - { - new Thread(new Runnable(){ - @Override - public void run() { - EventLoopGroup bossGroup = new NioEventLoopGroup(); - EventLoopGroup workerGroup = new NioEventLoopGroup(); - try{ - ServerBootstrap bootstrap = new ServerBootstrap(); - bootstrap.group(bossGroup, workerGroup); - bootstrap.childOption(ChannelOption.TCP_NODELAY, true); - bootstrap.channel(NioServerSocketChannel.class); - bootstrap.childHandler(new ChannelInitializer() { - @Override - public void initChannel(SocketChannel ch) throws Exception { - ChannelPipeline pipeline = ch.pipeline(); - - pipeline.addLast(new ServerMessageDecoder(ClassResolvers.cacheDisabled(CIMNioSocketAcceptor.class.getClassLoader()))); - pipeline.addLast(new ServerMessageEncoder()); - pipeline.addLast(new IdleStateHandler(READ_IDLE_TIME,WRITE_IDLE_TIME,0)); - pipeline.addLast(CIMNioSocketAcceptor.this); - } - }); - - bootstrap.bind(port).sync().channel().closeFuture().sync(); - }catch(Exception e) - { - e.printStackTrace(); - } - finally { - workerGroup.shutdownGracefully(); - bossGroup.shutdownGracefully(); - } - } - }).start(); - } - - - @Override - public void channelRegistered( ChannelHandlerContext ctx) throws Exception { - logger.debug("channelRegistered()... from "+ctx.channel().remoteAddress()); - } - - - /** - */ - public void exceptionCaught( ChannelHandlerContext ctx, Throwable cause) - throws Exception { - logger.error(ctx.channel().remoteAddress()); - logger.error(cause); - } - - - /** - * 检测到连接空闲事件,发送心跳请求命令 - */ - @Override - public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { - - if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.WRITER_IDLE)) { - onWriterIdeled(ctx.channel()); - } - - //如果心跳请求发出30秒内没收到响应,则关闭连接 - if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.READER_IDLE)) - { - onReaderIdeled(ctx.channel()); - } - super.userEventTriggered(ctx, evt); - } - - - private void onWriterIdeled(Channel channel){ - channel.attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_KEY)).set(System.currentTimeMillis()); - channel.writeAndFlush(CIMConstant.CMD_HEARTBEAT_REQUEST); - } - - private void onReaderIdeled(Channel channel){ - Long lastTime = (Long) channel.attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_KEY)).get(); - if(lastTime != null && System.currentTimeMillis() - lastTime >= PING_TIME_OUT) - { - channel.close(); - } - - channel.attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_KEY)).set(null); - - } - - - protected void channelRead0(ChannelHandlerContext ctx, SentBody body) throws Exception { - - - - CIMSession cimSession =new CIMSession(ctx.channel()); - ReplyBody reply = new ReplyBody(); - String key = body.getKey(); - - CIMRequestHandler handler = handlers.get(key); - if (handler == null) { - reply.setCode(CIMConstant.ReturnCode.CODE_405); - reply.setCode("KEY ["+key+"] 服务端未定义"); - } else { - reply = handler.process(cimSession, body); - } - - if(reply!=null) - { - reply.setKey(key); - cimSession.write(reply); - } - - } - - @Override - public void channelInactive(ChannelHandlerContext ctx) throws Exception { - logger.warn(ctx.channel().remoteAddress()); - CIMRequestHandler handler = handlers.get(CIMConstant.RequestKey.KEY_CLIENT_CIMSESSION_CLOSED); - handler.process(new CIMSession(ctx.channel()), null); - } - - - public void setHandlers(HashMap handlers) { - this.handlers = handlers; - } - - public void setPort(int port) { - this.port = port; - } - -} \ No newline at end of file diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatRequest.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatRequest.java new file mode 100644 index 0000000..49a4cd0 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatRequest.java @@ -0,0 +1,62 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; +/** + * 服务端心跳请求 + * + */ +public class HeartbeatRequest implements Serializable,Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "SERVER_HEARTBEAT_REQUEST"; + private static final String CMD_HEARTBEAT_RESPONSE = "SR"; + + private static HeartbeatRequest object = new HeartbeatRequest(); + + private HeartbeatRequest(){ + + } + + public static HeartbeatRequest getInstance() { + return object; + } + + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString(){ + return TAG; + } + + + @Override + public byte getType() { + return CIMConstant.ProtobufType.S_H_RQ; + } + +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatResponse.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatResponse.java new file mode 100644 index 0000000..99b75f5 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/HeartbeatResponse.java @@ -0,0 +1,60 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model; + +import java.io.Serializable; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; + +/** + * 客户端心跳响应 + */ +public class HeartbeatResponse implements Serializable, Protobufable { + + private static final long serialVersionUID = 1L; + private static final String TAG = "CLIENT_HEARTBEAT_RESPONSE"; + private static final String CMD_HEARTBEAT_RESPONSE = "CR"; + private static HeartbeatResponse object = new HeartbeatResponse(); + + private HeartbeatResponse() { + + } + + public static HeartbeatResponse getInstance() { + return object; + } + + @Override + public byte[] getByteArray() { + return CMD_HEARTBEAT_RESPONSE.getBytes(); + } + + public String toString() { + return TAG; + } + + @Override + public byte getType() { + return CIMConstant.ProtobufType.C_H_RS; + } + +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java index a777a5e..6d50d7f 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Message.java @@ -1,16 +1,34 @@ /** - * probject:cim-server-sdk - * @version 2.1.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.model; import java.io.Serializable; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.model.proto.MessageProto; /** * 消息对象 */ -public class Message implements Serializable { +public class Message implements Serializable,Protobufable { private static final long serialVersionUID = 1L; @@ -24,13 +42,13 @@ public class Message implements Serializable { /** * 消息类型,用户自定义消息类别 */ - private String type; + private String action; /** * 消息标题 */ private String title; /** - * 消息类容,于type 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 + * 消息类容,于action 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 */ private String content; @@ -43,21 +61,16 @@ public class Message implements Serializable { */ private String receiver; - /** - * 文件 url - */ - private String file; - /** - * 文件类型 - */ - private String fileType; - /** * content 内容格式 */ - private String format = "txt"; + private String format; + + /** + * 附加内容 内容 + */ + private String extra; - private long timestamp; @@ -73,14 +86,14 @@ public class Message implements Serializable { this.timestamp = timestamp; } - public String getType() { - return type; - } + - public void setType(String type) { - this.type = type; + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; } - public String getTitle() { return title; } @@ -113,22 +126,7 @@ public class Message implements Serializable { this.receiver = receiver; } - public String getFile() { - return file; - } - - public void setFile(String file) { - this.file = file; - } - - public String getFileType() { - return fileType; - } - - public void setFileType(String fileType) { - this.fileType = fileType; - } - + public String getFormat() { return format; } @@ -137,56 +135,16 @@ public class Message implements Serializable { this.format = format; } - public String toString() { - - StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(mid).append(""); - - if (isNotEmpty(type)) { - buffer.append("").append(type).append(""); - } - - if (isNotEmpty(title)) { - buffer.append("").append(title).append(""); - } - if (isNotEmpty(content)) { - buffer.append(""); - } - - if (isNotEmpty(file)) { - buffer.append("").append(file).append(""); - } - - if (isNotEmpty(fileType)) { - buffer.append("").append(fileType).append(""); - } - - if (isNotEmpty(sender)) { - buffer.append("").append(sender).append(""); - } - - if (isNotEmpty(receiver)) { - buffer.append("").append(receiver).append(""); - } - - if (isNotEmpty(format)) { - buffer.append("").append(format).append(""); - } - - if (timestamp > 0) { - buffer.append("").append(timestamp).append(""); - } - - buffer.append(""); - return buffer.toString(); + + + public String getExtra() { + return extra; } - - public String toXmlString() { - - return toString(); + public void setExtra(String extra) { + this.extra = extra; } + + public String getMid() { return mid; @@ -195,10 +153,57 @@ public class Message implements Serializable { public void setMid(String mid) { this.mid = mid; } + + @Override + public String toString() { + + StringBuffer buffer = new StringBuffer(); + buffer.append("#Message#").append("\n"); + buffer.append("mid:").append(mid).append("\n"); + buffer.append("action:").append(action).append("\n"); + buffer.append("title:").append(title).append("\n"); + buffer.append("content:").append(content).append("\n"); + buffer.append("extra:").append(extra).append("\n"); + buffer.append("sender:").append(sender).append("\n"); + buffer.append("receiver:").append(receiver).append("\n"); + buffer.append("format:").append(format).append("\n"); + buffer.append("timestamp:").append(timestamp); + return buffer.toString(); + } public boolean isNotEmpty(String txt) { - return txt != null && txt.trim().length()>0; + return txt != null && txt.trim().length()!=0; + } + @Override + public byte[] getByteArray() { + MessageProto.Model.Builder builder = MessageProto.Model.newBuilder(); + builder.setMid(mid); + builder.setAction(action); + builder.setSender(sender); + builder.setReceiver(receiver); + builder.setTimestamp(timestamp); + + /** + * 下面字段可能为空 + */ + if(content!=null){ + builder.setContent(content); + } + if(title!=null){ + builder.setTitle(title); + } + if(extra!=null){ + builder.setExtra(extra); + } + if(format!=null){ + builder.setFormat(format); + } + return builder.build().toByteArray(); + } + @Override + public byte getType() { + return CIMConstant.ProtobufType.MESSAGE; } -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Protobufable.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Protobufable.java new file mode 100644 index 0000000..4adf021 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/Protobufable.java @@ -0,0 +1,31 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model; +/** + * 需要向另一端发送的结构体 + */ +public interface Protobufable { + + byte[] getByteArray(); + + byte getType(); +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/ReplyBody.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/ReplyBody.java index 050d57c..6208090 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/ReplyBody.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/ReplyBody.java @@ -1,18 +1,38 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import com.farsunset.cim.sdk.server.constant.CIMConstant; +import com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto; /** * 请求应答对象 * */ -public class ReplyBody implements Serializable { +public class ReplyBody implements Serializable ,Protobufable{ private static final long serialVersionUID = 1L; @@ -35,14 +55,13 @@ public class ReplyBody implements Serializable { /** * 返回数据集合 */ - private HashMap data; + private HashMap data = new HashMap(); private long timestamp; public ReplyBody() { - data = new HashMap(); timestamp = System.currentTimeMillis(); } public long getTimestamp() { @@ -64,9 +83,15 @@ public class ReplyBody implements Serializable { } public void put(String k, String v) { - data.put(k, v); + if(v!=null && k!=null){ + data.put(k, v); + } } + public void putAll(Map map) { + data.putAll(map); + } + public String get(String k) { return data.get(k); } @@ -83,8 +108,8 @@ public class ReplyBody implements Serializable { this.message = message; } - public HashMap getData() { - return data; + public Set getKeySet() { + return data.keySet(); } public String getCode() { @@ -95,30 +120,46 @@ public class ReplyBody implements Serializable { this.code = code; } - + @Override public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(this.getKey()).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append("").append(code).append(""); - buffer.append(""); - for(String key:this.getData().keySet()) - { - buffer.append("<"+key+">").append(this.get(key)).append(""); + buffer.append("#ReplyBody#").append("\n"); + buffer.append("key:").append(this.getKey()).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + buffer.append("code:").append(code).append("\n"); + + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); + return buffer.toString(); } - - - public String toXmlString() - { + @Override + public byte[] getByteArray() { + ReplyBodyProto.Model.Builder builder = ReplyBodyProto.Model.newBuilder(); + builder.setCode(code); + if(message!=null){ + builder.setMessage(message); + } + if(!data.isEmpty()){ + builder.putAllData(data); + } + builder.setKey(key); + builder.setTimestamp(timestamp); - return toString(); + return builder.build().toByteArray(); } + + @Override + public byte getType() { + // TODO Auto-generated method stub + return CIMConstant.ProtobufType.REPLYBODY; + } + } diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/SentBody.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/SentBody.java index cd5d2d1..7ec1664 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/SentBody.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/SentBody.java @@ -1,13 +1,30 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.model; import java.io.Serializable; import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * java |android 客户端请求结构 * @@ -18,16 +35,10 @@ public class SentBody implements Serializable { private String key; - private HashMap data; + private HashMap data = new HashMap(); private long timestamp; - public SentBody() { - - data = new HashMap(); - timestamp = System.currentTimeMillis(); - } - public String getKey() { return key; } @@ -48,37 +59,43 @@ public class SentBody implements Serializable { this.key = key; } - public void put(String k, String v) { - data.put(k, v); - } - + public void remove(String k) { data.remove(k); } - public HashMap getData() { - return data; + public void put(String k, String v) { + if(v!=null && k!=null){ + data.put(k, v); + } } - + + public void putAll(Map map) { + data.putAll(map); + } + + public Set getKeySet() { + return data.keySet(); + } + + @Override public String toString() { StringBuffer buffer = new StringBuffer(); - buffer.append(""); - buffer.append(""); - buffer.append("").append(key).append(""); - buffer.append("").append(timestamp).append(""); - buffer.append(""); - for (String key : data.keySet()) { - buffer.append("<" + key + ">").append(data.get(key)).append( - ""); + buffer.append("#SentBody#").append("\n");; + buffer.append("key:").append(key).append("\n"); + buffer.append("timestamp:").append(timestamp).append("\n"); + + if(!data.isEmpty()){ + buffer.append("data{").append("\n"); + for(String key:getKeySet()) + { + buffer.append(key).append(":").append(this.get(key)).append("\n"); + } + buffer.append("}"); } - buffer.append(""); - buffer.append(""); + return buffer.toString(); } - - public String toXmlString() { - - return toString(); - } + } diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto new file mode 100644 index 0000000..677e574 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/Message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.server.model.proto; +option java_outer_classname="MessageProto"; +message Model { + string mid = 1; + string action = 2; + string content = 3; + string sender = 4; + string receiver = 5; + string extra = 6; + string title = 7; + string format = 8; + int64 timestamp = 9; +} + \ No newline at end of file diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java new file mode 100644 index 0000000..1a73a9f --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/MessageProto.java @@ -0,0 +1,1603 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model.proto; + +public final class MessageProto { + private MessageProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string mid = 1; + */ + java.lang.String getMid(); + /** + * string mid = 1; + */ + com.google.protobuf.ByteString + getMidBytes(); + + /** + * string action = 2; + */ + java.lang.String getAction(); + /** + * string action = 2; + */ + com.google.protobuf.ByteString + getActionBytes(); + + /** + * string content = 3; + */ + java.lang.String getContent(); + /** + * string content = 3; + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + * string sender = 4; + */ + java.lang.String getSender(); + /** + * string sender = 4; + */ + com.google.protobuf.ByteString + getSenderBytes(); + + /** + * string receiver = 5; + */ + java.lang.String getReceiver(); + /** + * string receiver = 5; + */ + com.google.protobuf.ByteString + getReceiverBytes(); + + /** + * string extra = 6; + */ + java.lang.String getExtra(); + /** + * string extra = 6; + */ + com.google.protobuf.ByteString + getExtraBytes(); + + /** + * string title = 7; + */ + java.lang.String getTitle(); + /** + * string title = 7; + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string format = 8; + */ + java.lang.String getFormat(); + /** + * string format = 8; + */ + com.google.protobuf.ByteString + getFormatBytes(); + + /** + * int64 timestamp = 9; + */ + long getTimestamp(); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + mid_ = ""; + action_ = ""; + content_ = ""; + sender_ = ""; + receiver_ = ""; + extra_ = ""; + title_ = ""; + format_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + mid_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + sender_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + receiver_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + extra_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + format_ = s; + break; + } + case 72: { + + timestamp_ = input.readInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); + } + + public static final int MID_FIELD_NUMBER = 1; + private volatile java.lang.Object mid_; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_FIELD_NUMBER = 2; + private volatile java.lang.Object action_; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 3; + private volatile java.lang.Object content_; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SENDER_FIELD_NUMBER = 4; + private volatile java.lang.Object sender_; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECEIVER_FIELD_NUMBER = 5; + private volatile java.lang.Object receiver_; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTRA_FIELD_NUMBER = 6; + private volatile java.lang.Object extra_; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 7; + private volatile java.lang.Object title_; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 8; + private volatile java.lang.Object format_; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private long timestamp_; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getMidBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mid_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, action_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (!getSenderBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, extra_); + } + if (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, title_); + } + if (!getFormatBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, format_); + } + if (timestamp_ != 0L) { + output.writeInt64(9, timestamp_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMidBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mid_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, action_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (!getSenderBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sender_); + } + if (!getReceiverBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, receiver_); + } + if (!getExtraBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, extra_); + } + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, title_); + } + if (!getFormatBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, format_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, timestamp_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) obj; + + boolean result = true; + result = result && getMid() + .equals(other.getMid()); + result = result && getAction() + .equals(other.getAction()); + result = result && getContent() + .equals(other.getContent()); + result = result && getSender() + .equals(other.getSender()); + result = result && getReceiver() + .equals(other.getReceiver()); + result = result && getExtra() + .equals(other.getExtra()); + result = result && getTitle() + .equals(other.getTitle()); + result = result && getFormat() + .equals(other.getFormat()); + result = result && (getTimestamp() + == other.getTimestamp()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MID_FIELD_NUMBER; + hash = (53 * hash) + getMid().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SENDER_FIELD_NUMBER; + hash = (53 * hash) + getSender().hashCode(); + hash = (37 * hash) + RECEIVER_FIELD_NUMBER; + hash = (53 * hash) + getReceiver().hashCode(); + hash = (37 * hash) + EXTRA_FIELD_NUMBER; + hash = (53 * hash) + getExtra().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getFormat().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) + com.farsunset.cim.sdk.server.model.proto.MessageProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.class, com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + mid_ = ""; + + action_ = ""; + + content_ = ""; + + sender_ = ""; + + receiver_ = ""; + + extra_ = ""; + + title_ = ""; + + format_ = ""; + + timestamp_ = 0L; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model build() { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model buildPartial() { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model result = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(this); + result.mid_ = mid_; + result.action_ = action_; + result.content_ = content_; + result.sender_ = sender_; + result.receiver_ = receiver_; + result.extra_ = extra_; + result.title_ = title_; + result.format_ = format_; + result.timestamp_ = timestamp_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.server.model.proto.MessageProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.MessageProto.Model other) { + if (other == com.farsunset.cim.sdk.server.model.proto.MessageProto.Model.getDefaultInstance()) return this; + if (!other.getMid().isEmpty()) { + mid_ = other.mid_; + onChanged(); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getSender().isEmpty()) { + sender_ = other.sender_; + onChanged(); + } + if (!other.getReceiver().isEmpty()) { + receiver_ = other.receiver_; + onChanged(); + } + if (!other.getExtra().isEmpty()) { + extra_ = other.extra_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getFormat().isEmpty()) { + format_ = other.format_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.server.model.proto.MessageProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.server.model.proto.MessageProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object mid_ = ""; + /** + * string mid = 1; + */ + public java.lang.String getMid() { + java.lang.Object ref = mid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mid = 1; + */ + public com.google.protobuf.ByteString + getMidBytes() { + java.lang.Object ref = mid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mid = 1; + */ + public Builder setMid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mid_ = value; + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder clearMid() { + + mid_ = getDefaultInstance().getMid(); + onChanged(); + return this; + } + /** + * string mid = 1; + */ + public Builder setMidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mid_ = value; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * string action = 2; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string action = 2; + */ + public com.google.protobuf.ByteString + getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string action = 2; + */ + public Builder setAction( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * string action = 2; + */ + public Builder setActionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + * string content = 3; + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content = 3; + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content = 3; + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * string content = 3; + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object sender_ = ""; + /** + * string sender = 4; + */ + public java.lang.String getSender() { + java.lang.Object ref = sender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sender = 4; + */ + public com.google.protobuf.ByteString + getSenderBytes() { + java.lang.Object ref = sender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + sender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sender = 4; + */ + public Builder setSender( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sender_ = value; + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder clearSender() { + + sender_ = getDefaultInstance().getSender(); + onChanged(); + return this; + } + /** + * string sender = 4; + */ + public Builder setSenderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sender_ = value; + onChanged(); + return this; + } + + private java.lang.Object receiver_ = ""; + /** + * string receiver = 5; + */ + public java.lang.String getReceiver() { + java.lang.Object ref = receiver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + receiver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string receiver = 5; + */ + public com.google.protobuf.ByteString + getReceiverBytes() { + java.lang.Object ref = receiver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + receiver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string receiver = 5; + */ + public Builder setReceiver( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + receiver_ = value; + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder clearReceiver() { + + receiver_ = getDefaultInstance().getReceiver(); + onChanged(); + return this; + } + /** + * string receiver = 5; + */ + public Builder setReceiverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + receiver_ = value; + onChanged(); + return this; + } + + private java.lang.Object extra_ = ""; + /** + * string extra = 6; + */ + public java.lang.String getExtra() { + java.lang.Object ref = extra_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + extra_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string extra = 6; + */ + public com.google.protobuf.ByteString + getExtraBytes() { + java.lang.Object ref = extra_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + extra_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string extra = 6; + */ + public Builder setExtra( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + extra_ = value; + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder clearExtra() { + + extra_ = getDefaultInstance().getExtra(); + onChanged(); + return this; + } + /** + * string extra = 6; + */ + public Builder setExtraBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + extra_ = value; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * string title = 7; + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string title = 7; + */ + public com.google.protobuf.ByteString + getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 7; + */ + public Builder setTitle( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 7; + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private java.lang.Object format_ = ""; + /** + * string format = 8; + */ + public java.lang.String getFormat() { + java.lang.Object ref = format_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + format_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string format = 8; + */ + public com.google.protobuf.ByteString + getFormatBytes() { + java.lang.Object ref = format_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + format_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string format = 8; + */ + public Builder setFormat( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value; + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder clearFormat() { + + format_ = getDefaultInstance().getFormat(); + onChanged(); + return this; + } + /** + * string format = 8; + */ + public Builder setFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + format_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 9; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 9; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 9; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) + private static final com.farsunset.cim.sdk.server.model.proto.MessageProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.MessageProto.Model(); + } + + public static com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.server.model.proto.MessageProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rMessage.proto\022(com.farsunset.cim.sdk.s" + + "erver.model.proto\"\230\001\n\005Model\022\013\n\003mid\030\001 \001(\t" + + "\022\016\n\006action\030\002 \001(\t\022\017\n\007content\030\003 \001(\t\022\016\n\006sen" + + "der\030\004 \001(\t\022\020\n\010receiver\030\005 \001(\t\022\r\n\005extra\030\006 \001" + + "(\t\022\r\n\005title\030\007 \001(\t\022\016\n\006format\030\010 \001(\t\022\021\n\ttim" + + "estamp\030\t \001(\003B\016B\014MessageProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, + new java.lang.String[] { "Mid", "Action", "Content", "Sender", "Receiver", "Extra", "Title", "Format", "Timestamp", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBody.proto b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBody.proto new file mode 100644 index 0000000..8bc7102 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBody.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.server.model.proto; +option java_outer_classname="ReplyBodyProto"; + +message Model { + string key = 1; + string code = 2; + message = 3; + int64 timestamp =4; + map data =5; + +} + \ No newline at end of file diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBodyProto.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBodyProto.java new file mode 100644 index 0000000..f5c5262 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/ReplyBodyProto.java @@ -0,0 +1,1241 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model.proto; + +public final class ReplyBodyProto { + private ReplyBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * string code = 2; + */ + java.lang.String getCode(); + /** + * string code = 2; + */ + com.google.protobuf.ByteString + getCodeBytes(); + + /** + * string message = 3; + */ + java.lang.String getMessage(); + /** + * string message = 3; + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + * int64 timestamp = 4; + */ + long getTimestamp(); + + /** + * map<string, string> data = 5; + */ + int getDataCount(); + /** + * map<string, string> data = 5; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 5; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 5; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + code_ = ""; + message_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + code_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 32: { + + timestamp_ = input.readInt64(); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000010; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object code_; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 4; + private long timestamp_; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 5; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, code_); + } + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + if (timestamp_ != 0L) { + output.writeInt64(4, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 5); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!getCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, code_); + } + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model other = (com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && getCode() + .equals(other.getCode()); + result = result && getMessage() + .equals(other.getMessage()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.class, com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + code_ = ""; + + message_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model build() { + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model result = new com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.code_ = code_; + result.message_ = message_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + /** + * string code = 2; + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string code = 2; + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string code = 2; + */ + public Builder setCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value; + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder clearCode() { + + code_ = getDefaultInstance().getCode(); + onChanged(); + return this; + } + /** + * string code = 2; + */ + public Builder setCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + code_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * string message = 3; + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string message = 3; + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string message = 3; + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * string message = 3; + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 4; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 4; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 4; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 5; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 5; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 5; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 5; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) + private static final com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.server.model.proto.ReplyBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017ReplyBody.proto\022(com.farsunset.cim.sdk" + + ".server.model.proto\"\274\001\n\005Model\022\013\n\003key\030\001 \001" + + "(\t\022\014\n\004code\030\002 \001(\t\022\017\n\007message\030\003 \001(\t\022\021\n\ttim" + + "estamp\030\004 \001(\003\022G\n\004data\030\005 \003(\01329.com.farsuns" + + "et.cim.sdk.server.model.proto.Model.Data" + + "Entry\032+\n\tDataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" + + "\030\002 \001(\t:\0028\001B\020B\016ReplyBodyProtob\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Code", "Message", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBody.proto b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBody.proto new file mode 100644 index 0000000..68a645e --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBody.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.server.model.proto; +option java_outer_classname="SentBodyProto"; + +message Model { + string key = 1; + int64 timestamp =2; + map data =3; + +} + \ No newline at end of file diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBodyProto.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBodyProto.java new file mode 100644 index 0000000..d919ccc --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/model/proto/SentBodyProto.java @@ -0,0 +1,967 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ +package com.farsunset.cim.sdk.server.model.proto; + +public final class SentBodyProto { + private SentBodyProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.farsunset.cim.sdk.server.model.proto.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + */ + java.lang.String getKey(); + /** + * string key = 1; + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * int64 timestamp = 2; + */ + long getTimestamp(); + + /** + * map<string, string> data = 3; + */ + int getDataCount(); + /** + * map<string, string> data = 3; + */ + boolean containsData( + java.lang.String key); + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getData(); + /** + * map<string, string> data = 3; + */ + java.util.Map + getDataMap(); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * map<string, string> data = 3; + */ + + java.lang.String getDataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Model extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.farsunset.cim.sdk.server.model.proto.Model) + ModelOrBuilder { + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Model() { + key_ = ""; + timestamp_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 16: { + + timestamp_ = input.readInt64(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + data__ = input.readMessage( + DataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + data_.getMutableMap().put( + data__.getKey(), data__.getValue()); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + + public static final int DATA_FIELD_NUMBER = 3; + private static final class DataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (timestamp_ != 0L) { + output.writeInt64(2, timestamp_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetData(), + DataDefaultEntryHolder.defaultEntry, + 3); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, timestamp_); + } + for (java.util.Map.Entry entry + : internalGetData().getMap().entrySet()) { + com.google.protobuf.MapEntry + data__ = DataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, data__); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model)) { + return super.equals(obj); + } + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model other = (com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model) obj; + + boolean result = true; + result = result && getKey() + .equals(other.getKey()); + result = result && (getTimestamp() + == other.getTimestamp()); + result = result && internalGetData().equals( + other.internalGetData()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (!internalGetData().getMap().isEmpty()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.farsunset.cim.sdk.server.model.proto.Model} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.farsunset.cim.sdk.server.model.proto.Model) + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableData(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.class, com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.Builder.class); + } + + // Construct using com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + key_ = ""; + + timestamp_ = 0L; + + internalGetMutableData().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + } + + public com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.getDefaultInstance(); + } + + public com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model build() { + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model buildPartial() { + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model result = new com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.key_ = key_; + result.timestamp_ = timestamp_; + result.data_ = internalGetData(); + result.data_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model) { + return mergeFrom((com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model other) { + if (other == com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + internalGetMutableData().mergeFrom( + other.internalGetData()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * string key = 1; + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + * int64 timestamp = 2; + */ + public long getTimestamp() { + return timestamp_; + } + /** + * int64 timestamp = 2; + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + * int64 timestamp = 2; + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> data_; + private com.google.protobuf.MapField + internalGetData() { + if (data_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DataDefaultEntryHolder.defaultEntry); + } + return data_; + } + private com.google.protobuf.MapField + internalGetMutableData() { + onChanged();; + if (data_ == null) { + data_ = com.google.protobuf.MapField.newMapField( + DataDefaultEntryHolder.defaultEntry); + } + if (!data_.isMutable()) { + data_ = data_.copy(); + } + return data_; + } + + public int getDataCount() { + return internalGetData().getMap().size(); + } + /** + * map<string, string> data = 3; + */ + + public boolean containsData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetData().getMap().containsKey(key); + } + /** + * Use {@link #getDataMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getData() { + return getDataMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.util.Map getDataMap() { + return internalGetData().getMap(); + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> data = 3; + */ + + public java.lang.String getDataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetData().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearData() { + internalGetMutableData().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder removeData( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableData() { + return internalGetMutableData().getMutableMap(); + } + /** + * map<string, string> data = 3; + */ + public Builder putData( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableData().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> data = 3; + */ + + public Builder putAllData( + java.util.Map values) { + internalGetMutableData().getMutableMap() + .putAll(values); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:com.farsunset.cim.sdk.server.model.proto.Model) + } + + // @@protoc_insertion_point(class_scope:com.farsunset.cim.sdk.server.model.proto.Model) + private static final com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model(); + } + + public static com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.farsunset.cim.sdk.server.model.proto.SentBodyProto.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016SentBody.proto\022(com.farsunset.cim.sdk." + + "server.model.proto\"\235\001\n\005Model\022\013\n\003key\030\001 \001(" + + "\t\022\021\n\ttimestamp\030\002 \001(\003\022G\n\004data\030\003 \003(\01329.com" + + ".farsunset.cim.sdk.server.model.proto.Mo" + + "del.DataEntry\032+\n\tDataEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\t:\0028\001B\017B\rSentBodyProtob\006pro" + + "to3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor, + new java.lang.String[] { "Key", "Timestamp", "Data", }); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor = + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_descriptor.getNestedTypes().get(0); + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_farsunset_cim_sdk_server_model_proto_Model_DataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/CIMSession.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/CIMSession.java index b3564b4..450ccac 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/CIMSession.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/CIMSession.java @@ -1,22 +1,35 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.session; -import io.netty.channel.Channel; -import io.netty.util.AttributeKey; - import java.io.Serializable; import java.net.InetAddress; import java.net.SocketAddress; import java.net.UnknownHostException; - - import com.farsunset.cim.sdk.server.constant.CIMConstant; +import io.netty.channel.Channel; +import io.netty.util.AttributeKey; + /** * Channel包装类,集群时 将此对象存入表中 */ @@ -60,7 +73,7 @@ public class CIMSession implements Serializable{ private int status;// 状态 public CIMSession(Channel session) { this.session = session; - this.nid = session.id().asLongText(); + this.nid = session.id().asShortText(); } public CIMSession() @@ -219,7 +232,9 @@ public class CIMSession implements Serializable{ setAttribute("host", host); } - + public void setChannel(Channel session) { + this.session = session; + } public int getApnsAble() { @@ -261,7 +276,7 @@ public class CIMSession implements Serializable{ public void removeAttribute(String key) { if(session!=null) - session.attr(AttributeKey.valueOf(key)).remove(); + session.attr(AttributeKey.valueOf(key)).set(null);; } public SocketAddress getRemoteAddress() { @@ -280,7 +295,7 @@ public class CIMSession implements Serializable{ } public boolean isConnected() { - if(session != null && isLocalhost()) + if(session != null) { return session.isActive(); } @@ -308,18 +323,10 @@ public class CIMSession implements Serializable{ public void closeNow() { - closeOnFlush(); + if(session!=null) + session.close(); } - public void closeOnFlush() { - if(session!=null){ - session.disconnect(); - session.close(); - } - - } - - public void setPackageName(String packageName) { this.packageName = packageName; setAttribute("packageName", apnsAble); @@ -328,16 +335,18 @@ public class CIMSession implements Serializable{ public String getPackageName() { return packageName; } + + + public int hashCode(){ + + return (deviceId + nid + host).hashCode(); + } + public boolean equals(Object o) { - if (o instanceof CIMSession) { - - CIMSession t = (CIMSession) o; - if(t.deviceId!=null && deviceId!=null) - { - return t.deviceId.equals(deviceId) && t.nid == nid && t.host.equals(host); - } - } + if(o instanceof CIMSession){ + return hashCode() == o.hashCode(); + } return false; } @@ -359,15 +368,6 @@ public class CIMSession implements Serializable{ return !fromOtherDevice(o); } - public void setChannel(Channel session) { - this.session = session; - } - - public Channel getSession() { - return session; - } - - public String toString() { @@ -392,4 +392,4 @@ public class CIMSession implements Serializable{ -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/DefaultSessionManager.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/DefaultSessionManager.java index 335d585..b5ff727 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/DefaultSessionManager.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/DefaultSessionManager.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.session; import java.util.ArrayList; import java.util.HashMap; @@ -29,11 +44,11 @@ public class DefaultSessionManager implements SessionManager{ /** * */ - public void add(String account,CIMSession session) { + public void add(CIMSession session) { if(session!=null) { - session.setAttribute(CIMConstant.SESSION_KEY, account); - sessions.put(account, session); + session.setAttribute(CIMConstant.SESSION_KEY, session.getAccount()); + sessions.put(session.getAccount(), session); connectionsCounter.incrementAndGet(); } @@ -50,9 +65,9 @@ public class DefaultSessionManager implements SessionManager{ public List queryAll() { - List list = new ArrayList(); - list.addAll(sessions.values()); - return list; + List list = new ArrayList(); + list.addAll(sessions.values()); + return list; } public void remove(CIMSession session) { @@ -74,37 +89,10 @@ public class DefaultSessionManager implements SessionManager{ return sessions.containsKey(account); } - - public String getAccount(CIMSession ios) - { - if(ios.getAttribute(CIMConstant.SESSION_KEY)==null) - { - for(String key:sessions.keySet()) - { - if(sessions.get(key).equals(ios) || sessions.get(key).getGid()==ios.getGid()) - { - return key; - } - } - }else - { - return ios.getAttribute(CIMConstant.SESSION_KEY).toString(); - } - - return null; - } - @Override public void update(CIMSession session) { sessions.put(session.getAccount(), session); } - - - @Override - public void setState(String account,int state) { - sessions.get(account).setStatus(state); - } - } diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/SessionManager.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/SessionManager.java index a46e32b..2fe0959 100644 --- a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/SessionManager.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/sdk/server/session/SessionManager.java @@ -1,9 +1,24 @@ /** - * probject:cim-server-sdk - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.sdk.server.session; import java.util.List; @@ -20,7 +35,7 @@ public interface SessionManager { /** * 添加新的session */ - public void add(String account,CIMSession session); + public void add(CIMSession session); /** * 更新session @@ -47,9 +62,4 @@ public interface SessionManager { */ public void remove(String account); - /** - * 设置session失效 - * @param session - */ - public void setState(String account,int state); -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-server/.classpath b/cim_for_netty/cim-server/.classpath index 47a962e..0d97d57 100644 --- a/cim_for_netty/cim-server/.classpath +++ b/cim_for_netty/cim-server/.classpath @@ -2,49 +2,17 @@ - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/cim_for_netty/cim-server/.mymetadata b/cim_for_netty/cim-server/.mymetadata deleted file mode 100644 index 576f422..0000000 --- a/cim_for_netty/cim-server/.mymetadata +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/cim_for_netty/cim-server/.project b/cim_for_netty/cim-server/.project index 96180f8..1f42254 100644 --- a/cim_for_netty/cim-server/.project +++ b/cim_for_netty/cim-server/.project @@ -5,33 +5,13 @@ - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder - - - org.eclipse.jdt.core.javabuilder - com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator - - - - - com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator + org.eclipse.wst.common.project.facet.core.builder @@ -40,19 +20,12 @@ - - com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder - - - org.eclipse.jem.workbench.JavaEMFNature - com.genuitec.eclipse.ast.deploy.core.deploymentnature - com.genuitec.eclipse.j2eedt.core.webnature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature org.eclipse.wst.jsdt.core.jsNature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.common.modulecore.ModuleCoreNature diff --git a/cim_for_netty/cim-server/.settings/.jsdtscope b/cim_for_netty/cim-server/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ b/cim_for_netty/cim-server/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/cim_for_netty/cim-server/.settings/org.eclipse.core.resources.prefs b/cim_for_netty/cim-server/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index be1ca8f..0000000 --- a/cim_for_netty/cim-server/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Mon Sep 15 17:02:27 CST 2014 -eclipse.preferences.version=1 -encoding//WebRoot/console/webclient/cim.js=UTF-8 -encoding//src/main/java/com/farsunset/ichat/api/action/MessageAction.java=gbk -encoding/=UTF-8 diff --git a/cim_for_netty/cim-server/.settings/org.eclipse.jdt.core.prefs b/cim_for_netty/cim-server/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/cim_for_netty/cim-server/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/cim_for_netty/cim-server/.settings/org.eclipse.wst.common.component b/cim_for_netty/cim-server/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..ea3a893 --- /dev/null +++ b/cim_for_netty/cim-server/.settings/org.eclipse.wst.common.component @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/cim_for_netty/cim-server/.settings/org.eclipse.wst.common.project.facet.core.xml b/cim_for_netty/cim-server/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..2ccaeb9 --- /dev/null +++ b/cim_for_netty/cim-server/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/cim_for_netty/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.container b/cim_for_netty/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/cim_for_netty/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/cim_for_netty/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.name b/cim_for_netty/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/cim_for_netty/cim-server/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/cim_for_netty/cim-server/WebRoot/META-INF/MANIFEST.MF b/cim_for_netty/cim-server/WebContent/META-INF/MANIFEST.MF similarity index 100% rename from cim_for_netty/cim-server/WebRoot/META-INF/MANIFEST.MF rename to cim_for_netty/cim-server/WebContent/META-INF/MANIFEST.MF diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.aop-3.0.2.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.aop-3.0.2.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.aop-3.0.2.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.aop-3.0.2.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.transaction-3.0.2.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.transaction-3.0.2.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.transaction-3.0.2.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.transaction-3.0.2.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/antlr-2.7.6.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/antlr-2.7.6.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/antlr-2.7.6.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/antlr-2.7.6.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/asm.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/asm.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/asm.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/asm.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/aspectjweaver.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/aspectjweaver.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/aspectjweaver.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/aspectjweaver.jar diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/cim-server-sdk-3.0.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/cim-server-sdk-3.0.jar new file mode 100644 index 0000000..1b93ff5 Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/cim-server-sdk-3.0.jar differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-io-2.4.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/commons-io-2.4.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-io-2.4.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/commons-io-2.4.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-lang-2.3.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/commons-lang-2.3.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-lang-2.3.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/commons-lang-2.3.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/commons-logging-1.0.4.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/commons-logging-1.0.4.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/freemarker-2.3.15.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/freemarker-2.3.15.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/freemarker-2.3.15.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/freemarker-2.3.15.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/gson-2.1.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/gson-2.1.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/gson-2.1.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/gson-2.1.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/httpclient-4.3.4.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/httpclient-4.3.4.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/httpclient-4.3.4.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/httpclient-4.3.4.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/httpcore-4.3.2.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/httpcore-4.3.2.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/jstl-1.2.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/jstl-1.2.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/jstl-1.2.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/jstl-1.2.jar diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/log4j.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/log4j.jar new file mode 100644 index 0000000..69b0005 Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/log4j.jar differ diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-buffer-4.1.9.Final.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-buffer-4.1.9.Final.jar new file mode 100644 index 0000000..31d9a48 Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-buffer-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-codec-4.1.9.Final.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-codec-4.1.9.Final.jar new file mode 100644 index 0000000..7c1717c Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-codec-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-common-4.1.9.Final.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-common-4.1.9.Final.jar new file mode 100644 index 0000000..e38f723 Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-common-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-handler-4.1.9.Final.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-handler-4.1.9.Final.jar new file mode 100644 index 0000000..1498d27 Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-handler-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-resolver-4.1.9.Final.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-resolver-4.1.9.Final.jar new file mode 100644 index 0000000..7d83091 Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-resolver-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-transport-4.1.9.Final.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-transport-4.1.9.Final.jar new file mode 100644 index 0000000..0cc8904 Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/netty-transport-4.1.9.Final.jar differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/ognl-2.7.3.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/ognl-2.7.3.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/ognl-2.7.3.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/ognl-2.7.3.jar diff --git a/cim_for_netty/cim-server/WebContent/WEB-INF/lib/protobuf-java-3.2.0.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/protobuf-java-3.2.0.jar new file mode 100644 index 0000000..b1f9701 Binary files /dev/null and b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/protobuf-java-3.2.0.jar differ diff --git a/cim_for_mina/client-mchat-android/libs/slf4j-api-1.7.5.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/slf4j-api-1.7.5.jar similarity index 100% rename from cim_for_mina/client-mchat-android/libs/slf4j-api-1.7.5.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/slf4j-api-1.7.5.jar diff --git a/cim_for_mina/client-mchat-android/libs/slf4j-nop-1.7.5.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/slf4j-nop-1.7.5.jar similarity index 100% rename from cim_for_mina/client-mchat-android/libs/slf4j-nop-1.7.5.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/slf4j-nop-1.7.5.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/spring-context-support.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/spring-context-support.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/spring-context-support.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/spring-context-support.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/struts2-core-2.1.8.1.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/struts2-core-2.1.8.1.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/xstream-1.3.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/xstream-1.3.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/xstream-1.3.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/xstream-1.3.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar b/cim_for_netty/cim-server/WebContent/WEB-INF/lib/xwork-core-2.1.6.jar similarity index 100% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar rename to cim_for_netty/cim-server/WebContent/WEB-INF/lib/xwork-core-2.1.6.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/web.xml b/cim_for_netty/cim-server/WebContent/WEB-INF/web.xml similarity index 97% rename from cim_for_netty/cim-server/WebRoot/WEB-INF/web.xml rename to cim_for_netty/cim-server/WebContent/WEB-INF/web.xml index 219d911..00c3ab1 100644 --- a/cim_for_netty/cim-server/WebRoot/WEB-INF/web.xml +++ b/cim_for_netty/cim-server/WebContent/WEB-INF/web.xml @@ -2,7 +2,7 @@ - ichat + cim-server diff --git a/cim_for_netty/cim-server/WebRoot/console/header.jsp b/cim_for_netty/cim-server/WebContent/console/header.jsp similarity index 100% rename from cim_for_netty/cim-server/WebRoot/console/header.jsp rename to cim_for_netty/cim-server/WebContent/console/header.jsp diff --git a/cim_for_netty/cim-server/WebRoot/console/index.jsp b/cim_for_netty/cim-server/WebContent/console/index.jsp similarity index 100% rename from cim_for_netty/cim-server/WebRoot/console/index.jsp rename to cim_for_netty/cim-server/WebContent/console/index.jsp diff --git a/cim_for_netty/cim-server/WebRoot/console/nav.jsp b/cim_for_netty/cim-server/WebContent/console/nav.jsp similarity index 59% rename from cim_for_netty/cim-server/WebRoot/console/nav.jsp rename to cim_for_netty/cim-server/WebContent/console/nav.jsp index 3a606c0..35fa388 100644 --- a/cim_for_netty/cim-server/WebRoot/console/nav.jsp +++ b/cim_for_netty/cim-server/WebContent/console/nav.jsp @@ -8,15 +8,7 @@
      - -
    • - - -
    • -
    • +
    • 在线用户 diff --git a/cim_for_netty/cim-server/WebRoot/console/session/manage.jsp b/cim_for_netty/cim-server/WebContent/console/session/manage.jsp similarity index 99% rename from cim_for_netty/cim-server/WebRoot/console/session/manage.jsp rename to cim_for_netty/cim-server/WebContent/console/session/manage.jsp index 3b648e1..85dacaa 100644 --- a/cim_for_netty/cim-server/WebRoot/console/session/manage.jsp +++ b/cim_for_netty/cim-server/WebContent/console/session/manage.jsp @@ -39,7 +39,7 @@ return; } showProcess('正在发送,请稍后......'); - $.post("<%=basePath%>/cgi/message_send.action", {content:message,type:2,sender:'system',receiver:account}, + $.post("<%=basePath%>/cgi/message_send.action", {content:message,action:2,sender:'system',receiver:account}, function(data){ hideProcess(); diff --git a/cim_for_netty/cim-server/WebRoot/index.jsp b/cim_for_netty/cim-server/WebContent/index.jsp similarity index 100% rename from cim_for_netty/cim-server/WebRoot/index.jsp rename to cim_for_netty/cim-server/WebContent/index.jsp diff --git a/cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/css/bootstrap.min.css b/cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/css/bootstrap.min.css similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/css/bootstrap.min.css rename to cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/css/bootstrap.min.css diff --git a/cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot b/cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot rename to cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot diff --git a/cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg b/cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg rename to cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg diff --git a/cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf b/cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf rename to cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf diff --git a/cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff b/cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff rename to cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff diff --git a/cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 b/cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 rename to cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2 diff --git a/cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/js/bootstrap.min.js b/cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/js/bootstrap.min.js similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/js/bootstrap.min.js rename to cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/js/bootstrap.min.js diff --git a/cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/js/npm.js b/cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/js/npm.js similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/bootstrap-3.3.6-dist/js/npm.js rename to cim_for_netty/cim-server/WebContent/resource/bootstrap-3.3.6-dist/js/npm.js diff --git a/cim_for_netty/cim-server/WebRoot/resource/css/base-ui.css b/cim_for_netty/cim-server/WebContent/resource/css/base-ui.css similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/css/base-ui.css rename to cim_for_netty/cim-server/WebContent/resource/css/base-ui.css diff --git a/cim_for_netty/cim-server/WebRoot/resource/css/dialog.css b/cim_for_netty/cim-server/WebContent/resource/css/dialog.css similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/css/dialog.css rename to cim_for_netty/cim-server/WebContent/resource/css/dialog.css diff --git a/cim_for_netty/cim-server/WebRoot/resource/css/login.css b/cim_for_netty/cim-server/WebContent/resource/css/login.css similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/css/login.css rename to cim_for_netty/cim-server/WebContent/resource/css/login.css diff --git a/cim_for_netty/cim-server/WebRoot/resource/css/main-layout.css b/cim_for_netty/cim-server/WebContent/resource/css/main-layout.css similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/css/main-layout.css rename to cim_for_netty/cim-server/WebContent/resource/css/main-layout.css diff --git a/cim_for_netty/cim-server/WebRoot/resource/css/table.css b/cim_for_netty/cim-server/WebContent/resource/css/table.css similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/css/table.css rename to cim_for_netty/cim-server/WebContent/resource/css/table.css diff --git a/cim_for_netty/cim-server/WebRoot/resource/css/webbase.css b/cim_for_netty/cim-server/WebContent/resource/css/webbase.css similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/css/webbase.css rename to cim_for_netty/cim-server/WebContent/resource/css/webbase.css diff --git a/cim_for_netty/cim-server/WebRoot/resource/img/icon.png b/cim_for_netty/cim-server/WebContent/resource/img/icon.png similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/img/icon.png rename to cim_for_netty/cim-server/WebContent/resource/img/icon.png diff --git a/cim_for_netty/cim-server/WebRoot/resource/img/icon_loading_small.gif b/cim_for_netty/cim-server/WebContent/resource/img/icon_loading_small.gif similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/img/icon_loading_small.gif rename to cim_for_netty/cim-server/WebContent/resource/img/icon_loading_small.gif diff --git a/cim_for_netty/cim-server/WebRoot/resource/img/pattern.png b/cim_for_netty/cim-server/WebContent/resource/img/pattern.png similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/img/pattern.png rename to cim_for_netty/cim-server/WebContent/resource/img/pattern.png diff --git a/cim_for_netty/cim-server/WebRoot/resource/js/framework.js b/cim_for_netty/cim-server/WebContent/resource/js/framework.js similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/js/framework.js rename to cim_for_netty/cim-server/WebContent/resource/js/framework.js diff --git a/cim_for_netty/cim-server/WebRoot/resource/js/jquery-2.2.3.min.js b/cim_for_netty/cim-server/WebContent/resource/js/jquery-2.2.3.min.js similarity index 100% rename from cim_for_netty/cim-server/WebRoot/resource/js/jquery-2.2.3.min.js rename to cim_for_netty/cim-server/WebContent/resource/js/jquery-2.2.3.min.js diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/log4j.properties b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/log4j.properties deleted file mode 100644 index b883399..0000000 --- a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/log4j.properties +++ /dev/null @@ -1,13 +0,0 @@ -log4j.rootLogger=info,console, file - -#----------console---------------- -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.Target=System.out -log4j.appender.console.layout.ConversionPattern=%C.%M() %p %d{yyyy-MM-dd HH:mm:ss}%n%m%n--------------------------------------------------------------------------------------------------------------------------%n -#----------file---------------- -log4j.appender.file=org.apache.log4j.FileAppender -log4j.appender.file.File=cim.log -log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%C.%M() %p %d{yyyy-MM-dd HH:mm:ss}%n%m%n--------------------------------------------------------------------------------------------------------------------------%n - diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-cim.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-cim.xml deleted file mode 100644 index 7748d3d..0000000 --- a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-cim.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-config.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-config.xml deleted file mode 100644 index de92bdb..0000000 --- a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-push.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-push.xml deleted file mode 100644 index d4eab02..0000000 --- a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-push.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/struts.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/struts.xml deleted file mode 100644 index f8f7936..0000000 --- a/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/struts.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - /console/session/manage.jsp - - - - - - - \ No newline at end of file diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/cim-server-sdk-2.2.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/cim-server-sdk-2.2.jar deleted file mode 100644 index 84da062..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/cim-server-sdk-2.2.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-buffer-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-buffer-4.1.0.CR7.jar deleted file mode 100644 index b850bdf..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-buffer-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-4.1.0.CR7.jar deleted file mode 100644 index d0092b7..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-memcache-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-memcache-4.1.0.CR7.jar deleted file mode 100644 index dd62cc8..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-memcache-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-socks-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-socks-4.1.0.CR7.jar deleted file mode 100644 index 6809c72..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-codec-socks-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-common-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-common-4.1.0.CR7.jar deleted file mode 100644 index 606e920..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-common-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-handler-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-handler-4.1.0.CR7.jar deleted file mode 100644 index 066c370..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-handler-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-handler-proxy-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-handler-proxy-4.1.0.CR7.jar deleted file mode 100644 index deaba24..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-handler-proxy-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-resolver-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-resolver-4.1.0.CR7.jar deleted file mode 100644 index 7c90d37..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-resolver-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-transport-4.1.0.CR7.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-transport-4.1.0.CR7.jar deleted file mode 100644 index 7dafa07..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-transport-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar deleted file mode 100644 index 8766455..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar deleted file mode 100644 index e55bdd8..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/console/webclient/CIMBridge.swf b/cim_for_netty/cim-server/WebRoot/console/webclient/CIMBridge.swf deleted file mode 100644 index 624ae51..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/console/webclient/CIMBridge.swf and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/console/webclient/LoginDialog.jsp b/cim_for_netty/cim-server/WebRoot/console/webclient/LoginDialog.jsp deleted file mode 100644 index 6e3f74c..0000000 --- a/cim_for_netty/cim-server/WebRoot/console/webclient/LoginDialog.jsp +++ /dev/null @@ -1,44 +0,0 @@ - <%@ page language="java" pageEncoding="utf-8"%> - <% - String loginBasePath = request.getScheme() + "://" - + request.getServerName() + ":" + request.getServerPort() - + request.getContextPath(); - - %> - - - - \ No newline at end of file diff --git a/cim_for_netty/cim-server/WebRoot/console/webclient/MessageDialog.jsp b/cim_for_netty/cim-server/WebRoot/console/webclient/MessageDialog.jsp deleted file mode 100644 index cb6fd4b..0000000 --- a/cim_for_netty/cim-server/WebRoot/console/webclient/MessageDialog.jsp +++ /dev/null @@ -1,19 +0,0 @@ - <%@ page language="java" pageEncoding="utf-8"%> - - \ No newline at end of file diff --git a/cim_for_netty/cim-server/WebRoot/console/webclient/cim.js b/cim_for_netty/cim-server/WebRoot/console/webclient/cim.js deleted file mode 100644 index 66eb45f..0000000 --- a/cim_for_netty/cim-server/WebRoot/console/webclient/cim.js +++ /dev/null @@ -1,5 +0,0 @@ -var CIM_HOST="127.0.0.1";//修改为服务器的真实IP -var CIM_PORT=23456;//修改为服务器的真实IP - -var ACCOUNT; - \ No newline at end of file diff --git a/cim_for_netty/cim-server/WebRoot/console/webclient/dingdong.mp3 b/cim_for_netty/cim-server/WebRoot/console/webclient/dingdong.mp3 deleted file mode 100644 index 5f15ae7..0000000 Binary files a/cim_for_netty/cim-server/WebRoot/console/webclient/dingdong.mp3 and /dev/null differ diff --git a/cim_for_netty/cim-server/WebRoot/console/webclient/main.jsp b/cim_for_netty/cim-server/WebRoot/console/webclient/main.jsp deleted file mode 100644 index b252aa8..0000000 --- a/cim_for_netty/cim-server/WebRoot/console/webclient/main.jsp +++ /dev/null @@ -1,125 +0,0 @@ -<%@ page language="java" pageEncoding="utf-8"%> -<% - String path = request.getContextPath(); - String basePath = request.getScheme() + "://" - + request.getServerName() + ":" + request.getServerPort() - + path; -%> - - - - - - -CIM for Web - - - - - - - - - - - - - - - - - - - - -<%@include file="LoginDialog.jsp"%> -<%@include file="MessageDialog.jsp"%> - - \ No newline at end of file diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java index 2e9419b..9edc18e 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.admin.action; @@ -12,6 +27,7 @@ import java.io.IOException; import org.apache.struts2.ServletActionContext; import com.farsunset.cim.push.SystemMessagePusher; +import com.farsunset.cim.sdk.server.constant.CIMConstant; import com.farsunset.cim.sdk.server.model.Message; import com.farsunset.cim.sdk.server.session.DefaultSessionManager; import com.farsunset.cim.util.ContextHolder; @@ -39,7 +55,7 @@ public class SessionAction extends ActionSupport { String account = ServletActionContext.getRequest().getParameter("account"); Message msg = new Message(); - msg.setType("999");//强行下线消息类型 + msg.setAction(CIMConstant.MessageAction.ACTION_999);//强行下线消息类型 msg.setReceiver(account); //向客户端 发送消息 diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java index cae3ec3..e84f2c8 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.api.action; import java.util.HashMap; @@ -51,7 +66,7 @@ public class MessageAction extends ActionSupport implements ModelDriven list = messageService.queryOffLineMessages(account); - List list = new ArrayList(); - for (Message m : list) { - - ios.write(m); - } - - } catch (Exception e) { - reply.setCode(CIMConstant.ReturnCode.CODE_500); - e.printStackTrace(); - logger.error("拉取离线消息失败", e); - } - return reply; - } -} \ No newline at end of file diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java index bb698e1..0336277 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.handler; import org.apache.log4j.Logger; @@ -25,22 +40,19 @@ public class SessionClosedHandler implements CIMRequestHandler { protected final Logger logger = Logger.getLogger(SessionClosedHandler.class); public ReplyBody process(CIMSession ios, SentBody message) { - - Object account =ios.getAttribute(CIMConstant.SESSION_KEY); - if(account==null){ - return null; - } - + Object account =ios.getAttribute(CIMConstant.SESSION_KEY); + if(account == null){ + return null; + } DefaultSessionManager sessionManager = ((DefaultSessionManager) ContextHolder.getBean("CIMSessionManager")); ios.removeAttribute(CIMConstant.SESSION_KEY); - ios.closeNow(); sessionManager.remove(account.toString()); - + return null; } -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java index 7d95633..ee8a8a8 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java @@ -1,9 +1,24 @@ - /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.push; import com.farsunset.cim.sdk.server.model.Message; diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java index 147f4ba..04fc363 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java @@ -1,20 +1,30 @@ - /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.push; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import com.farsunset.cim.sdk.server.model.Message; import com.farsunset.cim.sdk.server.session.CIMSession; import com.farsunset.cim.sdk.server.session.DefaultSessionManager; - - /** * 消息发送实现类 * @@ -22,8 +32,6 @@ import com.farsunset.cim.sdk.server.session.DefaultSessionManager; public class DefaultMessagePusher implements CIMMessagePusher { - private final Log log = LogFactory.getLog(getClass()); - private DefaultSessionManager sessionManager; @@ -38,94 +46,51 @@ public class DefaultMessagePusher implements CIMMessagePusher { public void push(Message msg) { CIMSession session = sessionManager.get(msg.getReceiver()); - /*服务器集群时,可以在此 判断当前session是否连接于本台服务器,如果是,继续往下走,如果不是,将此消息发往当前session连接的服务器并 return - if(!session.isLocalhost()){//判断当前session是否连接于本台服务器,如不是 - - MessageDispatcher.execute(msg, session.getHost()); - return; - } - */ - + /* + * 服务器集群时,可以在此 + * 判断当前session是否连接于本台服务器,如果是,继续往下走,如果不是,将此消息发往当前session连接的服务器并 return + * if(session!=null&&!session.isLocalhost()){//判断当前session是否连接于本台服务器,如不是 + * //发往目标服务器处理 + * MessageDispatcher.execute(MessageUtil.transform(msg),session.getHost()); + * return; + * } + */ + if (session != null && session.isConnected()) { - - /*//如果用户标示了DeviceToken 且 需要后台推送(Pushable=1) 说明这是ios设备需要使用anps发送 - - if(StringUtil.isNotEmpty(session.getDeviceToken())&&session.getPushable()==User.PUSHABLE) - { - try { - deliverByANPS(msg,session.getDeviceToken()); - msg.setStatus(Message.STATUS_SEND); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - msg.setStatus(Message.STATUS_NOT_SEND); - } - }else - { - - //推送消息 - session.deliver(MessageUtil.transform(msg)); - }*/ - - //推送消息 - session.write(msg); - - }else{ - - /*User target = ((UserService)ContextHolder.getBean("userServiceImpl")).getUserByAccount(msg.getReceiver()); - //如果用户标示了DeviceToken 且 需要后台推送(Pushable=1) 说明这是ios设备需要使用anps发送 - if(StringUtil.isNotEmpty(target.getDeviceToken())&&target.getPushable()==User.PUSHABLE) - { - try { - deliverByANPS(msg,target.getDeviceToken()); - msg.setStatus(Message.STATUS_SEND); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - msg.setStatus(Message.STATUS_NOT_SEND); - } - - } */ - //未发送 + session.write(msg); + return; } - try{ - //可以在这保存消息到数据库 - //((MessageService)ContextHolder.getBean("messageServiceImpl")).save(msg); - }catch(Exception e){ - log.warn(" Messages insert to database failure!!"); + + // 如果用户标示了APNS ON 说明这是ios设备需要使用apns发送 + if (session != null && session.getApnsAble() == CIMSession.APNS_ON) { + + apnsPush(1,msg.getContent(),session.getDeviceId()); } + } - -/* public void deliverByANPS(Message msg,String deviceToken) throws Exception { + /** + * 引入javaapns相关jar + * @param badge + * @param content + * @param token + */ + private void apnsPush(int badge,String content,String token){ + /*String password = "password"; + String keystore = "p12 文件 绝对路径"; + boolean isDebug = true; - - - String alert = getMessageTile(msg); - // 被推送的iphone应用程序标示符 - PayLoad payLoad = new PayLoad(); - payLoad.addAlert(alert); - payLoad.addBadge(1); - payLoad.addSound("default"); - PushNotificationManager pushManager = PushNotificationManager.getInstance(); - pushManager.addDevice(deviceToken, deviceToken); - String host = ConfigManager.getInstance().get("apple.anps.host"); // 测试用的苹果推送服务器 - int port = Integer.parseInt(ConfigManager.getInstance().get("apple.anps.port")); - - String password = ConfigManager.getInstance().get("apple.anps.p12.password"); - String p12File = ConfigManager.getInstance().get("apple.anps.p12.file"); - pushManager.initializeConnection(host, port,this.getClass().getClassLoader().getResourceAsStream(p12File), password, - SSLConnectionHelper.KEYSTORE_TYPE_PKCS12); + PushNotificationPayload payload = PushNotificationPayload.complex(); + try { + payload.addAlert(content); + payload.addBadge(1); + payload.addSound("default"); + Push.payload(payload, keystore, password, isDebug, token); - // Send Push - Device client = pushManager.getDevice(deviceToken); - pushManager.sendNotification(client, payLoad); // 推送消息 - pushManager.stopConnection(); - pushManager.removeDevice(deviceToken); + } catch (Exception e) { + e.printStackTrace(); + }*/ + } - } - - - */ } diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java index 819d9af..c44c791 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java @@ -1,9 +1,24 @@ - /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.push; import com.farsunset.cim.sdk.server.model.Message; @@ -12,10 +27,10 @@ public class SystemMessagePusher extends DefaultMessagePusher{ @Override - public void push(Message messsage){ + public void push(Message message){ - messsage.setSender("system"); - super.push(messsage); + message.setSender("system"); + super.push(message); } } diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java index fe2b056..f36b9f7 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java @@ -1,16 +1,29 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.session; import java.util.List; import com.farsunset.cim.sdk.server.session.CIMSession; import com.farsunset.cim.sdk.server.session.SessionManager; -import com.farsunset.cim.sdk.server.launcher.CIMNioSocketAcceptor; - /** * 集群 session管理实现示例, 各位可以自行实现 AbstractSessionManager接口来实现自己的 session管理 @@ -19,23 +32,13 @@ import com.farsunset.cim.sdk.server.launcher.CIMNioSocketAcceptor; public class ClusterSessionManager implements SessionManager{ - - - public void addSession(String account,CIMSession session) { - - - /** - * 下面 将session 存入数据库 - */ - - } public CIMSession get(String account) { //这里查询数据库 /*CIMSession session = database.getSession(account); - session.setIoSession(ContextHolder.getBean(CIMNioSocketAcceptor.class).getManagedSessions().get(session.getNid())); + session.setIoSession(ContextHolder.getBean(CIMNioSocketAcceptor.class).getManagedSessions().get(session.getNid())); return session;*/ return null; } @@ -43,8 +46,6 @@ public class ClusterSessionManager implements SessionManager{ @Override public List queryAll() { - /*//这里查询数据库 - return database.getSessions();*/ return null; } @@ -52,30 +53,19 @@ public class ClusterSessionManager implements SessionManager{ @Override public void remove(String account) { - //database.removeSession(account);*/ } - - @Override - public void setState(String account, int state) { - // TODO Auto-generated method stub - - } - - @Override public void update(CIMSession session) { } - @Override - public void add(String account, CIMSession session) { - // TODO Auto-generated method stub + public void add(CIMSession arg0) { } -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/Constants.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/Constants.java index 024cdee..129a69e 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/Constants.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/Constants.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.util; public interface Constants { diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java index 8f0a79a..7464ad3 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.util; import org.springframework.beans.BeansException; @@ -30,4 +45,4 @@ public class ContextHolder implements ApplicationContextAware{ throws BeansException { context = applicationContext; } -} \ No newline at end of file +} diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java index e835856..e040c55 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java @@ -1,9 +1,24 @@ /** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.util; import java.util.ArrayList; import java.util.List; @@ -52,13 +67,12 @@ public class MessageDispatcher { HttpPost httpPost = new HttpPost(url); List nvps = new ArrayList (); nvps.add(new BasicNameValuePair("mid", msg.getMid())); - nvps.add(new BasicNameValuePair("type", msg.getType())); + nvps.add(new BasicNameValuePair("extra", msg.getExtra())); + nvps.add(new BasicNameValuePair("action", msg.getAction())); nvps.add(new BasicNameValuePair("title", msg.getTitle())); nvps.add(new BasicNameValuePair("content",msg.getContent())); nvps.add(new BasicNameValuePair("sender", msg.getSender())); nvps.add(new BasicNameValuePair("receiver",msg.getReceiver())); - nvps.add(new BasicNameValuePair("file",msg.getFile())); - nvps.add(new BasicNameValuePair("fileType",msg.getFileType())); nvps.add(new BasicNameValuePair("timestamp",String.valueOf(msg.getTimestamp()))); httpPost.setEntity(new UrlEncodedFormEntity(nvps)); CloseableHttpResponse response2 = httpclient.execute(httpPost); diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java index c429684..341be83 100644 --- a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java @@ -1,3 +1,24 @@ +/** + * Copyright 2013-2023 Xia Jun(3979434@qq.com). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *************************************************************************************** + * * + * Website : http://www.farsunset.com * + * * + *************************************************************************************** + */ package com.farsunset.cim.util; import java.text.SimpleDateFormat; diff --git a/cim_for_netty/cim-server/src/main/resource/log4j.properties b/cim_for_netty/cim-server/src/main/resource/log4j.properties index b883399..5968d9f 100644 --- a/cim_for_netty/cim-server/src/main/resource/log4j.properties +++ b/cim_for_netty/cim-server/src/main/resource/log4j.properties @@ -1,4 +1,4 @@ -log4j.rootLogger=info,console, file +log4j.rootLogger=info,console,file #----------console---------------- log4j.appender.console=org.apache.log4j.ConsoleAppender diff --git a/cim_for_netty/cim-server/src/main/resource/spring-cim.xml b/cim_for_netty/cim-server/src/main/resource/spring-cim.xml index 7748d3d..57f0f60 100644 --- a/cim_for_netty/cim-server/src/main/resource/spring-cim.xml +++ b/cim_for_netty/cim-server/src/main/resource/spring-cim.xml @@ -1,44 +1,40 @@  + "> - - - - + + + + + - - - - - - - - + - - + + - + + + - - + + + + + + + \ No newline at end of file diff --git a/cim_for_netty/cim-server/src/main/resource/spring-config.xml b/cim_for_netty/cim-server/src/main/resource/spring-config.xml deleted file mode 100644 index de92bdb..0000000 --- a/cim_for_netty/cim-server/src/main/resource/spring-config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_netty/cim-server/src/main/resource/spring-push.xml b/cim_for_netty/cim-server/src/main/resource/spring-push.xml deleted file mode 100644 index d4eab02..0000000 --- a/cim_for_netty/cim-server/src/main/resource/spring-push.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/.classpath b/cim_for_netty/client-mchat-android/.classpath deleted file mode 100644 index 5176974..0000000 --- a/cim_for_netty/client-mchat-android/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/cim_for_netty/client-mchat-android/.project b/cim_for_netty/client-mchat-android/.project deleted file mode 100644 index 71b77c4..0000000 --- a/cim_for_netty/client-mchat-android/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - client-mchat-android - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/cim_for_netty/client-mchat-android/.settings/org.eclipse.jdt.core.prefs b/cim_for_netty/client-mchat-android/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b080d2d..0000000 --- a/cim_for_netty/client-mchat-android/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/cim_for_netty/client-mchat-android/gen/com/farsunset/ichat/example/BuildConfig.java b/cim_for_netty/client-mchat-android/gen/com/farsunset/ichat/example/BuildConfig.java deleted file mode 100644 index f60612a..0000000 --- a/cim_for_netty/client-mchat-android/gen/com/farsunset/ichat/example/BuildConfig.java +++ /dev/null @@ -1,6 +0,0 @@ -/** Automatically generated file. DO NOT MODIFY */ -package com.farsunset.ichat.example; - -public final class BuildConfig { - public final static boolean DEBUG = true; -} \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/gen/com/farsunset/ichat/example/R.java b/cim_for_netty/client-mchat-android/gen/com/farsunset/ichat/example/R.java deleted file mode 100644 index 807bf56..0000000 --- a/cim_for_netty/client-mchat-android/gen/com/farsunset/ichat/example/R.java +++ /dev/null @@ -1,947 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.farsunset.ichat.example; - -public final class R { - public static final class anim { - public static final int activity_back=0x7f040000; - public static final int activity_finish=0x7f040001; - public static final int activity_new=0x7f040002; - public static final int activity_out=0x7f040003; - public static final int appear=0x7f040004; - public static final int disappear=0x7f040005; - public static final int disappear_del=0x7f040006; - public static final int extension_appear_from_bottom_to_top=0x7f040007; - public static final int extension_disappear_from_top_to_bottom=0x7f040008; - public static final int rotate=0x7f040009; - public static final int slide_in_from_bottom=0x7f04000a; - public static final int slide_in_from_left=0x7f04000b; - public static final int slide_out_to_bottom=0x7f04000c; - public static final int slide_out_to_right=0x7f04000d; - } - public static final class array { - public static final int emoticoKeys=0x7f060001; - public static final int emoticos=0x7f060000; - } - public static final class attr { - /**

      May be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". -

      May be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". - */ - public static final int firstButtonBackground=0x7f010000; - /**

      May be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". -

      May be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". - */ - public static final int lastButtonBackground=0x7f010001; - /**

      May be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". -

      May be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". - */ - public static final int middleButtonBackground=0x7f010002; - /**

      May be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". -

      May be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". - */ - public static final int uniqueButtonBackground=0x7f010003; - } - public static final class color { - public static final int alpha=0x7f070010; - public static final int black=0x7f070005; - public static final int blue=0x7f070002; - public static final int chat_myself=0x7f070011; - public static final int chat_other=0x7f070012; - public static final int darkgray=0x7f07000f; - public static final int gray=0x7f070004; - public static final int gray_blue=0x7f07000e; - public static final int green=0x7f070003; - public static final int light_white=0x7f070008; - public static final int login_text_button_selector=0x7f070013; - public static final int orange=0x7f070000; - public static final int red=0x7f070006; - public static final int theme_night_bg=0x7f07000b; - public static final int theme_night_text_color=0x7f07000c; - public static final int theme_setting_item_text_pressed=0x7f070007; - public static final int theme_text_color=0x7f07000d; - public static final int transparent=0x7f07000a; - public static final int white=0x7f070001; - public static final int window_bg=0x7f070009; - } - public static final class dimen { - public static final int aio_bubble_padding_align_error=0x7f080086; - public static final int aio_bubble_padding_align_head=0x7f080085; - public static final int aio_bubble_padding_bottom=0x7f080084; - public static final int aio_bubble_padding_top=0x7f080083; - public static final int aio_content_padding=0x7f080092; - public static final int aio_padding_bottom=0x7f080090; - public static final int aio_padding_bottom_for_last=0x7f080091; - public static final int aio_padding_left=0x7f08008e; - public static final int aio_padding_right=0x7f08008f; - public static final int aio_padding_top=0x7f08008d; - public static final int aio_secretfile_item_height=0x7f080099; - public static final int aio_secretfile_item_width=0x7f080098; - public static final int aio_secretfile_text1_margin_big=0x7f080094; - public static final int aio_secretfile_text1_margin_small=0x7f080095; - public static final int aio_secretfile_text2_margin_big=0x7f080096; - public static final int aio_secretfile_text2_margin_small=0x7f080097; - public static final int aio_share_padding=0x7f080093; - public static final int aio_text_padding_align_error=0x7f08008a; - public static final int aio_text_padding_align_head=0x7f080089; - public static final int aio_text_padding_bottom=0x7f080088; - public static final int aio_text_padding_top=0x7f080087; - public static final int aio_text_size_extra_large=0x7f080012; - public static final int aio_text_size_large=0x7f080011; - public static final int aio_text_size_middle=0x7f080010; - public static final int aio_text_size_small=0x7f08000f; - public static final int aio_text_size_small_stable=0x7f08000e; - public static final int aio_timestamp_padding_bottom=0x7f08008c; - public static final int aio_timestamp_padding_top=0x7f08008b; - public static final int album_cover_width=0x7f08007c; - public static final int album_grid_edge_padding=0x7f0800e2; - public static final int album_grid_edge_padding_half=0x7f0800e3; - public static final int album_grid_item_horizontal_spacing=0x7f0800df; - public static final int album_grid_item_vertical_spacing=0x7f0800e0; - public static final int album_grid_item_vertical_spacing_half=0x7f0800e1; - public static final int album_grid_space=0x7f080038; - public static final int album_item_maker_padding_x=0x7f0800e4; - public static final int album_item_maker_padding_y=0x7f0800e5; - public static final int album_item_wh=0x7f0800e7; - public static final int album_list_edge_padding=0x7f08013f; - public static final int album_list_h_space=0x7f080140; - public static final int album_list_item_cover_height=0x7f080144; - public static final int album_list_item_cover_width=0x7f080143; - public static final int album_list_item_halving_line_paddingTop=0x7f080146; - public static final int album_list_item_height=0x7f08013e; - public static final int album_list_item_padding=0x7f080145; - public static final int album_list_item_width=0x7f08013d; - public static final int album_list_v_space=0x7f080141; - public static final int album_list_v_space_half=0x7f080142; - public static final int album_margin=0x7f080036; - public static final int album_padding_lr=0x7f080037; - public static final int album_selected_item_width=0x7f0800e6; - public static final int btn_back_padding_left=0x7f08000a; - public static final int btn_back_padding_right=0x7f08000b; - public static final int btn_padding_left=0x7f080008; - public static final int btn_padding_right=0x7f080009; - public static final int card_visitor_left_margin=0x7f080039; - public static final int card_visitor_right_margin=0x7f08003a; - public static final int card_visitor_space=0x7f08003b; - public static final int choose_book_blackboard_height=0x7f0800b5; - public static final int choose_book_column_width=0x7f0800b8; - public static final int choose_book_gridview_padding_left=0x7f0800b9; - public static final int choose_book_height=0x7f0800b6; - public static final int choose_book_height_between_board_and_book=0x7f0800ba; - public static final int choose_book_width=0x7f0800b7; - public static final int com_tencent_open_agent_auth_perm_height=0x7f080018; - public static final int com_tencent_open_agent_buddy_list_selected_buddy_marginbottom=0x7f08001a; - public static final int com_tencent_open_agent_buddy_list_selected_buddy_marginright=0x7f080019; - public static final int com_tencent_open_agent_dp100=0x7f080013; - public static final int com_tencent_open_agent_dp110=0x7f080014; - public static final int com_tencent_open_agent_dp120=0x7f080015; - public static final int com_tencent_open_agent_dp130=0x7f080016; - public static final int com_tencent_open_agent_dp150=0x7f080017; - public static final int com_tencent_open_appdetail_appicon_height=0x7f080020; - public static final int com_tencent_open_appdetail_appicon_width=0x7f08001f; - public static final int com_tencent_open_appdetail_dp172=0x7f080022; - public static final int com_tencent_open_appdetail_dp285=0x7f080021; - public static final int com_tencent_open_appdetail_margin_bottom=0x7f08001e; - public static final int com_tencent_open_appdetail_margin_left=0x7f08001b; - public static final int com_tencent_open_appdetail_margin_right=0x7f08001c; - public static final int com_tencent_open_appdetail_margin_top=0x7f08001d; - public static final int comment_btn_hight=0x7f080115; - public static final int comment_btn_width=0x7f080116; - public static final int common_action_sheet_layout_padding=0x7f08006a; - public static final int common_menu_dialog_layout_btn_marginBottom=0x7f080070; - public static final int common_menu_dialog_layout_btn_marginTop=0x7f08006f; - public static final int common_menu_dialog_layout_cancel_marginBottom=0x7f08006e; - public static final int common_menu_dialog_layout_cancel_marginTop=0x7f08006d; - public static final int common_menu_dialog_layout_paddingLR=0x7f08006b; - public static final int common_menu_dialog_tile_marginBottom=0x7f080069; - public static final int common_menu_dialog_tile_marginTop=0x7f080068; - public static final int common_menu_dialog_tilte_paddingLR=0x7f08006c; - public static final int common_title_height=0x7f080113; - public static final int contat_buddy_list_name_width=0x7f08009b; - public static final int copytextview_menu_height=0x7f080124; - public static final int copytextview_menu_width=0x7f080123; - public static final int cover_padding_top=0x7f080137; - public static final int dataline_msg_item_image_height=0x7f08002b; - public static final int dataline_msg_item_image_width=0x7f08002a; - public static final int detail_p_activity_v=0x7f08004f; - public static final int dialogBase_btnArea_magrinLeft=0x7f080064; - public static final int dialogBase_btnArea_magrinRight=0x7f080065; - public static final int dialogBase_btnArea_magrinTop=0x7f080066; - public static final int dialogBase_btnHeight=0x7f080063; - public static final int dialogBase_btnWidth=0x7f080062; - public static final int dialogBase_button_marginTop=0x7f080060; - public static final int dialogBase_content_margin=0x7f08005b; - public static final int dialogBase_listWidth=0x7f080061; - public static final int dialogBase_message_lineSpacing=0x7f08005f; - public static final int dialogBase_message_paddingLeft=0x7f08005d; - public static final int dialogBase_message_paddingRight=0x7f08005e; - public static final int dialogBase_message_paddingTop=0x7f08005c; - public static final int dialogBase_titleHeight=0x7f080059; - public static final int dialogBase_titleIconMargin=0x7f08005a; - public static final int dialogBase_width=0x7f080058; - public static final int divider_height=0x7f080120; - public static final int dp1=0x7f0800ea; - public static final int dp10=0x7f0800f2; - public static final int dp105=0x7f080100; - public static final int dp11=0x7f0800f3; - public static final int dp12=0x7f0800f4; - public static final int dp126=0x7f080101; - public static final int dp13=0x7f0800f5; - public static final int dp14=0x7f0800f6; - public static final int dp15=0x7f0800f7; - public static final int dp155=0x7f080102; - public static final int dp169=0x7f080103; - public static final int dp17=0x7f0800f8; - public static final int dp2=0x7f0800eb; - public static final int dp23=0x7f0800f9; - public static final int dp25=0x7f0800fa; - public static final int dp3=0x7f0800ec; - public static final int dp30=0x7f0800fb; - public static final int dp32=0x7f0800fd; - public static final int dp35=0x7f0800fc; - public static final int dp5=0x7f0800ed; - public static final int dp50=0x7f0800fe; - public static final int dp53=0x7f0800ff; - public static final int dp6=0x7f0800ee; - public static final int dp7=0x7f0800ef; - public static final int dp8=0x7f0800f0; - public static final int dp9=0x7f0800f1; - public static final int fastscroll_overlay_size=0x7f08002c; - public static final int fastscroll_thumb_height=0x7f08002e; - public static final int fastscroll_thumb_width=0x7f08002d; - public static final int feed_content_line_spacing_extra=0x7f0800db; - public static final int feed_detail_banner_bottom_margin=0x7f080148; - public static final int feed_detail_banner_top_margin=0x7f080147; - public static final int feed_item_area_margin_top=0x7f0800da; - public static final int feed_item_assist_text_size=0x7f0800d5; - public static final int feed_item_btn_size=0x7f0800d4; - public static final int feed_item_comment_text_size=0x7f0800d2; - public static final int feed_item_content_text_size=0x7f0800d0; - public static final int feed_item_margin_left=0x7f0800d6; - public static final int feed_item_margin_right=0x7f0800d7; - public static final int feed_item_margin_top20px=0x7f0800d9; - public static final int feed_item_margin_top30px=0x7f0800d8; - public static final int feed_item_time_text_size=0x7f0800d1; - public static final int feed_item_username_text_size=0x7f0800d3; - public static final int feed_loading_diameter=0x7f08014a; - public static final int feed_loading_min_length=0x7f08014c; - public static final int feed_loading_strokewidth=0x7f08014b; - public static final int font_size_extra_large=0x7f080031; - public static final int font_size_extra_small=0x7f080035; - public static final int font_size_large=0x7f080032; - public static final int font_size_middle=0x7f080033; - public static final int font_size_small=0x7f080034; - public static final int friendfeeds_empty_icon_marginTop=0x7f080149; - public static final int gallery_space=0x7f080067; - public static final int gesture_pattern_line_width=0x7f08009a; - public static final int indicator_corner_radius=0x7f080111; - public static final int indicator_internal_padding=0x7f080112; - public static final int indicator_right_padding=0x7f080110; - public static final int info_card_info_marginBottom=0x7f08009c; - public static final int info_card_level_icon_size=0x7f080073; - public static final int info_card_middle_item_txtsize=0x7f080072; - public static final int info_card_moreinfo_item_paddingLR=0x7f080074; - public static final int info_card_moreinfo_item_paddingTB=0x7f080075; - public static final int iphone_title_min_width=0x7f080114; - public static final int layout_common_xlistview_paddingLR=0x7f080071; - public static final int lite_activity_horizontal_margin=0x7f080028; - public static final int lite_activity_vertical_margin=0x7f080029; - public static final int local_photo_bottombar_h=0x7f08012e; - public static final int local_photo_hspace=0x7f08012c; - public static final int local_photo_item_mark_paddingRight=0x7f080132; - public static final int local_photo_item_mark_paddingTop=0x7f080131; - public static final int local_photo_list_cover_h=0x7f080130; - public static final int local_photo_list_cover_w=0x7f08012f; - public static final int local_photo_padding=0x7f08012b; - public static final int local_photo_vspace=0x7f08012d; - public static final int myfeed_source_content_comment_line_margintop=0x7f0800dd; - public static final int myfeed_source_content_comment_margintop=0x7f0800dc; - public static final int nar_btn_hight=0x7f080026; - public static final int nar_btn_width=0x7f080027; - public static final int nav_btn_height=0x7f080005; - public static final int nav_btn_text_size=0x7f080006; - public static final int nav_height=0x7f080004; - public static final int nav_padding_top=0x7f080007; - public static final int network_album_cover_width=0x7f0800de; - public static final int new_photo_list_cell_edge_padding=0x7f080082; - public static final int new_photo_list_cell_horizontal_spacing=0x7f080080; - public static final int new_photo_list_cell_vertical_spacing=0x7f080081; - public static final int phone_country_code_padding=0x7f0800bd; - public static final int phone_country_code_width=0x7f0800bc; - public static final int photo_list_cell_edge_padding=0x7f08007f; - public static final int photo_list_cell_horizontal_spacing=0x7f08007d; - public static final int photo_list_cell_vertical_spacing=0x7f08007e; - public static final int photo_wall_divider_l=0x7f080052; - public static final int photo_wall_guest_avatar_size=0x7f080055; - public static final int photo_wall_host_avatar_h=0x7f080053; - public static final int photo_wall_host_avatar_size=0x7f080054; - public static final int photo_wall_lr=0x7f080051; - public static final int photo_wall_title_marginBottom=0x7f080057; - public static final int photo_wall_title_marginTop=0x7f080056; - public static final int photo_wall_top=0x7f080050; - public static final int popup_win_height=0x7f08000d; - public static final int publishicon_height=0x7f080105; - public static final int publishicon_width=0x7f080104; - public static final int qb_tenpay_big_text_size=0x7f0800c5; - public static final int qb_tenpay_bigbtn_height=0x7f0800cb; - public static final int qb_tenpay_btn_resend_height=0x7f0800cc; - public static final int qb_tenpay_editor_height=0x7f0800c9; - public static final int qb_tenpay_editor_space_h=0x7f0800cd; - public static final int qb_tenpay_margin=0x7f0800ce; - public static final int qb_tenpay_navi_btn_height=0x7f0800c3; - public static final int qb_tenpay_navi_text_size=0x7f0800c4; - public static final int qb_tenpay_normal_text_size=0x7f0800c6; - public static final int qb_tenpay_paycenter_yellow_height=0x7f0800ca; - public static final int qb_tenpay_small_text_size=0x7f0800c7; - public static final int qb_tenpay_smallest_text_size=0x7f0800c8; - public static final int qb_tenpay_space_height=0x7f0800cf; - public static final int qb_tenpay_title_height=0x7f0800c2; - public static final int qzone_cover_height=0x7f080133; - public static final int qzone_custom_dialog_width=0x7f080109; - public static final int qzone_feed_detail_avatar_width=0x7f080122; - public static final int qzone_feed_detail_main_action_height=0x7f080121; - public static final int qzone_feeds_cover_marginBottom=0x7f080136; - public static final int qzone_feeds_header_height=0x7f080134; - public static final int qzone_feeds_header_marginBottom=0x7f080135; - public static final int qzone_home_guest_cover_height=0x7f080138; - public static final int qzone_home_guest_detail_marginTop=0x7f08013a; - public static final int qzone_home_guest_feeds_header_height=0x7f080139; - public static final int qzone_home_guest_question_height=0x7f08013b; - public static final int qzone_home_guest_sendResult_marginTop=0x7f08013c; - public static final int qzone_pic_minheight_content=0x7f080106; - public static final int qzone_pic_minheight_forward=0x7f080107; - public static final int qzone_pictureviewer_bottom_detail_margin=0x7f08010d; - public static final int qzone_pictureviewer_bottom_detail_minwidth=0x7f08010c; - public static final int qzone_pictureviewer_bottom_height_down=0x7f08010b; - public static final int qzone_pictureviewer_bottom_height_up=0x7f08010a; - public static final int qzone_pictureviewer_item_padding_left=0x7f08010e; - public static final int qzone_pictureviewer_item_padding_right=0x7f08010f; - public static final int qzone_pictureviewer_loading_text=0x7f080108; - public static final int recent_game_list_avatar=0x7f0800a4; - public static final int recent_game_list_avatar_marginleft=0x7f0800a5; - public static final int recent_list_foot_height=0x7f08007a; - public static final int recent_list_head_height=0x7f080076; - public static final int recent_list_margin_bottom=0x7f080126; - public static final int recent_list_margin_top=0x7f080125; - public static final int recent_list_net_bar_height=0x7f080077; - public static final int recent_list_pushbanner_height=0x7f080079; - public static final int recent_list_update_bar_height=0x7f080078; - public static final int recent_no_chat_height=0x7f08007b; - public static final int refresh_header_height=0x7f08002f; - public static final int refresh_header_real_height=0x7f080030; - public static final int search_troop_filter_width=0x7f08003e; - public static final int setting_item_marginTop=0x7f08004e; - public static final int setting_tips_marginBottom=0x7f08004c; - public static final int setting_tips_marginLeft=0x7f08004b; - public static final int setting_tips_marginRight=0x7f08004d; - public static final int setting_tips_marginTop=0x7f08004a; - public static final int share_pic_preview_height=0x7f0800b4; - public static final int share_pic_preview_width=0x7f0800b3; - public static final int shuoshuo_seleted_photo_height=0x7f0800e9; - public static final int shuoshuo_seleted_photo_width=0x7f0800e8; - public static final int sp10=0x7f080119; - public static final int sp12=0x7f08011a; - public static final int sp13=0x7f08011b; - public static final int sp14=0x7f08011c; - public static final int sp16=0x7f08011d; - public static final int sp18=0x7f08011e; - public static final int sp20=0x7f08011f; - public static final int sp6=0x7f080117; - public static final int sp8=0x7f080118; - public static final int struct_msg_content_layout_marginBottom=0x7f0800a0; - public static final int struct_msg_content_layout_marginLeft=0x7f08009d; - public static final int struct_msg_content_layout_marginRight=0x7f08009e; - public static final int struct_msg_content_layout_marginTop=0x7f08009f; - public static final int struct_msg_content_layout_source_receiveleft_margin=0x7f0800a2; - public static final int struct_msg_content_layout_source_sendleft_margin=0x7f0800a1; - public static final int subaccount_msg_header_height=0x7f0800a3; - public static final int tab_left_padding_right=0x7f080129; - public static final int tab_min_h=0x7f080128; - public static final int tab_min_w=0x7f080127; - public static final int tab_right_padding_left=0x7f08012a; - public static final int textSize11sp=0x7f08003f; - public static final int textSize12sp=0x7f080040; - public static final int textSize13sp=0x7f080041; - public static final int textSize14sp=0x7f080042; - public static final int textSize15sp=0x7f080043; - public static final int textSize16sp=0x7f080044; - public static final int textSize17sp=0x7f080045; - public static final int textSize18sp=0x7f080046; - public static final int textSize19sp=0x7f080047; - public static final int textSize20sp=0x7f080048; - public static final int textSize21sp=0x7f080049; - public static final int textSizeS1=0x7f080000; - public static final int textSizeS2=0x7f080001; - public static final int textSizeS3=0x7f080002; - public static final int textSizeS4=0x7f080003; - public static final int tip_layout_padding=0x7f08000c; - public static final int title_bar_height=0x7f08003c; - public static final int title_bar_main_alpha_height=0x7f080025; - public static final int title_bar_main_content_height=0x7f080024; - public static final int title_bar_offset=0x7f08003d; - public static final int title_margin_top=0x7f080023; - public static final int userguide_2_gv1Top=0x7f0800ae; - public static final int userguide_2_gv2Top=0x7f0800af; - public static final int userguide_3_Top=0x7f0800b2; - public static final int userguide_3_gv1Top=0x7f0800b0; - public static final int userguide_3_gv2Top=0x7f0800b1; - public static final int userguide_4_paddingbottom=0x7f0800ab; - public static final int userguide_4_paddingtop=0x7f0800aa; - public static final int userguide_btn_marginTop=0x7f0800a9; - public static final int userguide_choosebook_title_marginTop=0x7f0800bb; - public static final int userguide_sheet1_marginTop=0x7f0800ac; - public static final int userguide_sheet2_marginTop=0x7f0800ad; - public static final int userguide_sheet_marginBottom=0x7f0800a8; - public static final int userguide_t234_marginTop=0x7f0800a7; - public static final int userguide_t_marginTop=0x7f0800a6; - public static final int video_smallview_move_thresholdX=0x7f0800c0; - public static final int video_smallview_move_thresholdY=0x7f0800c1; - public static final int video_subview_right_margin=0x7f0800bf; - public static final int video_tool_bar_height=0x7f0800be; - public static final int widget_vip_progress_height=0x7f08014e; - public static final int widget_vip_progress_marginTop=0x7f08014f; - public static final int widget_vip_progress_minWidth=0x7f080150; - public static final int widget_vip_progress_text_marginLeft=0x7f080152; - public static final int widget_vip_progress_text_marginRight=0x7f080153; - public static final int widget_vip_progress_width=0x7f08014d; - public static final int widget_vip_speed_marginTop=0x7f080151; - } - public static final class drawable { - public static final int action_sheet_base_9=0x7f020000; - public static final int add_contacts_create_troop=0x7f020001; - public static final int add_contacts_look_for_similarity=0x7f020002; - public static final int add_contacts_look_for_troop=0x7f020003; - public static final int aicon_error=0x7f020004; - public static final int aio_friend_bg_nor=0x7f020005; - public static final int aio_friend_bg_pressed=0x7f020006; - public static final int aio_user_bg_nor=0x7f020007; - public static final int aio_user_bg_pressed=0x7f020008; - public static final int app_main_bg=0x7f020009; - public static final int arrow=0x7f02000a; - public static final int blue_button_normal=0x7f02000b; - public static final int blue_button_pressed=0x7f02000c; - public static final int bodylisttop=0x7f02000d; - public static final int bottom=0x7f02000e; - public static final int btn_check_off=0x7f02000f; - public static final int btn_check_on=0x7f020010; - public static final int card_avatar=0x7f020011; - public static final int chat_time_block=0x7f020012; - public static final int chat_tool_camera=0x7f020013; - public static final int chat_tool_location=0x7f020014; - public static final int chat_tool_photo=0x7f020015; - public static final int chat_tool_send_file=0x7f020016; - public static final int close_del=0x7f020017; - public static final int close_pressed=0x7f020018; - public static final int colorful_line=0x7f020019; - public static final int common_button_blue=0x7f02001a; - public static final int common_loading_0=0x7f02001b; - public static final int common_loading_1=0x7f02001c; - public static final int common_loading_10=0x7f02001d; - public static final int common_loading_11=0x7f02001e; - public static final int common_loading_2=0x7f02001f; - public static final int common_loading_3=0x7f020020; - public static final int common_loading_4=0x7f020021; - public static final int common_loading_5=0x7f020022; - public static final int common_loading_6=0x7f020023; - public static final int common_loading_7=0x7f020024; - public static final int common_loading_8=0x7f020025; - public static final int common_loading_9=0x7f020026; - public static final int common_msgbox_bg=0x7f020027; - public static final int conversation_loading_icon=0x7f020028; - public static final int conversation_net_error_icon=0x7f020029; - public static final int cutline=0x7f02002a; - public static final int edittext_bg=0x7f02002b; - public static final int f000=0x7f02002c; - public static final int f001=0x7f02002d; - public static final int f002=0x7f02002e; - public static final int f003=0x7f02002f; - public static final int f004=0x7f020030; - public static final int f005=0x7f020031; - public static final int f006=0x7f020032; - public static final int f007=0x7f020033; - public static final int f008=0x7f020034; - public static final int f009=0x7f020035; - public static final int f010=0x7f020036; - public static final int f011=0x7f020037; - public static final int f012=0x7f020038; - public static final int f013=0x7f020039; - public static final int f014=0x7f02003a; - public static final int f015=0x7f02003b; - public static final int f016=0x7f02003c; - public static final int f017=0x7f02003d; - public static final int f018=0x7f02003e; - public static final int f019=0x7f02003f; - public static final int f020=0x7f020040; - public static final int f021=0x7f020041; - public static final int f022=0x7f020042; - public static final int f023=0x7f020043; - public static final int f024=0x7f020044; - public static final int f025=0x7f020045; - public static final int f026=0x7f020046; - public static final int f027=0x7f020047; - public static final int f028=0x7f020048; - public static final int f029=0x7f020049; - public static final int f030=0x7f02004a; - public static final int f031=0x7f02004b; - public static final int f032=0x7f02004c; - public static final int f033=0x7f02004d; - public static final int f034=0x7f02004e; - public static final int f035=0x7f02004f; - public static final int f036=0x7f020050; - public static final int f037=0x7f020051; - public static final int f038=0x7f020052; - public static final int f039=0x7f020053; - public static final int f040=0x7f020054; - public static final int f041=0x7f020055; - public static final int f042=0x7f020056; - public static final int f043=0x7f020057; - public static final int f044=0x7f020058; - public static final int f045=0x7f020059; - public static final int f046=0x7f02005a; - public static final int f047=0x7f02005b; - public static final int f048=0x7f02005c; - public static final int f049=0x7f02005d; - public static final int f050=0x7f02005e; - public static final int f051=0x7f02005f; - public static final int f052=0x7f020060; - public static final int f053=0x7f020061; - public static final int f054=0x7f020062; - public static final int f055=0x7f020063; - public static final int f056=0x7f020064; - public static final int f057=0x7f020065; - public static final int f058=0x7f020066; - public static final int f059=0x7f020067; - public static final int f060=0x7f020068; - public static final int f061=0x7f020069; - public static final int f062=0x7f02006a; - public static final int f063=0x7f02006b; - public static final int f064=0x7f02006c; - public static final int f065=0x7f02006d; - public static final int f066=0x7f02006e; - public static final int f067=0x7f02006f; - public static final int f068=0x7f020070; - public static final int f069=0x7f020071; - public static final int f070=0x7f020072; - public static final int f071=0x7f020073; - public static final int f072=0x7f020074; - public static final int f073=0x7f020075; - public static final int f074=0x7f020076; - public static final int f075=0x7f020077; - public static final int f076=0x7f020078; - public static final int f077=0x7f020079; - public static final int f078=0x7f02007a; - public static final int f079=0x7f02007b; - public static final int f080=0x7f02007c; - public static final int f081=0x7f02007d; - public static final int f082=0x7f02007e; - public static final int f083=0x7f02007f; - public static final int f084=0x7f020080; - public static final int f085=0x7f020081; - public static final int f086=0x7f020082; - public static final int f087=0x7f020083; - public static final int f088=0x7f020084; - public static final int f089=0x7f020085; - public static final int f090=0x7f020086; - public static final int f091=0x7f020087; - public static final int f092=0x7f020088; - public static final int f093=0x7f020089; - public static final int f094=0x7f02008a; - public static final int f095=0x7f02008b; - public static final int f096=0x7f02008c; - public static final int f097=0x7f02008d; - public static final int f098=0x7f02008e; - public static final int f099=0x7f02008f; - public static final int f100=0x7f020090; - public static final int f101=0x7f020091; - public static final int f102=0x7f020092; - public static final int f103=0x7f020093; - public static final int f104=0x7f020094; - public static final int f105=0x7f020095; - public static final int f106=0x7f020096; - public static final int f_static_000=0x7f020097; - public static final int f_static_001=0x7f020098; - public static final int f_static_002=0x7f020099; - public static final int f_static_003=0x7f02009a; - public static final int f_static_004=0x7f02009b; - public static final int f_static_005=0x7f02009c; - public static final int f_static_006=0x7f02009d; - public static final int f_static_007=0x7f02009e; - public static final int f_static_008=0x7f02009f; - public static final int f_static_009=0x7f0200a0; - public static final int f_static_010=0x7f0200a1; - public static final int f_static_011=0x7f0200a2; - public static final int f_static_012=0x7f0200a3; - public static final int f_static_013=0x7f0200a4; - public static final int f_static_014=0x7f0200a5; - public static final int f_static_015=0x7f0200a6; - public static final int f_static_016=0x7f0200a7; - public static final int f_static_017=0x7f0200a8; - public static final int f_static_018=0x7f0200a9; - public static final int f_static_019=0x7f0200aa; - public static final int f_static_020=0x7f0200ab; - public static final int f_static_021=0x7f0200ac; - public static final int f_static_022=0x7f0200ad; - public static final int f_static_023=0x7f0200ae; - public static final int f_static_024=0x7f0200af; - public static final int f_static_025=0x7f0200b0; - public static final int f_static_026=0x7f0200b1; - public static final int f_static_027=0x7f0200b2; - public static final int f_static_028=0x7f0200b3; - public static final int f_static_029=0x7f0200b4; - public static final int f_static_030=0x7f0200b5; - public static final int f_static_031=0x7f0200b6; - public static final int f_static_032=0x7f0200b7; - public static final int f_static_033=0x7f0200b8; - public static final int f_static_034=0x7f0200b9; - public static final int f_static_035=0x7f0200ba; - public static final int f_static_036=0x7f0200bb; - public static final int f_static_037=0x7f0200bc; - public static final int f_static_038=0x7f0200bd; - public static final int f_static_039=0x7f0200be; - public static final int f_static_040=0x7f0200bf; - public static final int f_static_041=0x7f0200c0; - public static final int f_static_042=0x7f0200c1; - public static final int f_static_043=0x7f0200c2; - public static final int f_static_044=0x7f0200c3; - public static final int f_static_045=0x7f0200c4; - public static final int f_static_046=0x7f0200c5; - public static final int f_static_047=0x7f0200c6; - public static final int f_static_048=0x7f0200c7; - public static final int f_static_049=0x7f0200c8; - public static final int f_static_050=0x7f0200c9; - public static final int f_static_051=0x7f0200ca; - public static final int f_static_052=0x7f0200cb; - public static final int f_static_053=0x7f0200cc; - public static final int f_static_054=0x7f0200cd; - public static final int f_static_055=0x7f0200ce; - public static final int f_static_056=0x7f0200cf; - public static final int f_static_057=0x7f0200d0; - public static final int f_static_058=0x7f0200d1; - public static final int f_static_059=0x7f0200d2; - public static final int f_static_060=0x7f0200d3; - public static final int f_static_061=0x7f0200d4; - public static final int f_static_062=0x7f0200d5; - public static final int f_static_063=0x7f0200d6; - public static final int f_static_064=0x7f0200d7; - public static final int f_static_065=0x7f0200d8; - public static final int f_static_066=0x7f0200d9; - public static final int f_static_067=0x7f0200da; - public static final int f_static_068=0x7f0200db; - public static final int f_static_069=0x7f0200dc; - public static final int f_static_070=0x7f0200dd; - public static final int f_static_071=0x7f0200de; - public static final int f_static_072=0x7f0200df; - public static final int f_static_073=0x7f0200e0; - public static final int f_static_074=0x7f0200e1; - public static final int f_static_075=0x7f0200e2; - public static final int f_static_076=0x7f0200e3; - public static final int f_static_077=0x7f0200e4; - public static final int f_static_078=0x7f0200e5; - public static final int f_static_079=0x7f0200e6; - public static final int f_static_080=0x7f0200e7; - public static final int f_static_081=0x7f0200e8; - public static final int f_static_082=0x7f0200e9; - public static final int f_static_083=0x7f0200ea; - public static final int f_static_084=0x7f0200eb; - public static final int f_static_085=0x7f0200ec; - public static final int f_static_086=0x7f0200ed; - public static final int f_static_087=0x7f0200ee; - public static final int f_static_088=0x7f0200ef; - public static final int f_static_089=0x7f0200f0; - public static final int f_static_090=0x7f0200f1; - public static final int f_static_091=0x7f0200f2; - public static final int f_static_092=0x7f0200f3; - public static final int f_static_093=0x7f0200f4; - public static final int f_static_094=0x7f0200f5; - public static final int f_static_095=0x7f0200f6; - public static final int f_static_096=0x7f0200f7; - public static final int f_static_097=0x7f0200f8; - public static final int f_static_098=0x7f0200f9; - public static final int f_static_099=0x7f0200fa; - public static final int f_static_100=0x7f0200fb; - public static final int f_static_101=0x7f0200fc; - public static final int f_static_102=0x7f0200fd; - public static final int f_static_103=0x7f0200fe; - public static final int f_static_104=0x7f0200ff; - public static final int f_static_105=0x7f020100; - public static final int f_static_106=0x7f020101; - public static final int grouphead_normal=0x7f020102; - public static final int h033=0x7f020103; - public static final int ic_date_time=0x7f020104; - public static final int ic_read=0x7f020105; - public static final int icon=0x7f020106; - public static final int icon_addfriend=0x7f020107; - public static final int icon_away=0x7f020108; - public static final int icon_error=0x7f020109; - public static final int icon_face_click=0x7f02010a; - public static final int icon_face_nor=0x7f02010b; - public static final int icon_invisiable=0x7f02010c; - public static final int icon_joinfroup=0x7f02010d; - public static final int icon_logo=0x7f02010e; - public static final int icon_more=0x7f02010f; - public static final int icon_normal=0x7f020110; - public static final int icon_notify=0x7f020111; - public static final int icon_offline=0x7f020112; - public static final int icon_online=0x7f020113; - public static final int icon_recent_sysmsg=0x7f020114; - public static final int icon_share=0x7f020115; - public static final int icon_success=0x7f020116; - public static final int image_empty=0x7f020117; - public static final int input=0x7f020118; - public static final int input_box_bg=0x7f020119; - public static final int input_over=0x7f02011a; - public static final int list_blockbg=0x7f02011b; - public static final int list_divider_line=0x7f02011c; - public static final int list_head_border_whitebg=0x7f02011d; - public static final int listitem_hover=0x7f02011e; - public static final int loading_1=0x7f02011f; - public static final int loading_10=0x7f020120; - public static final int loading_11=0x7f020121; - public static final int loading_12=0x7f020122; - public static final int loading_13=0x7f020123; - public static final int loading_14=0x7f020124; - public static final int loading_15=0x7f020125; - public static final int loading_16=0x7f020126; - public static final int loading_17=0x7f020127; - public static final int loading_18=0x7f020128; - public static final int loading_19=0x7f020129; - public static final int loading_2=0x7f02012a; - public static final int loading_20=0x7f02012b; - public static final int loading_21=0x7f02012c; - public static final int loading_22=0x7f02012d; - public static final int loading_23=0x7f02012e; - public static final int loading_24=0x7f02012f; - public static final int loading_3=0x7f020130; - public static final int loading_4=0x7f020131; - public static final int loading_5=0x7f020132; - public static final int loading_6=0x7f020133; - public static final int loading_7=0x7f020134; - public static final int loading_8=0x7f020135; - public static final int loading_9=0x7f020136; - public static final int loading_bg=0x7f020137; - public static final int loading_coffee=0x7f020138; - public static final int login_bg=0x7f020139; - public static final int login_default_avatar=0x7f02013a; - public static final int login_input=0x7f02013b; - public static final int mchat_navbar_tab_m_normal=0x7f02013c; - public static final int mchat_navbar_tab_m_pressed=0x7f02013d; - public static final int message_hint=0x7f02013e; - public static final int msg_tips_bg_normal=0x7f02013f; - public static final int msg_tips_bg_pressed=0x7f020140; - public static final int narrow=0x7f020141; - public static final int narrow_select=0x7f020142; - public static final int profile_photowall_avatar_frame_nor=0x7f020143; - public static final int profile_photowall_bg_female=0x7f020144; - public static final int profile_photowall_bg_male=0x7f020145; - public static final int scrollbar=0x7f020146; - public static final int set_list_bottom=0x7f020147; - public static final int set_list_bottom_pre=0x7f020148; - public static final int set_list_middle=0x7f020149; - public static final int set_list_middle_pre=0x7f02014a; - public static final int set_list_single=0x7f02014b; - public static final int set_list_single_pre=0x7f02014c; - public static final int set_list_top=0x7f02014d; - public static final int set_list_top_pre=0x7f02014e; - public static final int show=0x7f02014f; - public static final int silver=0x7f020191; - public static final int skin_aio_input_bar_bg=0x7f020150; - public static final int skin_aio_more_nor=0x7f020151; - public static final int skin_aio_more_pressed=0x7f020152; - public static final int skin_aio_send_button_normal=0x7f020153; - public static final int skin_aio_send_button_pressed=0x7f020154; - public static final int skin_bottom_bar_background=0x7f020155; - public static final int skin_common_btn_blue_bg_pressed=0x7f020156; - public static final int skin_common_btn_blue_unpressed=0x7f020157; - public static final int skin_common_btn_green_disable=0x7f020158; - public static final int skin_common_btn_green_normal=0x7f020159; - public static final int skin_common_btn_green_pressed=0x7f02015a; - public static final int skin_common_btn_red_disabled=0x7f02015b; - public static final int skin_common_btn_red_pressed=0x7f02015c; - public static final int skin_common_btn_red_unpressed=0x7f02015d; - public static final int skin_common_btn_white_disabled=0x7f02015e; - public static final int skin_common_btn_white_pressed=0x7f02015f; - public static final int skin_common_btn_white_unpressed=0x7f020160; - public static final int skin_contact_add_btn_normal=0x7f020161; - public static final int skin_contact_add_btn_press=0x7f020162; - public static final int skin_header_bar_bg=0x7f020163; - public static final int skin_header_btn_back_normal=0x7f020164; - public static final int skin_header_btn_back_press=0x7f020165; - public static final int skin_header_btn_disable=0x7f020166; - public static final int skin_header_btn_indicative_normal=0x7f020167; - public static final int skin_header_btn_indicative_press=0x7f020168; - public static final int skin_header_btn_normal=0x7f020169; - public static final int skin_header_btn_press=0x7f02016a; - public static final int skin_header_icon_group=0x7f02016b; - public static final int skin_header_icon_single=0x7f02016c; - public static final int skin_header_tab_left_normal=0x7f02016d; - public static final int skin_header_tab_left_pressed=0x7f02016e; - public static final int skin_header_tab_right_normal=0x7f02016f; - public static final int skin_header_tab_right_pressed=0x7f020170; - public static final int skin_icon_arrow_right_normal=0x7f020171; - public static final int skin_icon_arrow_right_pressed=0x7f020172; - public static final int skin_msgbox_bg_nor=0x7f020173; - public static final int skin_msgbox_bg_pressed=0x7f020174; - public static final int skin_msgbox_bg_top=0x7f020175; - public static final int skin_tab_icon_contact_normal=0x7f020176; - public static final int skin_tab_icon_contact_selected=0x7f020177; - public static final int skin_tab_icon_conversation_normal=0x7f020178; - public static final int skin_tab_icon_conversation_selected=0x7f020179; - public static final int skin_tab_icon_plugin_normal=0x7f02017a; - public static final int skin_tab_icon_plugin_selected=0x7f02017b; - public static final int skin_tab_icon_setup_normal=0x7f02017c; - public static final int skin_tab_icon_setup_selected=0x7f02017d; - public static final int skin_tab_newmessage=0x7f02017e; - public static final int skin_tab_newmessage2=0x7f02017f; - public static final int skin_tabbar_tab_select=0x7f020180; - public static final int skin_tabbar_tab_select_left=0x7f020181; - public static final int skin_tabbar_tab_select_right=0x7f020182; - public static final int splash_bg=0x7f020183; - public static final int success=0x7f020184; - public static final int tab2_normal=0x7f020185; - public static final int tab2_over=0x7f020186; - public static final int tab3_normal=0x7f020187; - public static final int tab3_over=0x7f020188; - public static final int tab_new=0x7f020189; - public static final int table_arrow=0x7f02018a; - public static final int toast_bg=0x7f02018b; - public static final int top_back_left_selector=0x7f02018c; - public static final int topface_back=0x7f02018d; - public static final int troop_default_head_1=0x7f02018e; - public static final int troop_default_head_2=0x7f02018f; - public static final int troop_default_head_3=0x7f020190; - } - public static final class id { - public static final int TITLE_TEXT=0x7f0b000f; - public static final int TOP_BACK_BUTTON=0x7f0b000e; - public static final int account=0x7f0b0004; - public static final int chat_list=0x7f0b0008; - public static final int content=0x7f0b000d; - public static final int face=0x7f0b0001; - public static final int headImageView=0x7f0b000c; - public static final int header=0x7f0b0007; - public static final int input=0x7f0b0003; - public static final int login=0x7f0b0006; - public static final int loginInputView=0x7f0b0002; - public static final int loginlayout=0x7f0b0005; - public static final int rlSystemMsg=0x7f0b000b; - public static final int scrollAreaLayout=0x7f0b0000; - public static final int textMsgType=0x7f0b0009; - public static final int time=0x7f0b000a; - } - public static final class layout { - public static final int activity_login=0x7f030000; - public static final int activity_splansh=0x7f030001; - public static final int activity_system_chat=0x7f030002; - public static final int item_chat_sysmsg=0x7f030003; - public static final int layout_global_top_header=0x7f030004; - } - public static final class raw { - public static final int classic=0x7f050000; - } - public static final class string { - public static final int app_name=0x7f090000; - public static final int at_now=0x7f09000d; - public static final int check_update_tips=0x7f09000a; - public static final int dayago=0x7f090003; - public static final int find_new_verson_tips=0x7f09000c; - public static final int hourago=0x7f090002; - public static final int minuteago=0x7f090001; - public static final int no_new_verson_tips=0x7f09000b; - public static final int refresh_lasttime=0x7f090006; - public static final int refresh_pull=0x7f090005; - public static final int refresh_release=0x7f090004; - public static final int tip_look_more=0x7f090009; - public static final int tip_network_busy=0x7f090008; - public static final int tip_reload=0x7f090007; - } - public static final class style { - public static final int AnimationActivity=0x7f0a0003; - public static final int Animations_PopUpMenu_BottomToTop=0x7f0a0005; - public static final int ChatMsgContentStyle=0x7f0a0006; - public static final int DialogStyle=0x7f0a0000; - public static final int GlobeEditText=0x7f0a0001; - public static final int GlobeTextView=0x7f0a0002; - public static final int GlobeTheme=0x7f0a0004; - } - public static final class styleable { - /** Attributes that can be used with a SegmentedControlView. -

      Includes the following attributes:

      - - - - - - - - -
      AttributeDescription
      {@link #SegmentedControlView_firstButtonBackground com.farsunset.ichat.example:firstButtonBackground}
      {@link #SegmentedControlView_lastButtonBackground com.farsunset.ichat.example:lastButtonBackground}
      {@link #SegmentedControlView_middleButtonBackground com.farsunset.ichat.example:middleButtonBackground}
      {@link #SegmentedControlView_uniqueButtonBackground com.farsunset.ichat.example:uniqueButtonBackground}
      - @see #SegmentedControlView_firstButtonBackground - @see #SegmentedControlView_lastButtonBackground - @see #SegmentedControlView_middleButtonBackground - @see #SegmentedControlView_uniqueButtonBackground - */ - public static final int[] SegmentedControlView = { - 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003 - }; - /** -

      This symbol is the offset where the {@link com.farsunset.ichat.example.R.attr#firstButtonBackground} - attribute's value can be found in the {@link #SegmentedControlView} array. - - -

      May be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". -

      May be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". - @attr name com.farsunset.ichat.example:firstButtonBackground - */ - public static final int SegmentedControlView_firstButtonBackground = 0; - /** -

      This symbol is the offset where the {@link com.farsunset.ichat.example.R.attr#lastButtonBackground} - attribute's value can be found in the {@link #SegmentedControlView} array. - - -

      May be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". -

      May be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". - @attr name com.farsunset.ichat.example:lastButtonBackground - */ - public static final int SegmentedControlView_lastButtonBackground = 1; - /** -

      This symbol is the offset where the {@link com.farsunset.ichat.example.R.attr#middleButtonBackground} - attribute's value can be found in the {@link #SegmentedControlView} array. - - -

      May be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". -

      May be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". - @attr name com.farsunset.ichat.example:middleButtonBackground - */ - public static final int SegmentedControlView_middleButtonBackground = 2; - /** -

      This symbol is the offset where the {@link com.farsunset.ichat.example.R.attr#uniqueButtonBackground} - attribute's value can be found in the {@link #SegmentedControlView} array. - - -

      May be a reference to another resource, in the form "@[+][package:]type:name" -or to a theme attribute in the form "?[package:][type:]name". -

      May be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". - @attr name com.farsunset.ichat.example:uniqueButtonBackground - */ - public static final int SegmentedControlView_uniqueButtonBackground = 3; - }; -} diff --git a/cim_for_netty/client-mchat-android/libs/cim-android-sdk-2.2.jar b/cim_for_netty/client-mchat-android/libs/cim-android-sdk-2.2.jar deleted file mode 100644 index ea8aa24..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/cim-android-sdk-2.2.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/libs/fastjson-1.1.47.android.jar b/cim_for_netty/client-mchat-android/libs/fastjson-1.1.47.android.jar deleted file mode 100644 index 9062508..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/fastjson-1.1.47.android.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/libs/httpmime-4.1.1.jar b/cim_for_netty/client-mchat-android/libs/httpmime-4.1.1.jar deleted file mode 100644 index 01af40b..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/httpmime-4.1.1.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-buffer-4.1.0.CR7.jar b/cim_for_netty/client-mchat-android/libs/netty-buffer-4.1.0.CR7.jar deleted file mode 100644 index b850bdf..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/netty-buffer-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-codec-4.1.0.CR7.jar b/cim_for_netty/client-mchat-android/libs/netty-codec-4.1.0.CR7.jar deleted file mode 100644 index d0092b7..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/netty-codec-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-common-4.1.0.CR7.jar b/cim_for_netty/client-mchat-android/libs/netty-common-4.1.0.CR7.jar deleted file mode 100644 index 606e920..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/netty-common-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-handler-4.1.0.CR7.jar b/cim_for_netty/client-mchat-android/libs/netty-handler-4.1.0.CR7.jar deleted file mode 100644 index 066c370..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/netty-handler-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-resolver-4.1.0.CR7.jar b/cim_for_netty/client-mchat-android/libs/netty-resolver-4.1.0.CR7.jar deleted file mode 100644 index 7c90d37..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/netty-resolver-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-transport-4.1.0.CR7.jar b/cim_for_netty/client-mchat-android/libs/netty-transport-4.1.0.CR7.jar deleted file mode 100644 index 7dafa07..0000000 Binary files a/cim_for_netty/client-mchat-android/libs/netty-transport-4.1.0.CR7.jar and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/lint.xml b/cim_for_netty/client-mchat-android/lint.xml deleted file mode 100644 index 30966e4..0000000 --- a/cim_for_netty/client-mchat-android/lint.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/proguard.cfg b/cim_for_netty/client-mchat-android/proguard.cfg deleted file mode 100644 index d63e44b..0000000 --- a/cim_for_netty/client-mchat-android/proguard.cfg +++ /dev/null @@ -1,36 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --dontwarn --keep public class io.netty.** {*;} --keep public class com.farsunset.cim.sdk.android.model.** {*;} - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembernames class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembernames class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/project.properties b/cim_for_netty/client-mchat-android/project.properties deleted file mode 100644 index 358ce4a..0000000 --- a/cim_for_netty/client-mchat-android/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-22 diff --git a/cim_for_netty/client-mchat-android/res/anim/activity_back.xml b/cim_for_netty/client-mchat-android/res/anim/activity_back.xml deleted file mode 100644 index 236e499..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/activity_back.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/activity_finish.xml b/cim_for_netty/client-mchat-android/res/anim/activity_finish.xml deleted file mode 100644 index cb91d85..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/activity_finish.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/activity_new.xml b/cim_for_netty/client-mchat-android/res/anim/activity_new.xml deleted file mode 100644 index 3be216c..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/activity_new.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/activity_out.xml b/cim_for_netty/client-mchat-android/res/anim/activity_out.xml deleted file mode 100644 index 87c3b67..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/activity_out.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/appear.xml b/cim_for_netty/client-mchat-android/res/anim/appear.xml deleted file mode 100644 index 42eabbe..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/appear.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/disappear.xml b/cim_for_netty/client-mchat-android/res/anim/disappear.xml deleted file mode 100644 index ea454d7..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/disappear.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/disappear_del.xml b/cim_for_netty/client-mchat-android/res/anim/disappear_del.xml deleted file mode 100644 index a46ac7d..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/disappear_del.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/extension_appear_from_bottom_to_top.xml b/cim_for_netty/client-mchat-android/res/anim/extension_appear_from_bottom_to_top.xml deleted file mode 100644 index f0f37c3..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/extension_appear_from_bottom_to_top.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/extension_disappear_from_top_to_bottom.xml b/cim_for_netty/client-mchat-android/res/anim/extension_disappear_from_top_to_bottom.xml deleted file mode 100644 index c89b166..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/extension_disappear_from_top_to_bottom.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/rotate.xml b/cim_for_netty/client-mchat-android/res/anim/rotate.xml deleted file mode 100644 index 348512d..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/rotate.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/slide_in_from_bottom.xml b/cim_for_netty/client-mchat-android/res/anim/slide_in_from_bottom.xml deleted file mode 100644 index d2b6340..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/slide_in_from_bottom.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/slide_in_from_left.xml b/cim_for_netty/client-mchat-android/res/anim/slide_in_from_left.xml deleted file mode 100644 index e19ac80..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/slide_in_from_left.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/slide_out_to_bottom.xml b/cim_for_netty/client-mchat-android/res/anim/slide_out_to_bottom.xml deleted file mode 100644 index 5e8bd9d..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/slide_out_to_bottom.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/anim/slide_out_to_right.xml b/cim_for_netty/client-mchat-android/res/anim/slide_out_to_right.xml deleted file mode 100644 index 6272b4f..0000000 --- a/cim_for_netty/client-mchat-android/res/anim/slide_out_to_right.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/action_sheet_base_9.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/action_sheet_base_9.9.png deleted file mode 100644 index ca46d55..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/action_sheet_base_9.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_create_troop.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_create_troop.png deleted file mode 100644 index 22e984d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_create_troop.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_similarity.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_similarity.png deleted file mode 100644 index 2a6c22c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_similarity.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_troop.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_troop.png deleted file mode 100644 index 6d56f46..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_troop.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_nor.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_nor.9.png deleted file mode 100644 index 664e40b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_nor.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_pressed.9.png deleted file mode 100644 index 1771dff..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_nor.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_nor.9.png deleted file mode 100644 index cdea0c0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_nor.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_pressed.9.png deleted file mode 100644 index 66362e8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/card_avatar.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/card_avatar.9.png deleted file mode 100644 index ffe13ae..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/card_avatar.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_camera.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_camera.png deleted file mode 100644 index dee2c0a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_camera.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_location.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_location.png deleted file mode 100644 index fd3fb63..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_location.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_photo.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_photo.png deleted file mode 100644 index 4363324..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_photo.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_send_file.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_send_file.png deleted file mode 100644 index 31afee4..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_send_file.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_0.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_0.png deleted file mode 100644 index da34dea..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_0.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_1.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_1.png deleted file mode 100644 index afb0284..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_1.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_10.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_10.png deleted file mode 100644 index c0de888..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_10.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_11.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_11.png deleted file mode 100644 index 9794810..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_11.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_2.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_2.png deleted file mode 100644 index ee14cb5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_2.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_3.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_3.png deleted file mode 100644 index ae50016..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_3.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_4.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_4.png deleted file mode 100644 index 37cbbae..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_4.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_5.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_5.png deleted file mode 100644 index 39fca11..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_5.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_6.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_6.png deleted file mode 100644 index 1e48cd5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_6.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_7.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_7.png deleted file mode 100644 index 00ff673..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_7.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_8.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_8.png deleted file mode 100644 index 93cf418..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_8.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_9.png deleted file mode 100644 index 88d702b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_date_time.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_date_time.png deleted file mode 100644 index 76cb1d8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_date_time.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_read.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_read.png deleted file mode 100644 index 73b06e7..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_read.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_addfriend.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_addfriend.png deleted file mode 100644 index 7a9515f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_addfriend.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_click.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_click.png deleted file mode 100644 index 84384f2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_click.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_nor.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_nor.png deleted file mode 100644 index 0312e1e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_nor.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_joinfroup.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_joinfroup.png deleted file mode 100644 index f0a930a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_joinfroup.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_more.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_more.png deleted file mode 100644 index c67b3bf..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_more.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_recent_sysmsg.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_recent_sysmsg.png deleted file mode 100644 index c0d048d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_recent_sysmsg.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/input_box_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/input_box_bg.9.png deleted file mode 100644 index afaa782..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/input_box_bg.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/list_head_border_whitebg.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/list_head_border_whitebg.9.png deleted file mode 100644 index c3bda48..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/list_head_border_whitebg.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png deleted file mode 100644 index 6def1bb..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png deleted file mode 100644 index cde2205..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png deleted file mode 100644 index 2ac9df5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_female.jpg b/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_female.jpg deleted file mode 100644 index 0e3514e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_female.jpg and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_male.jpg b/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_male.jpg deleted file mode 100644 index 42ba79e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_male.jpg and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_input_bar_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_input_bar_bg.9.png deleted file mode 100644 index f9ce5ed..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_input_bar_bg.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_nor.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_nor.png deleted file mode 100644 index 5b5dd17..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_nor.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_pressed.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_pressed.png deleted file mode 100644 index fc72dc9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_pressed.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_normal.9.png deleted file mode 100644 index 741bcb3..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_pressed.9.png deleted file mode 100644 index 16161ea..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_bottom_bar_background.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_bottom_bar_background.png deleted file mode 100644 index 3ea9de9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_bottom_bar_background.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_disable.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_disable.9.png deleted file mode 100644 index c433b1c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_disable.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_normal.9.png deleted file mode 100644 index 434f6a0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_pressed.9.png deleted file mode 100644 index e6d72f2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_disabled.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_disabled.9.png deleted file mode 100644 index cf26862..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_disabled.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_pressed.9.png deleted file mode 100644 index 23f36b2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png deleted file mode 100644 index 9e2f395..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_disabled.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_disabled.9.png deleted file mode 100644 index e946848..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_disabled.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_pressed.9.png deleted file mode 100644 index faa9786..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png deleted file mode 100644 index c13a8ad..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_normal.9.png deleted file mode 100644 index a74f592..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_press.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_press.9.png deleted file mode 100644 index 2cf15e3..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_press.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_disable.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_disable.9.png deleted file mode 100644 index 1f2ac7b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_disable.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png deleted file mode 100644 index 87a34e0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_press.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_press.9.png deleted file mode 100644 index 16dbb9b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_press.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_normal.9.png deleted file mode 100644 index 8f2f995..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_press.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_press.9.png deleted file mode 100644 index 72ad591..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_press.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_group.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_group.png deleted file mode 100644 index f7f3460..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_group.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_single.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_single.png deleted file mode 100644 index 9289bc7..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_single.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_normal.9.png deleted file mode 100644 index 121915f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_pressed.9.png deleted file mode 100644 index ee4f3de..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_normal.9.png deleted file mode 100644 index c8762c5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_pressed.9.png deleted file mode 100644 index 07b360f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_normal.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_normal.png deleted file mode 100644 index 586637d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_selected.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_selected.png deleted file mode 100644 index 67c40c9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_selected.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_normal.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_normal.png deleted file mode 100644 index 1aef389..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_selected.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_selected.png deleted file mode 100644 index 58dc52f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_selected.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_normal.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_normal.png deleted file mode 100644 index 494c775..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_selected.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_selected.png deleted file mode 100644 index 4081a03..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_selected.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_normal.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_normal.png deleted file mode 100644 index 82995d6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_selected.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_selected.png deleted file mode 100644 index 577eca5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_selected.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage.png deleted file mode 100644 index 998c5c0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage2.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage2.9.png deleted file mode 100644 index b34abf0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage2.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select.9.png deleted file mode 100644 index 865e0d7..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_left.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_left.png deleted file mode 100644 index 40c178d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_left.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_right.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_right.png deleted file mode 100644 index e8be980..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_right.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-320dpi/tab_new.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/tab_new.png deleted file mode 100644 index 7f677bf..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-320dpi/tab_new.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/aicon_error.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/aicon_error.png deleted file mode 100644 index 7bdaed6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/aicon_error.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/app_main_bg.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/app_main_bg.png deleted file mode 100644 index 103ea69..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/app_main_bg.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/arrow.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/arrow.png deleted file mode 100644 index d29af2b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/arrow.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_normal.9.png deleted file mode 100644 index 53eb720..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_pressed.9.png deleted file mode 100644 index 807c2b9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/bodylisttop.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/bodylisttop.9.png deleted file mode 100644 index 8ba7f02..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/bodylisttop.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/bottom.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/bottom.9.png deleted file mode 100644 index 0b5c6c4..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/bottom.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_off.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_off.png deleted file mode 100644 index 4ac8c48..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_off.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_on.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_on.png deleted file mode 100644 index bbbc179..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_on.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/chat_time_block.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/chat_time_block.9.png deleted file mode 100644 index e987c49..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/chat_time_block.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/close_del.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/close_del.png deleted file mode 100644 index a49370d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/close_del.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/close_pressed.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/close_pressed.png deleted file mode 100644 index 1863272..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/close_pressed.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/colorful_line.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/colorful_line.png deleted file mode 100644 index 03aa8d7..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/colorful_line.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_loading_icon.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_loading_icon.png deleted file mode 100644 index 12e3d6e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_loading_icon.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_net_error_icon.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_net_error_icon.png deleted file mode 100644 index b495e75..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_net_error_icon.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/cutline.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/cutline.png deleted file mode 100644 index 35771f5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/cutline.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/edittext_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/edittext_bg.9.png deleted file mode 100644 index 87b94de..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/edittext_bg.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f000.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f000.gif deleted file mode 100644 index cd75cab..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f000.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f001.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f001.gif deleted file mode 100644 index 29e59c6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f001.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f002.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f002.gif deleted file mode 100644 index e4afbf5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f002.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f003.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f003.gif deleted file mode 100644 index 89ab9ef..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f003.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f004.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f004.gif deleted file mode 100644 index 9962e46..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f004.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f005.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f005.gif deleted file mode 100644 index 596447d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f005.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f006.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f006.gif deleted file mode 100644 index b98791f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f006.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f007.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f007.png deleted file mode 100644 index f5c788f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f007.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f008.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f008.png deleted file mode 100644 index 1189a7d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f008.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f009.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f009.gif deleted file mode 100644 index b43cb16..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f009.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f010.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f010.gif deleted file mode 100644 index b9911b9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f010.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f011.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f011.gif deleted file mode 100644 index 1d5b4c2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f011.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f012.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f012.gif deleted file mode 100644 index e388fff..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f012.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f013.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f013.gif deleted file mode 100644 index 9c79e8e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f013.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f014.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f014.gif deleted file mode 100644 index 49a29c0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f014.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f015.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f015.gif deleted file mode 100644 index b312a9e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f015.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f016.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f016.png deleted file mode 100644 index 28d74f6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f016.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f017.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f017.gif deleted file mode 100644 index ff87ee9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f017.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f018.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f018.gif deleted file mode 100644 index b3a13d1..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f018.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f019.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f019.gif deleted file mode 100644 index 4fe7626..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f019.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f020.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f020.gif deleted file mode 100644 index bf77a41..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f020.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f021.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f021.gif deleted file mode 100644 index 2e2d871..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f021.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f022.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f022.gif deleted file mode 100644 index c864eb1..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f022.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f023.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f023.gif deleted file mode 100644 index b0a22db..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f023.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f024.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f024.gif deleted file mode 100644 index a4e351c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f024.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f025.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f025.gif deleted file mode 100644 index 087d409..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f025.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f026.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f026.gif deleted file mode 100644 index 516d91c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f026.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f027.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f027.gif deleted file mode 100644 index 86df7df..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f027.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f028.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f028.png deleted file mode 100644 index d85dd30..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f028.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f029.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f029.gif deleted file mode 100644 index 976fdc1..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f029.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f030.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f030.gif deleted file mode 100644 index d8a2811..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f030.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f031.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f031.gif deleted file mode 100644 index 1258a90..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f031.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f032.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f032.png deleted file mode 100644 index 004500e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f032.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f033.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f033.gif deleted file mode 100644 index b3f7f1a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f033.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f034.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f034.gif deleted file mode 100644 index 9dcfd7a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f034.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f035.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f035.gif deleted file mode 100644 index f767d36..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f035.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f036.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f036.gif deleted file mode 100644 index 7cd7f94..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f036.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f037.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f037.gif deleted file mode 100644 index 38200e0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f037.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f038.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f038.gif deleted file mode 100644 index 466ab43..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f038.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f039.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f039.png deleted file mode 100644 index 59af419..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f039.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f040.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f040.gif deleted file mode 100644 index bc32ca2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f040.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f041.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f041.gif deleted file mode 100644 index f857313..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f041.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f042.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f042.gif deleted file mode 100644 index a20cdbc..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f042.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f043.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f043.gif deleted file mode 100644 index 68f8b0d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f043.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f044.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f044.gif deleted file mode 100644 index d397d74..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f044.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f045.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f045.gif deleted file mode 100644 index 35eae02..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f045.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f046.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f046.gif deleted file mode 100644 index 5a953c8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f046.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f047.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f047.png deleted file mode 100644 index 42bbddd..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f047.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f048.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f048.gif deleted file mode 100644 index bad2c64..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f048.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f049.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f049.gif deleted file mode 100644 index 4a872ef..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f049.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f050.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f050.gif deleted file mode 100644 index 1e95b53..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f050.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f051.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f051.gif deleted file mode 100644 index 11475e6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f051.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f052.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f052.gif deleted file mode 100644 index 13b460e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f052.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f053.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f053.gif deleted file mode 100644 index 87f2990..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f053.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f054.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f054.gif deleted file mode 100644 index 7b85568..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f054.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f055.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f055.gif deleted file mode 100644 index 7f2d417..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f055.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f056.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f056.gif deleted file mode 100644 index 1d2b1a6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f056.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f057.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f057.png deleted file mode 100644 index 94c9277..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f057.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f058.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f058.png deleted file mode 100644 index 42bb7ee..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f058.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f059.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f059.gif deleted file mode 100644 index cb0197a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f059.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f060.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f060.png deleted file mode 100644 index 2be04f2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f060.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f061.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f061.gif deleted file mode 100644 index 6a6d9e0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f061.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f062.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f062.gif deleted file mode 100644 index 3f1c513..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f062.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f063.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f063.gif deleted file mode 100644 index a39068e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f063.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f064.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f064.png deleted file mode 100644 index 1875bf2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f064.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f065.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f065.gif deleted file mode 100644 index 0a8eebe..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f065.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f066.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f066.gif deleted file mode 100644 index 4239600..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f066.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f067.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f067.png deleted file mode 100644 index ccb101b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f067.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f068.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f068.png deleted file mode 100644 index 3ae7d31..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f068.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f069.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f069.png deleted file mode 100644 index a1be64e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f069.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f070.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f070.gif deleted file mode 100644 index d243db0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f070.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f071.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f071.png deleted file mode 100644 index 03ed33f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f071.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f072.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f072.gif deleted file mode 100644 index 8ed341e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f072.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f073.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f073.gif deleted file mode 100644 index bbe3dab..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f073.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f074.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f074.gif deleted file mode 100644 index 1cbedb9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f074.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f075.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f075.png deleted file mode 100644 index 7d8a3af..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f075.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f076.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f076.png deleted file mode 100644 index 315392a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f076.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f077.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f077.gif deleted file mode 100644 index 8ab455f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f077.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f078.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f078.png deleted file mode 100644 index 8a7ea81..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f078.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f079.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f079.gif deleted file mode 100644 index 1be369b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f079.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f080.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f080.png deleted file mode 100644 index dbc258c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f080.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f081.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f081.gif deleted file mode 100644 index f40fc49..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f081.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f082.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f082.gif deleted file mode 100644 index 2b59b94..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f082.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f083.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f083.gif deleted file mode 100644 index 7c0ba4b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f083.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f084.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f084.gif deleted file mode 100644 index 012b953..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f084.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f085.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f085.gif deleted file mode 100644 index a9047a2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f085.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f086.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f086.gif deleted file mode 100644 index ac09218..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f086.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f087.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f087.gif deleted file mode 100644 index 559c8c8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f087.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f088.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f088.gif deleted file mode 100644 index 6dd40f1..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f088.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f089.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f089.gif deleted file mode 100644 index 3caead4..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f089.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f090.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f090.gif deleted file mode 100644 index 5ca6afc..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f090.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f091.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f091.gif deleted file mode 100644 index bb09d0f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f091.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f092.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f092.gif deleted file mode 100644 index 477a994..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f092.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f093.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f093.gif deleted file mode 100644 index 029bc34..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f093.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f094.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f094.gif deleted file mode 100644 index 7e5af84..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f094.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f095.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f095.gif deleted file mode 100644 index 8f6049c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f095.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f096.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f096.gif deleted file mode 100644 index fd1485a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f096.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f097.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f097.gif deleted file mode 100644 index 2103bee..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f097.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f098.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f098.gif deleted file mode 100644 index 796c41f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f098.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f099.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f099.gif deleted file mode 100644 index 140d0a8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f099.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f100.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f100.gif deleted file mode 100644 index 09390e8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f100.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f101.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f101.gif deleted file mode 100644 index 460746b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f101.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f102.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f102.gif deleted file mode 100644 index c157bd8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f102.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f103.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f103.gif deleted file mode 100644 index 63f3923..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f103.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f104.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f104.gif deleted file mode 100644 index 2f13fd5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f104.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f105.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f105.gif deleted file mode 100644 index 3ad0fa9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f105.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f106.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f106.gif deleted file mode 100644 index 4c81113..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f106.gif and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_000.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_000.png deleted file mode 100644 index 5875442..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_000.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_001.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_001.png deleted file mode 100644 index 051e7eb..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_001.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_002.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_002.png deleted file mode 100644 index f8f9430..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_002.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_003.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_003.png deleted file mode 100644 index e69a076..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_003.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_004.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_004.png deleted file mode 100644 index b06515a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_004.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_005.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_005.png deleted file mode 100644 index 78d8234..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_005.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_006.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_006.png deleted file mode 100644 index e48785b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_006.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_007.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_007.png deleted file mode 100644 index f5c788f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_007.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_008.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_008.png deleted file mode 100644 index 1189a7d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_008.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_009.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_009.png deleted file mode 100644 index 1b514a7..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_009.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_010.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_010.png deleted file mode 100644 index df9a459..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_010.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_011.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_011.png deleted file mode 100644 index e502d4d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_011.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_012.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_012.png deleted file mode 100644 index 83237fd..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_012.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_013.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_013.png deleted file mode 100644 index 273081e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_013.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_014.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_014.png deleted file mode 100644 index 4af6fc2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_014.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_015.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_015.png deleted file mode 100644 index 28081a2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_015.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_016.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_016.png deleted file mode 100644 index 28d74f6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_016.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_017.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_017.png deleted file mode 100644 index 56d5760..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_017.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_018.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_018.png deleted file mode 100644 index 83f304b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_018.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_019.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_019.png deleted file mode 100644 index 5a769f0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_019.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_020.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_020.png deleted file mode 100644 index b77259c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_020.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_021.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_021.png deleted file mode 100644 index b379586..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_021.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_022.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_022.png deleted file mode 100644 index bdb94e0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_022.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_023.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_023.png deleted file mode 100644 index d97ff5f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_023.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_024.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_024.png deleted file mode 100644 index 4e2eb4d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_024.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_025.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_025.png deleted file mode 100644 index 02780e9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_025.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_026.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_026.png deleted file mode 100644 index 85d095a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_026.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_027.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_027.png deleted file mode 100644 index c8fc628..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_027.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_028.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_028.png deleted file mode 100644 index d85dd30..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_028.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_029.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_029.png deleted file mode 100644 index d37e5fe..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_029.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_030.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_030.png deleted file mode 100644 index 3efb667..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_030.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_031.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_031.png deleted file mode 100644 index 8a0bdc5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_031.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_032.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_032.png deleted file mode 100644 index 004500e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_032.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_033.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_033.png deleted file mode 100644 index 1ab0a23..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_033.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_034.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_034.png deleted file mode 100644 index ef598ba..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_034.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_035.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_035.png deleted file mode 100644 index 3260627..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_035.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_036.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_036.png deleted file mode 100644 index 8b6bd2a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_036.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_037.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_037.png deleted file mode 100644 index 2e50c1f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_037.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_038.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_038.png deleted file mode 100644 index ae7ee00..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_038.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_039.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_039.png deleted file mode 100644 index 59af419..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_039.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_040.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_040.png deleted file mode 100644 index cee4c08..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_040.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_041.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_041.png deleted file mode 100644 index 4d05ffa..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_041.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_042.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_042.png deleted file mode 100644 index 364558b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_042.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_043.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_043.png deleted file mode 100644 index f055c30..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_043.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_044.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_044.png deleted file mode 100644 index 605ccea..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_044.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_045.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_045.png deleted file mode 100644 index 5815657..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_045.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_046.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_046.png deleted file mode 100644 index 70f7b1c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_046.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_047.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_047.png deleted file mode 100644 index 42bbddd..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_047.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_048.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_048.png deleted file mode 100644 index 022720a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_048.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_049.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_049.png deleted file mode 100644 index 906aa62..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_049.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_050.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_050.png deleted file mode 100644 index d01d9fe..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_050.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_051.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_051.png deleted file mode 100644 index b041181..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_051.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_052.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_052.png deleted file mode 100644 index 98061e2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_052.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_053.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_053.png deleted file mode 100644 index e79ab1b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_053.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_054.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_054.png deleted file mode 100644 index 083e467..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_054.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_055.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_055.png deleted file mode 100644 index 0cdcb3c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_055.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_056.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_056.png deleted file mode 100644 index 9763453..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_056.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_057.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_057.png deleted file mode 100644 index 94c9277..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_057.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_058.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_058.png deleted file mode 100644 index 42bb7ee..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_058.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_059.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_059.png deleted file mode 100644 index bd6abad..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_059.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_060.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_060.png deleted file mode 100644 index 2be04f2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_060.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_061.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_061.png deleted file mode 100644 index 229f4c8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_061.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_062.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_062.png deleted file mode 100644 index 0e3ef0e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_062.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_063.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_063.png deleted file mode 100644 index 8e5458c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_063.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_064.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_064.png deleted file mode 100644 index 1875bf2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_064.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_065.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_065.png deleted file mode 100644 index 06d4ffa..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_065.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_066.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_066.png deleted file mode 100644 index 3d4ef11..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_066.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_067.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_067.png deleted file mode 100644 index ccb101b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_067.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_068.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_068.png deleted file mode 100644 index 3ae7d31..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_068.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_069.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_069.png deleted file mode 100644 index a1be64e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_069.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_070.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_070.png deleted file mode 100644 index 5df5aaa..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_070.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_071.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_071.png deleted file mode 100644 index 03ed33f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_071.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_072.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_072.png deleted file mode 100644 index 953c7c4..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_072.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_073.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_073.png deleted file mode 100644 index fd93144..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_073.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_074.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_074.png deleted file mode 100644 index faa8185..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_074.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_075.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_075.png deleted file mode 100644 index 7d8a3af..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_075.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_076.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_076.png deleted file mode 100644 index 315392a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_076.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_077.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_077.png deleted file mode 100644 index 578f579..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_077.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_078.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_078.png deleted file mode 100644 index 8a7ea81..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_078.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_079.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_079.png deleted file mode 100644 index 7f458bc..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_079.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_080.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_080.png deleted file mode 100644 index dbc258c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_080.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_081.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_081.png deleted file mode 100644 index 5452bba..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_081.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_082.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_082.png deleted file mode 100644 index 06adc90..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_082.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_083.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_083.png deleted file mode 100644 index 0d726f9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_083.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_084.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_084.png deleted file mode 100644 index 84394ba..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_084.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_085.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_085.png deleted file mode 100644 index 3d2ea19..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_085.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_086.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_086.png deleted file mode 100644 index 40a2dbf..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_086.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_087.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_087.png deleted file mode 100644 index 1881c51..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_087.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_088.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_088.png deleted file mode 100644 index 91e5001..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_088.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_089.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_089.png deleted file mode 100644 index 709aadc..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_089.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_090.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_090.png deleted file mode 100644 index 73b2673..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_090.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_091.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_091.png deleted file mode 100644 index e4825c8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_091.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_092.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_092.png deleted file mode 100644 index a5ab2ba..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_092.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_093.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_093.png deleted file mode 100644 index 32747a5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_093.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_094.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_094.png deleted file mode 100644 index 89fe440..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_094.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_095.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_095.png deleted file mode 100644 index 37f5a78..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_095.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_096.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_096.png deleted file mode 100644 index 79d4699..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_096.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_097.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_097.png deleted file mode 100644 index 9881beb..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_097.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_098.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_098.png deleted file mode 100644 index 214017c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_098.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_099.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_099.png deleted file mode 100644 index 24c92ba..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_099.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_100.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_100.png deleted file mode 100644 index e42beb5..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_100.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_101.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_101.png deleted file mode 100644 index f7adb23..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_101.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_102.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_102.png deleted file mode 100644 index 4c92efc..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_102.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_103.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_103.png deleted file mode 100644 index 718cca7..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_103.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_104.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_104.png deleted file mode 100644 index a21ce49..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_104.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_105.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_105.png deleted file mode 100644 index 4d163bd..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_105.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_106.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_106.png deleted file mode 100644 index 06b4ccd..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_106.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/grouphead_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/grouphead_normal.png deleted file mode 100644 index 7f25f46..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/grouphead_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/h033.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/h033.png deleted file mode 100644 index 0de2b39..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/h033.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_away.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_away.png deleted file mode 100644 index 63d77db..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_away.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_error.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_error.png deleted file mode 100644 index 4bd3f06..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_error.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_invisiable.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_invisiable.png deleted file mode 100644 index 8f7072d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_invisiable.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_logo.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_logo.png deleted file mode 100644 index 0828184..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_logo.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_normal.png deleted file mode 100644 index 9568b0d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_notify.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_notify.png deleted file mode 100644 index e85c92d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_notify.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_offline.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_offline.png deleted file mode 100644 index 77e8cfc..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_offline.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_online.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_online.png deleted file mode 100644 index 8c75355..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_online.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_share.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_share.png deleted file mode 100644 index 3e330bd..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_share.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_success.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_success.png deleted file mode 100644 index fd8ec0a..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_success.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/image_empty.jpg b/cim_for_netty/client-mchat-android/res/drawable-hdpi/image_empty.jpg deleted file mode 100644 index e0b2944..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/image_empty.jpg and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/input.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/input.9.png deleted file mode 100644 index 3010c31..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/input.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/input_over.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/input_over.9.png deleted file mode 100644 index 96541f2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/input_over.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/list_blockbg.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/list_blockbg.9.png deleted file mode 100644 index 3350dfc..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/list_blockbg.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/list_divider_line.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/list_divider_line.png deleted file mode 100644 index b1936b7..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/list_divider_line.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/listitem_hover.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/listitem_hover.9.png deleted file mode 100644 index ffd7160..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/listitem_hover.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_1.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_1.png deleted file mode 100644 index 6531ea6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_1.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_10.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_10.png deleted file mode 100644 index f34df80..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_10.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_11.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_11.png deleted file mode 100644 index eed8afc..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_11.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_12.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_12.png deleted file mode 100644 index 55e603c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_12.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_13.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_13.png deleted file mode 100644 index 348607e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_13.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_14.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_14.png deleted file mode 100644 index 250c692..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_14.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_15.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_15.png deleted file mode 100644 index 525658c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_15.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_16.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_16.png deleted file mode 100644 index 383fdd2..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_16.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_17.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_17.png deleted file mode 100644 index 112e8bf..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_17.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_18.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_18.png deleted file mode 100644 index 47c0808..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_18.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_19.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_19.png deleted file mode 100644 index ea124f8..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_19.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_2.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_2.png deleted file mode 100644 index 5308892..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_2.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_20.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_20.png deleted file mode 100644 index 7646ae3..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_20.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_21.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_21.png deleted file mode 100644 index ee1cad0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_21.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_22.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_22.png deleted file mode 100644 index 1cb8c28..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_22.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_23.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_23.png deleted file mode 100644 index fbf7994..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_23.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_24.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_24.png deleted file mode 100644 index 12d1824..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_24.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_3.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_3.png deleted file mode 100644 index 7e871ba..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_3.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_4.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_4.png deleted file mode 100644 index 3fce700..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_4.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_5.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_5.png deleted file mode 100644 index cf86a3f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_5.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_6.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_6.png deleted file mode 100644 index f082aa1..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_6.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_7.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_7.png deleted file mode 100644 index 8105112..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_7.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_8.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_8.png deleted file mode 100644 index f985f3b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_8.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_9.png deleted file mode 100644 index a5e3a9f..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_bg.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_bg.png deleted file mode 100644 index 0ecb5a4..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_bg.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_coffee.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_coffee.png deleted file mode 100644 index 5598cd0..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_coffee.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/message_hint.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/message_hint.png deleted file mode 100644 index 03bfe4b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/message_hint.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_normal.9.png deleted file mode 100644 index f643c56..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_normal.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_pressed.9.png deleted file mode 100644 index 41c1cf6..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_pressed.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow.9.png deleted file mode 100644 index 48aacf1..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow_select.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow_select.9.png deleted file mode 100644 index 6690171..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow_select.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/scrollbar.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/scrollbar.9.png deleted file mode 100644 index d23b51c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/scrollbar.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom.9.png deleted file mode 100644 index 74085ae..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom_pre.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom_pre.9.png deleted file mode 100644 index 2218423..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom_pre.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle.9.png deleted file mode 100644 index aa17a3c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle_pre.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle_pre.9.png deleted file mode 100644 index d4a3fc1..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle_pre.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single.9.png deleted file mode 100644 index 4a13540..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single_pre.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single_pre.9.png deleted file mode 100644 index 6a11115..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single_pre.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top.9.png deleted file mode 100644 index 91ab8bb..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top_pre.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top_pre.9.png deleted file mode 100644 index a31b497..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top_pre.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/show.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/show.png deleted file mode 100644 index dbb2d2e..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/show.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_normal.png deleted file mode 100644 index a385d13..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_pressed.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_pressed.png deleted file mode 100644 index cfc3e89..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_pressed.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/success.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/success.png deleted file mode 100644 index b2ccbc4..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/success.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_normal.png deleted file mode 100644 index b640d29..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_over.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_over.png deleted file mode 100644 index bfd217c..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_over.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_normal.png deleted file mode 100644 index b2a3c19..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_normal.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_over.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_over.png deleted file mode 100644 index 3a3f25b..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_over.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/table_arrow.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/table_arrow.png deleted file mode 100644 index dd3dfe9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/table_arrow.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/toast_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/toast_bg.9.png deleted file mode 100644 index a7a11a9..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/toast_bg.9.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/topface_back.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/topface_back.png deleted file mode 100644 index 4f937cf..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/topface_back.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_1.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_1.png deleted file mode 100644 index d585e7d..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_1.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_2.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_2.png deleted file mode 100644 index f7c43de..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_2.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_3.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_3.png deleted file mode 100644 index 52e2827..0000000 Binary files a/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_3.png and /dev/null differ diff --git a/cim_for_netty/client-mchat-android/res/values/arrays.xml b/cim_for_netty/client-mchat-android/res/values/arrays.xml deleted file mode 100644 index 3610151..0000000 --- a/cim_for_netty/client-mchat-android/res/values/arrays.xml +++ /dev/null @@ -1,225 +0,0 @@ - - - - - f_static_000 - f_static_001 - f_static_002 - f_static_003 - f_static_004 - f_static_005 - f_static_006 - f_static_007 - f_static_008 - f_static_009 - f_static_010 - f_static_011 - f_static_012 - f_static_013 - f_static_014 - f_static_015 - f_static_016 - f_static_017 - f_static_018 - f_static_019 - f_static_020 - f_static_021 - f_static_022 - f_static_023 - f_static_024 - f_static_025 - f_static_026 - f_static_027 - f_static_028 - f_static_029 - f_static_030 - f_static_031 - f_static_032 - f_static_033 - f_static_034 - f_static_035 - f_static_036 - f_static_037 - f_static_038 - f_static_039 - f_static_040 - f_static_041 - f_static_042 - f_static_043 - f_static_044 - f_static_045 - f_static_046 - f_static_047 - f_static_048 - f_static_049 - f_static_050 - f_static_051 - f_static_052 - f_static_053 - f_static_054 - f_static_055 - f_static_056 - f_static_057 - f_static_058 - f_static_059 - f_static_060 - f_static_061 - f_static_062 - f_static_063 - f_static_064 - f_static_065 - f_static_066 - f_static_067 - f_static_068 - f_static_069 - f_static_070 - f_static_071 - f_static_072 - f_static_073 - f_static_074 - f_static_075 - f_static_076 - f_static_077 - f_static_078 - f_static_079 - f_static_080 - f_static_081 - f_static_082 - f_static_083 - f_static_084 - f_static_085 - f_static_086 - f_static_087 - f_static_088 - f_static_089 - f_static_090 - f_static_091 - f_static_092 - f_static_093 - f_static_094 - f_static_095 - f_static_096 - f_static_097 - f_static_098 - f_static_099 - f_static_100 - f_static_101 - f_static_102 - f_static_103 - f_static_104 - f_static_105 - f_static_106 - - - - - 000 - 001 - 002 - 003 - 004 - 005 - 006 - 007 - 008 - 009 - 010 - 011 - 012 - 013 - 014 - 015 - 016 - 017 - 018 - 019 - 020 - 021 - 022 - 023 - 024 - 025 - 026 - 027 - 028 - 029 - 030 - 031 - 032 - 033 - 034 - 035 - 036 - 037 - 038 - 039 - 040 - 041 - 042 - 043 - 044 - 045 - 046 - 047 - 048 - 049 - 050 - 051 - 052 - 053 - 054 - 055 - 056 - 057 - 058 - 059 - 060 - 061 - 062 - 063 - 064 - 065 - 066 - 067 - 068 - 069 - 070 - 071 - 072 - 073 - 074 - 075 - 076 - 077 - 078 - 079 - 080 - 081 - 082 - 083 - 084 - 085 - 086 - 087 - 088 - 089 - 090 - 091 - 092 - 093 - 094 - 095 - 096 - 097 - 098 - 099 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/values/attrs.xml b/cim_for_netty/client-mchat-android/res/values/attrs.xml deleted file mode 100644 index 520cbbb..0000000 --- a/cim_for_netty/client-mchat-android/res/values/attrs.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/cim_for_netty/client-mchat-android/res/values/color.xml b/cim_for_netty/client-mchat-android/res/values/color.xml deleted file mode 100644 index 8d861c4..0000000 --- a/cim_for_netty/client-mchat-android/res/values/color.xml +++ /dev/null @@ -1,27 +0,0 @@ - - -#f89636 -#ffffff -#3399CC -#A5CD4E -#ff789089 -#000000 -#E20C0C - #fff4f6f8 -#c8ffffff -#ffeef1f3 -#00000000 - -#050917 -#59687C - -#050917 - -#DDDDFF - #AAAAAA - #00000000 - #0D3EDE - #519A2D - - #00ffffff - diff --git a/cim_for_netty/client-mchat-android/res/values/dimens.xml b/cim_for_netty/client-mchat-android/res/values/dimens.xml deleted file mode 100644 index 1431fa5..0000000 --- a/cim_for_netty/client-mchat-android/res/values/dimens.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - 19.0sp - 16.0sp - 15.0sp - 12.0sp - 52.0dip - 34.0dip - 15.0sp - 50.0dip - 8.0dip - 8.0dip - 15.0dip - 8.0dip - 10.0dip - 42.0dip - 16.0dip - 16.0sp - 18.0sp - 20.0sp - 22.0sp - 100.0dip - 110.0dip - 120.0dip - 130.0dip - 150.0dip - 240.0dip - 5.0dip - 10.0dip - 10.0dip - 10.0dip - 10.0dip - 10.0dip - 64.0dip - 64.0dip - 285.0dip - 172.0dip - 3.0dip - 43.5dip - 6.5dip - 29.0dip - 48.0dip - 0.0dip - 0.0dip - 150.0dip - 150.0dip - 104.0dip - 64.0dip - 52.0dip - 60.0dip - 180.0dip - 22.0sp - 18.0sp - 16.0sp - 14.0sp - 12.0sp - 10.0dip - 6.0dip - 2.0dip - 10.0dip - 6.0dip - 2.0dip - 50.0dip - 50.0dip - 146.0dip - 11.0sp - 12.0sp - 13.0sp - 14.0sp - 15.0sp - 16.0sp - 17.0sp - 18.0sp - 19.0sp - 20.0sp - 21.0sp - 11.0dip - 10.0dip - 6.0dip - 0.0dip - 20.0dip - 12.0dip - 12.0dip - 7.0dip - 14.0dip - 80.0dip - 64.0dip - 75.0dip - 10.0dip - 9.0dip - 288.0dip - 48.0dip - 12.0dip - 12.0dip - 5.0dip - 2.0dip - 2.0dip - 5.0dip - 2.0dip - 254.0dip - 122.0dip - 46.0dip - 10.0dip - 10.0dip - 20.0dip - 30.0dip - 10.0dip - 5.0dip - 10.0dip - 12.5dip - 25.0dip - 20.0dip - 18.0dip - 3.0dip - 3.0dip - 10.0dip - 15.5sp - 16.5dip - 10.0dip - 12.0dip - 48.0dip - 40.0dip - 40.0dip - 60.0dip - 5.0dip - 70.0dip - 62.0dip - 4.0dip - 4.0dip - 4.0dip - 1.0dip - 1.0dip - 2.0dip - 9.0dip - 9.0dip - 13.0dip - 9.0dip - 6.0dip - 6.0dip - 7.0dip - 8.0dip - 14.0dip - 10.0dip - 11.0dip - 10.0dip - 10.0dip - 0.0dip - 10.0dip - 6.0dip - 6.0dip - 47.0dip - 42.0dip - 35.0dip - 29.0dip - 96.0dip - 66.0dip - 4.0dip - 194.0dip - 12.5dip - 10.0dip - 10.0dip - 10.0dip - 10.0dip - 3.0dip - 10.0dip - 75.0dip - 23.0dip - 6.0dip - 104.0dip - 98.0dip - 99.0dip - 57.0dip - 38.0dip - 61.0dip - 151.0dip - 133.0dip - 40.0dip - 30.0dip - 31.0dip - 10.0dip - 108.0dip - 400.0px - 300.0px - 117.0dip - 110.0dip - 80.0dip - 107.0dip - 25.0dip - 20.0dip - 5.0dip - 115.0dip - 6.0dip - 56.0dip - 4.0dip - 30.0dip - 40.0dip - 50.0dip - 32.0dip - 19.0sp - 22.0sp - 16.0sp - 14.0sp - 12.0sp - 44.0dip - 40.0dip - 50.0dip - 36.0dip - 10.0dip - 13.0dip - 15.0dip - 15.0sp - 13.0sp - 13.0sp - 15.0sp - 11.0sp - 12.0sp - 4.0dip - 7.0dip - 15.0dip - 10.0dip - 5.0dip - 3.5sp - 0.0dip - 2.0dip - 60.0dip - 5.0dip - 4.0dip - 2.0dip - 15.0dip - 2.0dip - 5.0dip - 5.0dip - 35.0dip - 74.25dip - 80.0dip - 80.0dip - 1.0dip - 2.0dip - 3.0dip - 5.0dip - 6.0dip - 7.0dip - 8.0dip - 9.0dip - 10.0dip - 11.0dip - 12.0dip - 13.0dip - 14.0dip - 15.0dip - 17.0dip - 23.0dip - 25.0dip - 30.0dip - 35.0dip - 32.0dip - 50.0dip - 53.0dip - 105.0dip - 126.66998dip - 155.0dip - 169.32999dip - 50.0dip - 50.0dip - 58.0dip - 55.0dip - 14.0dip - 300.0dip - 64.0dip - 14.0dip - 56.0dip - 18.0dip - 2.0dip - 2.0dip - 10.0dip - 12.0dip - 4.0dip - 48.0dip - 68.0dip - 26.0dip - 60.0dip - 6.0sp - 8.0sp - 10.0sp - 12.0sp - 13.0sp - 14.0sp - 16.0sp - 18.0sp - 20.0sp - 0.5dip - 58.0dip - 38.0dip - 57.0dip - 39.0dip - 10.5dip - 10.5dip - 50.0dip - 30.0dip - 11.0dip - 11.0dip - 4.0dip - 5.0dip - 4.0dip - 50.0dip - 60.0dip - 60.0dip - 4.0dip - 5.0dip - 360.0dip - 402.0dip - 23.0dip - 63.0dip - -100.0dip - 360.0dip - 402.0dip - 24.0dip - 50.0dip - 12.0dip - 147.0dip - 160.0dip - 12.0dip - 12.0dip - 9.0dip - 4.5dip - 147.0dip - 110.0dip - 3.0dip - 3.0dip - 60.0dip - 10.0dip - 15.0dip - 52.0dip - 8.0dip - 83.0dip - 120.0dip - 8.0dip - 3.0dip - 16.0dip - 3.0dip - 2.0dip - 4.0dip - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/res/values/strings.xml b/cim_for_netty/client-mchat-android/res/values/strings.xml deleted file mode 100644 index e67fda0..0000000 --- a/cim_for_netty/client-mchat-android/res/values/strings.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - ichat - 分钟前 - 小时前 - 天前 - 松开获取更多 - 下拉可以刷新 - 上次更新: - 重新加载 - 网络连接失败 - 查看更多 - 正在检查更新...... - 当前已是最新版本 - 发现新版本 - 刚刚 - diff --git a/cim_for_netty/client-mchat-android/res/values/styles.xml b/cim_for_netty/client-mchat-android/res/values/styles.xml deleted file mode 100644 index 8fdab2e..0000000 --- a/cim_for_netty/client-mchat-android/res/values/styles.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java deleted file mode 100644 index a60ef9a..0000000 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.adapter; - -import java.util.Comparator; - -import com.farsunset.cim.sdk.android.model.Message; - -public class MessageTimeDescComparator implements Comparator{ - - @Override - public int compare(Message arg0, Message arg1) { - - return (int) (arg1.getTimestamp() - arg0.getTimestamp()) ; - } - - - -} diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java deleted file mode 100644 index 560da3a..0000000 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.app; - - -import com.farsunset.cim.sdk.android.CIMEventListener; -import com.farsunset.cim.sdk.android.CIMListenerManager; -import com.farsunset.cim.sdk.android.model.Message; -import com.farsunset.cim.sdk.android.model.ReplyBody; - -import android.app.Activity; -import android.net.NetworkInfo; -import android.os.Bundle; - -public abstract class CIMMonitorActivity extends Activity implements CIMEventListener{ - - - CommonBaseControl commonBaseControl; - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - CIMListenerManager.registerMessageListener(this,this); - - commonBaseControl = new CommonBaseControl(this); - - - } - - @Override - public void finish() { - super.finish(); - CIMListenerManager.removeMessageListener(this); - - } - - @Override - public void onRestart() { - super.onRestart(); - CIMListenerManager.registerMessageListener(this,this); - } - - - public void showProgressDialog(String title,String content) - { - commonBaseControl.showProgressDialog(title, content); - } - - public void hideProgressDialog() - { - commonBaseControl.hideProgressDialog(); - } - - public void showToask(String hint){ - - commonBaseControl.showToask(hint); - } - - - - - @Override - public void onMessageReceived(Message arg0){}; - - @Override - public void onNetworkChanged(NetworkInfo info){} - - /** - * 与服务端断开连接时回调,不要在里面做连接服务端的操作 - */ - @Override - public void onConnectionClosed() {} - - - /** - * 连接服务端成功时回调 - */ - - @Override - public void onConnectionSuccessed(boolean arg0) {} - - - @Override - public void onReplyReceived(ReplyBody arg0) {} - @Override - public void onConnectionFailed(Exception e){}; -} diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CommonBaseControl.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CommonBaseControl.java deleted file mode 100644 index 038bcfd..0000000 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CommonBaseControl.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.app; - - - -import android.app.ProgressDialog; -import android.content.Context; -import android.widget.Toast; - - -public class CommonBaseControl { - - private ProgressDialog progressDialog; - - Context mContent; - - - public CommonBaseControl(Context content) - { - this.mContent = content; - } - - - - public void showProgressDialog(String title,String message) - { - if(progressDialog==null) - { - - progressDialog = ProgressDialog.show(mContent, title, message, true, true); - }else if(progressDialog.isShowing()) - { - progressDialog.setTitle(title); - progressDialog.setMessage(message); - } - - progressDialog.show(); - - } - - public void hideProgressDialog() - { - - if(progressDialog!=null&&progressDialog.isShowing()) - { - progressDialog.dismiss(); - } - - } - - public void showToask(String hint){ - - Toast toast=Toast.makeText(mContent,hint,Toast.LENGTH_SHORT); - toast.show(); - } - - -} diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java deleted file mode 100644 index 75e0c14..0000000 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.app; - -public interface Constant { - - //服务端IP地址 - public static final String CIM_SERVER_HOST = "192.168.191.1"; - - //服务端web地址 - public static final String SERVER_URL = "http://"+CIM_SERVER_HOST+":8080/cim-server"; - - - //注意,这里的端口不是tomcat的端口,CIM端口在服务端spring-cim.xml中配置的,没改动就使用默认的23456 - public static final int CIM_SERVER_PORT = 23456; - - public static interface MessageType{ - - - //用户之间的普通消息 - public static final String TYPE_0 = "0"; - - - //下线类型 - String TYPE_999 = "999"; - } - - - public static interface MessageStatus{ - - //消息未读 - public static final String STATUS_0 = "0"; - //消息已经读取 - public static final String STATUS_1 = "1"; - } - -} diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIRequester.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIRequester.java deleted file mode 100644 index 5ddad4d..0000000 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIRequester.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.network; -import java.io.File; -import java.nio.charset.Charset; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.mime.MultipartEntity; -import org.apache.http.entity.mime.content.FileBody; -import org.apache.http.entity.mime.content.StringBody; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.params.CoreConnectionPNames; -import org.apache.http.util.EntityUtils; -import android.os.Handler; -import android.os.Message; -import com.alibaba.fastjson.JSON; - - -public class HttpAPIRequester { - HttpAPIResponser responser; - private static BlockingQueue queue = new LinkedBlockingQueue(); - private static ThreadPoolExecutor executor = new ThreadPoolExecutor(3, 5, 20, TimeUnit.SECONDS,queue);; - - public HttpAPIRequester(HttpAPIResponser responser) - { - this.responser = responser; - - } - - public HttpAPIRequester() - {} - - - //http api 调用 - public void execute(final HashMap params, final String url) - { - executor.execute(new Runnable() { - @Override - public void run() { - try { - httpPost(url,params); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - - - /** - * HTTP api 调用方法,回应将再responser里面处理 - *execute(这里用一句话描述这个方法的作用) - *(这里描述这个方法是用条件 - 可选) - * @param dtype 返回数据的 data节点数据泛型 - * @param dltype 返回数据的 dataList节点数据泛型 - * @param url - *void - * @exception - * @since 1.0.0 - */ - public void execute( final String url) - { - - responser.onRequest(); - executor.execute(new Runnable() { - @Override - public void run() { - - Message message = handler.obtainMessage(); - message.getData().putString("url", url); - try { - String dataString = httpPost(url,responser.getRequestParams()); - - message.getData().putString("data", dataString); - message.what = 0; - } catch (Exception e) { - e.printStackTrace(); - message.getData().putSerializable("exception", e); - message.what = 1; - } - handler.sendMessage(message); - } - }); - - } - - - public static String httpPost(String url,Map map) throws Exception - { - HttpPost httpPost = new HttpPost(url); - MultipartEntity mpEntity = new MultipartEntity(); - - for(String key:map.keySet()) - { - if(map.get(key)!=null) - { - if(map.get(key) instanceof File) - { - FileBody fileBody = new FileBody((File)map.get(key)); - mpEntity.addPart(key,fileBody); - }else - { - StringBody stringBody = new StringBody(map.get(key).toString(), Charset.forName("UTF-8")); - mpEntity.addPart(key,stringBody); - } - } - } - - System.out.println(url); - System.out.println(JSON.toJSONString(map)); - httpPost.setEntity(mpEntity); - HttpClient httpClient = new DefaultHttpClient(); - httpClient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 30000); - httpClient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 30000); - HttpResponse httpResp = httpClient.execute(httpPost); - String json = EntityUtils.toString(httpResp.getEntity(), "UTF-8"); - httpClient.getConnectionManager().closeIdleConnections(1, TimeUnit.MILLISECONDS); - System.out.println(json); - return json; - } - - Handler handler = new Handler(){ - public void handleMessage(Message message) - { - String url = message.getData().getString("url"); - switch(message.what) - { - case 0: - String data = message.getData().getString("data"); - responser.onSuccess(data,url); - - break; - case 1: - responser.onFailed((Exception) message.getData().get("exception"),url); - break; - } - - } - }; -} diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIResponser.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIResponser.java deleted file mode 100644 index a59b8d2..0000000 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIResponser.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.network; - -import java.util.Map; - - -public interface HttpAPIResponser { - public void onSuccess(String resulet,String url); - public void onFailed(Exception e,String url); - public Map getRequestParams(); - public void onRequest(); -} diff --git a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java deleted file mode 100644 index 4440f83..0000000 --- a/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * probject:cim - * @version 2.0 - * - * @author 3979434@qq.com - */ -package com.farsunset.ichat.example.receiver; - - -import android.app.Notification; -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.net.NetworkInfo; - -import com.farsunset.cim.sdk.android.CIMEventBroadcastReceiver; -import com.farsunset.cim.sdk.android.CIMListenerManager; -import com.farsunset.cim.sdk.android.model.Message; -import com.farsunset.cim.sdk.android.model.ReplyBody; -import com.farsunset.ichat.example.R; -import com.farsunset.ichat.example.ui.SystemMessageActivity; - -/** - * 消息入口,所有消息都会经过这里 - * @author 3979434 - * - */ -public final class CustomCIMMessageReceiver extends CIMEventBroadcastReceiver { - - private NotificationManager notificationManager; - - - - //当收到消息时,会执行onMessageReceived,这里是消息第一入口 - @Override - public void onMessageReceived(Message message) { - - //调用分发消息监听 - CIMListenerManager.notifyOnMessageReceived(message); - - //以开头的为动作消息,无须显示,如被强行下线消息Constant.TYPE_999 - if(message.getType().startsWith("9")) - { - return ; - } - - showNotify(context,message); - } - - - - private void showNotify(Context context , Message msg) - { - - this.notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - String title = "系统消息"; - - Notification notification = new Notification(R.drawable.icon_notify,title,msg.getTimestamp()); - notification.defaults = Notification.DEFAULT_LIGHTS; - notification.flags |= Notification.FLAG_AUTO_CANCEL; - - Intent notificationIntent = new Intent(context,SystemMessageActivity.class); - PendingIntent contentIntent = PendingIntent.getActivity(context,1, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); - notification.contentIntent = contentIntent; - notification.setLatestEventInfo(context,title, msg.getContent(),contentIntent); - notificationManager.notify(R.drawable.icon_notify, notification); - - } - - @Override - public void onNetworkChanged(NetworkInfo info) { - CIMListenerManager.notifyOnNetworkChanged(info); - } - - - @Override - public void onConnectionSuccessed(boolean hasAutoBind) { - CIMListenerManager.notifyOnConnectionSuccessed(hasAutoBind); - } - - @Override - public void onConnectionClosed() { - CIMListenerManager.notifyOnConnectionClosed(); - } - - - @Override - public void onReplyReceived(ReplyBody body) { - CIMListenerManager.notifyOnReplyReceived(body); - } - - - - @Override - public void onConnectionFailed(Exception arg0) { - // TODO Auto-generated method stub - CIMListenerManager.notifyOnConnectionFailed(arg0); - } - -} diff --git a/cim_for_netty/netty版本需要JDK1.7.txt b/cim_for_netty/netty版本需要JDK1.7.txt deleted file mode 100644 index e69de29..0000000 diff --git a/doc/CIM客户端文档.doc b/doc/CIM客户端文档.doc new file mode 100644 index 0000000..fabadcb Binary files /dev/null and b/doc/CIM客户端文档.doc differ diff --git a/JavaSDK使用文档.doc b/doc/JavaSDK使用文档.doc similarity index 100% rename from JavaSDK使用文档.doc rename to doc/JavaSDK使用文档.doc diff --git a/doc/Message.proto b/doc/Message.proto new file mode 100644 index 0000000..a5cb5ee --- /dev/null +++ b/doc/Message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="MessageProto"; +message Model { + string mid = 1; + string action = 2; + string content = 3; + string sender = 4; + string receiver = 5; + string extra = 6; + string title = 7; + string format = 8; + int64 timestamp = 9; +} + \ No newline at end of file diff --git a/doc/ReplyBody.proto b/doc/ReplyBody.proto new file mode 100644 index 0000000..db92900 --- /dev/null +++ b/doc/ReplyBody.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="ReplyBodyProto"; + +message Model { + string key = 1; + string code = 2; + string message = 3; + int64 timestamp =4; + map data =5; + +} + \ No newline at end of file diff --git a/doc/SentBody.proto b/doc/SentBody.proto new file mode 100644 index 0000000..20f0534 --- /dev/null +++ b/doc/SentBody.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package com.farsunset.cim.sdk.android.model.proto; +option java_outer_classname="SentBodyProto"; + +message Model { + string key = 1; + int64 timestamp =2; + map data =3; + +} + \ No newline at end of file diff --git a/doc/发送消息接口文档.doc b/doc/发送消息接口文档.doc new file mode 100644 index 0000000..e10b3ef Binary files /dev/null and b/doc/发送消息接口文档.doc differ diff --git a/说明.txt b/说明.txt index 2562b60..fb180f9 100644 --- a/说明.txt +++ b/说明.txt @@ -1,6 +1,7 @@ 1.cim-android-sdk androidͻ˷װĵjar 2.cim-java-sdk javaͻ˷װĵjar 3.cim-server-sdk cim-server õķװjar -4.cim-server java weḅmyeclipseߣeclipseע޸±뻷 -5.client-mchat-android androidͻ -5.CIMFlashBridge webͻʹflashΪʹFlashBuilder +4.cim-server java weḅeclipse +5.cim-client-android androidͻ android studio + +6.άflash汾 sdk,ȤĿԼ޸ԭflash 汾Դ