Create a map of resource type -> cumulative counts.
@param resourceTypes The resource types.
@param actionType A string indicating granted, revoked, etc.
@return The map.
969058
private Map<ResourceType, MetricsTimeVaryingLong>
  createTypeToResourceCountMap(
      Collection<ResourceType> resourceTypes, String actionType) {
    Map<ResourceType, MetricsTimeVaryingLong> m =
        new HashMap<ResourceType, MetricsTimeVaryingLong>();
    for (ResourceType t : resourceTypes) {
      String name = (actionType + "_" + t).toLowerCase();
      MetricsTimeVaryingLong value = new MetricsTimeVaryingLong(name, registry);
      m.put(t, value);
    }
    return m;
  }
370323
public List<ResourceHandle> getChildrenByType(final String type) {
        final ArrayList<ResourceHandle> children = new ArrayList<>();
        if (this.isValid()) {
            for (final Resource child : this.resource.getChildren()) {
                ResourceHandle handle = ResourceHandle.use(child);
                if (handle.isOfType(type)) {
                    children.add(handle);
                }
            }
        }
        return children;
    }
901591
public ResourceHandle getParent(String resourceType) {
        ResourceHandle result = getResource();
        while (result.isValid() && !result.isResourceType(resourceType)) {
            result = result.getParent();
        }
        if (!result.isValid()) {
            result = getParent(resourceType, getPath()); // implicit fallback to the path
        }
        return result;
    }
1009728
public ServiceResponseBuilder<T, E> registerAll(Map<Integer, Type> responseTypes) {
        this.responseTypes.putAll(responseTypes);
        return this;
    }
1358006
public static Event map(EventType eventType) {
        Event event = new Event();
        event.setEventType(mapEventTypeEnum(eventType.getEventType()));
        Date date = (eventType.getTimestamp() == null)
                ? new Date() : eventType.getTimestamp().toGregorianCalendar().getTime();
        event.setTimestamp(date);
        event.setOriginator(mapOriginatorType(eventType.getOriginator()));
        MessageInfo messageInfo = mapMessageInfo(eventType.getMessageInfo());
        event.setMessageInfo(messageInfo);
        String content = mapContent(eventType.getContent());
        event.setContent(content);
        event.getCustomInfo().clear();
        event.getCustomInfo().putAll(mapCustomInfo(eventType.getCustomInfo()));
        return event;
    }
615201
public static Permission getPermissionByNameAndResourceType(String permissionName, int resourceType) {
    for (Permission permission : getPermissionsByResourceType(resourceType)) {
      if (permission.getName().equals(permissionName)) {
        return permission;
      }
    }
    throw new BadUserRequestException(
        String.format("The permission '%s' is not valid for '%s' resource type.", permissionName, getResourceByType(resourceType))
        );
  }
101244
public ResourceRepository<Resource, String> getRepositoryForPath(String resourceType) {
        init();

        ResourceInformation resourceInformation =
                new ResourceInformation(
                        moduleRegistry.getTypeParser()
                        , Resource.class
                        , resourceType
                        , null
                        , null
                        , PagingSpec.class
                );
        return (ResourceRepository<Resource, String>) decorate(new ResourceRepositoryStubImpl<>(this, Resource.class, resourceInformation, urlBuilder));
    }
393028
public static TaskTrackerAction createAction(ActionType actionType) {
    TaskTrackerAction action = null;
    
    switch (actionType) {
    case LAUNCH_TASK:
      {
        action = new LaunchTaskAction();
      }
      break;
    case KILL_TASK:
      {
        action = new KillTaskAction();
      }
      break;
    case KILL_JOB:
      {
        action = new KillJobAction();
      }
      break;
    case REINIT_TRACKER:
      {
        action = new ReinitTrackerAction();
      }
      break;
    case COMMIT_TASK:
      {
        action = new CommitTaskAction();
      }
      break;
    }

    return action;
  }
348938
public JawrConfigManagerMBean getConfigMgr(String resourceType) {

		JawrConfigManagerMBean configMgr = null;
		if (resourceType.equals(JS_TYPE)) {
			configMgr = jsMBean;
		} else if (resourceType.equals(CSS_TYPE)) {
			configMgr = cssMBean;
		} else if (resourceType.equals(BINARY_TYPE)) {
			configMgr = binaryMBean;
		}

		return configMgr;
	}
24100
public void incr(ResourceType resourceType) {
    Integer current = typeToCountMap.get(resourceType);
    if (current == null) {
      typeToCountMap.put(resourceType, new Integer(1));
    } else {
      typeToCountMap.put(resourceType, current + 1);
    }
  }
325316
private static <L> Map<Name, TypeSet<ResourceType<L>>> buildTypeMapForConstructor(
            Collection<ResourceType<L>> allTypes) {
        TypeSetBuilder<ResourceType<L>> bldr = TypeSet.<ResourceType<L>> builder();
        bldr.enabled(true);
        bldr.name(new Name("all"));
        for (ResourceType<L> type : allTypes) {
            bldr.type(type);
        }
        TypeSet<ResourceType<L>> typeSet = bldr.build();

        return Collections.singletonMap(typeSet.getName(), typeSet);
    }
190214
public Map<PoolInfo, PoolInfoMetrics> getPoolInfoMetrics(ResourceType type) {
    return schedulersForTypes.get(type).getPoolInfoMetrics();
  }
1264892
public void setResourceTypes(List<String> resourceTypes) {

        if ((resourceTypes != null) && !resourceTypes.isEmpty()) {
            addFilterQuery(CmsSearchField.FIELD_TYPE, resourceTypes, false, false);
        }
    }
1325880
private Map<String, CmsGalleryTypeInfo> readGalleryInfosByTypeBeans(List<CmsResourceTypeBean> resourceTypes) {

        Map<String, CmsGalleryTypeInfo> galleryTypeInfos = new HashMap<String, CmsGalleryTypeInfo>();
        for (CmsResourceTypeBean typeBean : resourceTypes) {
            try {
                if (!typeBean.isDeactivated()) {
                    addGalleriesForType(galleryTypeInfos, typeBean.getType());
                }
            } catch (CmsLoaderException e1) {
                logError(e1);
            }
        }
        return galleryTypeInfos;
    }
809893
public void setResourceType(java.util.Collection<StringFilter> resourceType) {
        if (resourceType == null) {
            this.resourceType = null;
            return;
        }

        this.resourceType = new java.util.ArrayList<StringFilter>(resourceType);
    }
1257988
protected List<ResourceTypeHandler<?>> getResourceTypeHandlers() {
        final List<ResourceTypeHandler<?>> handlers = new ArrayList<ResourceTypeHandler<?>>();
        handlers.add(new FileResourceTypeHandler(getRelativeParentDirectory()));
        handlers.add(new UrlResourceTypeHandler());
        handlers.add(new ClasspathResourceTypeHandler());
        handlers.add(new VfsResourceTypeHandler());
        return handlers;
    }
71166
@Override
	public ActionInvocation deserialize(ActionContext actionContext) {
		JsonActionInvocation that = this;
		that.container = actionContext.getContainer();
		return that;
	}