class ComponentTagProvider {

  public String getTag(String component, String containerId) {
    if (SliderUtils.isSet(component) && SliderUtils.isSet(containerId)) {
      ConcurrentHashMap<String, String> compTags = getComponentSpecificTags(component);
      synchronized (compTags) {
        for (String key : compTags.keySet()) {
          if (compTags.get(key).equals(containerId)) {
            return key;
          }
        }
        for (String key : compTags.keySet()) {
          if (compTags.get(key).equals(FREE)) {
            compTags.put(key, containerId);
            return key;
          }
        }
        String newKey = new Integer(compTags.size() + 1).toString();
        compTags.put(newKey, containerId);
        return newKey;
      }
    }
    return "";
  }

  public  ComponentTagProvider();

}