Code example for ConcurrentMap

Methods: containsKey

     * @return a cookie for use in OFFlowMod.setCookie() 
     * @throws IllegalStateException if the application has not been registered 
    static public long makeCookie(int application, int user) {
        if (!appIdMap.containsKey(application)) {
            throw new AppIDNotRegisteredException(application);
        long longApp = application;
        long longUser = user & USER_MASK; // mask to prevent sign extend
        return (longApp << APP_ID_SHIFT) | longUser;
     * Extract the application id from a flow cookie. Does <em>not</em> check 
     * whether the application id is registered 
     * @param cookie 
     * @return 
    static public int extractApp(long cookie) {
Stop searching for code, let great code find you!  Add Codota to your java IDE