class urn_perun_resource_attribute_def_def_shells extends ResourceAttributesModuleAbstract implements ResourceAttributesModuleImplApi {

	@Override
	public Attribute fillAttribute(PerunSessionImpl perunSession, Resource resource, AttributeDefinition attribute) throws WrongAttributeAssignmentException {
		Attribute atr = new Attribute(attribute);
		Facility facility = perunSession.getPerunBl().getResourcesManagerBl().getFacility(perunSession, resource);

		Attribute allShellsPerFacility;
		try {
			allShellsPerFacility = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, facility, A_F_shells);
		} catch (AttributeNotExistsException ex) {
			throw new InternalErrorException("Attribute with list of shells from facility " + facility.getId() +" could not obtained.",ex);
		}

		atr.setValue(allShellsPerFacility.getValue());

		return atr;
	}

}