/**
 * Copyright 2013 52°North Initiative for Geospatial Open Source Software GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.n52.geolabel.component;

import java.util.HashSet;
import java.util.Set;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class GeoLabelResourcesBean {

    private boolean resourcesAdded = false;
    private boolean geoLabelServiceFailed = false;
    private Set<String> failedEndpoints = new HashSet<String>();

    public boolean isResourcesAdded() {
        return resourcesAdded;
    }

    public void setResourcesAdded(boolean resourcesAdded) {
        this.resourcesAdded = resourcesAdded;
    }

    public boolean isGeoLabelServiceFailed() {
        return geoLabelServiceFailed;
    }

    public void setGeoLabelServiceFailed(boolean geoLabelServiceFailed) {
        this.geoLabelServiceFailed = geoLabelServiceFailed;
        if ( !geoLabelServiceFailed) {
            this.failedEndpoints.clear();
        }
    }

    public void setGeoLabelServiceFailed(String endpoint) {
        this.failedEndpoints.add(endpoint);
        this.geoLabelServiceFailed = true;
    }

    public boolean isGeoLabelServiceFailed(String endpoint) {
        return failedEndpoints.contains(endpoint);
    }
}

@@ -1020,19 +1020,13 @@
 Set%3C
-String
 %3E();%0A
+
 %0A   
@@ -1077,16 +1077,21 @@
  return 
+this.
 resource
@@ -1280,16 +1280,21 @@
  return 
+this.
 geoLabel
@@ -1477,34 +1477,32 @@
 elServiceFailed)
- %7B
 %0A            thi
@@ -1532,18 +1532,8 @@
 ();%0A
-        %7D%0A
     
@@ -1743,32 +1743,32 @@
 ing endpoint) %7B%0A
-
         return f
@@ -1766,16 +1766,21 @@
  return 
+this.
 failedEn

fix minor compiler warnings