Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSDictionary$_JavaNSDictionaryMapEntry


     * @param choices
     */
    protected NSArray choiceByLeavingKeys(NSArray keys, NSArray choices) {
        NSMutableArray result = new NSMutableArray(choices.count());
        for (Enumeration e = choices.objectEnumerator(); e.hasMoreElements();) {
            NSDictionary choice = (NSDictionary) e.nextElement();
            if(keys.containsObject(choice.objectForKey(BRANCH_NAME))) {
                result.addObject(choice);
            }
        }
        return result;
    }
View Full Code Here


    NSMutableDictionary result = new NSMutableDictionary();
    NSArray editors = (NSArray) componentConfiguration().objectForKey("editors");
    if (editors != null) {
      for (Enumeration iter = editors.objectEnumerator(); iter.hasMoreElements();) {
        String key = (String) iter.nextElement();
        NSDictionary dict = (NSDictionary) configuration.editors().objectForKey(key);
        if (dict != null) {
          result.setObjectForKey(dict, key);
        }
      }
    }
View Full Code Here

        NSMutableDictionary monitorRequest = new NSMutableDictionary(1);
        NSMutableDictionary updateWotaskd = new NSMutableDictionary(1);
        NSMutableDictionary requestTypeDict = new NSMutableDictionary();

        if (_Config != null) {
            NSDictionary site = new NSDictionary(_Config.values());
            requestTypeDict.takeValueForKey(site, "site");
        }
        if (_Host != null) {
            NSArray hostArray = new NSArray(_Host.values());
            requestTypeDict.takeValueForKey(hostArray, "hostArray");
View Full Code Here

    /* ******* */

    /* ******** OVERWRITE / CLEAR (UPDATE) ********* */
    public void sendOverwriteToWotaskd(MHost aHost) {
        NSDictionary SiteConfig = siteConfig().dictionaryForArchive();
        NSMutableDictionary data = new NSMutableDictionary(SiteConfig, "SiteConfig");
        _sendOverwriteClearToWotaskd(aHost, "overwrite", data);
    }
View Full Code Here

            commandWotaskd.addObject(command);

            for (int i = 0; i < instanceCount; i++) {
                MInstance anInst = (MInstance) instanceArray.objectAtIndex(i);
                commandWotaskd.addObject(new NSDictionary(new Object[] { anInst.applicationName(), anInst.id(),
                        anInst.hostName(), anInst.port() }, commandInstanceKeys));
            }
            monitorRequest.takeValueForKey(commandWotaskd, "commandWotaskd");

            WOResponse[] responses = collector.sendRequest(monitorRequest, wotaskdArray, false);
View Full Code Here

        if ((updateType.equals("overwrite")) || (updateType.equals("clear")))
            clearOverwrite = true;

        for (int i = 0; i < responseDicts.length; i++) {
            if (responseDicts[i] != null) {
                NSDictionary responseDict = responseDicts[i];
                getGlobalErrorFromResponse(responseDict, errorArray);

                NSDictionary updateWotaskdResponseDict = (NSDictionary) responseDict
                        .valueForKey("updateWotaskdResponse");

                if (updateWotaskdResponseDict != null) {
                    NSDictionary updateTypeResponse = (NSDictionary) updateWotaskdResponseDict.valueForKey(updateType);
                    if (updateTypeResponse != null) {
                        if (clearOverwrite) {
                            String errorMessage = (String) updateTypeResponse.valueForKey("errorMessage");
                            if (errorMessage != null) {
                                errorArray.addObject(errorMessage);
                            }
                        } else {
                            if (hasSite) {
                                NSDictionary aDict = (NSDictionary) updateTypeResponse.valueForKey("site");
                                String errorMessage = (String) aDict.valueForKey("errorMessage");
                                if (errorMessage != null) {
                                    errorArray.addObject(errorMessage);
                                }
                            }
                            if (hasHosts)
View Full Code Here

    protected void _addUpdateResponseToErrorArray(NSDictionary updateTypeResponse, String responseKey,
            NSMutableArray errorArray) {
        NSArray aResponse = (NSArray) updateTypeResponse.valueForKey(responseKey);
        if (aResponse != null) {
            for (Enumeration e = aResponse.objectEnumerator(); e.hasMoreElements();) {
                NSDictionary aDict = (NSDictionary) e.nextElement();
                String errorMessage = (String) aDict.valueForKey("errorMessage");
                if (errorMessage != null) {
                    errorArray.addObject(errorMessage);
                }
            }
        }
View Full Code Here

    public NSMutableArray getCommandErrors(NSDictionary[] responseDicts) {
        NSMutableArray errorArray = new NSMutableArray();

        for (int i = 0; i < responseDicts.length; i++) {
            if (responseDicts[i] != null) {
                NSDictionary responseDict = responseDicts[i];
                getGlobalErrorFromResponse(responseDict, errorArray);

                NSArray commandWotaskdResponse = (NSArray) responseDict.valueForKey("commandWotaskdResponse");
                if ((commandWotaskdResponse != null) && (commandWotaskdResponse.count() > 0)) {
                    int count = commandWotaskdResponse.count();
                    for (int j = 1; j < count; j++) {
                        NSDictionary aDict = (NSDictionary) commandWotaskdResponse.objectAtIndex(j);
                        String errorMessage = (String) aDict.valueForKey("errorMessage");
                        if (errorMessage != null) {
                            errorArray.addObject(errorMessage);
                            if (j == 0)
                                break; // the command produced an error,
                            // parsing didn't finish
View Full Code Here

    protected NSMutableArray getQueryErrors(NSDictionary[] responseDicts) {
        NSMutableArray errorArray = new NSMutableArray();

        for (int i = 0; i < responseDicts.length; i++) {
            if (responseDicts[i] != null) {
                NSDictionary responseDict = responseDicts[i];
                getGlobalErrorFromResponse(responseDict, errorArray);

                NSArray commandWotaskdResponse = (NSArray) responseDict.valueForKey("commandWotaskdResponse");
                if ((commandWotaskdResponse != null) && (commandWotaskdResponse.count() > 0)) {
                    int count = commandWotaskdResponse.count();
                    for (int j = 1; j < count; j++) {
                        NSDictionary aDict = (NSDictionary) commandWotaskdResponse.objectAtIndex(j);
                        String errorMessage = (String) aDict.valueForKey("errorMessage");
                        if (errorMessage != null) {
                            errorArray.addObject(errorMessage);
                            if (j == 0)
                                break; // the command produced an error,
                            // parsing didn't finish
View Full Code Here

            WOResponse[] responses = sendQueryToWotaskds("INSTANCE", hostArray);

            NSMutableArray errorArray = new NSMutableArray();
            NSArray responseArray = null;
            NSDictionary responseDictionary = null;
            NSDictionary queryResponseDictionary = null;
            for (int i = 0; i < responses.length; i++) {
                if ((responses[i] == null) || (responses[i].content() == null)) {
                    responseDictionary = emptyResponse;
                } else {
                    try {
                        responseDictionary = (NSDictionary) new _JavaMonitorDecoder().decodeRootObject(responses[i]
                                .content());
                    } catch (WOXMLException wxe) {
                        NSLog.err.appendln("MonitorComponent pageWithName(AppDetailPage) Error decoding response: "
                                + responses[i].contentString());
                        responseDictionary = responseParsingFailed;
                    }
                }
                getGlobalErrorFromResponse(responseDictionary, errorArray);

                queryResponseDictionary = (NSDictionary) responseDictionary.valueForKey("queryWotaskdResponse");
                if (queryResponseDictionary != null) {
                    responseArray = (NSArray) queryResponseDictionary.valueForKey("instanceResponse");
                    if (responseArray != null) {
                        for (int j = 0; j < responseArray.count(); j++) {
                            responseDictionary = (NSDictionary) responseArray.objectAtIndex(j);

                            String host = (String) responseDictionary.valueForKey("host");
                            Integer port = (Integer) responseDictionary.valueForKey("port");
                            String runningState = (String) responseDictionary.valueForKey("runningState");
                            Boolean refusingNewSessions = (Boolean) responseDictionary
                                    .valueForKey("refusingNewSessions");
                            NSDictionary statistics = (NSDictionary) responseDictionary.valueForKey("statistics");
                            NSArray deaths = (NSArray) responseDictionary.valueForKey("deaths");
                            String nextShutdown = (String) responseDictionary.valueForKey("nextShutdown");

                            MInstance anInstance = siteConfig().instanceWithHostnameAndPort(host, port);
                            if (anInstance != null) {
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSDictionary$_JavaNSDictionaryMapEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.