summaryrefslogtreecommitdiff
path: root/java/management/eclipse-plugin/src
diff options
context:
space:
mode:
authorRobert Greig <rgreig@apache.org>2007-04-19 16:24:30 +0000
committerRobert Greig <rgreig@apache.org>2007-04-19 16:24:30 +0000
commit1fa77f853198411390da6f81447f34534eaaf24f (patch)
treed4d024487965446858bf1742775f17215b5fa5f8 /java/management/eclipse-plugin/src
parent40a5f4759bd24950326550b4d862c832685cb506 (diff)
downloadqpid-python-1fa77f853198411390da6f81447f34534eaaf24f.tar.gz
Merged revisions 1-447993,447995-448007,448009-448141,448143-448157,448161-448194,448196-448210,448212-448218,448220-448223,448225-448233,448235,448237-448241,448243-448596,448598-448623,448625-448850,448852-448880,448882-448982,448984-449635,449637-449639,449641-449642,449644-449645,449647-449674,449676-449719,449721-449749,449751-449762,449764-449933,449935-449941,449943-450383,450385,450387-450400,450402-450433,450435-450503,450505-450555,450557-450860,450862-451024,451026-451149,451151-451316,451318-451931,451933-452139,452141-452162,452164-452320,452322,452324-452325,452327-452333,452335-452429,452431-452528,452530-452545,452547-453192,453194-453195,453197-453536,453538,453540-453656,453658-454676,454678-454735,454737,454739-454781,454783-462728,462730-462819,462821-462833,462835-462839,462841-463071,463073-463178,463180-463308,463310-463362,463364-463375,463377-463396,463398-463402,463404-463409,463411-463661,463663-463670,463672-463673,463675-464493,464495-464502,464504-464576,464578-464613,464615-464628,464630,464632-464866,464868-464899,464901-464942,464944-464949,464951-465004,465006-465016,465018-465053,465055-465165,465167-465321,465323-465406,465408-465427,465429-465431,465433-465548,465550-466044,466047-466075,466077,466079-466081,466083-466099,466101-466112,466114-466126,466128-466240,466242-466971,466973-466978,466980-467309,467311-467312,467316-467328,467330-467485,467487-467588,467590-467604,467606-467699,467701-467706,467708-467749,467751-468069,468071-468537,468539-469241,469244-469246,469248-469318,469320-469421,469423,469425-469429,469431-469435,469437-469462,469464-469469,469472-469477,469479-469490,469492-469503,469505-469529,469531-469598,469600-469624,469626-469737,469739-469752,469754-469806,469808-469928,469930-469953,469955-470011,470013-470109,470111-470335,470338-470339,470341-470379,470381,470383-470399,470401-470446,470448-470741,470743-470758,470760-470809,470811-470817,470819-470993,470995-471001,471003-471788,471790-471792,471794-472028,472030-472032,472034-472036,472038,472040,472043,472045-472059,472061,472063,472065-472066,472068,472070-472072,472074-472080,472082,472084-472092,472094-472107,472109-472123,472125-472158,472160-472165,472167-472172,472174-472457,472459-472460,472462-472464,472466-472470,472472-472483,472486-472491,472493-472494,472496-472497,472499,472501-472503,472505-472512,472514-472544,472546-472556,472558-472560,472562-472572,472574-472587,472589-472591,472593-472605,472607,472609-472731,472733-472786,472788-472843,472845-472849,472851-472859,472861-472878,472880-472903,472905,472907-472988,472990-472991,472993-473071,473073-473086,473088-473090,473093,473095-473096,473098-473106,473108-473110,473112-473185,473187-473260,473262,473268-473270,473275-473279,473281,473284-473287,473289-473295,473297-473306,473308-473330,473332-473335,473337,473339-473344,473346-473351,473353-473355,473357-473358,473361-473471,473473-473497,473499-473535,473537-473567,473569-473888,473890-474451,474454-474492,474494-474563,474565-474843,474845-474865,474867-474932,474934-475035,475037-475144,475146-475180,475182-475265,475267-475285,475287,475289-475293,475295-475296,475298-475302,475304-475631,475633-475649,475651-475748,475750-475752,475754-476107,476109-476302,476304-476413,476415-476430,476432-476700,476702-476868,476870-477147,477149-477213,477215-477263,477265-477340,477342-477635,477637-477789,477791-477825,477827-477841,477843,477846-477852,477854,477856,477858-477865,477867-477894,477896-478022,478024-478182,478184-478211,478213-478233,478235-478236,478238-478241,478243-478252,478254-478259,478261-478263,478265,478267-478269,478271-478286,478288-478342,478344-478379,478381-478412,478414-478443,478445-478636,478639-478658,478660-478821,478823-478853,478855-478922,478924-478962,478965-478974,478976-479029,479031-479049,479051-479210,479212-479214,479216-479407,479409-479415,479417-479425,479427-479559,479561-479639,479641-479676,479678-479685,479687-480030,480033-480086,480091-480093,480095-480118,480120-480139,480141,480143-480148,480150-480156,480158-480163,480165-480177,480179-480189,480191-480193,480195-480198,480200-480220,480222-480282,480284-480292,480294-480308,480310-480317,480320-480422,480424,480426-480581,480583-480656,480658-480692,480695-480702,480704,480706-480710,480712-480910,480913-480933,480935-480945,480947-480972,480974-480993,480995-481034,481036-481158,481161-481174,481176-481220,481222-481234,481236-481260,481263-481264,481266-481296,481298-481304,481306-481311,481313-481332,481334,481336-481380,481382-481441,481443-482144,482146-482180,482182-482193,482195-482232,482234-482236,482239,482241-482242,482244-482247,482250-482251,482253,482256-482261,482264-482288,482290-482364,482366,482368,482370-482554,482556,482558-482569,482572-482636,482638,482640-482696,482698-482722,482724-482732,482734-482771,482774-482957,482959-483045,483047-483105,483108,483110-483115,483117,483119-483127,483130-483134,483136-483148,483150-483158,483160-483164,483166-483178,483180-483391,483393-483400,483402-483403,483405-483418,483420-483421,483425-483436,483438-483470,483472-483502,483504-483558,483560-483599,483601-483637,483639-483644,483646-483659,483661-483670,483672-483878,483880-483910,483912-483915,483917-483940,483942,483944-483968,483970-483972,483974-483976,483978,483980-484612,484614-484657,484659-484693,484695-484718,484720-484842,484844-484847,484849-484986,484988-485019,485021-485489,485491-485544,485546-485591,485593,485595-485697,485699-485729,485731-485734,485736-485779,485781-485787,485789-485851,485853,485855-486007,486009,486011-486020,486022-486083,486085-486097,486099-486117,486120-486131,486133-486148,486150-486161,486163-486164,486166-486197,486199-486205,486208-486247,486249-486253,486256-486427,486429-486431,486433-486554,486556-486573,486575-486593,486595,486597-486609,486611-486619,486622,486625,486627-486641,486643-486645,486649-486687,486689-486721,486723-486730,486732-486746,486748-486759,486761,486763-486777,486779-486782,486784-486788,486790,486792,486794-486796,486798-487175,487178,487180-487213,487215,487217-487267,487269-487284,487286-487298,487300-487358,487360-487367,487369-487382,487384-487434,487436-487480,487482-487547,487549-487561,487563-487565,487567-487578,487580-487615,487617-487622,487624,487626,487628,487630-487635,487637-487703,487705-487777,487780-487781,487783-487800,487802-487803,487805-487820,487822-487848,487850-487902,487904-488103,488105-488133,488135-488158,488160-488163,488165-488187,488189-488216,488218-488248,488250-488278,488280,488282-488303,488305-488313,488315-488342,488344-488351,488353-488376,488378-488449,488451-488593,488595,488597-488623,488625-488700,488702-488704,488706-488710,488714,488716-488725,488727-488744,488746-488770,488772-488798,488800,488802-488807,488809,488811-488829,488831-488843,488845-488851,488853-489069,489071-489077,489079-489081,489084-489102,489104-489105,489107-489109,489111-489112,489114-489139,489141-489178,489181-489203,489205-489211,489213,489216-489329,489332-489402,489404-489417,489419-489421,489423-489643,489645-489690,489692-489703,489705-489714,489716-489747,489749-489753,489755-489803,489805-489904,489906-490372,490374-490504,490506-490604,490606-490707,490710-490733,490735-490871,490873-490984,490986-491028,491030,491032-491071,491073-491119,491121-491576,491578-491672,491674-491800,491802-491838,491840-491878,491880-492183,492185-492279,492281-492317,492319-492513,492515-492584,492586-492587,492589-492601,492603-492635,492637-492640,492642-492717,492719-492723,492725-492729,492731-492755,492757-492901,492903-492955,492957-492962,492964-492997,492999-493002,493004-493041,493043-493059,493062-493063,493065-493086,493088-493125,493127-493139,493141-493150,493152-493871,493873-494017,494019-494030,494032-494041,494043-494091,494093-494120,494122-494354,494356-494436,494438-494539,494541-494552,494554-494586,494588-494649,494651,494653-494654,494656-494657,494659-494764,494766-494768,494770-494796,494798-494799,494802,494804-494860,494862-494903,494905-494906,494908-495019,495021-495160,495162-495168,495171-495188,495190-495229,495231-495254,495256-495303,495305-495313,495315-495336,495338-495372,495374-495379,495381-495454,495457-495459,495462-495516,495518-495524,495526-495531,495533-495548,495551-495553,495555,495557-495558,495560,495562-495573,495575-495583,495585-495594,495596-495628,495630-495638,495640-495651,495653-495660,495662-495753,495755-496259,496261-496262,496264-496269,496271-496275,496277-496301,496303-496316,496318-496383,496385-496413,496415-496495,496497-496625,496627-496636,496638-496640,496642-496647,496650-496657,496659-496660,496663-496664,496666-496677,496679-496681,496683-496730,496732-496750,496752,496754-496784,496786-496832,496834-496840,496842-496990,496992-496995,496997-497340,497343-497351,497353-497403,497405-497424,497426-497438,497440-497481,497483-497497,497499-497765,497767-497769,497771-497775,497777-497778,497780,497782-497783,497785,497787-497812,497814-497871,497873-497877,497879-498573,498575-498588,498590,498592,498594-498636,498638-498669,498671-498686,498688-498689,498691-498719,498721-498964,498966-498969,498971-498973,498975-498982,498985-499035,499037-499040,499042,499044-499048,499050-499082,499084-499086,499088-499164,499167-499169,499171-499355,499357-499370,499372-499373,499375-499391,499393,499395-499425,499428,499430-499445,499447-499455,499457-499460,499462-499465,499467,499469-499489,499491-499492,499494-499531,499533-499562,499566-499627,499629-499715,499717-499732,499734-499755,499758-499763,499765-499780,499782-499795,499797-499802,499804-499844,499846,499848-499850,499852-499863,499865-499873,499875-499974,499976-499978,499980-500263,500265-500283,500285-500309,500311-501000,501002,501012-501057,501059-501095,501097-501390,501392-501410,501413-501447,501449-501454,501456,501458-501464,501466-501471,501473-501803,501805-501913,501915-501916,501918-501919,501921-501944,501946-502171,502173-502177,502181,502183-502247,502250-502252,502254-502260,502262-502267,502270,502272,502274-502575,502577-502609,502611-502619,502621-502626,502628-502654,502656-503592,503594-503603,503605-503608,503610-503636,503638-503645,503647-503705,503707-503789,503791-504024,504026-504111,504113-504506,504508-504735,504737-504863,504865-504867,504869-504914,504916-505241,505243-505254,505257-505267,505269-505354,505356-505891,505893-505971,505973-506400,506402-506404,506407-506438,506440-506516,506518-506541,506543-506966,506968-506971,506973-507095,507097-507108,507111-507454,507456,507459-507471,507473-507556,507558,507560-507581,507585-507594,507597,507599-507608,507610-507728,507730-507893,507895-507937,507940-508234,508236-508350,508352-508365,508367-508380,508383,508386-508415,508417-508648,508650-508941,508943-509146,509148-509171,509173-509175,509179-509201,509203-509207,509209-509215,509217-509222,509224-509477,509480-509627,509629-509634,509636-509641,509643-509736,509738-509931,509933-510059,510061-510075,510077-510158,510161-510896,510898-510938,510940-511388,511390-511922,511924-512287,512289-512698,512702-512813,512815-512817,512819-513359,513361-513370,513372-514702,514704-514886,514888-514902,514904-515126,515129-515141,515143-515516,515518-515534,515536-515538,515540-515648,515650-515651,515653-516070,516072-516411,516413-516448,516450,516452-517637,517639-517647,517649-517659,517661-517663,517665-517677,517679-517682,517684-517744,517746-518085,518087-518175,518177-518558,518560-518568,518571-518666,518668,518670-518699,518701-518987,518990-518992,518994-519908,519910-519932,519934-520414,520416-520842,520844-520937,520939-521362,521364-521792,521794-522462,522464-522527,522529-522534,522536-522566,522568-522993,522995-523244,523246-525530,525532,525534,525537-526149,526151-526682,526686-526713,526715-530399 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2 ........ r521682 | bhupendrab | 2007-03-23 11:50:55 +0000 (Fri, 23 Mar 2007) | 2 lines QPID-418 (merged from trunk) svn merge -r521336:521345 https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/java . ........ r521705 | rgreig | 2007-03-23 12:44:14 +0000 (Fri, 23 Mar 2007) | 1 line Updates to performance tests. ........ r521710 | ritchiem | 2007-03-23 12:59:18 +0000 (Fri, 23 Mar 2007) | 2 lines QPID-419 Access Control QPID-423 Authentication per virtualhost Improved error handling when hostconfig is not specifed. Was NPE-ing ........ r521715 | ritchiem | 2007-03-23 13:10:33 +0000 (Fri, 23 Mar 2007) | 2 lines QPID-423 Authentication per virtualhost Improved error handling when hostconfig is not specifed. Was NPE-ing ........ r521782 | bhupendrab | 2007-03-23 16:02:51 +0000 (Fri, 23 Mar 2007) | 1 line QPID-420 (merged from trunk) And r518998:518999 and r520846:520850 ........ r522959 | ritchiem | 2007-03-27 16:39:51 +0100 (Tue, 27 Mar 2007) | 2 lines Updated assembly/bin.xml to include transient_config.xml persistent_config.xml ........ r522961 | ritchiem | 2007-03-27 16:42:40 +0100 (Tue, 27 Mar 2007) | 1 line forgot to rename files after they had been copied ........ r522967 | ritchiem | 2007-03-27 16:56:03 +0100 (Tue, 27 Mar 2007) | 1 line correctly renamed transient and persistent config files ........ r522977 | ritchiem | 2007-03-27 17:06:15 +0100 (Tue, 27 Mar 2007) | 1 line updated config files ........ r522981 | ritchiem | 2007-03-27 17:10:45 +0100 (Tue, 27 Mar 2007) | 1 line Added echo of progress and reduced timeout ........ r522989 | ritchiem | 2007-03-27 17:33:04 +0100 (Tue, 27 Mar 2007) | 1 line fixed error where script wouldn't pickup running pids ........ r522990 | ritchiem | 2007-03-27 17:36:34 +0100 (Tue, 27 Mar 2007) | 1 line Added additional logging and comments ........ r522991 | ritchiem | 2007-03-27 17:37:17 +0100 (Tue, 27 Mar 2007) | 1 line Added additional comments ........ r523747 | rajith | 2007-03-29 16:32:56 +0100 (Thu, 29 Mar 2007) | 1 line Fix for setting the message id ........ r524050 | rgreig | 2007-03-30 12:51:09 +0100 (Fri, 30 Mar 2007) | 1 line Removed excess logging to optimize performance. ........ r524739 | ritchiem | 2007-04-02 08:29:06 +0100 (Mon, 02 Apr 2007) | 1 line Added BDB Test scripts and updated pom to contain same tests as were used in perftesting ........ r524740 | ritchiem | 2007-04-02 08:47:29 +0100 (Mon, 02 Apr 2007) | 1 line Fixed error with passwordfile parameter ........ r524743 | ritchiem | 2007-04-02 09:07:55 +0100 (Mon, 02 Apr 2007) | 1 line Added CTQ tests ........ r524763 | ritchiem | 2007-04-02 11:50:06 +0100 (Mon, 02 Apr 2007) | 1 line Added verify password method to PrincipalDatabase ........ r524765 | ritchiem | 2007-04-02 11:55:12 +0100 (Mon, 02 Apr 2007) | 1 line Moved broker details to a separate variable. ........ r524767 | ritchiem | 2007-04-02 12:17:54 +0100 (Mon, 02 Apr 2007) | 1 line ignored idea files ........ r525487 | ritchiem | 2007-04-04 11:42:59 +0100 (Wed, 04 Apr 2007) | 3 lines Added default timeout to AMQConnection.close(); ........ r525553 | ritchiem | 2007-04-04 17:34:35 +0100 (Wed, 04 Apr 2007) | 1 line Updated case of properties ........ r525766 | ritchiem | 2007-04-05 09:51:55 +0100 (Thu, 05 Apr 2007) | 1 line QPID-308 Added test case to demonstrate heap exhaustion of broker. Can't be run InVM as it kills the broker. ........ r525777 | ritchiem | 2007-04-05 10:29:22 +0100 (Thu, 05 Apr 2007) | 20 lines QPID-414 : Addition of CRAM-MD5-HASHED authentication. Same as CRAM-MD5 but the client uses the hash of the password rather than the original password. This allows the broker to store the hash not the original password. Added initial tool for generation passwords. Broker: Renamed MD5PasswordFilePrincipalDatabase.java to Base64MD5PasswordFilePrincipalDatabase.java as that more accurately represents the file contents. PlainPasswordVhostFilePrincipalDatabase.java - import tidy up PrincipalDatabaseAuthenticationManager.java - Changed to add our SASL providers at the start of the SASL list. CRAMMD5Hashed* - New SASL mechanism that delegates to CRAM-MD5 but understands that the password to use is the hash of the users password. JCAProvider - Removed the addProvider() line as this is done after the construction in PrincipalDatabaseAuthenticationManager. PlainSaslServerFactory - White Space Passwd.java - New util stub for managing passwords ala htpasswd. Client Added CRAM-MD5-HASHED to CallbackHandlerRegistry Added ClientFactory for CRAMMD5Hashed that returns the first CRAM-MD5 SaslClient. DynamicSaslRegistrar.java - Tidied imports added new JCAProviders at the start of the Sasl lists. DynamicSaslRegistrar.properties - Added CRAM-MD5-HASHED handler. JCAProvider.java - as with broker stopped JCAProvider.java adding itself as the DynamicSaslRegistrar.java does this on the client. UsernameHashedPasswordCallbackHandler.java - New callback handler that is used by CRAM-MD5-HASHED. It hashes the client's password and uses that in the CRAM-MD5 algorithm. ........ r525785 | ritchiem | 2007-04-05 10:48:43 +0100 (Thu, 05 Apr 2007) | 1 line Old ant folder ........ r525786 | ritchiem | 2007-04-05 10:57:33 +0100 (Thu, 05 Apr 2007) | 1 line QPID-440 - added comments in the code relating to this bug. ........ r525787 | ritchiem | 2007-04-05 10:58:20 +0100 (Thu, 05 Apr 2007) | 2 lines QPID-308 removed closeConnection() that calls close(-1) and may result in a client hang. better to call closeConnection(long timeout) so forced this my removing closeConnection(); ........ r525788 | ritchiem | 2007-04-05 11:00:56 +0100 (Thu, 05 Apr 2007) | 1 line QPID-414 update to config.xml to give usage example. ........ r525804 | ritchiem | 2007-04-05 13:19:31 +0100 (Thu, 05 Apr 2007) | 1 line QPID-308 Updated HeapExhaustion to be able to be run from command line ........ r525817 | ritchiem | 2007-04-05 14:14:50 +0100 (Thu, 05 Apr 2007) | 1 line Update to qpid stop scripts to properly check for existing broker instances and promptly stop them. ........ r525829 | ritchiem | 2007-04-05 14:50:56 +0100 (Thu, 05 Apr 2007) | 1 line Updated scripts to work correctly under solaris and bash 2.0 ........ r525862 | rgodfrey | 2007-04-05 17:37:40 +0100 (Thu, 05 Apr 2007) | 1 line QPID-443 : Fix to transactionality of message publishing ........ r525867 | ritchiem | 2007-04-05 17:47:59 +0100 (Thu, 05 Apr 2007) | 2 lines QPID-416 Provided simple update to Access Control via FileAccessManager to allow access rights for a virtualhost to be stored in a separate file. Updated PrincipalDatabaseAccessManager to use the default AccessManager if the specified PrincipalDatabase is not an AccessManager. ........ r526091 | ritchiem | 2007-04-06 09:21:01 +0100 (Fri, 06 Apr 2007) | 5 lines QPID-416 Update to Access control to allow simply read/write permissions per Virtual host. access - updated file to have examples of access control. AccessManager - Deprecated old isAuthorised method Implemented new isAuthorized method on all AccessManagers ........ r526113 | ritchiem | 2007-04-06 11:28:43 +0100 (Fri, 06 Apr 2007) | 1 line Updated case of properties to be true cammelCase and updated tests to run for a duration of 10 minutes rather than set message count. To provide better results for graphing. ........ r526117 | ritchiem | 2007-04-06 11:42:11 +0100 (Fri, 06 Apr 2007) | 9 lines QPID-416 Update to Access control to allow simply read/write permissions per Virtual host. access - updated file to have examples of access control. Changed AMQProtocolSession to record an authorized Principal not just a String. - Required Added AccessRights files needed for VirtualHostAccess control. Updated ConnectionOpenMethodHandler to allow Principals with any access to connect not just read. UsernamePrincipal - Added a toString ........ r526118 | rgodfrey | 2007-04-06 11:55:17 +0100 (Fri, 06 Apr 2007) | 1 line ........ r526122 | ritchiem | 2007-04-06 12:26:06 +0100 (Fri, 06 Apr 2007) | 1 line removed pauses between batches ........ r526154 | rgodfrey | 2007-04-06 14:24:46 +0100 (Fri, 06 Apr 2007) | 1 line QPID-443 : Fix to transactionality of message publishing ........ r526157 | bhupendrab | 2007-04-06 14:32:56 +0100 (Fri, 06 Apr 2007) | 1 line QPID-444 : Enabling the Qpid to use SASL. jmxmp can be plugged into for SASL. Can be configured to use security. ........ r526158 | ritchiem | 2007-04-06 14:34:52 +0100 (Fri, 06 Apr 2007) | 1 line Duplicate of BDB-Qpid.sh ........ r526159 | bhupendrab | 2007-04-06 14:37:47 +0100 (Fri, 06 Apr 2007) | 1 line QPID-444 : adding jmxport, which is used when out of the box JMXAgent is not used ........ r526166 | ritchiem | 2007-04-06 14:51:41 +0100 (Fri, 06 Apr 2007) | 1 line QPID-414 - Initial script to run the passwd gen. ........ r526187 | bhupendrab | 2007-04-06 15:53:36 +0100 (Fri, 06 Apr 2007) | 2 lines QPID-444 : Enabling the SASL support. jmxmp can be plugged into for SASL. ........ r526194 | rgreig | 2007-04-06 16:21:19 +0100 (Fri, 06 Apr 2007) | 1 line Added some ramping up performance tests. ........ r526195 | marnie | 2007-04-06 16:21:33 +0100 (Fri, 06 Apr 2007) | 1 line QPID-381 Amended session constructor to be non-transactional and use client ack mode. ........ r526198 | rgreig | 2007-04-06 16:26:02 +0100 (Fri, 06 Apr 2007) | 1 line Fixed message sizes. ........ r526199 | rgreig | 2007-04-06 16:29:06 +0100 (Fri, 06 Apr 2007) | 1 line Fixed commit batch size. ........ r526666 | ritchiem | 2007-04-09 08:47:14 +0100 (Mon, 09 Apr 2007) | 1 line Updated so the FileAppender includes time stamps by default.. ConversionPattern made the same as STDOUT and RollingFileAppender ........ r526691 | ritchiem | 2007-04-09 10:39:47 +0100 (Mon, 09 Apr 2007) | 1 line Added $@ to allow pass through of command line args to each sub process ........ r526692 | bhupendrab | 2007-04-09 10:45:06 +0100 (Mon, 09 Apr 2007) | 4 lines QPID-444 : added log statements and some config parameters. Removed the autoDelete parameter from createNewQueue method used from Management Console. ........ r526694 | bhupendrab | 2007-04-09 10:51:46 +0100 (Mon, 09 Apr 2007) | 1 line ........ r526709 | bhupendrab | 2007-04-09 12:02:08 +0100 (Mon, 09 Apr 2007) | 2 lines QPID-444 : updated the management console dependency configuration for sasl support ........ r526776 | rgreig | 2007-04-09 16:26:04 +0100 (Mon, 09 Apr 2007) | 1 line Stopped throwing away exception causes. ........ r526803 | rgreig | 2007-04-09 17:09:24 +0100 (Mon, 09 Apr 2007) | 1 line Got rid of some uses of System.out instead of log4j logging. ........ r526807 | rgreig | 2007-04-09 17:12:49 +0100 (Mon, 09 Apr 2007) | 1 line Got rid of some uses of System.out instead of log4j logging. ........ r527049 | ritchiem | 2007-04-10 08:58:26 +0100 (Tue, 10 Apr 2007) | 1 line Moved bdb tests to bdbstore package ........ r527050 | ritchiem | 2007-04-10 09:00:42 +0100 (Tue, 10 Apr 2007) | 1 line QueueDeclareHandler.java - Added more detail to error messages. Such as returning the queue name that was attempted to be declared but failed. ........ r527053 | ritchiem | 2007-04-10 09:03:15 +0100 (Tue, 10 Apr 2007) | 1 line Added a test to check that Persistent Queues do actually persist. ........ r527182 | ritchiem | 2007-04-10 17:29:47 +0100 (Tue, 10 Apr 2007) | 1 line QPID-446 Initial MBean framework. ........ r527487 | ritchiem | 2007-04-11 14:31:18 +0100 (Wed, 11 Apr 2007) | 5 lines QPID-446 AMQUserManagementMBean Initial implementation of user management in authentication file. UserManagement - Added annotations for MBeanOperations PrincipalDatabase - Added new methods to update,create,delete Principal. - Implemented method on all PrincipalDatabase implementations, most return false to say not complete except Base64MD5PasswordFilePrincipalDatabase - which now stores in memory the password file and flushes any changes to disk. ........ r527493 | ritchiem | 2007-04-11 14:50:40 +0100 (Wed, 11 Apr 2007) | 1 line QPID-446 Missed the commit of JMXManagedObjectRegistry change on verifyPassword char[] to String ........ r527499 | bhupendrab | 2007-04-11 15:16:02 +0100 (Wed, 11 Apr 2007) | 1 line QPID-444 : added CRAM-MD5-HASHED mechanism for sasl ........ r527509 | bhupendrab | 2007-04-11 15:47:22 +0100 (Wed, 11 Apr 2007) | 1 line ........ r527518 | ritchiem | 2007-04-11 16:21:37 +0100 (Wed, 11 Apr 2007) | 14 lines QPID-446 JMXManagedObjectRegistry - Split instantiation from starting up. To all the setting of the Access file when loaded later in the startup sequence. ManagedObjectRegistry - Added Start method MBeanInvocationHandlerImpl - Updated to allow the setting of the access properties object from the AMQUserManagementMBean NoopManagedObjectRegistry - implemented no-op start ConfigurationFileApplicationRegistry - Adjusted to split creation of ManagedObjectRegistry from starting server to allow the setting of access rights. AMQUserManagementMBean - Implemented reading of access rights file. Base64MD5PasswordFilePrincipalDatabase - added comment for future Management. PrincipalDatabaseManager - added initialiseManagement method ConfigurationFilePrincipalDatabaseManager - implemented general Management initialisation. PropertiesPrincipalDatabaseManager - no-op implementation ........ r527537 | ritchiem | 2007-04-11 16:47:30 +0100 (Wed, 11 Apr 2007) | 2 lines QPID-446 Update to contain jmx config settings. ........ r527556 | bhupendrab | 2007-04-11 17:07:58 +0100 (Wed, 11 Apr 2007) | 1 line synchronized with hash mechanism used in Broker ........ r527557 | ritchiem | 2007-04-11 17:08:54 +0100 (Wed, 11 Apr 2007) | 1 line Fixed Bug in convertPassword where data wasn't correctly updated PropertiesPrincipalDatabase, ........ r527558 | ritchiem | 2007-04-11 17:09:54 +0100 (Wed, 11 Apr 2007) | 1 line QpiQPID-446 Update to ensure qpid.password file is correctly written in savePasswordFile ........ r527803 | ritchiem | 2007-04-12 08:16:54 +0100 (Thu, 12 Apr 2007) | 5 lines QPID-446 Update to write accessRights file and correctly write Base64 MD5 Hashed password to password file. MBeanInvocationHandlerImpl - made statics ADMIN,READONLY,READWRITE public so they can be used in writing the access file. AMQUserManagementMBean - Update to write the access File. PrincipalDatabase - create getUser(username) to retrieve a Principal from the database this is then implemented in all PDs. Used to check for existence of a user. ........ r527843 | ritchiem | 2007-04-12 09:52:19 +0100 (Thu, 12 Apr 2007) | 10 lines QPID-446 Update to send userList to JMX Management console. Currently niave implementation just sending ALL users in one go. If a LDAPPrincipalDatabase was created this could be quite a lot of data a) to send but b) to create in broker Heap. PrincipalDatabase - javadoc'd and getUsers method, -changed verifyPassword method to take String for username rather than Principal only the Managment Console uses this method and it the MC should be changed to use the Broker SASL modules directly rather than having very similar ones of its own. - Removed AccountNotFound exception from createPrincipal as it made no sence No-op implementation in PlainPasswordFilePrincipalDatabase and PropertiesPrincipalDatabase Base64MD5PasswordFilePrincipalDatabase changed local User class to implement Principal so current Map can be returned via getUsers - Added locking to ensure integrity of files in the face of multiple edits. ........ r527848 | ritchiem | 2007-04-12 10:11:19 +0100 (Thu, 12 Apr 2007) | 1 line QPID-446 Removed hashing of presented password in Base64MD5PasswordFilePrincipalDatabase. ........ r527876 | rgodfrey | 2007-04-12 11:31:51 +0100 (Thu, 12 Apr 2007) | 3 lines QPID-451 Throw InvalidDestinationException on attempt to publish to a Queue which does not exist Changed QueueSenderAdapter to check if the routing key is bound to a queue on the given exchange. The checking can be turned off by setting the system property org.apache.qpid.client.verifyQueueBindingBeforePublish to anything but true ........ r527941 | bhupendrab | 2007-04-12 14:49:10 +0100 (Thu, 12 Apr 2007) | 1 line not needed for management console ........ r527959 | bhupendrab | 2007-04-12 15:40:36 +0100 (Thu, 12 Apr 2007) | 1 line refining the mbean operations ........ r527972 | ritchiem | 2007-04-12 16:11:16 +0100 (Thu, 12 Apr 2007) | 3 lines QPID-446 Updated sample configs to contain jmx security options. ........ r528003 | marnie | 2007-04-12 17:15:48 +0100 (Thu, 12 Apr 2007) | 1 line QPID-352 Changes ........ r528005 | marnie | 2007-04-12 17:16:34 +0100 (Thu, 12 Apr 2007) | 1 line QPID-352 Changes ........ r528424 | rgreig | 2007-04-13 11:17:12 +0100 (Fri, 13 Apr 2007) | 1 line Created new ping client that sends messages only. Usefull for examaning known queue states in mgmnt console. ........ r529233 | bhupendrab | 2007-04-16 14:25:58 +0100 (Mon, 16 Apr 2007) | 1 line added parameter for SASL ........ r529246 | bhupendrab | 2007-04-16 14:48:31 +0100 (Mon, 16 Apr 2007) | 1 line removed default username as guest. Added hashing for new user password field. ........ r529297 | rgodfrey | 2007-04-16 16:53:45 +0100 (Mon, 16 Apr 2007) | 1 line QPID-453 : AMQShortString should implement Comparable ........ r529635 | bhupendrab | 2007-04-17 16:07:06 +0100 (Tue, 17 Apr 2007) | 1 line QPID-422 : Combined all user configured notifications on one view. ........ r529659 | ritchiem | 2007-04-17 17:08:00 +0100 (Tue, 17 Apr 2007) | 7 lines QPID-454 Message 'taken' notion is per message. But should be per message per queue AMQChannel - pass queue in on all take/release/getSubscriptionDelievered calls BasicRejectMethodHandler - pass queue in on getSubscriptionDelievered calls AMQMessage - Changes to require AMQQueue on all take/release/getSubscriptionDelievered calls ConcurrentSelectorDeliveryManager - pass queue in on take/release/getSubscriptionDelievered calls SubscriptionImpl - - pass queue in on release calls ........ r529666 | ritchiem | 2007-04-17 17:19:59 +0100 (Tue, 17 Apr 2007) | 11 lines QPID-455 Prefetched messages can cause problems with client tools. AMQSession - suspend channel at startup until start() and recieve/setMessageListener are called. BasicMessageConsumer - mainly style sheet changes MessageListenerMultiConsumerTest - removed one test case as we cannot ensure round-robin effect at start up .. added test case for only c2 consuming when c1 does nothing. MessageListenerTest - added new test that can demonstrate a further bug of message 'loss' when a receive is called only once before a message listener is set. Prefetched message end up on _SynchronousQueue regression of QPID-293 as of r501004. MessageRequeueTest - Was missing a conn.start() DurableSubscriptionTest - Removed blocking receives() so we don't block on failure CommitRollbackTest - Text message was wrong on testGetThenDisconnect tests so adjusted ........ r529669 | bhupendrab | 2007-04-17 17:43:53 +0100 (Tue, 17 Apr 2007) | 1 line QPID-417 ........ r530034 | bhupendrab | 2007-04-18 15:32:02 +0100 (Wed, 18 Apr 2007) | 2 lines AMQUserManagementMBean.java - calling relaod within viewUsers method. Creating user list on management console instead of typing the user name. ........ r530037 | ritchiem | 2007-04-18 15:37:30 +0100 (Wed, 18 Apr 2007) | 1 line QPID-454 Message 'taken' notion is per message. REVERTED as it just wasn't right.. needs to be refactored. ........ r530041 | ritchiem | 2007-04-18 15:40:47 +0100 (Wed, 18 Apr 2007) | 1 line QPID-457 Fixed rollback inTran problem with test case ........ r530042 | ritchiem | 2007-04-18 15:42:16 +0100 (Wed, 18 Apr 2007) | 1 line QPID-457 Fixed rollback inTran problem with test case Missed the actual file fix. ........ r530043 | ritchiem | 2007-04-18 15:46:36 +0100 (Wed, 18 Apr 2007) | 1 line QPID-458 Fix to make the CSDM check if a message is taken when deliverying to browser. Removing the message from the queue and continuing if that is the caee. ........ r530044 | ritchiem | 2007-04-18 15:54:36 +0100 (Wed, 18 Apr 2007) | 1 line Removed e.printstacktrace that sneaked in with the other code style changes. ........ r530047 | ritchiem | 2007-04-18 16:09:28 +0100 (Wed, 18 Apr 2007) | 1 line Fix for intermittent CRT expected <1> but was <2> errors ........ r530048 | ritchiem | 2007-04-18 16:10:24 +0100 (Wed, 18 Apr 2007) | 3 lines ResetMessageListenerTest was using the wrong queue for running tests. This was causing problems during testing. Changed queue to use ResetMessageListenerTest queue ........ r530049 | ritchiem | 2007-04-18 16:11:22 +0100 (Wed, 18 Apr 2007) | 2 lines QPID-455 Prefetched messages can cause problems with client tools. Removed the changes as this was causing problems. Guarded with a check for now but solution is till not correct. ........ r530052 | ritchiem | 2007-04-18 16:12:45 +0100 (Wed, 18 Apr 2007) | 1 line QPID-455 - Guarded test with a check until a full solution is found ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@530474 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/management/eclipse-plugin/src')
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java9
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java2
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java197
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java16
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java4
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java6
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java13
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java13
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java5
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java170
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java52
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java15
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java8
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java60
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java54
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java56
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java203
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java35
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java73
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java82
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java2
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java98
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java27
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java410
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java84
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java13
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java12
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java462
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java69
-rw-r--r--java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF19
-rw-r--r--java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini2
31 files changed, 1697 insertions, 574 deletions
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
index 38a4d4561f..714f84ea49 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
@@ -41,7 +41,9 @@ public abstract class ApplicationRegistry
{
private static ImageRegistry imageRegistry = new ImageRegistry();
private static FontRegistry fontRegistry = new FontRegistry();
-
+ public static final boolean debug = Boolean.getBoolean("debug");
+ public static final String securityMechanism = System.getProperty("security", null);
+
static
{
imageRegistry.put(Constants.CONSOLE_IMAGE,
@@ -130,4 +132,9 @@ public abstract class ApplicationRegistry
_closedServerList.clear();
return list;
}
+
+ public static String getSecurityMechanism()
+ {
+ return securityMechanism;
+ }
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java
index 3d163fb111..e3aedef28e 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java
@@ -49,7 +49,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
int x = Display.getDefault().getBounds().width;
int y = Display.getDefault().getBounds().height;
- configurer.setInitialSize(new Point(4*x/5, 3*y/4));
+ configurer.setInitialSize(new Point(9*x/10, 8*y/10));
configurer.setShowCoolBar(true);
configurer.setShowStatusLine(false);
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
index 91dec841cf..da70dc736c 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
@@ -1,3 +1,4 @@
+/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -7,9 +8,9 @@
* to you 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
@@ -29,98 +30,110 @@ import static org.apache.qpid.management.ui.Constants.CONNECTION_PROTOCOLS;
*/
public class Constants
{
- public final static String APPLICATION_NAME = "Qpid Management Console";
-
- public final static String ACTION_REMOVE_MBEANNODE = "Remove from list";
- public final static String VALUE = "value";
- public final static String TYPE = "type";
- public final static String NODE_TYPE_SERVER = "server";
- public final static String NODE_TYPE_DOMAIN = "domain";
- public final static String NODE_TYPE_MBEANTYPE = "mbeantype";
+ public static final String APPLICATION_NAME = "Qpid Management Console";
+
+ public static final String ACTION_REMOVE_MBEANNODE = "Remove from list";
+ public static final String VALUE = "value";
+ public static final String TYPE = "type";
+ public static final String NODE_TYPE_SERVER = "server";
+ public static final String NODE_TYPE_DOMAIN = "domain";
+ public static final String NODE_TYPE_MBEANTYPE = "mbeantype";
// currently used only for virtual host instances, but will work as general also
- public final static String NODE_TYPE_TYPEINSTANCE = "mbeantype_instance";
- public final static String MBEAN = "mbean";
- public final static String ATTRIBUTE = "Attribute";
- public final static String ATTRIBUTES = "Attributes";
- public final static String NOTIFICATION = "Notifications";
- public final static String RESULT = "Result";
- public final static String VIRTUAL_HOST = "VirtualHost";
- public final static String DEFAULT_VH = "Default";
- public final static String DEFAULT_USERNAME = "guest";
- public final static String DEFAULT_PASSWORD = "guest";
-
- public final static String USERNAME = "Username";
- public final static String PASSWORD = "Password";
-
+ public static final String NODE_TYPE_TYPEINSTANCE = "mbeantype_instance";
+ public static final String MBEAN = "mbean";
+ public static final String ATTRIBUTE = "Attribute";
+ public static final String ATTRIBUTES = "Attributes";
+ public static final String NOTIFICATIONS = "Notifications";
+ public static final String RESULT = "Result";
+ public static final String VIRTUAL_HOST = "VirtualHost";
+ public static final String DEFAULT_VH = "Default";
+ public static final String DEFAULT_USERNAME = "guest";
+ public static final String DEFAULT_PASSWORD = "guest";
+
+ public static final String USERNAME = "Username";
+ public static final String PASSWORD = "Password";
+
// Attributes and operations are used to customize the GUI for Qpid. If these are changes in the
// Qpid server, then these should be updated accordingly
- public final static String ATTRIBUTE_QUEUE_OWNER = "owner";
- public final static String ATTRIBUTE_QUEUE_DEPTH = "QueueDepth";
- public final static String ATTRIBUTE_QUEUE_CONSUMERCOUNT = "ActiveConsumerCount";
- public final static String OPERATION_CREATE_QUEUE = "createNewQueue";
- public final static String OPERATION_CREATE_BINDING = "createNewBinding";
- public final static String OPERATION_MOVE_MESSAGES = "moveMessages";
-
- public final static String ALL = "All";
-
- public final static String NAVIGATION_ROOT = "Qpid Connections";
- public final static String DESCRIPTION = " Description";
-
- public final static String QUEUE = "Queue";
- public final static String CONNECTION ="Connection";
- public final static String EXCHANGE = "Exchange";
- public final static String EXCHANGE_TYPE = "ExchangeType";
- public final static String[] EXCHANGE_TYPE_VALUES = {"direct", "topic", "headers"};
- public final static String[] BOOLEAN_TYPE_VALUES = {"false", "true"};
- public final static String[] ATTRIBUTE_TABLE_TITLES = {"Attribute Name", "Value"};
- public static final String[] CONNECTION_PROTOCOLS ={"RMI"};
+ public static final String ATTRIBUTE_QUEUE_OWNER = "owner";
+ public static final String ATTRIBUTE_QUEUE_DEPTH = "QueueDepth";
+ public static final String ATTRIBUTE_QUEUE_CONSUMERCOUNT = "ActiveConsumerCount";
+ public static final String OPERATION_CREATE_QUEUE = "createNewQueue";
+ public static final String OPERATION_CREATE_BINDING = "createNewBinding";
+ public static final String OPERATION_MOVE_MESSAGES = "moveMessages";
+
+ public static final String OPERATION_CREATEUSER = "createUser";
+ public static final String OPERATION_VIEWUSERS = "viewUsers";
+ public static final String OPERATION_PARAM_USERNAME = "username";
+
+ public static final String OPERATION_SUCCESSFUL = "Operation successful";
+ public static final String OPERATION_UNSUCCESSFUL = "Operation unsuccessful";
+
+ public static final String ALL = "All";
+
+ public static final String NAVIGATION_ROOT = "Qpid Connections";
+ public static final String DESCRIPTION = " Description";
+
+ public static final String ADMIN_MBEAN_TYPE = "UserManagement";
+ public static final String QUEUE = "Queue";
+ public static final String CONNECTION = "Connection";
+ public static final String EXCHANGE = "Exchange";
+ public static final String EXCHANGE_TYPE = "ExchangeType";
+ public static final String[] EXCHANGE_TYPE_VALUES = { "direct", "fanout", "headers", "topic" };
+ public static final String[] BOOLEAN_TYPE_VALUES = { "false", "true" };
+ public static final String[] ATTRIBUTE_TABLE_TITLES = { "Attribute Name", "Value" };
+ public static final String[] CONNECTION_PROTOCOLS = { "RMI" };
public static final String DEFAULT_PROTOCOL = CONNECTION_PROTOCOLS[0];
-
- public final static String ACTION_ADDSERVER = "New Connection";
- public final static String ACTION_RECONNECT = "Reconnect";
- public final static String ACTION_LOGIN = "Login";
-
- public final static String QUEUE_SORT_BY_NAME = "Queue Name";
- public final static String QUEUE_SORT_BY_DEPTH = "Queue Depth";
- public final static String QUEUE_SORT_BY_CONSUMERCOUNT = "Consumer Count";
- public final static String QUEUE_SHOW_TEMP_QUEUES= "show temporary queues";
-
- public final static String SUBSCRIBE_BUTTON = "Subscribe";
- public final static String UNSUBSCRIBE_BUTTON = "Unsubscribe";
-
- public final static String CONSOLE_IMAGE = "ConsoelImage";
- public final static String CLOSED_FOLDER_IMAGE = "ClosedFolderImage";
- public final static String OPEN_FOLDER_IMAGE = "OpenFolderImage";
- public final static String MBEAN_IMAGE = "MBeanImage";
- public final static String NOTIFICATION_IMAGE = "NotificationImage";
-
- public final static String FONT_BUTTON = "ButtonFont";
- public final static String FONT_BOLD = "BoldFont";
- public final static String FONT_ITALIC = "ItalicFont";
- public final static String FONT_TABLE_CELL = "TableCellFont";
- public final static String FONT_NORMAL = "Normal";
-
- public final static String BUTTON_DETAILS = "Details";
- public final static String BUTTON_EDIT_ATTRIBUTE = "Edit Attribute";
- public final static String BUTTON_REFRESH = "Refresh";
- public final static String BUTTON_GRAPH = "Graph";
- public final static int TIMER_INTERVAL = 5000;
- public final static String BUTTON_EXECUTE = "Execute";
- public final static String BUTTON_CLEAR = "Clear";
- public final static String BUTTON_CONNECT = "Connect";
- public final static String BUTTON_CANCEL = "Cancel";
- public final static String BUTTON_UPDATE = "Update";
-
-
- public final static int OPERATION_IMPACT_INFO = 0;
- public final static int OPERATION_IMPACT_ACTION = 1;
- public final static int OPERATION_IMPACT_ACTIONINFO = 2;
- public final static int OPERATION_IMPACT_UNKNOWN = 3;
-
- public final static String ERROR_SERVER_CONNECTION = "Server could not be connected";
- public final static String INFO_PROTOCOL = "Please select the protocol";
- public final static String INFO_HOST_ADDRESS = "Please enter the host address";
- public final static String INFO_HOST_PORT = "Please enter the port number";
- public final static String INFO_USERNAME = "Please enter the " + USERNAME;
- public final static String INFO_PASSWORD = "Please enter the " + PASSWORD;
+
+ public static final String ACTION_ADDSERVER = "New Connection";
+ public static final String ACTION_RECONNECT = "Reconnect";
+ public static final String ACTION_LOGIN = "Login";
+
+ public static final String QUEUE_SORT_BY_NAME = "Queue Name";
+ public static final String QUEUE_SORT_BY_DEPTH = "Queue Depth";
+ public static final String QUEUE_SORT_BY_CONSUMERCOUNT = "Consumer Count";
+ public static final String QUEUE_SHOW_TEMP_QUEUES = "show temporary queues";
+
+ public static final String SUBSCRIBE_BUTTON = "Subscribe";
+ public static final String UNSUBSCRIBE_BUTTON = "Unsubscribe";
+
+ public static final String CONSOLE_IMAGE = "ConsoelImage";
+ public static final String CLOSED_FOLDER_IMAGE = "ClosedFolderImage";
+ public static final String OPEN_FOLDER_IMAGE = "OpenFolderImage";
+ public static final String MBEAN_IMAGE = "MBeanImage";
+ public static final String NOTIFICATION_IMAGE = "NotificationImage";
+
+ public static final String FONT_BUTTON = "ButtonFont";
+ public static final String FONT_BOLD = "BoldFont";
+ public static final String FONT_ITALIC = "ItalicFont";
+ public static final String FONT_TABLE_CELL = "TableCellFont";
+ public static final String FONT_NORMAL = "Normal";
+
+ public static final String BUTTON_DETAILS = "Details";
+ public static final String BUTTON_EDIT_ATTRIBUTE = "Edit Attribute";
+ public static final String BUTTON_REFRESH = "Refresh";
+ public static final String BUTTON_GRAPH = "Graph";
+ public static final int TIMER_INTERVAL = 5000;
+ public static final String BUTTON_EXECUTE = "Execute";
+ public static final String BUTTON_CLEAR = "Clear";
+ public static final String BUTTON_CONNECT = "Connect";
+ public static final String BUTTON_CANCEL = "Cancel";
+ public static final String BUTTON_UPDATE = "Update";
+
+ public static final int OPERATION_IMPACT_INFO = 0;
+ public static final int OPERATION_IMPACT_ACTION = 1;
+ public static final int OPERATION_IMPACT_ACTIONINFO = 2;
+ public static final int OPERATION_IMPACT_UNKNOWN = 3;
+
+ public static final String ERROR_SERVER_CONNECTION = "Server could not be connected";
+ public static final String INFO_PROTOCOL = "Please select the protocol";
+ public static final String INFO_HOST_ADDRESS = "Please enter the host address";
+ public static final String INFO_HOST_PORT = "Please enter the port number";
+ public static final String INFO_USERNAME = "Please enter the " + USERNAME;
+ public static final String INFO_PASSWORD = "Please enter the " + PASSWORD;
+
+ public static final String MECH_CRAMMD5 = "CRAM-MD5";
+ public static final String MECH_PLAIN = "PLAIN";
+ public static final String SASL_CRAMMD5 = "SASL/CRAM-MD5";
+ public static final String SASL_PLAIN = "SASL/PLAIN";
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java
index 38c3e8f413..31825e925d 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java
@@ -20,6 +20,7 @@
*/
package org.apache.qpid.management.ui;
+import static org.apache.qpid.management.ui.Constants.*;
import java.util.HashMap;
/**
@@ -50,7 +51,7 @@ public abstract class ManagedBean extends ManagedObject
this._properties = properties;
setName(getProperty("name"));
setType(getProperty("type"));
- _virtualHostName = getProperty(Constants.VIRTUAL_HOST);
+ _virtualHostName = getProperty(VIRTUAL_HOST);
}
public String getDomain()
{
@@ -89,7 +90,7 @@ public abstract class ManagedBean extends ManagedObject
public String getVirtualHostName()
{
// To make it work with the broker with no virtual host implementation
- return _virtualHostName == null ? Constants.DEFAULT_VH : _virtualHostName;
+ return _virtualHostName == null ? DEFAULT_VH : _virtualHostName;
}
/**
@@ -106,21 +107,26 @@ public abstract class ManagedBean extends ManagedObject
public boolean isQueue()
{
- return _type.endsWith(Constants.QUEUE);
+ return _type.endsWith(QUEUE);
}
public boolean isConnection()
{
- return _type.endsWith(Constants.CONNECTION);
+ return _type.endsWith(CONNECTION);
}
public boolean isExchange()
{
- return _type.endsWith(Constants.EXCHANGE);
+ return _type.endsWith(EXCHANGE);
}
public boolean isTempQueue()
{
return (isQueue() && getName().startsWith("tmp_"));
}
+
+ public boolean isAdmin()
+ {
+ return _type.endsWith(ADMIN_MBEAN_TYPE);
+ }
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java
index da49d70b88..f93200cadf 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java
@@ -37,8 +37,8 @@ public class Perspective implements IPerspectiveFactory
layout.setEditorAreaVisible(false);
// standalone view meaning it can't be docked or stacked with other views, and it doesn't have a title bar.
- layout.addStandaloneView(NavigationView.ID, true, IPageLayout.LEFT, 0.25f, editorArea);
- layout.addStandaloneView(MBeanView.ID, true, IPageLayout.RIGHT, 0.75f, editorArea);
+ layout.addStandaloneView(NavigationView.ID, true, IPageLayout.LEFT, 0.30f, editorArea);
+ layout.addStandaloneView(MBeanView.ID, true, IPageLayout.RIGHT, 0.70f, editorArea);
layout.getViewLayout(NavigationView.ID).setCloseable(false);
layout.getViewLayout(MBeanView.ID).setCloseable(false);
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
index fa71ee9bc7..313e143df5 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
@@ -128,6 +128,10 @@ public abstract class ServerRegistry
return _virtualHosts;
}
+ public abstract void setUserList(List<String> list);
+
+ public abstract List<String> getUsernames();
+
public abstract void addManagedObject(ManagedBean key);
public abstract List<ManagedBean> getMBeans();
@@ -154,7 +158,7 @@ public abstract class ServerRegistry
public abstract boolean hasSubscribedForNotifications(ManagedBean mbean, String name, String type);
- public abstract void clearNotifications(ManagedBean mbean);
+ public abstract void clearNotifications(ManagedBean mbean, List<NotificationObject> list);
public ClientListener getNotificationListener()
{
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
index 5a926e6474..0e12c59de4 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
@@ -194,9 +194,6 @@ public class AddServer/* extends Action*/ implements IWorkbenchWindowActionDeleg
}
}
- //If you create it, you dispose it.
- shell.dispose();
-
// enable the main shell
_window.getShell().setEnabled(true);
_window.getShell().open();
@@ -263,7 +260,7 @@ public class AddServer/* extends Action*/ implements IWorkbenchWindowActionDeleg
user.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
final Text textUser = new Text(composite, SWT.BORDER);
- textUser.setText(DEFAULT_USERNAME);
+ textUser.setText("");
textUser.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
Label password = new Label(composite, SWT.NONE);
@@ -271,7 +268,7 @@ public class AddServer/* extends Action*/ implements IWorkbenchWindowActionDeleg
password.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
final Text textPwd = new Text(composite, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD);
- textPwd.setText(DEFAULT_PASSWORD);
+ textPwd.setText("");
//textPwd.setEchoChar('*');
textPwd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
@@ -327,11 +324,7 @@ public class AddServer/* extends Action*/ implements IWorkbenchWindowActionDeleg
_domain = comboDomain.getText();
_addServer = true;
-
- if (!connectButton.getShell().isDisposed())
- {
- connectButton.getShell().dispose();
- }
+ shell.dispose();
}
});
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
index 8fe08462cd..9aa265ab3c 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
@@ -168,9 +168,6 @@ public class ReconnectServer implements IWorkbenchWindowActionDelegate
}
}
- //If you create it, you dispose it.
- shell.dispose();
-
// enable the main shell
_window.getShell().setEnabled(true);
_window.getShell().open();
@@ -194,7 +191,7 @@ public class ReconnectServer implements IWorkbenchWindowActionDelegate
user.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
final Text textUser = new Text(composite, SWT.BORDER);
- textUser.setText(DEFAULT_USERNAME);
+ textUser.setText("");
textUser.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
// Put cursor on this field
textUser.setFocus();
@@ -204,7 +201,7 @@ public class ReconnectServer implements IWorkbenchWindowActionDelegate
password.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
final Text textPwd = new Text(composite, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD);
- textPwd.setText(DEFAULT_PASSWORD);
+ textPwd.setText("");
textPwd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
Composite buttonsComposite = new Composite(composite, SWT.NONE);
@@ -240,11 +237,7 @@ public class ReconnectServer implements IWorkbenchWindowActionDelegate
}
_connect = true;
-
- if (!connectButton.getShell().isDisposed())
- {
- connectButton.getShell().dispose();
- }
+ shell.dispose();
}
});
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java
index 82447d645e..2be0ddbebf 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java
@@ -45,10 +45,7 @@ public class ClientListener implements NotificationListener
{
ObjectName objName = null;
String type = notification.getType();
- if (MBeanUtility.isDebug())
- {
- System.out.println(type + ":" + objName);
- }
+ MBeanUtility.printOutput(type + ":" + objName);
if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(type))
{
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
index b0f9928c38..816c479cf9 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
@@ -20,6 +20,10 @@
*/
package org.apache.qpid.management.ui.jmx;
+import static org.apache.qpid.management.ui.Constants.*;
+
+import java.lang.reflect.Constructor;
+import java.security.Security;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@@ -35,8 +39,9 @@ import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
+import javax.security.sasl.SaslClientFactory;
-import org.apache.qpid.management.ui.Constants;
+import org.apache.qpid.management.ui.ApplicationRegistry;
import org.apache.qpid.management.ui.ManagedBean;
import org.apache.qpid.management.ui.ManagedServer;
import org.apache.qpid.management.ui.ServerRegistry;
@@ -44,6 +49,10 @@ import org.apache.qpid.management.ui.model.ManagedAttributeModel;
import org.apache.qpid.management.ui.model.NotificationInfoModel;
import org.apache.qpid.management.ui.model.NotificationObject;
import org.apache.qpid.management.ui.model.OperationDataModel;
+import org.apache.qpid.management.ui.sasl.JCAProvider;
+import org.apache.qpid.management.ui.sasl.SaslProvider;
+import org.apache.qpid.management.ui.sasl.UserPasswordCallbackHandler;
+import org.apache.qpid.management.ui.sasl.UsernameHashedPasswordCallbackHandler;
public class JMXServerRegistry extends ServerRegistry
@@ -52,11 +61,12 @@ public class JMXServerRegistry extends ServerRegistry
private JMXConnector _jmxc = null;
private MBeanServerConnection _mbsc = null;
+ private List<String> _usersList;
// When an mbean gets removed from mbean server, then the notification listener
// will add that mbean in this list.
private List<ManagedBean> _mbeansToBeRemoved = new ArrayList<ManagedBean>();
- // Map containing all managed beans and ampped with unique mbean name
+ // Map containing all managed beans and mapped with unique mbean name
private HashMap<String, ManagedBean> _mbeansMap = new HashMap<String, ManagedBean>();
// Map containing MBeanInfo for all mbeans and mapped with unique mbean name
private HashMap<String, MBeanInfo> _mbeanInfoMap = new HashMap<String, MBeanInfo>();
@@ -83,11 +93,69 @@ public class JMXServerRegistry extends ServerRegistry
{
super(server);
JMXServiceURL jmxUrl = new JMXServiceURL(server.getUrl());
- Map<String, Object> env = new HashMap<String, Object>();
- String[] creds = {server.getUser(), server.getPassword()};
- env.put(JMXConnector.CREDENTIALS, creds);
-
- _jmxc = JMXConnectorFactory.connect(jmxUrl, env);
+ Map<String, Object> env = null;
+ String securityMechanism = ApplicationRegistry.getSecurityMechanism();
+
+ if (securityMechanism != null)
+ {
+ try
+ {
+ // Check if the JMXMP connector is available
+ Class klass = Class.forName("javax.management.remote.jmxmp.JMXMPConnector");
+
+ jmxUrl = new JMXServiceURL("jmxmp", server.getHost(), server.getPort());
+ env = new HashMap<String, Object>();
+
+ if (MECH_CRAMMD5.equals(securityMechanism))
+ {
+ // For SASL/CRAM-MD5
+ Map<String, Class<? extends SaslClientFactory>> map = new HashMap<String, Class<? extends SaslClientFactory>>();
+ Class<?> clazz = Class.forName("org.apache.qpid.management.ui.sasl.CRAMMD5HashedSaslClientFactory");
+ map.put("CRAM-MD5-HASHED", (Class<? extends SaslClientFactory>) clazz);
+
+ Security.addProvider(new JCAProvider(map));
+ env.put("jmx.remote.profiles", SASL_CRAMMD5);
+ env.put("jmx.remote.sasl.callback.handler",
+ new UsernameHashedPasswordCallbackHandler(server.getUser(), server.getPassword()));
+ }
+ else if (MECH_PLAIN.equals(securityMechanism))
+ {
+ // For SASL/PLAIN
+ Security.addProvider(new SaslProvider());
+ env.put("jmx.remote.profiles", SASL_PLAIN);
+ env.put("jmx.remote.sasl.callback.handler",
+ new UserPasswordCallbackHandler(server.getUser(), server.getPassword()));
+ }
+ else
+ {
+ MBeanUtility.printOutput("Security mechanism " + securityMechanism + " is not supported.");
+ }
+
+ // Now create the instance of JMXMPConnector
+ Class[] paramTypes = {JMXServiceURL.class, Map.class};
+ Constructor cons = klass.getConstructor(paramTypes);
+
+ Object[] args = {jmxUrl, env};
+ Object theObject = cons.newInstance(args);
+
+ _jmxc = (JMXConnector)theObject;
+ _jmxc.connect();
+ MBeanUtility.printOutput("Starting JMXConnector with SASL. Server=" + server.getName());
+ }
+ catch (Exception ex)
+ {
+ // When JMXMPConnector is not available
+ MBeanUtility.printOutput("Starting JMXConnector. Server=" + server.getName());
+ jmxUrl = new JMXServiceURL(server.getUrl());
+ _jmxc = JMXConnectorFactory.connect(jmxUrl, null);
+ }
+ }
+ else
+ {
+ jmxUrl = new JMXServiceURL(server.getUrl());
+ _jmxc = JMXConnectorFactory.connect(jmxUrl, null);
+ }
+
_mbsc = _jmxc.getMBeanServerConnection();
_clientListener = new ClientListener(server);
@@ -155,10 +223,7 @@ public class JMXServerRegistry extends ServerRegistry
public void removeManagedObject(ManagedBean mbean)
{
- if (MBeanUtility.isDebug())
- {
- System.out.println("Removing MBean:" + mbean.getUniqueName());
- }
+ MBeanUtility.printOutput("Removing MBean:" + mbean.getUniqueName());
if (mbean.isQueue())
{
@@ -218,17 +283,78 @@ public class JMXServerRegistry extends ServerRegistry
list.add(obj);
}
+ /**
+ * Returns all the notification objects for a given mbean. If mbean is null, it returns
+ * notification objects for all the mbeans.
+ */
public List<NotificationObject> getNotifications(ManagedBean mbean)
{
- return _notificationsMap.get(mbean.getUniqueName());
+ if (mbean == null)
+ {
+ List<NotificationObject> totalList = new ArrayList<NotificationObject>();
+ for (List<NotificationObject> list : _notificationsMap.values())
+ {
+ totalList.addAll(list);
+ }
+ return totalList;
+ }
+ else
+ {
+ return _notificationsMap.get(mbean.getUniqueName());
+ }
}
- public void clearNotifications(ManagedBean mbean)
+ public void clearNotifications(ManagedBean mbean, List<NotificationObject> list)
{
- if (_notificationsMap.containsKey(mbean.getUniqueName()))
- _notificationsMap.get(mbean.getUniqueName()).clear();
+ if (mbean == null)
+ {
+ if (list == null || list.isEmpty())
+ {
+ // All notifications of all mbeans to be cleared
+ _notificationsMap.clear();
+ }
+ else
+ {
+ // Clear the selected notifications
+ for (NotificationObject obj : list)
+ {
+ mbean = _mbeansMap.get(obj.getSource().toString());
+ List<NotificationObject> nList = _notificationsMap.get(mbean.getUniqueName());
+ if (nList != null && !nList.isEmpty())
+ {
+ nList.remove(obj);
+ }
+ }
+ }
+ }
+ else
+ {
+ if (list == null || list.isEmpty())
+ {
+ // All notifications of this mbean to be cleared
+ List<NotificationObject> nList = _notificationsMap.get(mbean.getUniqueName());
+ if (nList != null && !nList.isEmpty())
+ {
+ nList.clear();
+ }
+ }
+ else
+ {
+ // Clear the selected notifications
+ for (NotificationObject obj : list)
+ {
+ List<NotificationObject> nList = _notificationsMap.get(mbean.getUniqueName());
+ if (nList != null && !nList.isEmpty())
+ {
+ nList.remove(obj);
+ }
+ }
+ }
+ }
}
+
+
/**
* Adds notification name and type to the map. The map contains all the notification names,
* subscribed for an mbean.
@@ -254,7 +380,7 @@ public class JMXServerRegistry extends ServerRegistry
map.put(name, list);
}
// Now add the notification type to the list
- if (Constants.ALL.equals(type))
+ if (ALL.equals(type))
{
List<NotificationInfoModel> infoList = _notificationInfoMap.get(mbean.getUniqueName());
for (NotificationInfoModel model : infoList)
@@ -313,7 +439,7 @@ public class JMXServerRegistry extends ServerRegistry
HashMap<String, List<String>> map = _subscribedNotificationMap.get(mbean.getUniqueName());
if (map.containsKey(name))
{
- if (Constants.ALL.equals(type))
+ if (ALL.equals(type))
{
map.remove(name);
}
@@ -441,6 +567,16 @@ public class JMXServerRegistry extends ServerRegistry
}
return connections;
}
+
+ public void setUserList(List<String> list)
+ {
+ _usersList = list;
+ }
+
+ public List<String> getUsernames()
+ {
+ return _usersList;
+ }
public ClientNotificationListener getNotificationListener()
{
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
index 5ceeb879b4..41db11c10e 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
@@ -60,13 +60,6 @@ import org.apache.qpid.management.ui.views.ViewUtility;
*/
public class MBeanUtility
{
- private static boolean _debug;
- static
- {
- String debug = System.getProperty("debug");
- _debug = "true".equalsIgnoreCase(debug) ? true : false;
- }
-
public static final BigInteger MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE);
public static final BigInteger MAX_INT = BigInteger.valueOf(Integer.MAX_VALUE);
/**
@@ -149,27 +142,27 @@ public class MBeanUtility
* @param mbean managed bean
* @param ex Exception
*/
- public static void handleException(ManagedBean mbean, Exception ex)
+ public static void handleException(ManagedBean mbean, Throwable ex)
{
if (mbean == null)
{
ViewUtility.popupErrorMessage("Error", "Managed Object is null \n" + ex.toString());
- ex.printStackTrace();
+ printStackTrace(ex);
}
else if (ex instanceof IOException)
{
ViewUtility.popupErrorMessage(mbean.getInstanceName(), "IO Error occured \n" + ex.toString());
- ex.printStackTrace();
+ printStackTrace(ex);
}
else if (ex instanceof ReflectionException)
{
ViewUtility.popupErrorMessage(mbean.getInstanceName(), "Server has thrown error \n" + ex.toString());
- ex.printStackTrace();
+ printStackTrace(ex);
}
else if (ex instanceof InstanceNotFoundException)
{
ViewUtility.popupErrorMessage(mbean.getInstanceName(), "Managed Object Not Found \n" + ex.toString());
- ex.printStackTrace();
+ printStackTrace(ex);
}
else if (ex instanceof MBeanException)
{
@@ -188,8 +181,20 @@ public class MBeanUtility
}
else
{
- ViewUtility.popupErrorMessage(mbean.getInstanceName(), ex.getMessage());
- ex.printStackTrace();
+ if (ex.getCause() != null)
+ {
+ handleException(mbean, ex.getCause());
+ }
+ else
+ {
+ String msg = ex.getMessage();
+ if (msg == null)
+ {
+ msg = ex.toString();
+ }
+ ViewUtility.popupErrorMessage(mbean.getInstanceName(), msg);
+ printStackTrace(ex);
+ }
}
}
@@ -449,12 +454,19 @@ public class MBeanUtility
return Arrays.asList(domains);
}
- /**
- * return true if System property is set to true -Ddebug=true
- * @return
- */
- public static boolean isDebug()
+ public static void printOutput(String statement)
{
- return _debug;
+ if (ApplicationRegistry.debug)
+ {
+ System.out.println(statement);
+ }
+ }
+
+ private static void printStackTrace(Throwable ex)
+ {
+ if (ApplicationRegistry.debug)
+ {
+ ex.printStackTrace();
+ }
}
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
index 8ba74b3ce8..926e5f0a24 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
@@ -24,10 +24,12 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
+import javax.management.ObjectName;
+
public class NotificationObject
{
- private long _sequenceNo;
+ private long _sequenceNo;
private Date _timeStamp;
private String _message;
private Object _source;
@@ -52,6 +54,17 @@ public class NotificationObject
{
this._source = _source;
}
+
+ public String getSourceName()
+ {
+ if (_source instanceof ObjectName)
+ {
+ return ((ObjectName)_source).getKeyProperty("name");
+ }
+
+ return null;
+ }
+
public String getMessage()
{
return _message;
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
index 9b6750c21a..2b83645942 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
@@ -80,5 +80,13 @@ public class OperationData
this._returnType = returnType;
}
+ public boolean isReturnTypeBoolean()
+ {
+ return (_returnType.equals("boolean") || _returnType.equals("java.lang.Boolean"));
+ }
+ public boolean isReturnTypeVoid()
+ {
+ return (_returnType.equals("void") || _returnType.equals("java.lang.Void"));
+ }
} \ No newline at end of file
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java
new file mode 100644
index 0000000000..32a0c12344
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java
@@ -0,0 +1,60 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+package org.apache.qpid.management.ui.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.sasl.Sasl;
+import javax.security.sasl.SaslClient;
+import javax.security.sasl.SaslClientFactory;
+import javax.security.sasl.SaslException;
+
+public class CRAMMD5HashedSaslClientFactory implements SaslClientFactory
+{
+ /** The name of this mechanism */
+ public static final String MECHANISM = "CRAM-MD5-HASHED";
+
+ public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol,
+ String serverName, Map<String, ?> props, CallbackHandler cbh)
+ throws SaslException
+ {
+ for (int i = 0; i < mechanisms.length; i++)
+ {
+ if (mechanisms[i].equals(MECHANISM))
+ {
+ if (cbh == null)
+ {
+ throw new SaslException("CallbackHandler must not be null");
+ }
+
+ String[] mechs = {"CRAM-MD5"};
+ return Sasl.createSaslClient(mechs, authorizationId, protocol, serverName, props, cbh);
+ }
+ }
+ return null;
+ }
+
+ public String[] getMechanismNames(Map props)
+ {
+ return new String[]{MECHANISM};
+ }
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java
new file mode 100644
index 0000000000..ce9a273eaa
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+package org.apache.qpid.management.ui.sasl;
+
+import java.util.Map;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.sasl.SaslClient;
+import javax.security.sasl.SaslClientFactory;
+import javax.security.sasl.SaslException;
+
+public class ClientSaslFactory implements SaslClientFactory
+{
+ public SaslClient createSaslClient(String[] mechs, String authorizationId, String protocol,
+ String serverName, Map props, CallbackHandler cbh)
+ throws SaslException
+ {
+ for (int i = 0; i < mechs.length; i++)
+ {
+ if (mechs[i].equals("PLAIN"))
+ {
+ return new PlainSaslClient(authorizationId, cbh);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Simple-minded implementation that ignores props
+ */
+ public String[] getMechanismNames(Map props)
+ {
+ return new String[]{"PLAIN"};
+ }
+
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java
new file mode 100644
index 0000000000..d8189f3ac3
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java
@@ -0,0 +1,56 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+package org.apache.qpid.management.ui.sasl;
+
+import java.security.Provider;
+import java.util.Map;
+
+import javax.security.sasl.SaslClientFactory;
+
+public class JCAProvider extends Provider
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Creates the security provider with a map from SASL mechanisms to implementing factories.
+ *
+ * @param providerMap The map from SASL mechanims to implementing factory classes.
+ */
+ public JCAProvider(Map<String, Class<? extends SaslClientFactory>> providerMap)
+ {
+ super("AMQSASLProvider", 1.0, "A JCA provider that registers all "
+ + "AMQ SASL providers that want to be registered");
+ register(providerMap);
+ }
+
+ /**
+ * Registers client factory classes for a map of mechanism names to client factory classes.
+ *
+ * @param providerMap The map from SASL mechanims to implementing factory classes.
+ */
+ private void register(Map<String, Class<? extends SaslClientFactory>> providerMap)
+ {
+ for (Map.Entry<String, Class<? extends SaslClientFactory>> me : providerMap.entrySet())
+ {
+ put("SaslClientFactory." + me.getKey(), me.getValue().getName());
+ }
+ }
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java
new file mode 100644
index 0000000000..22190f29eb
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java
@@ -0,0 +1,203 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+package org.apache.qpid.management.ui.sasl;
+
+import java.io.*;
+import javax.security.auth.callback.*;
+import javax.security.sasl.*;
+
+public class PlainSaslClient implements SaslClient
+{
+
+ private boolean completed;
+ private CallbackHandler cbh;
+ private String authorizationID;
+ private String authenticationID;
+ private byte password[];
+ private static byte SEPARATOR = 0;
+
+ public PlainSaslClient(String authorizationID, CallbackHandler cbh) throws SaslException
+ {
+ completed = false;
+ this.cbh = cbh;
+ Object[] userInfo = getUserInfo();
+ this.authorizationID = authorizationID;
+ this.authenticationID = (String) userInfo[0];
+ this.password = (byte[]) userInfo[1];
+ if (authenticationID == null || password == null)
+ {
+ throw new SaslException("PLAIN: authenticationID and password must be specified");
+ }
+ }
+
+ public byte[] evaluateChallenge(byte[] challenge) throws SaslException
+ {
+ if (completed)
+ {
+ throw new IllegalStateException("PLAIN: authentication already " +
+ "completed");
+ }
+ completed = true;
+ try
+ {
+ byte authzid[] =
+ authorizationID == null ? null : authorizationID.getBytes("UTF8");
+ byte authnid[] = authenticationID.getBytes("UTF8");
+ byte response[] =
+ new byte[
+ password.length +
+ authnid.length +
+ 2 + // SEPARATOR
+ (authzid != null ? authzid.length : 0)
+ ];
+ int size = 0;
+ if (authzid != null) {
+ System.arraycopy(authzid, 0, response, 0, authzid.length);
+ size = authzid.length;
+ }
+ response[size++] = SEPARATOR;
+ System.arraycopy(authnid, 0, response, size, authnid.length);
+ size += authnid.length;
+ response[size++] = SEPARATOR;
+ System.arraycopy(password, 0, response, size, password.length);
+ clearPassword();
+ return response;
+ } catch (UnsupportedEncodingException e) {
+ throw new SaslException("PLAIN: Cannot get UTF-8 encoding of ids",
+ e);
+ }
+ }
+
+ public String getMechanismName()
+ {
+ return "PLAIN";
+ }
+
+ public boolean hasInitialResponse()
+ {
+ return true;
+ }
+
+ public boolean isComplete()
+ {
+ return completed;
+ }
+
+ public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
+ {
+ if (completed) {
+ throw new IllegalStateException("PLAIN: this mechanism supports " +
+ "neither integrity nor privacy");
+ } else {
+ throw new IllegalStateException("PLAIN: authentication not " +
+ "completed");
+ }
+ }
+
+ public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
+ {
+ if (completed)
+ {
+ throw new IllegalStateException("PLAIN: this mechanism supports " +
+ "neither integrity nor privacy");
+ }
+ else
+ {
+ throw new IllegalStateException("PLAIN: authentication not " +
+ "completed");
+ }
+ }
+
+ public Object getNegotiatedProperty(String propName)
+ {
+ if (completed)
+ {
+ if (propName.equals(Sasl.QOP))
+ {
+ return "auth";
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ throw new IllegalStateException("PLAIN: authentication not " +
+ "completed");
+ }
+ }
+
+ private void clearPassword()
+ {
+ if (password != null)
+ {
+ for (int i = 0 ; i < password.length ; i++)
+ {
+ password[i] = 0;
+ }
+ password = null;
+ }
+ }
+
+ public void dispose() throws SaslException
+ {
+ clearPassword();
+ }
+
+ protected void finalize()
+ {
+ clearPassword();
+ }
+
+ private Object[] getUserInfo() throws SaslException
+ {
+ try
+ {
+ final String userPrompt = "PLAIN authentication id: ";
+ final String pwPrompt = "PLAIN password: ";
+ NameCallback nameCb = new NameCallback(userPrompt);
+ PasswordCallback passwordCb = new PasswordCallback(pwPrompt, false);
+ cbh.handle(new Callback[] { nameCb, passwordCb });
+ String userid = nameCb.getName();
+ char pwchars[] = passwordCb.getPassword();
+ byte pwbytes[];
+ if (pwchars != null)
+ {
+ pwbytes = (new String(pwchars)).getBytes("UTF8");
+ passwordCb.clearPassword();
+ }
+ else
+ {
+ pwbytes = null;
+ }
+ return (new Object[] { userid, pwbytes });
+ }
+ catch (IOException e)
+ {
+ throw new SaslException("Cannot get password", e);
+ }
+ catch (UnsupportedCallbackException e)
+ {
+ throw new SaslException("Cannot get userid/password", e);
+ }
+ }
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java
new file mode 100644
index 0000000000..2917de8740
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+package org.apache.qpid.management.ui.sasl;
+
+import java.security.Provider;
+
+public class SaslProvider extends Provider
+{
+ private static final long serialVersionUID = -6978096016899676466L;
+
+ public SaslProvider()
+ {
+ super("SaslClientFactory", 1.0, "SASL PLAIN CLIENT MECHANISM");
+ put("SaslClientFactory.PLAIN", "ClientSaslFactory");
+ }
+
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java
new file mode 100644
index 0000000000..1602229c85
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+package org.apache.qpid.management.ui.sasl;
+
+import java.io.*;
+import javax.security.auth.callback.*;
+
+public class UserPasswordCallbackHandler implements CallbackHandler
+{
+ private String user;
+ private char[] pwchars;
+
+ public UserPasswordCallbackHandler(String user, String password)
+ {
+ this.user = user;
+ this.pwchars = password.toCharArray();
+ }
+
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ for (int i = 0; i < callbacks.length; i++)
+ {
+ if (callbacks[i] instanceof NameCallback)
+ {
+ NameCallback ncb = (NameCallback) callbacks[i];
+ ncb.setName(user);
+ }
+ else if (callbacks[i] instanceof PasswordCallback)
+ {
+ PasswordCallback pcb = (PasswordCallback) callbacks[i];
+ pcb.setPassword(pwchars);
+ }
+ else
+ {
+ throw new UnsupportedCallbackException(callbacks[i]);
+ }
+ }
+ }
+
+ private void clearPassword()
+ {
+ if (pwchars != null)
+ {
+ for (int i = 0 ; i < pwchars.length ; i++)
+ {
+ pwchars[i] = 0;
+ }
+ pwchars = null;
+ }
+ }
+
+ protected void finalize()
+ {
+ clearPassword();
+ }
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java
new file mode 100644
index 0000000000..f4e3d2661e
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java
@@ -0,0 +1,82 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+package org.apache.qpid.management.ui.sasl;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.qpid.management.ui.views.ViewUtility;
+
+public class UsernameHashedPasswordCallbackHandler implements CallbackHandler
+{
+ private String user;
+ private char[] pwchars;
+
+ public UsernameHashedPasswordCallbackHandler(String user, String password) throws Exception
+ {
+ this.user = user;
+ this.pwchars = ViewUtility.getHash(password);
+ }
+
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ for (int i = 0; i < callbacks.length; i++)
+ {
+ if (callbacks[i] instanceof NameCallback)
+ {
+ NameCallback ncb = (NameCallback) callbacks[i];
+ ncb.setName(user);
+ }
+ else if (callbacks[i] instanceof PasswordCallback)
+ {
+ PasswordCallback pcb = (PasswordCallback) callbacks[i];
+ pcb.setPassword(pwchars);
+ }
+ else
+ {
+ throw new UnsupportedCallbackException(callbacks[i]);
+ }
+ }
+ }
+
+
+ private void clearPassword()
+ {
+ if (pwchars != null)
+ {
+ for (int i = 0 ; i < pwchars.length ; i++)
+ {
+ pwchars[i] = 0;
+ }
+ pwchars = null;
+ }
+ }
+
+ protected void finalize()
+ {
+ clearPassword();
+ }
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
index 437afeeda1..a7e8bbfc4c 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
@@ -596,7 +596,7 @@ public class AttributesTabControl extends TabControl
}
// Refresh from the server registry
- private void refresh()
+ public void refresh()
{
JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(_mbean);
ManagedAttributeModel attributesList = serverRegistry.getAttributeModel(_mbean);
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java
index 59b9fe3aaa..344c3c4e7f 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java
@@ -62,6 +62,7 @@ public class MBeanView extends ViewPart
private FormToolkit _toolkit = null;
private Form _form = null;
+ private String _formText = APPLICATION_NAME;
private static ManagedServer _server = null;
private TreeObject _selectedNode = null;
private ManagedBean _mbean = null;
@@ -73,6 +74,8 @@ public class MBeanView extends ViewPart
// TabFolder to list all the mbeans for a given mbeantype(eg Connection, Queue, Exchange)
private TabFolder typeTabFolder = null;
+
+ private TabFolder notificationTabFolder = null;
/*
* Listener for the selection events in the navigation view
*/
@@ -91,16 +94,41 @@ public class MBeanView extends ViewPart
// an mbeantype. For mbeantype selection(eg Connection, Queue, Exchange) _mbean will remain null.
_mbean = null;
setInvisible();
- _form.setText(APPLICATION_NAME);
- // If a selected node(mbean) gets unregistered from mbena server, mbenaview should should
+ // If a selected node(mbean) gets unregistered from mbean server, mbeanview should
// make the tabfolber for that mbean invisible
if (_selectedNode == null)
return;
setServer();
refreshMBeanView();
+ setFormTitle();
+ }
+ }
+
+ private void setFormTitle()
+ {
+ if (_mbean != null)
+ {
+ _formText = _mbean.getType();
+ if ((_mbean.getVirtualHostName() != null) && (!DEFAULT_VH.equals(_mbean.getVirtualHostName())) )
+ {
+ _formText = _formText.replaceFirst(VIRTUAL_HOST, _mbean.getVirtualHostName());
+ if (_mbean.getName() != null && _mbean.getName().length() != 0)
+ {
+ _formText = _formText + ": " + _mbean.getName();
+ }
+ }
+ }
+ else if ((_selectedNode.getVirtualHost() != null) && (!DEFAULT_VH.equals(_selectedNode.getVirtualHost())))
+ {
+ _formText = _selectedNode.getVirtualHost();
}
+ else
+ {
+ _formText = APPLICATION_NAME;
+ }
+ _form.setText(_formText);
}
public void refreshMBeanView()
@@ -121,10 +149,16 @@ public class MBeanView extends ViewPart
{
refreshTypeTabFolder(_selectedNode.getName());
}
- else
+ else if (NOTIFICATIONS.equals(_selectedNode.getType()))
+ {
+ refreshNotificationPage();
+ }
+ else if (MBEAN.equals(_selectedNode.getType()))
{
+ _mbean = (ManagedBean)_selectedNode.getManagedObject();
showSelectedMBean();
}
+
_form.layout(true);
_form.getBody().layout(true, true);
}
@@ -174,20 +208,7 @@ public class MBeanView extends ViewPart
}
private void showSelectedMBean() throws Exception
- {
- if (NOTIFICATION.equals(_selectedNode.getType()))
- {
- _mbean = (ManagedBean)_selectedNode.getParent().getManagedObject();
- }
- else if (MBEAN.equals(_selectedNode.getType()))
- {
- _mbean = (ManagedBean)_selectedNode.getManagedObject();
- }
- else
- {
- return;
- }
-
+ {
try
{
MBeanUtility.getMBeanInfo(_mbean);
@@ -213,14 +234,8 @@ public class MBeanView extends ViewPart
tabFolder = createMBeanTabFolder();
}
- String text = _mbean.getType();
- if (_mbean.getName() != null && _mbean.getName().length() != 0)
- {
- text = text + ": " + _mbean.getName();
- }
- _form.setText(text);
int tabIndex = 0;
- if (NOTIFICATION.equals(_selectedNode.getType()))
+ if (NOTIFICATIONS.equals(_selectedNode.getType()))
{
tabIndex = tabFolder.getItemCount() -1;
}
@@ -247,6 +262,8 @@ public class MBeanView extends ViewPart
// Add mbeantype TabFolder. This will list all the mbeans under a mbeantype (eg Queue, Exchange).
// Using this list mbeans will be added in the navigation view
createMBeanTypeTabFolder();
+
+ createNotificationsTabFolder();
}
private TabFolder createMBeanTabFolder()
@@ -345,7 +362,7 @@ public class MBeanView extends ViewPart
NotificationsTabControl controller = new NotificationsTabControl(tabFolder);
TabItem tab = new TabItem(tabFolder, SWT.NONE);
- tab.setText(NOTIFICATION);
+ tab.setText(NOTIFICATIONS);
tab.setData(CONTROLLER, controller);
tab.setControl(controller.getControl());
}
@@ -432,6 +449,32 @@ public class MBeanView extends ViewPart
});
}
+ private void createNotificationsTabFolder()
+ {
+ notificationTabFolder = new TabFolder(_form.getBody(), SWT.NONE);
+ FormData layoutData = new FormData();
+ layoutData.left = new FormAttachment(0);
+ layoutData.top = new FormAttachment(0);
+ layoutData.right = new FormAttachment(100);
+ layoutData.bottom = new FormAttachment(100);
+ notificationTabFolder.setLayoutData(layoutData);
+ notificationTabFolder.setVisible(false);
+
+ VHNotificationsTabControl controller = new VHNotificationsTabControl(notificationTabFolder);
+ TabItem tab = new TabItem(notificationTabFolder, SWT.NONE);
+ tab.setText(NOTIFICATIONS);
+ tab.setData(CONTROLLER, controller);
+ tab.setControl(controller.getControl());
+ }
+
+ private void refreshNotificationPage()
+ {
+ TabItem tab = notificationTabFolder.getItem(0);
+ VHNotificationsTabControl controller = (VHNotificationsTabControl)tab.getData(CONTROLLER);
+ controller.refresh();
+ notificationTabFolder.setVisible(true);
+ }
+
/**
* Refreshes the Selected mbeantype tab. The control lists all the available mbeans
* for an mbeantype(eg Queue, Exchange etc)
@@ -492,6 +535,11 @@ public class MBeanView extends ViewPart
{
typeTabFolder.setVisible(false);
}
+
+ if (notificationTabFolder != null)
+ {
+ notificationTabFolder.setVisible(false);
+ }
}
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
index a861405d30..68f95e01f0 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
@@ -244,7 +244,8 @@ public class NavigationView extends ViewPart
List<TreeObject> list = _serversRootNode.getChildren();
for (TreeObject node : list)
{
- if (url.equals(node.getUrl()))
+ ManagedServer nodeServer = (ManagedServer)node.getManagedObject();
+ if (url.equals(nodeServer.getUrl()))
{
// Server is already in the list of added servers, so now connect it.
// Set the server node as selected and then connect it.
@@ -266,7 +267,6 @@ public class NavigationView extends ViewPart
// Server connection is successful. Now add the server in the tree
TreeObject serverNode = new TreeObject(serverAddress, NODE_TYPE_SERVER);
- serverNode.setUrl(url);
serverNode.setManagedObject(managedServer);
_serversRootNode.addChild(serverNode);
@@ -504,6 +504,11 @@ public class NavigationView extends ViewPart
typeChild = new TreeObject(QUEUE, NODE_TYPE_MBEANTYPE);
typeChild.setParent(parent);
typeChild.setVirtualHost(parent.getVirtualHost());
+
+ // Add common notification node for virtual host
+ TreeObject notificationNode = new TreeObject(NOTIFICATIONS, NOTIFICATIONS);
+ notificationNode.setParent(parent);
+ notificationNode.setVirtualHost(parent.getVirtualHost());
}
/**
@@ -585,7 +590,10 @@ public class NavigationView extends ViewPart
// create a node for "type"
typeNode = createTypeNode(parentNode, type);
- typeNode.setVirtualHost(mbean.getVirtualHostName());
+ if (!type.equals(VIRTUAL_HOST))
+ {
+ typeNode.setVirtualHost(mbean.getVirtualHostName());
+ }
}
// now type node create becomes the parent node for next node in hierarchy
@@ -641,8 +649,8 @@ public class NavigationView extends ViewPart
// Add notification node
// TODO: show this only if the mbean sends any notification
- TreeObject notificationNode = new TreeObject(NOTIFICATION, NOTIFICATION);
- notificationNode.setParent(mbeanNode);
+ //TreeObject notificationNode = new TreeObject(NOTIFICATION, NOTIFICATION);
+ //notificationNode.setParent(mbeanNode);
}
private TreeObject createTypeNode(TreeObject parent, String name)
@@ -1044,7 +1052,7 @@ public class NavigationView extends ViewPart
public Image getImage(Object element)
{
TreeObject node = (TreeObject) element;
- if (node.getType().equals(NOTIFICATION))
+ if (node.getType().equals(NOTIFICATIONS))
{
return ApplicationRegistry.getImage(NOTIFICATION_IMAGE);
}
@@ -1107,8 +1115,11 @@ public class NavigationView extends ViewPart
{
return 1;
}
-
- return 2;
+ if (node.getType().equals(NOTIFICATIONS))
+ {
+ return 2;
+ }
+ return 3;
}
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
index 4f0acde1b4..6894080859 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
@@ -20,29 +20,28 @@
*/
package org.apache.qpid.management.ui.views;
-import java.util.ArrayList;
+import static org.apache.qpid.management.ui.Constants.BUTTON_CLEAR;
+import static org.apache.qpid.management.ui.Constants.BUTTON_REFRESH;
+import static org.apache.qpid.management.ui.Constants.DESCRIPTION;
+import static org.apache.qpid.management.ui.Constants.FONT_BOLD;
+import static org.apache.qpid.management.ui.Constants.FONT_BUTTON;
+import static org.apache.qpid.management.ui.Constants.FONT_ITALIC;
+import static org.apache.qpid.management.ui.Constants.SUBSCRIBE_BUTTON;
+import static org.apache.qpid.management.ui.Constants.UNSUBSCRIBE_BUTTON;
+
import java.util.List;
-import static org.apache.qpid.management.ui.Constants.*;
import org.apache.qpid.management.ui.ApplicationRegistry;
import org.apache.qpid.management.ui.ManagedBean;
import org.apache.qpid.management.ui.ServerRegistry;
import org.apache.qpid.management.ui.jmx.MBeanUtility;
import org.apache.qpid.management.ui.model.NotificationInfoModel;
import org.apache.qpid.management.ui.model.NotificationObject;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
@@ -52,71 +51,35 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* Creates control composite for Notifications tab
* @author Bhupendra Bhardwaj
*/
-public class NotificationsTabControl extends TabControl
-{
- private FormToolkit _toolkit;
- private Form _form;
- private Table table = null;
- private TableViewer _tableViewer = null;
-
- private IStructuredContentProvider contentProvider = new ContentProviderImpl();
- private SelectionListener selectionListener = new SelectionListenerImpl();
- private SelectionListener comboListener = new ComboSelectionListener();
-
- private Thread worker = null;
-
- private List<NotificationObject> _notifications = null;
- private static final String COLUMN_SEQ = "Sequence No";
- private static final String COLUMN_TIME = "TimeStamp";
- private static final String COLUMN_TYPE = "Type";
- private static final String COLUMN_MSG = "Notification Message";
- private static final String[] _tableTitles = new String [] {
- COLUMN_SEQ,
- COLUMN_TIME,
- COLUMN_TYPE,
- COLUMN_MSG
- };
+public class NotificationsTabControl extends VHNotificationsTabControl
+{
+ private static final String SELECT_NOTIFICATIONNAME = "Select Notification";
+ private static final String SELECT_NOTIFICATIONTYPE = "Select Type";
+ private SelectionListener selectionListener;
+ private SelectionListener comboListener;
private Combo notificationNameCombo = null;
private Combo typesCombo = null;
private Label descriptionLabel = null;
private Button _subscribeButton = null;
private Button _unsubscribeButton = null;
- private Button _clearButton = null;
- private Button _refreshButton = null;
-
public NotificationsTabControl(TabFolder tabFolder)
{
super(tabFolder);
- _toolkit = new FormToolkit(_tabFolder.getDisplay());
- _form = _toolkit.createForm(_tabFolder);
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginWidth = 0;
- gridLayout.marginHeight = 0;
- _form.getBody().setLayout(gridLayout);
-
- createWidgets();
- worker = new Thread(new Worker());
- worker.start();
}
- private void createWidgets()
+ protected void createWidgets()
{
+ selectionListener = new SelectionListenerImpl();
+ comboListener = new ComboSelectionListener();
createNotificationInfoComposite();
//addFilterComposite();
addButtons();
@@ -124,14 +87,6 @@ public class NotificationsTabControl extends TabControl
}
/**
- * @see TabControl#getControl()
- */
- public Control getControl()
- {
- return _form;
- }
-
- /**
* Creates composite and populates for displaying Notification Information (name, type, description)
* and creates buttons for subscribing or unsubscribing for notifications
*/
@@ -205,7 +160,7 @@ public class NotificationsTabControl extends TabControl
/**
* Creates clear buttin and refresh button
*/
- private void addButtons()
+ protected void addButtons()
{
Composite composite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
@@ -224,8 +179,9 @@ public class NotificationsTabControl extends TabControl
if (_mbean == null)
return;
+ IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection();
ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
- serverRegistry.clearNotifications(_mbean);
+ serverRegistry.clearNotifications(_mbean, ss.toList());
refresh();
}
});
@@ -247,155 +203,13 @@ public class NotificationsTabControl extends TabControl
}
});
}
-
- /**
- * Creates table to display notifications
- */
- private void createTable()
- {
- table = _toolkit.createTable(_form.getBody(), SWT.FULL_SELECTION);
- table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- TableColumn column = new TableColumn(table, SWT.NONE);
- column.setText(_tableTitles[0]);
- column.pack(); //column.setWidth(200);
-
- column = new TableColumn(table, SWT.NONE);
- column.setText(_tableTitles[1]);
- column.setWidth(150);
-
- column = new TableColumn(table, SWT.NONE);
- column.setText(_tableTitles[2]);
- column.setWidth(100);
-
- column = new TableColumn(table, SWT.NONE);
- column.setText(_tableTitles[3]);
- column.setWidth(500);
-
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- }
-
- /**
- * Creates JFace viewer for the notifications table
- */
- protected void createTableViewer()
- {
- createTable();
- _tableViewer = new TableViewer(table);
- //_tableViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- _tableViewer.setUseHashlookup(true);
- _tableViewer.setContentProvider(contentProvider);
- _tableViewer.setLabelProvider(new LabelProviderImpl());
- _tableViewer.setColumnProperties(_tableTitles);
- /*
- CellEditor[] cellEditors = new CellEditor[_tableTitles.length];
- TextCellEditor textEditor = new TextCellEditor(table);
- cellEditors[0] = textEditor;
- textEditor = new TextCellEditor(table);
- cellEditors[1] = textEditor;
- textEditor = new TextCellEditor(table);
- cellEditors[2] = textEditor;
- textEditor = new TextCellEditor(table);
- cellEditors[3] = textEditor;
-
- // Assign the cell editors to the viewer
- _tableViewer.setCellEditors(cellEditors);
- _tableViewer.setCellModifier(new TableCellModifier());
- */
-
- addTableListeners();
-
- //_tableViewer.addSelectionChangedListener(new );
-
- //_notificationDetails = new Composite(_tabControl, SWT.BORDER);
- //_notificationDetails.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- //_tabControl.layout();
- //viewerComposite.layout();
- }
-
- /**
- * Adds listeners to the viewer for displaying notification details
- */
- private void addTableListeners()
- {
- _tableViewer.addDoubleClickListener(new IDoubleClickListener()
- {
- Display display = null;
- Shell shell = null;
- public void doubleClick(DoubleClickEvent event)
- {
- display = Display.getCurrent();
- shell = new Shell(display, SWT.BORDER | SWT.CLOSE | SWT.MIN |
- SWT.MAX | SWT.RESIZE);
- shell.setText("Notification");
-
- int x = display.getBounds().width;
- int y = display.getBounds().height;
- shell.setBounds(x/4, y/4, x/2, y/3);
- StructuredSelection selection = (StructuredSelection)event.getSelection();
- createPopupContents((NotificationObject)selection.getFirstElement());
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
-
- //If you create it, you dispose it.
- shell.dispose();
- }
-
- private void createPopupContents(NotificationObject obj)
- {
- shell.setLayout(new GridLayout());
-
- Composite parent = new Composite(shell, SWT.NONE);
- parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- GridLayout layout = new GridLayout(4, true);
- parent.setLayout(layout);
-
- Label key = new Label(parent, SWT.TRAIL);
- key.setText(COLUMN_SEQ);
- GridData layoutData = new GridData(SWT.TRAIL, SWT.TOP, false, false,1,1);
- key.setLayoutData(layoutData);
- Text value = new Text(parent, SWT.BEGINNING | SWT.BORDER |SWT.READ_ONLY);
- value.setText(""+obj.getSequenceNo());
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
-
- // Time row
- key = new Label(parent, SWT.TRAIL);
- key.setText(COLUMN_TIME);
- key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
- value = new Text(parent, SWT.BEGINNING | SWT.BORDER | SWT.READ_ONLY);
- value.setText(""+obj.getTimeStamp());
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
-
- key = new Label(parent, SWT.TRAIL);
- key.setText(COLUMN_TYPE);
- key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
- value = new Text(parent, SWT.BEGINNING | SWT.BORDER | SWT.READ_ONLY);
- value.setText(""+obj.getType());
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
-
- key = new Label(parent, SWT.TRAIL);
- key.setText(COLUMN_MSG);
- key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
- value = new Text(parent, SWT.MULTI | SWT.WRAP| SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY);
- value.setText(""+obj.getMessage());
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
- gridData.heightHint = 100;
- value.setLayoutData(gridData);
- }
- });
- }
-
+
@Override
public void refresh(ManagedBean mbean)
{
_mbean = mbean;
_notifications = null;
+ _table.deselectAll();
_tableViewer.getTable().clearAll();
if (_mbean == null)
@@ -431,9 +245,10 @@ public class NotificationsTabControl extends TabControl
_form.getBody().layout(true, true);
}
- private void refresh()
+ public void refresh()
{
_notifications = null;
+ _table.deselectAll();
_tableViewer.getTable().clearAll();
}
@@ -444,7 +259,11 @@ public class NotificationsTabControl extends TabControl
{
notificationNameCombo.removeAll();
NotificationInfoModel[] items = MBeanUtility.getNotificationInfo(_mbean);
- notificationNameCombo.add("Select Notification");
+ if (items.length > 1)
+ {
+ notificationNameCombo.add(SELECT_NOTIFICATIONNAME);
+ }
+
for (int i = 0; i < items.length; i++)
{
notificationNameCombo.add(items[i].getName());
@@ -457,6 +276,7 @@ public class NotificationsTabControl extends TabControl
typesCombo.select(0);
typesCombo.setEnabled(false);
+ populateNotificationType(notificationNameCombo.getItem(0));
checkForEnablingButtons();
}
@@ -466,7 +286,8 @@ public class NotificationsTabControl extends TabControl
private void checkForEnablingButtons()
{
int nameIndex = notificationNameCombo.getSelectionIndex();
- if (nameIndex == 0)
+ int itemCount = notificationNameCombo.getItems().length;
+ if ((itemCount > 1) && (nameIndex == 0))
{
_subscribeButton.setEnabled(false);
_unsubscribeButton.setEnabled(false);
@@ -475,7 +296,8 @@ public class NotificationsTabControl extends TabControl
}
int typeIndex = typesCombo.getSelectionIndex();
- if (typeIndex == 0)
+ itemCount = typesCombo.getItems().length;
+ if ((itemCount > 1) && (typeIndex == 0))
{
_subscribeButton.setEnabled(false);
_unsubscribeButton.setEnabled(false);
@@ -560,164 +382,38 @@ public class NotificationsTabControl extends TabControl
Combo combo = (Combo)e.getSource();
if (combo == notificationNameCombo)
{
- if (combo.getSelectionIndex() == 0)
- {
- descriptionLabel.setText("");
- typesCombo.select(0);
- typesCombo.setEnabled(false);
- return;
- }
- String index = combo.getItem(combo.getSelectionIndex());
- NotificationInfoModel data = (NotificationInfoModel)combo.getData(index);
- descriptionLabel.setText(data.getDescription());
- typesCombo.removeAll();
- typesCombo.setItems(data.getTypes());
- typesCombo.add("Select Type", 0);
- typesCombo.select(0);
- typesCombo.setEnabled(true);
+ String selectedItem = combo.getItem(combo.getSelectionIndex());
+ populateNotificationType(selectedItem);
}
checkForEnablingButtons();
}
}
- /**
- * Content provider class for the table viewer
- */
- private class ContentProviderImpl implements IStructuredContentProvider, INotificationViewer
+ private void populateNotificationType(String notificationName)
{
- public void inputChanged(Viewer v, Object oldInput, Object newInput)
+ NotificationInfoModel data = (NotificationInfoModel)notificationNameCombo.getData(notificationName);
+ if (data == null)
{
-
- }
- public void dispose()
- {
-
- }
- public Object[] getElements(Object parent)
- {
- return _notifications.toArray(new NotificationObject[0]);
- }
- public void addNotification(NotificationObject notification)
- {
- _tableViewer.add(notification);
- }
-
- public void addNotification(List<NotificationObject> notificationList)
- {
- _tableViewer.add(notificationList.toArray(new NotificationObject[0]));
- }
- }
-
- /**
- * Label provider for the table viewer
- */
- private class LabelProviderImpl implements ITableLabelProvider
- {
- List<ILabelProviderListener> listeners = new ArrayList<ILabelProviderListener>();
- public void addListener(ILabelProviderListener listener)
- {
- listeners.add(listener);
- }
-
- public void dispose(){
-
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- String result = null;
- NotificationObject t = (NotificationObject)element;
- switch(columnIndex)
- {
- case 0 :
- result = String.valueOf(t.getSequenceNo());
- break;
- case 1 :
- result = String.valueOf(t.getTimeStamp());
- break;
- case 2 :
- result = t.getType();
- break;
- case 3 :
- result = t.getMessage();
- break;
- default :
- result = "";
- }
-
- return result;
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- listeners.remove(listener);
- }
- } // end of LabelProviderImpl
-
- private boolean workerRunning = false;
- private void setWorkerRunning(boolean running)
- {
- workerRunning = running;
- }
-
- /**
- * Worker class which keeps looking if there are new notifications coming from server for the selected mbean
- */
- private class Worker implements Runnable
- {
- public void run()
- {
- Display display = _tabFolder.getDisplay();
- while(true)
- {
- if (!workerRunning || _mbean == null || display == null)
- {
- sleep();
- continue;
- }
-
- display.syncExec(new Runnable()
- {
- public void run()
- {
- setWorkerRunning(_form.isVisible());
- if (!workerRunning) return;
-
- updateTableViewer();
- }
- });
-
- sleep();
- }
+ descriptionLabel.setText("");
+ typesCombo.select(0);
+ typesCombo.setEnabled(false);
+ return;
}
-
- private void sleep()
+ descriptionLabel.setText(data.getDescription());
+ typesCombo.removeAll();
+ typesCombo.setItems(data.getTypes());
+ if (typesCombo.getItemCount() > 1)
{
- try
- {
- Thread.sleep(2000);
- }
- catch(Exception ex)
- {
-
- }
+ typesCombo.add(SELECT_NOTIFICATIONTYPE, 0);
}
+ typesCombo.select(0);
+ typesCombo.setEnabled(true);
}
/**
* Updates the table with new notifications received from mbean server for the selected mbean
*/
- private void updateTableViewer()
+ protected void updateTableViewer()
{
ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
List<NotificationObject> newList = serverRegistry.getNotifications(_mbean);
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
index 49b61c0fc6..2ac037e4f0 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
@@ -20,10 +20,16 @@
*/
package org.apache.qpid.management.ui.views;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularDataSupport;
+
import static org.apache.qpid.management.ui.Constants.*;
import org.apache.qpid.management.ui.ApplicationRegistry;
import org.apache.qpid.management.ui.ManagedBean;
@@ -76,7 +82,7 @@ public class OperationTabControl extends TabControl
private SelectionListener operationExecutionListener = new OperationExecutionListener();
private SelectionListener refreshListener = new RefreshListener();
private SelectionListener parameterSelectionListener = new ParameterSelectionListener();
- private SelectionListener bolleanSelectionListener = new BooleanSelectionListener();
+ private SelectionListener booleanSelectionListener = new BooleanSelectionListener();
private VerifyListener verifyListener = new VerifyListenerImpl();
private KeyListener keyListener = new KeyListenerImpl();
private KeyListener headerBindingListener = new HeaderBindingKeyListener();
@@ -249,6 +255,8 @@ public class OperationTabControl extends TabControl
formData.top = new FormAttachment(0, parameterPositionOffset);
formData.left = new FormAttachment(label, 5);
formData.right = new FormAttachment(valueWidth);
+ // this will contain the list of items, if the list is to be made available to choose from
+ // e.g. the list of exchanges
String[] items = null;
if (param.getName().equals(QUEUE))
{
@@ -269,6 +277,15 @@ public class OperationTabControl extends TabControl
{
items = EXCHANGE_TYPE_VALUES;
}
+ else if (_mbean.isAdmin() && param.getName().equals(OPERATION_PARAM_USERNAME)
+ && !_opData.getName().equals(OPERATION_CREATEUSER))
+ {
+ List<String> list = ApplicationRegistry.getServerRegistry(_mbean).getUsernames();
+ if (list != null && !list.isEmpty())
+ {
+ items = list.toArray(new String[0]);
+ }
+ }
if (items != null)
{
@@ -295,12 +312,17 @@ public class OperationTabControl extends TabControl
Button booleanButton = _toolkit.createButton(_paramsComposite, "", SWT.CHECK);
booleanButton.setLayoutData(formData);
booleanButton.setData(param);
- booleanButton.addSelectionListener(bolleanSelectionListener);
+ booleanButton.addSelectionListener(booleanSelectionListener);
valueInCombo = true;
}
else
{
- Text text = _toolkit.createText(_paramsComposite, "", SWT.NONE);
+ int style = SWT.NONE;
+ if (PASSWORD.equalsIgnoreCase(param.getName()))
+ {
+ style = SWT.PASSWORD;
+ }
+ Text text = _toolkit.createText(_paramsComposite, "", style);
formData = new FormData();
formData.top = new FormAttachment(0, parameterPositionOffset);
formData.left = new FormAttachment(label, 5);
@@ -530,6 +552,8 @@ public class OperationTabControl extends TabControl
((org.eclipse.swt.widgets.List)controls[i]).deselectAll();
else if (controls[i] instanceof Text)
((Text)controls[i]).setText("");
+ else if (controls[i] instanceof Button)
+ ((Button)controls[i]).setSelection(false);
else if (controls[i] instanceof Composite)
clearParameterValues((Composite)controls[i]);
}
@@ -557,6 +581,21 @@ public class OperationTabControl extends TabControl
}
// End of custom code
+
+ // customized for passwords
+ if (PASSWORD.equalsIgnoreCase(param.getName()))
+ {
+ try
+ {
+ param.setValueFromString(ViewUtility.getHashedString(param.getValue()));
+ }
+ catch (Exception ex)
+ {
+ MBeanUtility.handleException(_mbean, ex);
+ return;
+ }
+ }
+ // end of customization
ViewUtility.popupInfoMessage(_form.getText(),
"Please select the " + ViewUtility.getDisplayText(param.getName()));
@@ -609,6 +648,17 @@ public class OperationTabControl extends TabControl
return;
}
+ // Custom code for Admin mbean operation
+ /* These custome codes here are to make the GUI look more user friendly.
+ * Here we are adding the users to a list, which will be used to list username to be selected on
+ * pages like "delete user", "set password" instead of typing the username
+ */
+ if (_mbean.isAdmin() && _opData.getName().equals(OPERATION_VIEWUSERS))
+ {
+ ApplicationRegistry.getServerRegistry(_mbean).setUserList(extractUserList(result));
+ }
+ // end of custom code
+
// Some mbeans have only "type" and no "name".
String title = _mbean.getType();
if (_mbean.getName() != null && _mbean.getName().length() != 0)
@@ -616,9 +666,15 @@ public class OperationTabControl extends TabControl
title = _mbean.getName();
}
- if (_opData.getReturnType().equals("void") || _opData.getReturnType().equals("java.lang.Void"))
+ if (_opData.isReturnTypeVoid())
+ {
+ ViewUtility.popupInfoMessage(title, OPERATION_SUCCESSFUL);
+ }
+ else if (_opData.isReturnTypeBoolean())
{
- ViewUtility.popupInfoMessage(title, "Operation successful");
+ boolean success = Boolean.parseBoolean(result.toString());
+ String message = success ? OPERATION_SUCCESSFUL : OPERATION_UNSUCCESSFUL;
+ ViewUtility.popupInfoMessage(title, message);
}
else if (_opData.getParameters() != null && !_opData.getParameters().isEmpty())
{
@@ -634,6 +690,24 @@ public class OperationTabControl extends TabControl
}
+ private List<String> extractUserList(Object result)
+ {
+ if (!(result instanceof TabularDataSupport))
+ {
+ return null;
+ }
+
+ TabularDataSupport tabularData = (TabularDataSupport)result;
+ Collection<CompositeData> records = tabularData.values();
+ List<String> list = new ArrayList<String>();
+ for (CompositeData data : records)
+ {
+ list.add(data.get(USERNAME).toString());
+ }
+ Collections.sort(list);
+ return list;
+ }
+
/**
* Listener class for the operation parameters widget
*/
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java
index 0793e33538..c13c92066c 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java
@@ -69,7 +69,18 @@ public abstract class TabControl
return null;
}
- public abstract void refresh(ManagedBean mbean);
+ public void refresh(ManagedBean mbean)
+ {
+ if (mbean == null)
+ {
+ refresh();
+ }
+ }
+
+ public void refresh()
+ {
+
+ }
public void refresh(ManagedBean mbean, OperationData opData)
{
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java
index 511c2d7150..9545ed9876 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java
@@ -31,7 +31,6 @@ public class TreeObject
{
private String _name;
private String _type;
- private String _url;
private String _virtualHost;
private TreeObject _parent;
private List<TreeObject> _children = new ArrayList<TreeObject>();
@@ -88,16 +87,6 @@ public class TreeObject
{
return _type;
}
-
- public String getUrl()
- {
- return _url;
- }
-
- public void setUrl(String url)
- {
- this._url = url;
- }
public String getVirtualHost()
{
@@ -131,7 +120,6 @@ public class TreeObject
if (parent != null)
{
- this._url = parent.getUrl();
parent.addChild(this);
}
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
new file mode 100644
index 0000000000..258f5ce02a
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
@@ -0,0 +1,462 @@
+package org.apache.qpid.management.ui.views;
+
+import static org.apache.qpid.management.ui.Constants.BUTTON_CLEAR;
+import static org.apache.qpid.management.ui.Constants.BUTTON_REFRESH;
+import static org.apache.qpid.management.ui.Constants.CONSOLE_IMAGE;
+import static org.apache.qpid.management.ui.Constants.FONT_BUTTON;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.qpid.management.ui.ApplicationRegistry;
+import org.apache.qpid.management.ui.ServerRegistry;
+import org.apache.qpid.management.ui.model.NotificationObject;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+public class VHNotificationsTabControl extends TabControl
+{
+ protected FormToolkit _toolkit;
+ protected Form _form;
+ protected Table _table = null;
+ protected TableViewer _tableViewer = null;
+
+ protected Thread worker = null;
+
+ protected List<NotificationObject> _notifications = null;
+
+ private static final String COLUMN_OBJ = "Object Name";
+ private static final String COLUMN_SEQ = "Sequence No";
+ private static final String COLUMN_TIME = "TimeStamp";
+ private static final String COLUMN_TYPE = "Type";
+ private static final String COLUMN_MSG = "Notification Message";
+ protected static final String[] _tableTitles = new String [] {
+ COLUMN_OBJ,
+ COLUMN_SEQ,
+ COLUMN_TIME,
+ COLUMN_TYPE,
+ COLUMN_MSG
+ };
+
+ protected Button _clearButton = null;
+ protected Button _refreshButton = null;
+
+ public VHNotificationsTabControl(TabFolder tabFolder)
+ {
+ super(tabFolder);
+ _toolkit = new FormToolkit(_tabFolder.getDisplay());
+ _form = _toolkit.createForm(_tabFolder);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ _form.getBody().setLayout(gridLayout);
+
+ worker = new Thread(new Worker());
+ worker.start();
+ }
+
+ protected void createWidgets()
+ {
+ addButtons();
+ createTableViewer();
+ }
+
+ /**
+ * @see TabControl#getControl()
+ */
+ public Control getControl()
+ {
+ if (_table == null)
+ {
+ createWidgets();
+ }
+ return _form;
+ }
+
+ /**
+ * Creates clear buttin and refresh button
+ */
+ protected void addButtons()
+ {
+ Composite composite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ composite.setLayout(new GridLayout(2, true));
+
+ // Add Clear Button
+ _clearButton = _toolkit.createButton(composite, BUTTON_CLEAR, SWT.PUSH | SWT.CENTER);
+ _clearButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
+ GridData gridData = new GridData(SWT.LEAD, SWT.TOP, true, false);
+ gridData.widthHint = 80;
+ _clearButton.setLayoutData(gridData);
+ _clearButton.addSelectionListener(new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent e)
+ {
+ //TODO : Get selected rows and clear those
+ IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection();
+ ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
+ serverRegistry.clearNotifications(null, ss.toList());
+ refresh();
+ }
+ });
+
+ // Add Refresh Button
+ _refreshButton = _toolkit.createButton(composite, BUTTON_REFRESH, SWT.PUSH | SWT.CENTER);
+ _refreshButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
+ gridData = new GridData(SWT.TRAIL, SWT.TOP, true, false);
+ gridData.widthHint = 80;
+ _refreshButton.setLayoutData(gridData);
+ _refreshButton.addSelectionListener(new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent e)
+ {
+ refresh();
+ }
+ });
+ }
+
+ /**
+ * Creates table to display notifications
+ */
+ private void createTable()
+ {
+ _table = _toolkit.createTable(_form.getBody(), SWT.MULTI | SWT.FULL_SELECTION);
+ _table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ TableColumn column = new TableColumn(_table, SWT.NONE);
+ column.setText(_tableTitles[0]);
+ column.setWidth(100);
+
+ column = new TableColumn(_table, SWT.NONE);
+ column.setText(_tableTitles[1]);
+ column.setWidth(100);
+
+ column = new TableColumn(_table, SWT.NONE);
+ column.setText(_tableTitles[2]);
+ column.setWidth(130);
+
+ column = new TableColumn(_table, SWT.NONE);
+ column.setText(_tableTitles[3]);
+ column.setWidth(100);
+
+ column = new TableColumn(_table, SWT.NONE);
+ column.setText(_tableTitles[4]);
+ column.setWidth(500);
+
+ _table.setHeaderVisible(true);
+ _table.setLinesVisible(true);
+ }
+
+ /**
+ * Creates JFace viewer for the notifications table
+ */
+ protected void createTableViewer()
+ {
+ createTable();
+ _tableViewer = new TableViewer(_table);
+ //_tableViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ _tableViewer.setUseHashlookup(true);
+ _tableViewer.setContentProvider(new ContentProviderImpl());
+ _tableViewer.setLabelProvider(new LabelProviderImpl());
+ _tableViewer.setColumnProperties(_tableTitles);
+ /*
+ CellEditor[] cellEditors = new CellEditor[_tableTitles.length];
+ TextCellEditor textEditor = new TextCellEditor(table);
+ cellEditors[0] = textEditor;
+ textEditor = new TextCellEditor(table);
+ cellEditors[1] = textEditor;
+ textEditor = new TextCellEditor(table);
+ cellEditors[2] = textEditor;
+ textEditor = new TextCellEditor(table);
+ cellEditors[3] = textEditor;
+
+ // Assign the cell editors to the viewer
+ _tableViewer.setCellEditors(cellEditors);
+ _tableViewer.setCellModifier(new TableCellModifier());
+ */
+
+ addTableListeners();
+
+ //_tableViewer.addSelectionChangedListener(new );
+
+ //_notificationDetails = new Composite(_tabControl, SWT.BORDER);
+ //_notificationDetails.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ //_tabControl.layout();
+ //viewerComposite.layout();
+ }
+
+ /**
+ * Adds listeners to the viewer for displaying notification details
+ */
+ protected void addTableListeners()
+ {
+ _tableViewer.addDoubleClickListener(new IDoubleClickListener()
+ {
+ Display display = null;
+ Shell shell = null;
+ public void doubleClick(DoubleClickEvent event)
+ {
+ display = Display.getCurrent();
+ shell = new Shell(display, SWT.BORDER | SWT.CLOSE | SWT.MIN | SWT.MAX | SWT.RESIZE);
+ shell.setText("Notification");
+ shell.setImage(ApplicationRegistry.getImage(CONSOLE_IMAGE));
+
+ int x = display.getBounds().width;
+ int y = display.getBounds().height;
+ shell.setBounds(x/4, y/4, x/2, y/3);
+ StructuredSelection selection = (StructuredSelection)event.getSelection();
+ createPopupContents((NotificationObject)selection.getFirstElement());
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+
+ //If you create it, you dispose it.
+ shell.dispose();
+ }
+
+ private void createPopupContents(NotificationObject obj)
+ {
+ shell.setLayout(new GridLayout());
+
+ Composite parent = _toolkit.createComposite(shell, SWT.NONE);
+ parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ GridLayout layout = new GridLayout(4, true);
+ parent.setLayout(layout);
+
+ // Object name record
+ Label key = _toolkit.createLabel(parent, COLUMN_OBJ, SWT.TRAIL);
+ GridData layoutData = new GridData(SWT.TRAIL, SWT.TOP, false, false,1,1);
+ key.setLayoutData(layoutData);
+ Text value = _toolkit.createText(parent, obj.getSourceName(), SWT.BEGINNING | SWT.BORDER |SWT.READ_ONLY);
+ value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
+
+ // Sequence no record
+ key = _toolkit.createLabel(parent, COLUMN_SEQ, SWT.TRAIL);
+ layoutData = new GridData(SWT.TRAIL, SWT.TOP, false, false,1,1);
+ key.setLayoutData(layoutData);
+ value = _toolkit.createText(parent, ""+obj.getSequenceNo(), SWT.BEGINNING | SWT.BORDER |SWT.READ_ONLY);
+ value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
+
+ // Time row
+ key = _toolkit.createLabel(parent, COLUMN_TIME, SWT.TRAIL);
+ key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
+ value = _toolkit.createText(parent, obj.getTimeStamp(), SWT.BEGINNING | SWT.BORDER | SWT.READ_ONLY);
+ value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
+
+ key = _toolkit.createLabel(parent, COLUMN_TYPE, SWT.TRAIL);
+ key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
+ value = _toolkit.createText(parent, obj.getType(), SWT.BEGINNING | SWT.BORDER | SWT.READ_ONLY);
+ value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
+
+ key = _toolkit.createLabel(parent, COLUMN_MSG, SWT.TRAIL);
+ key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
+ value = _toolkit.createText(parent, obj.getMessage(), SWT.MULTI | SWT.WRAP| SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY);
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
+ gridData.heightHint = 100;
+ value.setLayoutData(gridData);
+ }
+ });
+ }
+
+ public void refresh()
+ {
+ _notifications = null;
+ _table.deselectAll();
+ _tableViewer.getTable().clearAll();
+
+ Control[] children = _form.getBody().getChildren();
+ for (int i = 0; i < children.length; i++)
+ {
+ children[i].setVisible(true);
+ }
+
+ workerRunning = true;
+ _form.layout(true);
+ _form.getBody().layout(true, true);
+ }
+
+ /**
+ * Content provider class for the table viewer
+ */
+ protected class ContentProviderImpl implements IStructuredContentProvider, INotificationViewer
+ {
+ public void inputChanged(Viewer v, Object oldInput, Object newInput)
+ {
+
+ }
+ public void dispose()
+ {
+
+ }
+ public Object[] getElements(Object parent)
+ {
+ return _notifications.toArray(new NotificationObject[0]);
+ }
+ public void addNotification(NotificationObject notification)
+ {
+ _tableViewer.add(notification);
+ }
+
+ public void addNotification(List<NotificationObject> notificationList)
+ {
+ _tableViewer.add(notificationList.toArray(new NotificationObject[0]));
+ }
+ }
+
+ /**
+ * Label provider for the table viewer
+ */
+ protected class LabelProviderImpl implements ITableLabelProvider
+ {
+ List<ILabelProviderListener> listeners = new ArrayList<ILabelProviderListener>();
+ public void addListener(ILabelProviderListener listener)
+ {
+ listeners.add(listener);
+ }
+
+ public void dispose(){
+
+ }
+
+ public Image getColumnImage(Object element, int columnIndex)
+ {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex)
+ {
+ String result = null;
+ NotificationObject t = (NotificationObject)element;
+ switch(columnIndex)
+ {
+ case 0 :
+ result = t.getSourceName();
+ break;
+ case 1 :
+ result = String.valueOf(t.getSequenceNo());
+ break;
+ case 2 :
+ result = String.valueOf(t.getTimeStamp());
+ break;
+ case 3 :
+ result = t.getType();
+ break;
+ case 4 :
+ result = t.getMessage();
+ break;
+ default :
+ result = "";
+ }
+
+ return result;
+ }
+
+ public boolean isLabelProperty(Object element, String property)
+ {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener)
+ {
+ listeners.remove(listener);
+ }
+ } // end of LabelProviderImpl
+
+ protected boolean workerRunning = false;
+ protected void setWorkerRunning(boolean running)
+ {
+ workerRunning = running;
+ }
+
+ /**
+ * Worker class which keeps looking if there are new notifications coming from server for the selected mbean
+ */
+ private class Worker implements Runnable
+ {
+ public void run()
+ {
+ Display display = _tabFolder.getDisplay();
+ while(true)
+ {
+ if (!workerRunning || display == null)
+ {
+ sleep();
+ continue;
+ }
+
+ display.syncExec(new Runnable()
+ {
+ public void run()
+ {
+ if (_form == null || _form.isDisposed())
+ return;
+ setWorkerRunning(_form.isVisible());
+ if (!workerRunning) return;
+
+ updateTableViewer();
+ }
+ });
+
+ sleep();
+ }
+ }
+
+ private void sleep()
+ {
+ try
+ {
+ Thread.sleep(2000);
+ }
+ catch(Exception ex)
+ {
+
+ }
+ }
+ }
+
+ /**
+ * Updates the table with new notifications received from mbean server for all mbeans
+ */
+ protected void updateTableViewer()
+ {
+ ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
+ List<NotificationObject> newList = serverRegistry.getNotifications(null);
+ if (newList == null)
+ return;
+
+ _notifications = newList;
+ _tableViewer.setInput(_notifications);
+ _tableViewer.refresh();
+ }
+
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
index 9625a58f20..9b5cddd342 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
@@ -20,8 +20,13 @@
*/
package org.apache.qpid.management.ui.views;
+import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -70,6 +75,8 @@ public class ViewUtility
public static final String PREV = "Previous";
public static final String INDEX = "Index";
+ private static final Comparator tabularDataComparator = new TabularDataComparator();
+
private static List<String> SUPPORTED_ARRAY_DATATYPES = new ArrayList<String>();
static
{
@@ -121,6 +128,9 @@ public class ViewUtility
text.setLayoutData(layoutData);
return;
}
+
+ Collections.sort(list, tabularDataComparator);
+
// Attach the tabular record to be retrieved and shown later when record is traversed
// using first/next/previous/last buttons
composite.setData(list);
@@ -549,4 +559,63 @@ public class ViewUtility
oldControls[i].dispose();
}
}
+
+ public static String getHashedString(Object text) throws NoSuchAlgorithmException, UnsupportedEncodingException
+ {
+ char[] chars = getHash((String)text);
+ return new String(chars);
+ }
+
+ public static char[] getHash(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException
+ {
+ byte[] data = text.getBytes("utf-8");
+
+ MessageDigest md = MessageDigest.getInstance("MD5");
+
+ for (byte b : data)
+ {
+ md.update(b);
+ }
+
+ byte[] digest = md.digest();
+
+ char[] hash = new char[digest.length ];
+
+ int index = 0;
+ for (byte b : digest)
+ {
+ hash[index++] = (char) b;
+ }
+
+ return hash;
+ }
+
+ private static class TabularDataComparator implements java.util.Comparator<Map.Entry>
+ {
+ public int compare(Map.Entry data1, Map.Entry data2)
+ {
+ if (data1.getKey() instanceof List)
+ {
+ Object obj1 = ((List)data1.getKey()).get(0);
+ Object obj2 = ((List)data2.getKey()).get(0);
+ String str1 = obj1.toString();
+ String str2 = obj2.toString();
+ if (obj1 instanceof String)
+ {
+ return str1.compareTo(str2);
+ }
+
+ try
+ {
+ return Long.valueOf(str1).compareTo(Long.valueOf(str2));
+ }
+ catch (Exception ex)
+ {
+ return -1;
+ }
+ }
+
+ return -1;
+ }
+ }
}
diff --git a/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF b/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF
new file mode 100644
index 0000000000..7a9e5caaaf
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Jmxmp Plug-in
+Bundle-SymbolicName: jmxremote.optional
+Bundle-Version: 1.0.1
+Bundle-ClassPath: .
+Bundle-Vendor:
+Bundle-Localization: plugin
+Export-Package: com.sun.jmx.remote.generic,
+ com.sun.jmx.remote.opt.internal,
+ com.sun.jmx.remote.opt.security,
+ com.sun.jmx.remote.opt.util,
+ com.sun.jmx.remote.profile.sasl,
+ com.sun.jmx.remote.profile.tls,
+ com.sun.jmx.remote.protocol.jmxmp,
+ com.sun.jmx.remote.socket,
+ javax.management.remote.generic,
+ javax.management.remote.jmxmp,
+ javax.management.remote.message
diff --git a/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini b/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini
index dbe3f23fe9..1762840aff 100644
--- a/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini
+++ b/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini
@@ -22,5 +22,5 @@
osgi.splashPath=platform:/base/plugins/org.apache.qpid.management.ui
eclipse.product=org.apache.qpid.management.ui.product
eclipse.application=org.apache.qpid.management.ui.application
-osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,com.ibm.icu,org.apache.qpid.management.ui,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.ui,org.eclipse.ui.forms,org.eclipse.ui.workbench
+osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,com.ibm.icu,org.apache.qpid.management.ui,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.ui,org.eclipse.ui.forms,jmxremote.optional,org.eclipse.ui.workbench
osgi.bundles.defaultStartLevel=4