Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2015 BonitaSoft S.A. BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
package org.bonitasoft.engine.util;

Author(s):
Elias Ricken de Medeiros
Matthieu Chaffotte
public class APITypeManager {
    private static final String API_TYPE = "org.bonitasoft.engine.api-type";
    private static ApiAccessType apiAccessType = null;
    private static Map<StringStringapiTypeParameters = null;
        if ( == null) {
            final String apiType = getProperty();
            if (..name().equalsIgnoreCase(apiType)) {
                 = .;
            } else if (..name().equalsIgnoreCase(apiType)) {
                 = .;
            } else if (apiType.equalsIgnoreCase(..name())) {
                 = .;
            } else if (apiType.equalsIgnoreCase(..name())) {
                 = .;
            } else {
                throw new UnknownAPITypeException("Invalid API type: " + apiType);
            }
        }
        return ;
    }
    public static void setAPITypeAndParams(final ApiAccessType typefinal Map<StringStringparameters) {
         = type;
        if (!..equals(type)) {
             = new HashMap<StringString>();
            .putAll(parameters);
        }
    }
    private static String getProperty(final String propertyNamethrows BonitaHomeNotSetExceptionServerAPIExceptionIOException {
        return BonitaHomeClient.getInstance().getProperty(propertyName);
    }
    @SuppressWarnings({ "unchecked""rawtypes" })
        if ( == null) {
            final Properties properties = BonitaHomeClient.getInstance().getProperties();
             = new HashMap<StringString>((Mapproperties);
            .remove();
        }
        return ;
    }
    public static void refresh() {
         = null;
         = null;
        BonitaHomeClient.getInstance().refreshBonitaHome();
    }
New to GrepCode? Check out our FAQ X